How can I convert a Windows batch script to a .exe?

Question: I have a fairly simple batch script that I would like to execute using a macro on my fancy gaming keyboard.  However, SteelSeries Engine only supports opening a .exe file with the macro buttons.  Is there any way to convert the script into a simple executable?
Comment: Bash or Batch? They are quite differant, despite being so similar in purpose.
Comment: You could also use AutoIt or AutoHotKey. They're more powerful than Batch and both include compilers to generate standalone `.exe`s.
Comment: [**Here's how**](http://stackoverflow.com/questions/28174386/how-can-a-bat-file-be-converted-to-exe-without-third-party-tools) this can be done without external tools
Comment: Related: [*Converting .bat to .exe with no additional external software (Create SFX)*](https://stackoverflow.com/q/51098378/3357935)
Comment: Use this tool:
https://www.portablefreeware.com/index.php?id=1660
Answer: Yes, actually.  It's not pretty, but it's clean (nothing to clean up afterwards) and it's actually built-in to your system!
In your C:\Windows\System32\ folder, there is a file called iexpress.exe.

Right-click it an Run as administrator.
Create a new SED and select "Extract files and run an installation command."
Add the script you want, and make sure that on the next screen, you set the install program to cmd /c [your_script.bat] where [your_script.bat] is the script file you want to execute.  If you don't do this, windows will try to use Command.com (the old version of Command Prompt) which hasn't been in use for quite a while.
Select preferences (you might need to select "Store files using Long File Name inside Package), set an output path (to the .exe file you want to create), and select "No restart".
Click next and you should have your .exe!

Just a note, this file actually only acts as a wrapper for your script, and the script itself actually gets executed in a temp folder created on execution (and deleted afterwards), so make sure you don't use any relative paths.
Comment: Unfortunately, our enterprise AV noticed that the resulting executable was a "Cabinet Self-Extractor" and flagged it as malicious activity.
Comment: +1 for built in tools
Comment: Niice. Thanks man.This helped me create an EXE from a BAT script that I was unable to do earlier using various tools available online such as Bat2Exe etc,
Comment: @kmote me too. they asked me about it once before because it probably came up in a report and I explained what it is, this time around they just deleted it without asking.
Comment: +1 for the iexpress tool, i've never known about it before :)
Comment: Is there a tool without the limitation you mentioned? Namely it will act as the batch file is run form the `exe` path.
Comment: brilliant solution!
Answer: Here are 2 free programs that I highly recommend for creating EXE's out of batch files
1 - Bat To Exe Converter
2 - Bat 2 Exe
You can use both programs with simple GUI.
Bat To Exe Converter supports also CLI commands (\? flag for help). Basic example from documentation:
Bat_To_Exe_Converter.exe -bat mybatfile.bat -save myprogram.exe -icon myicon

Comment: Could you also give a quick rundown on how to accomplish the task with those programs? It never hurts to have extra detail in an answer :)
Comment: Virus Detectors will mark the exe files from """1 - Bat To Exe Converter""" as potential threats
Comment: `Bat2Exec` allows you to add Administrator manifest which I liked.
Comment: Advanced Bat 2 Exe converter is shareware
Comment: http://web.archive.org/web/20150810162835id_/http://www.f2ko.de/en/b2e.php
Comment: Does **2 - Bat 2 Exe** support CLI? I cannot see any info on this.
Comment: The first one is now a dead link.
Comment: Windows 11 defender marks exe files generated by **Bat 2 Exe** as virus and deletes them.
Answer: If your keyboard software supports the passing of arguments to the executable (which is not improbable) you don't have to.
cmd.exe /c <path to batchfile>

would run the batch file, and give you a valid executable to name for the keyboard software. No conversion needed means you can always easily make changes to your bat without additional steps required.
Comment: This is nice but how do i turn this into `executor.exe`?
Comment: If you mean how you convert this into one single exe file, that is not the point of this answer. The point of this answer is to show that sometimes this is not even necessary because many programs do take command line arguments along with the executable. If you need to convert a script + cmd to a single exe this is covered by some of the other answers (especially the two most top voted ones)
Comment: This is not even necessary at all. Because if you are using an EXE then you are also using a MS Machine that runs EXE files and also BAT files. So, merely double clicking a batch file will execute the batch file, or even just opening a terminal in the folder and typing in the batch file 'file name' will do the same thing. I convert batch files to EXE all of the time because not everyone loves running commands through a terminal or even knows how.
Comment: The original question included the info "SteelSeries Engine only supports opening a .exe". While I cannot confirm whether this is true for the specific program it is certainly possible.  A program can use ShellExecute which is the same thing that double clicking does and letting windows decide but it is absolutely possible to not do that (sometimes even necessary because of strange decisions by ms) and directly execute a binary. In this case a bat would not work but going through cmd.exe might.
Answer: I found this article which shows you how to convert a .bat to .exe file using a batch-scipt:
@ECHO OFF
ECHO Make EXE From BAT
ECHO Written by: Jason Faulkner
ECHO SysadminGeek.com
ECHO.
ECHO.

REM Usage:
REM MakeExeFromBat BatFileToConvert [IncludeFile1] [IncludeFile2] [...]
REM
REM Required Parameters:
REM  BatFileToConvert
REM      Source batch file to use to produce the output Exe file.
REM
REM Optional Parameters:
REM  IncludeFile
REM      Additional files to include in the Exe file.
REM      You can include external tools used by the batch file so they are available on the executing machine.

SETLOCAL

REM Configuration (no quotes needed):
SET PathTo7Zip=

REM ---- Do not modify anything below this line ----

SET OutputFile="%~n1.exe"
SET SourceFiles="%TEMP%MakeEXE_files.txt"
SET Config="%TEMP%MakeEXE_config.txt"
SET Source7ZFile="%Temp%MakeEXE.7z"

REM Remove existing files
IF EXIST %OutputFile% DEL %OutputFile%

REM Build source archive
ECHO "%~dpnx1" > %SourceFiles%
:AddInclude
IF {%2}=={} GOTO EndInclude
ECHO "%~dpnx2" >> %SourceFiles%
SHIFT /2
GOTO AddInclude
:EndInclude
"%PathTo7Zip%7za.exe" a %Source7ZFile% @%SourceFiles%

REM Build config file
ECHO ;!@Install@!UTF-8! > %Config%
ECHO RunProgram="%~nx1" >> %Config%
ECHO ;!@InstallEnd@! >> %Config%

REM Build EXE
COPY /B "%PathTo7Zip%7zsd.sfx" + %Config% + %Source7ZFile% %OutputFile%

REM Clean up
IF EXIST %SourceFiles% DEL %SourceFiles%
IF EXIST %Config% DEL %Config%
IF EXIST %Source7ZFile% DEL %Source7ZFile%

ENDLOCAL

Important downloads:

Download Make EXE from BAT Script from Sysadmin Geek
Download 7-Zip Command Line Tool
Download 7-Zip Advanced 7zSD SFX
Comment: Is it possible to make the EXE echo to the same command line it was run from? (As opposed to opening a new window)
Answer: Different versions of Windows has different effects for same batch file commands, and some commands are limited to some Windows systems eg. findstr and shutdown.
BTW, Win 10 CMD doesn't allow changes to SETLOCAL on command line. OK for batch files.
See this link for different commands for restarting different versions of windows:
https://www.computerhope.com/issues/ch000321.htm
So if you were to compile a script on Win 98, and run on Win 8.1, you'd get unexpected results or scripts may not even work.
See list of commands here:
https://www.ionos.com/digitalguide/server/know-how/windows-cmd-commands/
For this reason, one would need a different compiler on each version of Windows, preferably which would spit out binary code (generic) that can be run on as many CPU chips as possible, with same instruction sets. A workaround offered by most programs is to wrap the script in an exe file that would unwrap and execute the script when opened/run eg. Bat_To_Exe_Converter, Bat2Exe, BatchCompiler or Winzip:
https://support.winzip.com/hc/en-us/articles/115011794948-What-is-a-Self-Extracting-Zip-File-
To solve this issue of portability, virtual machines have become more popular and hence the rise of Java & related scripts.
This however, would still be intepreted code, and not as fast as compiled code. Even byte code (intermediate code) from virtual machines still need to be compiled, even if it's (JIT):
https://aboullaite.me/understanding-jit-compiler-just-in-time-compiler/
In short, you can get an exe file which would contain a script that would be intepreted by the command processor, but it won't be a native executable file, meaning it won't run without a host by the Windows operating system.
Answer: This is a simple way to convert a bat or cmd file to an exe.
I was having problems running batch files so I decided to rename the file .cmd and see if it would execute.  I added the required "setlocal EnableDelayedExpansion" to the top of the new .cmd file but it displayed a "privileges" error.
I have copies of numerous programs that convert BAT to EXE, but most require multiple inputs and options to generate an EXE file.  For something simple, I wanted a way to convert a simple BAT to EXE without having to select multiple options and configurations.
I did some research and located on OLD 7zip utility that provided a clean, simple and quick method of converting a simple .bat or .cmd file to an EXE.   The old, outdated and unsupported utility is called "7z SFX CREATOR".  I discovered that the utility only requires THREE files and two of the outdated 7zip program files that it includes (7z.dll and 7zG.exe) can be easily updated to the latest 7zip versions.
This little utility creates good EXE files from .bat or .cmd and requires only THREE options: the SOURCE file, the TARGET file and the TYPE of output: installer(run a file) or archive (dont run a file).
Since EXE files automatically run with privileges-the EXE I created worked perfectly.
Clean, simple, uncomplicated and efficient.  That's all I wanted in a BAT to EXE utility.


Chilli Plant Leave Tips

Question:
My chilli plant is growing however the tips of the leaves are drying, any suggestions ? Is this normal ?
Comment: Do you rotate the plant? The window seems to have very different temperature. Maybe tips just touch sometime windows and are "burned" by cold. Personally I would put away for windows: in winter they can live without much direct sun.
Answer: They are pretty hardy plants as long as they don't get too cold.  So I would not worry about them with just that little bit of damage on the tip.

Chilli Plant Leave Tips


Is it possible to image android phone and run on emulator?

Question: I have an LG phone with faulty screen that I am not interested in fixing, but I am interested in an installed app.
I am looking for a way to convert it to an image and run it on my PC, is that possible?
Searching online just shows me results for how to transfer images from my phone to my PC :D
Answer: Hope you're doing well.
You said you're interested in an application, well let me try and clear it up, but if you just want to use an application, you're better off with running it fresh on an emulator, and that way you will not have to worry about your broken phone, but if it is the app data you're interested in then I'd suggest you'd take a backup of your phone, that will basically be an image of your broken phone, using adb tools and then restore it onto an emulator. But you will have to look it up as to how you want to flash adb tools onto your phone without a display(assuming your display is completely dead).
Otherwise, your topic seems a little too broad


Is there any dataset of Indian Traffics Signs?

Question: I wanted data set of Indian Traffic Sign for classification purpose.
Answer: I would do a google search "road signs India". I found this Wikipedia article had some clear pictures with descriptions in English. If you want Hindi or other language translation, I suspect a google image search will help.


Can we use two independently measured features in a same ML model?

Question: Two features are measured at different times but belong to the same target. In which conditions or form these features can be modeled together? Or they shouldn't be used in the same model but modeled separately? E.g. I am trying to identify users by looking at their mouse dynamics data and keyboard dynamics data, however, these two are measured independently but they belong to the same person (I have this scenario for many users). To explain it better, imagine it like I gave a text to users to repeatedly write them using the keyboard (and I recorded their keyboard usage) and similarly I gave them a different task to use mouse repeatedly (and I recorded that too). The sample size is also different for each feature.
Comment: How do you wind up with a different sample size for each feature?
Comment: The sample size for each user is simply formed by the repetition of a task. So if user 1 repeated the keyboard task 14 times sample size is 14 (for keyboard dynamics of that user), and the mouse task 27 times then the sample size is 27 (for mouse dynamics of that user).
Comment: If we imagine that sample sizes were the same, even in that case I am suspicious about combining or joining these two because they did not record parallelly. I am kind of confused on the theoretical side of the problem.
Answer: From the example I assume that an instance corresponds to a user, and you have both full sequences of the mouse and keyboard as features for predicting the user. I can think of two options for using these features in the same model:

With feature engineering, find a way to represent both sequences as a fixed array of features. For example you might have features such as average typing speed average mouse speed, number of mouse movements, number of times each key is pressed, etc.
Similar idea but in a more DL approach: find a way to represent both sequences as embeddings (there are methods for word embeddings, sentence embeddings, graph embeddings...)

In my opinion the main issue is the variable length of the sequences, not the fact that they are not aligned (the alignment would matter if the target variable was for one element in the sequence).
Comment: Thanks, Erwan. Actually, I am able to handle the variable length of the sequences problem, but I am stuck about whether it is right to align these two independently recorded features in the same model or I should perform the separate modeling approach. Even though the target variable is the same in both, aligning the samples is another challenge. I mean, which sample from MD should be aligned with another sample from KD. Let's think that there are 5 samples, m1, m2, m3, m4, m5 from MD, and 5 from KD, k1, k2, k3, k4, k5. Can I discard the order while aligning or I should follow some steps?
Comment: Oh ok I think I understand now: you're talking about matching a particular keyboard sequence with another mouse sequence, in order to use the two kinds of information in the same model. Sorry I didn't understand this before. I'm not really sure about this scenario, but given that the sequences all represent the same task by the same user and have no direct relation with each other, it looks to me like you could randomly pair any sample from KD with any sample from MD. You could even try to do the full cartesian product KD x MD, i.e. consider all the possible pairs. But I don't have a clear ..
Comment: ... idea of how this kind of data works and how to manipulate it, so I might be wrong.
Comment: That is the case with me too. I have been searching for papers or articles about the issue, but seems like no one has faced the issue or put that on paper. I accept it is kind of weird situation, but from mathematical side I think there is a something problematic with that because different combinations of the pairs may affect the model coefficients (or other outputs) differently. I think, I will follow this approach to see whether different pairings affect the result of the model drastically (i.e. outputs vary). Thank you very much again.


Why is the transparency on my particles not working once exported to Godot?

Question: I am new to blender. I am using blender 2.8 version. Recently I created a grass setup with the help of a tutorial video. In which I applied transparency for outside of grass using node editor. It renders completely fine. But if I export it to Godot, the meshes and materials exported perfectly. But the transparency from node editor is not applied. So instead of seeing a grass, all I see is a plane with grass image. I added the screenshots for your reference.
Comment: This is more of a Godot question than a Blender question, so this question is likely to be closed for being off topic. Before that happens, though, have you enabled "Use Alpha Scissor" and played with the slider under the parameters tab of your material in Godot?
Answer: From what I've found Godot uses the alpha value of the albedo color as transparency.
A blender material with transparency enabled and the alpha value changed looks right in Blender, but doesn't work in Godot:

As you see, it correctly turned on the "Transparent" flag, but still has no alpha.
You have to change the alpha value of the albedo color in the Blender material for it to work:


Does an eighteen-year-old Oregon resident who obtained a driver license as a minor need to get a new license to tow a trailer?

Question: In Oregon, drivers under eighteen years of age may not tow trailers. The "Provisional Driver License" issued to drivers aged sixteen through eighteen says it is valid for "[a]ny signle vehicle with a GVWR of not more than 26,000 pounds with the proper endorsements. Any emergency vehicle operated by a firefighter." This license remains valid after the driver turns eighteen; there is no need to replace it to continue driving single vehicles. If the driver wants to start towing trailers (and is not a firefighter), is it necessary to get a new license without the "single vehicle" restriction, or is it implied that this restriction only applies through age eighteen?
Comment: @user71659 those words are copied from the back of my driver license.
Comment: I found a sample image (https://duckduckgo.com/?q=oregon+driver+license+back&t=fpas&iax=images&ia=images&iai=https%3A%2F%2Fwww.pngitem.com%2Fpimgs%2Fm%2F277-2779603_oregon-drivers-license-back-hd-png-download.png) showing an adult's license, and it has the same wording mine does. It looks like that is what's on every license.
Comment: Exactly, they were too lazy/ran out of space to write all the conditions down. I don't see any evidence that Oregon limits towing for minors. [Some other states do](https://www.ncleg.net/enactedlegislation/statutes/html/bysection/chapter_20/gs_20-7.html). You have to find the exact statute to see when it no longer applies.
Comment: Please provide evidence where you found that limitation, I don't see any trailer limitation on OR graduated licenses. Single vehicle <26,001 lbs GVWR is the standard class C license all over the country because Federal CDL requirements kick in at 26,001. Wherever you copied that from probably had further words explaining the [10k/26k trailer limit](https://www.oregon.gov/odot/dmv/pages/driverid/classes.aspx) for a class C.
Comment: So they ran out of space for the trailer words.
Comment: @user71659 I posted a redacted image of my license. My permit did not have the "single vehicle" restriction, but I don't remember the exact wording it had.
Answer: I couldn't find the same wording on the Oregon DMV / law websites, but in a Background Brief on the Oregon Legislature website, there is this statement, just after discussion of restrictions on a Class C provisional license:

Upon reaching 18 years of age, individuals may qualify for a standard
Class C license. This license allows the bearer to operate vehicles
under 26,000 pounds, recreational vehicles, fire and emergency
vehicles, and to tow other vehicles and trailers with certain weight
restrictions.

Emphasis mine. The document is from 2012.


Regression for ordinal-scaled variables?

Question: I've got several ordinal-scaled variables (likert-scaled).
1. In my first hypothesis I want to find out the connection between two ordinal-scale variables. Normally I should use the rank correlation but my adviser told me to use the regression. Which regression is meant. The ordinal scaled?
2. In my second hypothesis I've got three ordinalscaled variable as independent, dependent and mediator variables. My adviser wants me to use Process macro for mediator-hypothesis. Is it possible to use Process for ordinalscaled variable or do I need interval-scaled variables?
Answer:
Ask your advisor, not us. There exist regression methods created specifically to handle rating scales and other ordinal variables, both as independent variables and dependent variables, but it is also common to just treat ordinal variables as interval variables. You'd have to ask your advisor what they meant.
I can't tell you much about PROCESS because it's only documented in a $50 textbook. I would recommend using something else. This said, if you don't notice any options the program has explicitly for use with ordinal data or rating scales, then chances are it will treat your data as interval-valued. But it is still reasonable to treat ordinal data as if it were interval in many cases.
Comment: Thank you very much!!! 2. You mean the book "Introduction to Mediation, Moderation, and Conditional Process Analysis: A Regression-Based Approach" by Andrew Hayes?
Comment: Yes. (If you felt my answer was satisfactory, remember to accept it by clicking on the check mark under the voting arrows.)


Separate network with second router behind openmesh/cloudtrax site?

Question: My wife and I live on a "campus".  They have a CloudTrax (openmesh if I'm not confused) network.  I have been given authorized access to configuration settings.  I have a wired connection from a lan port on the main router "ROUTER1" (that is connected to the fiber internet connection) to a LinkSys WRT1900AC "ROUTER2".  I'm a CS major and have done some network config before, but this is stumping me.
How do I create a separate "isolated" network on ROUTER2.
Basically, according to what I can see on the ROUTER1 (CloudTrax) config pages, I (believe) I can do one of the following:

Set up a separate LAN from one of the ROUTER1 physical ports.
Set up a VLAN, which I'm honestly a little confused about.
Give ROUTER2 a reserved IP address and try an finagle it.

Environment Overview

Fiber connection "modem" Gateway
CloudTrax G200 (Model A64) (ROUTER1)
About 7 (OM2Pv2) Wireless Access Points supporting 2 separate WiFi SSID's connecting close to 200 clients
LinkSys WRT1900AC (ROUTER2) wired/connected to LAN port on ROUTER1
LinkSys LGS105 5-port unmanaged switch connected to LAN port on ROUTER2

Goal for the setup

I'd like for us to be able to connect all our devices to ROUTER2's WiFi and LAN ports for internet access.
Run my personal devices (servers, desktops, printers) (on ROUTER2's "network") so that I have access when off site, and so they can "talk" to each other.
Keep ROUTER1's clients out of ROUTER2's network

What I've tried

Before they moved to the CloudTrax, I was able to simply give my router (ROUTER2) a reserved IP address on (the old) ROUTER1 going from LAN port on ROUTER1 to WAN port on ROUTER2 and a separate subnet on ROUTER2.  I was able to communicate with my local server, set up a separate WiFi SSID, and connect all my stuff to the internet through ROUTER2.
Right now, as a temporary fix for internet access, I've got the LAN port from ROUTER1 connected to a LAN port on ROUTER2 so it's acting like a switch.

My Request
Simply put, help me take the shortest path around my backside to get to my elbow.  What settings to I need to adjust here.  Thank you in advance!

Supporting Diagrams and Images
Network Diagram (Basic)

Images of Cloudtrax Settings Pages
Answer: You can make a subnet from router2 but you won't be able to see router2 through router1 as it will be double natted.
You can use a vpn to bridge the connection but of course your network will be open to anyone.


What makes a molecule a polyatomic ion?

Question: I checked the Wikipedia page, but it did not seem to provide a very intuitive explanation.
What distinguishes a molecule such that it behaves like a polyatomic ion? I understand that it is a covalent bond, but what distinguishes it from other covalent bonds that allow it to act like one element. Why does it have a charge, unlike many other compounds (ionic and covalent)?
Answer: A polyatomic ion is simply a molecule that has gained or lost one or more electrons, thus acquiring a net charge. This can occur due to oxidation or reduction of the molecule, by association of an atomic ion with a neutral molecule or by autoionisation of a neutral species into a anion/cation pair.
A concrete example of the latter two processes is the autoionisation of water, which to a first-order approximation may be considered as $\ce{2H_{2}O <=> H_{3}O^{+} + OH^{-}}$. This is coincidentally an example (one of many) of an aqueous reaction involving covalency with a water molecule, addressing in part one of your other questions.
There also exist polyatomic ions known as zwitterions (from German 'zwitter', meaning 'hermaphrodite' or 'hybrid') which possess localised opposite charges on different atoms, but are neutral overall.
Comment: Thanks. Why are polyatonic ions treated as a singular element though? (as in the case of double displacement, single displacement etc)
Comment: @FarhadYusufali - Because for study purposes you have been shown a subset of reactions to study that don't involve the covalent bonds within the ions being broken. Instead, I imagine you are looking at reactions involving ionic bonds being broken in solution.

What makes a molecule a polyatomic ion?


Export shapefile to CSV files by a grid I drew in a image

Question: The shapefile is in orange and I need to export them into (1.csv and 2.csv etc...) corresponding to each grid I drew in the map. Is there any way this can be done in a single process?
Comment: Why draw the grid in the image? And if you drew it yourself, is it really necessary to use exactly that grid, or could you build a new grid?
Comment: what do you mean a new grid? Am new to qgis .. could you please explain :-)   ... But the idea is to split the shapefile into chunks and save them as .csv files
Comment: Do you need exactly this grid, or could it be slightly different?
Comment: could be slightly different
Answer:
Create a grid (vector -> research tools -> create grid) covering the area of the city you need to be covered. Your gridsize seems to be about 100 by 100 m, use this for vertical and horizontal distances. Make sure you get polgyons, not any other type of grid.
Make sure your grid-polygons all have an ID.
Use vector -> data management tools -> join attributes by location to add the ID of your grid-polygons to your point layer.
Again from the data management tools choose split vector layer and use the added ID-field as a base for splitting your point layer into small chunks.

You might need to convert to csv manually.


Converting between number systems without using mid-conversion

Question: I've searched a lot about this but I couldn't find any thread. Is there any tutorial, course or whatever that explains how to convert from any number system to some other number system (for example ternary to binary or base-7 to base-15 or any combination)? The reason I'm asking is because on the test that I have coming up, you can be asked to convert from any number system to another WITHOUT converting to decimal system in between. So, is there a universal algorithm or a few algorithms universal for specific cases? Or is there a different algorithm for every single combination?
I already know how to convert some of the most used systems, for example binary to hex or hex to octal or octal to binary etc; but things that confuse me are those examples that I've given which use ternary or base-4 or anything else.
In addition to this, I've tried searching for specific cases but all I get are algorithms with mid-conversion to decimal, and I can't use that.
So, does anyone have any resource they might share?
Thanks in advance.
Comment: There was a similar discussion here: https://math.stackexchange.com/questions/2449307/question-on-type-conversion-in-number-system#comment5062869_2449307
Comment: To convert directly from base $5$ to base $7$ you need to know how to divide in base $5$ numbers written in base $5$ by $7$ which is greater than $5$: it's a nightmare! Which test can ask such a stupid thing?
Answer: There are two basic methods to find the radix expansion of a positive integer.
In the first method you need to repeatedly divide by the target radix keeping track of the remainders as digits. In the second method you assume that you have a representation of it in a source radix and you repeatedly multiply by the source radix and add digits while doing the arithmetic in the target radix.
An example may help make this clear. Suppose $A=13$ and we want the binary expansion. We repeatedly divide by $2$ and use the remainders to build up the binary expansion giving $A=1101_2.$ Now suppose we want the ternary expansion of this using base $3$ arithmetic. We build up the number using the source radix $2$ which is the reverse of the process which got the expansion.
$$A_0 = 0,\; A_1=2\cdot A_0+1,\ A_2=2\cdot A_1+1,\ A_3=2\cdot A_2+0,\ A_4=2\cdot A_3+1=13.$$
Doing the same arithmetic in base 3 the computation is
$$A_0\! =\! 0_3,A_1\!=\!2\!\cdot\! 0_3\!+\!1\!=\!1_3, A_2\!=\!2\!\cdot\!1_3\!+\!1=10_3,A_3=2\!\cdot\!10_3\!+\!0=20_3,A_4=2\!\cdot\! 20_3\!+\!1=111_3.$$
which gives the correct answer as it should.
There are other variations on the first method which are more general in that they work for more general number representation systems, but I don't want to confuse you with the details of them.
Comment: @GaurangTandon: Note the "Doing the arithmeitc in base 3 the computation is:" No need for conversion there.
Comment: "We build up the number using the source radix 2 which is the reverse of the process which got the expansion." I am sorry, but I don't see how this is an answer to the question being asked. In converting the number $13$, from base $2$ to base $3$, you _did_ convert the binary number to decimal _before_ converting it to base $3$. The OP explicitly states _without using mid-conversion_. Thank you!
Comment: Awesome, I now noticed the wonderful subtle detail!


IIS HTTPS Windows Performance Counters

Question: We are currently checking the performance of our production sites (Windows 2003).  They are serving a lot of HTTPS traffic, which we can't currently swap over to HTTP.  I was wondering what were the best performance counters to investigate to see if our servers are being bogged down by the SSL connections?
Answer: If you want to use Windows performance counters the WWW service performance counter can give you a lot of useful information about a site or sites running in IIS (both http and https). You can find details of what you can log here.
Answer: Assuming you've already monitored your Internet connection to make sure it isn't saturated (that isn't SSL specific of course) the main impact of SSL is likely to be CPU, so use performance monitor to check the CPU over some suitable period. You may also want to monitor the process counter to check CPU usage for the inetinfo and w3wp processes.
I don't know of a way to drill down further, e.g. to see that it's SSL causing the high CPU as opposed to a rogue ASP script. I suppose you could run all SSL traffic in a separate application pool and just monitor CPU for the appropriate w3wp process.
JR
Comment: Is it right to assume then if there is not a lot of CPU load that the SSL is not a bottleneck?  I was under the impression that there was a queue of SSL connections and that if that was overloaded that it may show a low CPU, but a long wait for new SSL connections.
Comment: Servicing SSL requests is computationally much more expensive than servicing HTTP requests because the server has to do the encryption and decryption. So if SSL processing is the bottleneck you'd expect to see high CPU. If bandwidth is the bottleneck then you'd expect to see a big queue of SSL (and HTTP) connections and low CPU.

IIS HTTPS Windows Performance Counters


The color red disappeared on the GUI.

Question: My relative brought this to my attention a little while ago. They told me they turned on their computer recently and the color red did not appear on their GUI. Has this ever happened to anyone and why would it happen?
Comment: I've had green break before - the rest of the display is pink in that case. Is the rest of his display tinted blue/green? Red objects would appear black in that case. (All three answers below are proposing this possibility)
Comment: All of these answers and comments are definite possibilities. The obvious thing is I have to see the monitor myself first. I'll have to ask my relative to bring over the monitor and tower. Using my monitor, perhaps I can find out if it's a monitor issue or an internal issue from the get go if my desktop monitor has problems on the GUI or not.
Answer: There's a few possiblities - the red channel isn't getting sent to the system - this may be a fault somewhere along the signal chain - video card failure, issues with a cable, or something inside the monitor breaking.
Comment: @Christopher Chipps See also here. http://superuser.com/questions/347383/screen-went-pink  I have seen the VGA analog not have one wire fully connected Many times, because here we do not screw them in fully, because if they get jerked on it can break things.  if the vga connection is not inserted well, it can easily knock out one of the R-G-B connections.  If it is a Color thing, not whole colors, a profile might be at fault.
Answer: Have you seen the red-less GUI yourself ? Technically, it is possible your relative's computer is ok, but but his/her vision is impaired.
In the real world however, the first thing I would advise them to check is a half-loose plug.
It is possible that the video card or the monitor are broken with respect to the red channel, but in 20 years of computer maintenance, I have not seen that happen for one single color; in my experience, graphics cards and monitors either live or die.
Issues that usually cause problems like that (and also prevent proper visual inspection):

computer case is under the desk and most people don't like crawling under them; elderly people might physically not be able to
there is no light under the desk / behind the computer case and people can't find a working torch, so they try to 'feel' the right plug, but usually don't get the right one
the computer case is 'built in' tightly with no cable slack, so whenever you want to move the case (e.g. to pull it out and look at the back side), some cables come loose
there is a mess of (often dusty) twisted and tangled cables behind the machine and to a layman's eyes, it's unclear what cable goes where

Speaking of dust: Years ago, I had the weirdest freezes on an ancient machine that'd been sitting in a dusty workshop for years. The owner was already about to buy a new one when took it all apart and blew the dust with compressed air out of every cooler grill, fan, case corner I could find (like e.g. IDE slots - this is the 90s ;-). Worked like a charm afterwards for many years more.
Ideal solution: Go there yourself, take it all apart and give the machine a good mechanical cleanup. This takes not longer than one hour and will save you from computer help requests from friends and family for at least a few years. Plus of course the computer runs much faster afterwards ;-)
Answer: Old CRT monitors would occasionally get a loose connection in one of the guns in the CRT tube. You could often momentarily cure it using percussive techniques (slap upside the monitor) and have the fix work anywhere from 10 minutes to two weeks. The worst was the old Zenith flat screen CRT's. They used a lot of small boards, interconnect cables and the guns could go into a round robin failure if the monitor got dropped. I think the support elements for the electron guns were weak.
Modern equipment using LCD/LED technology can experience this when a pin gets bent (common failure in the HD-15 type connectors, why DVI or HDMI is better). I've seen them folded over into a 90 degree dogleg and fixed it with a bit of patience and a pair of needle-nose pliers and a recommendation to never remove the cable unless the system was being moved out of the house as the pins would probably break the next time they got bent.

The color red disappeared on the GUI.


What is the best shield for an anarchy spec Mechromancer?

Question: So I started playing this game again recently having picked up some of the DLCs and I'm currently doing an anarchy mechromancer.  From doing some reading it looks like the best gun to use is a redundant fibber, but what is the best shield for the build?
Comment: Probably Hide of terra but I didn't play Gaige much.
Comment: @AdrienXL I've come across that, but mostly for deathtrap builds.
Answer: I'd basically recommend 2 shields.
first would be the bee if you wanna go pure dps since her skills restore shields on kills and it wouldnt have much downtime as a result. so you get quite the damage buff. However this comes at the cost of shields that would give you more survivability.
The alternative would be the sham. Absorbing bullets will give you more survivability (can go up to 94% absorb rate). Especially useful if using norfleet rocket (try to get a logans gun which is dropped from willhelm if you want to use rockets. while equipped with the sham, you can just shoot the ground with logans gun and absorb socket ammo from the splash explosions)


Real-Valued Function With Distinct Average Rates of Change

Question: Let R be the set of all real numbers. Define the average rate of change of a function on the interval [a,b] in the usual way: (f(b)-f(a))/(b-a). Does there exist a real-valued function defined on all of R such that for any two distinct intervals [a,b] and [c,d], the average rate of change on [a,b] does not equal the average rate of change on [c,d]? (In other words, does there exist a real-valued function defined on all of R whose average rates of change are all distinct?)
Comment: Can $f$ be any function, or does it need to be continuous? My instinct in either case is no, but I feel surer about continuous functions.
Comment: @CecilEllard I highly suspect that no such *continuous* function exist, but that some such *discontinuous* function exists.
Answer: There is no such continuous function.  There is such a discontinuous function.
The statement is equivalent to saying that the function does not have two parallel chords.  In the figure below the heavy line is our function.  Draw a chord $AB$ from $(A,f(A))$ to $(B,f(B))$.  Let $E$ be the point on the curve furthest from $AB$, which is there because the distance is a continuous function on a compact interval, so it attains its maximum.  Find $C$ between $A$ and $E$ with $(C,f(C))$ on the same side of $AB$ as $(E,f(E))$.  A line through $C$ parallel to $AB$ will intersect the curve at $(D,f(D))$.  The average rate of change over $[A,B]$ and $[C,D]$ is the same.

If the function is allowed to be discontinuous, we can construct one as follows:  well order the reals in type $\mathfrak c$ so each has $\lt \mathfrak c$ many predecessors.  Call them $r_0,r_1,r_2,\ldots$.  Start with $r_0,r_1$ and pick any $f(r_0),f(r_1)$ you want.  Now for each point $r_k$, find all the slopes of the lines between all pairs of points that have been chosen so far.  There are $\lt \mathfrak c$ of them.  Now construct all the lines from all the points with all the slopes and note where they cross $x=r_k$.  There are still $\lt \mathfrak c$ points accounted for, so we can find an $f(r_k)$ that does not duplicate any of the existing slopes.  Keep going until you have accounted for all the reals.


Can ERC-20 based stablecoins be confiscated or be subject to legal process?

Question: Can ERC-20 based stablecoins be confiscated or blacklisted? Can I lose my stablecoins? What are differences between stablecoins out there?
Comment: "confiscated or blacklisted" - this terminology is outside the scope of this website IMO. Moreover, these terms are subjected to the specific legal system in the specific country that considers itself in charge of your assets (i.e., entitled to tax them). For every individual, there are typically two such countries - the country of residency and the USA (except for USA citizens of course, for which there is one such country). In any case, your question, as well as your own answer below, are both subjected to legal interpretation, hence are not well defined IMO.
Comment: In short, the SEC evil empire can do whatever it wants to the assets of any individual on the planet at any given moment (and it can also choose to change its mind at a later point in time). So any answer to a question around that issue is simply inconclusive.
Answer: Technically ERC-20 standard itself cares about transfers and transfers only. It does not care what happens outside transfers and this activity might including thing like minting, but also things like freezing, blacklisting or reclaiming tokens.
The censorship resistance of a particular token has more dealing with the issuance of the asset the token presents. Then this derives the characteristics of a smart contract. Generally, stablecoins can be divided into two categories.

Synthetic, cryptocurrency backed: DAI, sUSD

US dollar bank account backed: USDC (recently had its historical first blacklisting), USDT

US dollar bank account backed currencies are subject to the US law. Thus, they must have a way to have legal enforcing. In the case of USDC a court order was served to the Centri, the company managing the reserves of USDC stablecoin. Centri needs to follow the court ruling, or they cannot keep existing as an American company.
On the other end of a spectrum, we have MakerDAO DAI that was backed purely by censorship-resistant cryptocurrencies (USDC was included in the collateral pool causing this principle to break). If the collateral for a stablecoin lives on a blockchain and is censorship-free, it is  harder to have a court oversight to stop something in this kind of an ecosystem, though not impossible as the court could always go after well-known DAI or collateral holders.
Here is my article about the recent USDC freeze that also discuss freeze and blacklisting implications for smart contracts, lending pools and such.


How to bypass anti debugger? IDA Pro

Question: Im new to reverse engineering and doing a crackme that requires me to make a keygen, yes i know making a keygen isn't a beginner task however im stuborn, i am trying to debug the program to understand what it does to check for a valid key but i continue to get hit with the "A debugger is present on your computer" text the program prints out, I am aware of where it is checking for the debugger (i think), i just don't know how to avoid it, i can't patch the file so ive got to avoid it without tampering with the original code, anybody know how to get past this or? Thanks i'd really appreciate it.
Comment: See https://reverseengineering.stackexchange.com/questions/10888/modify-memory-without-patching-the-database for a possible solution. If the bugger test functions return properly (and don't kill the process) you could just overwrite the result in `eax` or patch the whole call to the debugger test methods..
Answer: I'll try to "teach you to fish" and provide a good general process to bypass these checks while debugging (without patching the binary)

Set a breakpoint on the call of interest (e.g. IsDebuggerPresent)
Single step in your debugger
Identify which register was modified (and how) based upon the return value of the call e.g. perhaps it was eax. (<< this is probably architecture specific)
Single step in your debugger. At this point if you're using a debugger like IDA free and viewing in graph mode (hit spacebar to toggle between the listing view and graph view) you should see a flashing line that connects the current code block to the "bad" code block. In this case "bad" just means the code block that you DON'T want to reach aka the exit() block, etc.
Modify value that was identified in step 3. If you're using IDA free you can right click on the register > modify value. If it's currently a 0 and the bad branch is flashing, generally you can just change it to a non-zero value (e.g. 1) to get the good branch to flash

Note: it is helpful to actually understand how the function works. e.g., if a debugger is present this function will return XX, otherwise it will return YY. That way you're not arbitrarily modifying values... you can do so with intention.
Hope this helps!
Answer: Use an "anti-anti-debugger" plugin (like ScyllaHide), which simply injects code into IsDebuggerPresent, yes that's possible, since each executable loads API separetly into RAM, which's one of reasons why newer Chrome versions eat RAM (each tab is a process).

How to bypass anti debugger? IDA Pro


synonym for spacious

Question:

Can you guys tell what the right answer is? imo the right answer is (B)
Comment: @JJJ and co: There's a lot of nuance in this this question which would stretch many native speakers to elucidate, in my opinion.
Answer: Of the four words only Luxurious does not necessarily imply dimensions in any way.  There are luxurious dog kennels.
Of the remainder

Wide means lots of width  but makes no statement about length or height/depth.
Big means the same as large but it is an ugly word that is not suited to a sales pitch, as here.
Large means the same as big, but it's posher somehow, and therefore the closest to Spacious

synonym for spacious


Should tamarind pulp go into Pad Thai sauce?

Question: I'm making my own Pad Thai sauce and I'm not sure if I should strain out the tamarind pulp or if it can stay in the sauce. Or is there some type of prepared tamarind which dissolves into the sauce so there's nothing to strain?
Answer: The pulp is what you're actually trying to obtain from tamarind. What you should be trying to strain out is any seeds or any chunks too fibrous to be considered pulp. It is sometimes possible to add liquid and smash the tamarind several times to extract more and more (progressively diluted) pulp each time.
Comment: Well I got what looks like a sticky block of fiber (sort of resembles tobacco using in hookah :-). What I would do is simmer it with palm sugar to obtain my final sauce. From what you're saying it seems I've been doing it right, correct? :-)
Comment: So from this I understand that the seeds and any tougher fibrous parts shoud be thrown off; correct?
Comment: @nav yeah, I'd remove the seeds for sure; as for the fibrous parts, just depends on how much patience you have for smashing through the sieve.
Answer: It's essential to get all the debris(seeds, large fibrous bits, skins etc) out of the pulp. I normally add a little hot water in a bowl with the block of pulp, be careful not to add too much or it'll end up watery - better to add more as you go, wash your hands thoroughly and break the pulp up by hand. Then strain out the seeds etc and it's ready to use.
You can buy ready to use Tamarind puree in shops but it's normally not a good.
There's more info on working with Tamarind pulp in the footnotes here(as well as a good Pad Thai recipe) http://chezpim.com/cook/pad_thai_for_beginners


"Cartesian" dual vs. polar dual of convex polytope

Question: Say $P$ is a convex Euclidean polytope, where the origin is not contained in any bounding hyperplane containing a facet of $P$, with $n$ facets given by $\langle f_i , x\rangle = 1$ and $m$ vertices $v_j$ with $1\leq i\leq n$ and $1\leq j\leq m$. (That is, each facet equation has been multiplied through as needed to obtain $1$ on the right side.)
Is it true that the polytope $P'$ with $m$ facets given by $\langle v_j , x\rangle = 1$ and $n$ vertices $f_i$ is combinatorially equivalent to the polar dual $P^*$ of $P$?
Answer: Yes. Your polytope $P'$ is exactly the polar $P^*$ of $P$ with respect to the standard unit sphere. Choosing another conic instead of the unit sphere will in general give another polar. See this wikpedia page for the two-dimensional case of polarity with respect to other conics. So your "Cartesian" dual corresponds to the unit sphere.
Polarity/duality of polytopes or more generally, convex bodies, is treated in many books on convexity. Unfortunately, many of them leave a lot of detail to the reader. I recommend Webster's Convexity, Brønsted's An Introduction to Convex Polytopes or Matousek's Lectures on Discrete Geometry.
Comment: Thanks! I will check out these references. I omitted from the question whether P is fully dimensional - i.e., a d-dimensional polytope in R^d. If P is k-dimensional (k < d) in R^d, and P is contained in a k-dimensional hyperplane, then the facet equations for P are not uniquely determined - so the Cartesian dual would depend on the choice of these equations as well. (I'm ditching the scare quotes, and the pun is intended.)

“Cartesian” dual vs. polar dual of convex polytope


How to enter a number from a range on a mobile web app?

Question: I'm designing a web app for smartphones that allows the user to enter some numbers within a large range (say 0-511 or 0-1023). The numbers are exact and equally likely to be spread across the whole range. What's the best control to use for that? Typical spinner buttons are likely to be too small to use on a mobile touchscreen. Someone suggested a modified spinner with the decrement button on the left and increment on the right, but I don't think anyone would actually use the buttons since the range is so large. It would be easier to just type the number into a box. In that case is a simple text field with input validation good enough?
Answer:
It would be easier to just type the number into a box. In that case is a simple text field with input validation good enough?

That is surely the most sensible thing to do. Spinners would require plenty more than the three or four actions needed to hit each digit on a keypad.
Of course, you would want to show something like "Enter a number between 0 and 1023" next to the box (at risk of stating the obvious).
Comment: +1. Addition: Don't forget to trigger the numeric keyboard
Answer: Another option may be a slider where the handle can be dragged with just a user's thumb, since I think jumping into the keyboard is sometimes a pain. (minor inconvenience but on mobile that's a bigger deal)
an example of what I'm taling about : http://dribbble.com/shots/111446-Slider , just with the number that a user has selected above the handle as they drag it around.
This might be less convenient for large numbers like you mentioned because exactness may be harder to obtain but you could experiment with where too large a number became an issue, or if the exactness isn't really an issue for your app then that issue may be ignored.
Comment: I thought about sliders but in this case the exact number is important. With only a few hundred pixels in either orientation they would not allow this great of a range.
Comment: That's a bad idea. Have you ever tried choosing anything on a slider that's - say - from 0 to 1000 and you have only 480 pixel wide screen? Right. I'd say - go with a text input with optional plus/minus buttons on top and bottom for easy increment and decrement.


Workflow shortcut to meet the release deadline

Question: When you design a test scenario or even when you run your tests and you stumble to lack of specifications from your marketing Dept. should you bypass them and take the initiative of making your own specs, or should you delay the deployment till you get a definite answer?
Comment: Your question is wildly open to speculation. Can you give us a little bit more detail on what the actual process is in your organization and what exactly is expected from QA and from marketing? You are asking whether it's ok to take over some steps of the process, but don't tell us what steps those are. Is it complete lack of specifications?  Why, in your opinion, does the process fail?
Comment: Complete lack of specs due to work flow short cuts.
Answer: You should talk to your marketing department and understand why they have no specification for that particular area and explain to them why it is important for specification to exist and that there cannot be any short-cutting in this area. You may find out that they lacked resources or were unsure about this area. Regardless of the reason you can help them out and you can both together write the specification for this.
I'm not a great believer in something being outside someone's job description, if there is something that needs done and you can help, then you should. A project will run smoother if you have this mentality. Just because you are in QA doesn't mean that you cant help out in roles outside your own.
If you choose not to write a specification and you are going to document the test cases for this area, then these tests will essentially be the specification. It's is worth getting the marketing guys involved here to make sure that what you are testing is correct and the behaviour you have assumed is correct . Do not create the test cases on your own, you don't own the product and cannot make these decision of how the product should behave.
Comment: +1 as this reflects the nature of Software Quality Assurance being everyone's job.  Additionally, the principle of open communication and collaboration within a project is key even if there are clearly written specs.  Sometimes even a clearly written spec leaves out key details that only a collaborative effort can discover.
Comment: We use a Q&A section on our functional specs on our team wiki to help spec out gray areas.  As the whole team gathers information, they update the Q&A section of the wiki so we have the information in one place.
Answer: We never start with clearly written, complete, unambiguous, mutually-consistent specifications, and sometimes we start with nothing but an untested product.  You can't test without some kind of model of what the product should be.  You should ask yourself how important it is for your model to match the model in the heads of the rest of the company, and your answer should drive how you proceed.
Personally, I read whatever is written down, if anything, and draw a diagram of the product's entities, relationships, inputs, outputs, and constraints, in as much detail as I think I need in order to test.  As I draw the diagram, I run into things I don't know.  I make a list of questions, and when the list is long enough, I ask people until I find the answers.  The final result isn't a specification, but it is enough to drive a test plan.
Answer: Getting clarification on specifications should be the correct move in my opinion.  Consider what will happen if you choose your own specs; you could spend a considerable amount of time going in a direction that may turn out to be entirely different than what the business had in mind.
Answer: The QA process does include requirements / specs review (feasibility review, standards review etc) but a QA specialist should not be involved in the actual gathering / creation of the requirements.
Having said that, it's also not a very good idea to assign the process to a marketing dept., marketing people should of course generate ideas but those ideas should then be transformed / translated to specs.
So, to answer your question: Initiative is good, but overstepping the boundaries of your job description is probably not. QA skills may be closer to what's required than marketing skills, but still not close enough.
That of course is a generic view, and it may not apply to your specific situation. The "best man / woman for the job" principle transcends department titles and if you strongly feel that you can better the process (and can prove it to the decision makers), then what you should do is involve yourself in the process in an official role.
Requirements / specs are too important to the creative process, and its crucial to not let them become a bottleneck.
Comment: I strongly disagree with a QA specialist should not be involved in the creation of requirements. From experience, I have found that getting testing involved from the start of a project (requirements creation) has helped us catch bugs or potential bugs before any time has been wasted on writing code for a component that would be fundamentally flawed.
Comment: "QA specialist should not be involved in the actual gathering / creation of the requirements." At the end of the first sentence in your answer. Apart from that you make some great points such as not letting letting the process become a bottleneck.
Comment: @stuartf If this was a general discussion I'd agree with you, but the question is more along the lines "Should I take over specs creation?". And where do I suggest that a QA specialist should not get involved? Getting testing involved from the start is what requirements reviews are for, shaping requirements with your reviews does involve QA in the creation process. But completely taking over the creation process, that's not typically a good thing. Still, if the person is sufficiently talented, the wrong way may be the best way to go.
Comment: @stuartf Yes, my bad. In that line I refer to gathering / creation as the very first steps towards the actual specs, which usually involve gathering input from clients / stakeholders, generating raw ideas, checking the competition etc, assuming that's what the OP had in mind (as what else could a marketing dept. actually do towards specs?). I think we need a lot of clarification on the question itself, its wildly open to speculation.
Answer: This is so tricky - either one is a good solution depending on the situation.

Picking the right one will make you a hero.
Picking the wrong one could make you lose your job.

So then if you take the time to talk with the stakeholders and flesh out the specs, what happens? Do they say "Wow, you were very thoughtful and thorough! Let's answer these questions so we can move forward with the project!" Or, do they tell you "Wow, you're wasting more of our time with these trivial details? Can't you just go do your "computery stuff" and let us get back to work?"
I've seen it both ways (okay, not marketing, but does it matter who made the poor spec? :-) and I've been treated both ways.
I try to find a delicate balance of the two. For small changes, I don't waste their time. I use previous examples to make a best guess about what they really want. For bigger changes or contradictions in the spec, I PROPOSE a solution and send it to them for a stamp of approval. I also send them a list of the small changes I took the liberty of making. Hopefully they get back to me in time before it ships if they want it changed.
Also, before I start work on a project, I identify things that need to be clarified and send them to the analyst before doing any development. (I know you're doing test scenarios, not application development, but I feel the same rule applies.) Then I try to work around those grey-areas until I am forced to put it on hold or bite the bullet and make some changes.
< personalRant justification="I hate it when people do this to me">
Some developers I know play "gotchya games" with the analysts to cover their own backside. They'll send a request for clarification, but they'll hide some of the main points. Maybe they're broken up in sentences in the middle of a paragraph or something like that, or you put two requests in the same bullet point in the email. Please, please, please don't do this.
It's not always intentional, but the end result is the same: they miss the request for clarification on a particular issue, so you miss out on what they had to say, the product ships without the clarification (and is usually wrong) and it comes back to you. Then you say "Well, I sent it to the analyst and he didn't seem to be interested in it. Not my fault he didn't think it was a big deal."
It works in the short term to get the "blame-hogs" off your back when something goes wrong, but the long term effects are drastic: Poor relations between your team and the analysts (as if it isn't hard enough getting information!), the product's reputation with customers suffers (and you may even lose some customers if the issue that went live is bad enough) and if it happens too many times, management begins to notice a pattern about you, especially when it happens with multiple analysts.
< /personalRant>
tl;dr: make what decisions you can, and communicate the ones you can't. Keep them apprised on your situation, and listen to what they have to say. Try to keep relations between your team and the analyst/marketing/business team (or any team!) as good as you can; it makes it better for everyone at the firm!


How to create a bounding box around a point using postgis

Question: How to create a bounding box around a geom (POINT) and find all the intersecting geoms(POINTS) within that bounding box?
Comment: Is this your homework?
Comment: Welcome to gis.stackexchange! Please edit the title of your question to include enough information for future visitors to be able to find this thread when looking for the same problem.
Answer: Bounding box is rectangular and therefore ST_DWithin gives wrong result by using a circle for making the selection. Your workflow could be:

Define a point
Buffer the point and create a circle
Make minimum bounding box around the circle
Use this newly build box for selecting the features

Thus, if we forget the trouble with geometric coordinates, the SQL query would be like:
SELECT * from your_table AS a
where ST_Intersects(a.geom,
ST_Envelope(
ST_Buffer(
ST_GeomFromText('POINT (-108 43)',4326),10)));

The buffer of 10 degrees with EPSG:4326 may not make sense but the SQL per se gives an answer to your question as you put it. If your data and the Envelope that you build are in some projected SRS like some UTM zone the result should be fine.
Comment: excellent answer, I would add a query that create buffer from point and than find closest OSM ways intersecting it select osm_id,
      highway,
      name,
      st_distance(w.way, st_transform(st_setsrid(st_makepoint(-75.540846,40.075881), 4326), 3857)) as distance
from planet_osm_line w
where (w.highway is not null ) and w.way &&
      st_transform(st_envelope(st_buffer(st_transform(st_setsrid(st_makepoint(-75.540846,40.075881), 4326), 26986), 100,2)),3857)
order by distance;
Answer: SELECT pt.id
FROM points_table pt
WHERE ST_DWithin(ST_GeomFromText('POINT 0 0', 3857), pt.geom, 500);

This might be one way to solve your problem.
Comment: What CRS do you use?
Comment: Thanks Michal, this is what I wanted, but facing some problem , though I am altering the distance parameter, still I am getting the same result, any solution ?
Comment: try geography if you are using 4326


Show that there is a primitive root mod m

Question: Let p be an odd prime and let m = 2p.  Show that there is a primitive root mod m, in the sense that there is a number a between 1 and m − 1 with order φ(m) = p − 1 mod m. i'm not able to figure out to proceed. any help i highly appreciated .
Comment: Do you know that there is a primitive root mod $p$ ?
Answer: Hint:
Chinese remainder theorem: $\;\begin{aligned}[t]\mathbf Z/m\mathbf Z&\simeq \mathbf Z/2\mathbf Z\times\mathbf Z/p\mathbf Z\\
x\bmod m&\mapsto(x\bmod 2,x\bmod p)\end{aligned}$
The multiplicative group $(\mathbf Z/p\mathbf Z)^\times$ is cyclic, i.e. it is the set of powers of a single element.
Some details:
Let $2u+vp=1$ a Bézout's relation between $2$ and $p$.  If $\alpha$ is a generator of the cyclic group $(\mathbf Z/p\mathbf Z)^\times\;$ represented by a number in $[2\,..\,p-1]$, the element $(1,\alpha)\in(\mathbf Z/2\mathbf Z)^\times\times(\mathbf Z/p\mathbf Z)^\times\;$ has order $p-1$, and it corresponds by the inverse isomorphism to the element $2\alpha u+vp\;$ in $\;\mathbf Z/2p\mathbf Z$.
Comment: can you explain in more detail ?
Comment: @kkr: please see my completed answer. Is it clearer?
Comment: can you explain it in more simpler way? I don't know what a cycli group is and what isomorphism is
Comment: A cyclic group is a group generated by he powers of a single element. A (ring) isomorphism such as mentioned at the beginning, is a map between rings which respects addition and multiplication in these rings. I've added details of the isomorphism in the Chinese remainder theorem.


How many convex solids have the same faces?

Question: The five platonic solids have all faces regular Polyhedra. They are also all convex. But there are other properties they satisfy. Like each vertex should have the same number of edges meeting there. Let's say we relax all other criterion and only require that the solid be convex and that it have all faces regular. How many such solids can exist? One example is pasting two tetrahedra together along a face to get a solid with 6 sides and triangular faces.
Answer: Convex polyhedra with regular faces which are not Platonic are called Johnson solids. There are 5 Johnson solids with the same faces. It happens they are all triangular faced (can you see why?)

J12 Triangular bipyramid
J13 Pentagonal bipyramid
J17 Gyroelongated square bipyramid
J51 Triaugmented triangular prism
J84 Snub disphenoid

So together with 5 Platonic solids, you have 10.
Comment: If we have identical regular faces and identical vertices, we would get platonic solids. So some vertices should be non-identical, meaning we should have different numbers of faces meet at vertices. However, you can only have 3 squares or 3 pentagons at vertex of a strictly-convex polyhedron. Thus, only [deltahedra](https://en.wikipedia.org/wiki/Deltahedron) meet your criteria.
Comment: Why are they all triangular faced? Sorry, I can't even see how to being trying to see why. Especially since we have the cube and Dodecahedron.


receiving RTP stream on RPi

Question: Need to receive RTP stream with lowest possible latency and CPU load. I need to always read the latest frame, that is, as if I had a buffer equal to 1. What is the best way? I need it to be possible to read this frame later using OpenCV in C++. I have tried pipeline with Gstreamer or ffmpeg but the latency is quite high
Answer: Create and connect to a VPN server on your LAN or whatever network the stream is on. Type in the port and machine with the stream into your browser. Do what you will with stream, capture, whatever.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

receiving RTP stream on RPi


My past employer is talking openly to my boyfriend about my leaving the job

Question: I walked out on my position as a medical assistant. My boyfriend is still a patient there, and during his last apointment, the doctor openly talked about how wrong I was to walk out on my job. Does he have a legal right to talk to others about how I left my employment? They're already making it impossible to use as a reference as its left me with nothing but dead ends.
Comment: What state? Also, can you be more precise about what you mean when you say you "walked out" and what types of things the previous employer is saying. For example, are they saying things that are untrue? More details will help frame your question.
Answer: Unless your employer agreed in a contract to not discuss your employment, then there is no legal restrictions on them discussing anything about your employment.  If they say things that are untrue you could sue them for defamation.
Answer: If you contact your old HR department you can see if its illegal for him to be talking about you in a way that is effecting your life and current career, if its bad enough and you dont want to confront him about it, id say go to the eeoc website which is the US equal employment opportunity commission and file a complaint with them. I would try and get a copy of the any documents you signed when you were hired and read about your rights as an employee there. If there is nothing there that is legally binding about what he is doing to you, there might be little you can do. Id say if you have evidence it is probably illegal...also depends on what state you're in. eeoc.gov will tell you what to do.
Comment: Also, you need to indicate how talking about an ex-employee is related to the powers of EEOC. They aren't a generic complaint agency.
Comment: This is advice, but it doesn't appear to be an answer to the question: "Does he have a legal right to talk to others about how I left my employment?"


Best way to practice solidity

Question: Pardon my question. I'm new on Solidity yet very curious to learn more about the language.
I've done many research on the web, trying to absorb the most I can to understand about the code, and believe me, I'm catching up quite fast. I don't have experience with Java script which makes things a little harder for me to understand how the lines of codes are structured. I do understand some of the variables and functions based on the material I've found on articles and youtube videos, however I'm still struggling to understand what's the best way to structure the lines of solidity codes.
I was wondering if there would be any patter to follow to make it easy to understand, but I wasn't able to find that. The programmers that are on YouTube don't talk about patters that could be followed while writing a function on solidity, and that's what I would like to know.
I'm trying to learn by my own and something not having someone to explain a certain doubt makes it hard to move forward.
Hope somebody here would be able to explain to me if there is any patter that I could follow to write functions on solidity.
Answer: Solidity documentation has a style guide. Other projects like OpenZeppelin add a few details.

Best way to practice solidity


Configuring osTicket to fetch mail from an email account

Question: I'm trying to use osTicket to implement a ticketing system but I'm not able to fetch the mails from an email account even after configuring the host, port, user name and password.
Comment: I use OSTicket on several sites, and have no problem fetching mail with it.

To start we are going to need to know why you think it is not working. Does an error message come up at all, or is it just not fetching mail without showing an error?

Also, what is the domain of the e-mail address you are trying to fetch mail from? Some e-mail addresses, like Gmail and any other Google Apps e-mail addresses, need some additional settings to work properly.
Comment: @SherwinFlight I did not setup a cron job,i think how can i do it
Comment: im using cpanel hosting
Comment: Are you asking how to set up a cron job in cPanel, or are you asking for the specific osticket cron settings?
Comment: specific osticket cron settings for cron.php
Answer: To make the mail fetch work you need to be running thr cron.php file as frequently as you need to poll the mail server.
Cron
*/5 * * * * nobody /path/to/php /path/to/api/cron.php
Windows Scheduled Tasks
Add "c:\php\bin\php.exe c:\website\osticket\api\cron.php" to the Windows scheduled tasks pane.
Note that the cron.php file has restrictions in place to ensure that it is triggered by the server and not a remote browser connection or remote virtual scheduled tasks provider.
http://osticket.com/wiki/POP3/IMAP_Setting_Guide#Recurring_tasks_scheduler_.28Cron_Job.29


Append extras informations to Series in Pandas

Question: Is it possible to customize Serie (in a simple way, and DataFrame by the way :p) from pandas to append extras informations on the display and in the plots? A great thing will be to have the possibility to append informations like "unit", "origin" or anything relevant for the user that will not be lost during computations, like the "name" parameter.
Answer: Right now there is not an easy way to maintain metadata on pandas objects across computations.
Maintaining metadata has been an open discussion on github for some time now but we haven't had to time code it up.
We'd welcome any additional feedback you have (see pandas on github) and would love to accept a pull-request if you're interested in rolling your own.


Qt mingw32 build Error [debug/rasterwindow.o] Error 1

Question: I installed Qt 5.0.1 mingw 4.7, when I build/run an example, I got this at issues:

and this at Compile Output:

I can't build/run anything. How to fix that? Thanks.
Answer: This was worked for me
Projects > Build > Build Environment:
Check the Clear System environment
follow the following link for more answers
stackoverflow.com/qt-error-2-at-compile-time
Answer:
There are some other issues too. This error is mostly  occurred the
situations when you run your code one time and again trying to run it
without closing the previously generated wizard(GUI window).
QT can't open the target file because it's already in use. So please make sure that you close the generated wizard before run/build the project again.
Answer: Have you set your PATH correctly within your System Environment Variables?
Path Variables I have set for Qt:
QTDIR: D:\Qt\Qt5.0.1\5.0.1\mingw47_32
Path:
C:\Ruby200-x64\bin;C:\Python33\;C:\Perl64\site\bin;D:\Qt\Qt5.0.1\Tools\MinGW\bin;xxx;D:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin;
** Note: I have read before that ordering can matter. Ensure you have your Qt bin path after your MinGW bin path.
Refer to these discussions:
Similar Issue: Case 1
If you were able to run programs in previous versions, but cannot now - try this:

Clean project
Close QtCreator
Remove Release/Debug Folder from app directory
Delete xxx.pro.user file (lives in app directory)
Manually delete Makefile, Makefile.Debug, Makefile.Release (If still there)
Open Qt Creator again and open your project. It should now be asking you to reconfigure your project build settings.

Good Luck!


Vinyl converter spins 35.3 RPM -- How to correct?

Question: My new "Numark PT-01 USB" turntable/vinyl converter actually spins 35.3 RPM instead of 33.3.  Notes sound slightly sharp.  Is there a good software to fix this?
Answer: Just about any audio editing software should be able to do this for you.  You simply need a "stretch" or "speed" adjustment.  If you don't know of any software, Audacity is a popular free option.  It's probably overkill for your needs, but should allow you to stretch the audio out to slow it down.


Young adult book about a traveling snake oil salesman selling magic elixirs that worked, including a strength potion

Question: I read this book in the mid-to-late '90s. It was about a traveling snake oil salesman in one of those old horse-drawn carriages, and he had magic elixirs and potions which actually worked. I vaguely remember him giving a strength potion to a guy and he was able to lift a lot in front of everyone, I think? But this guy traveled from town to town, and each person he sold a different magic elixir to.
Comment: Snake oil generally refers to a product that does not work. Were these potions flawed in some way? Hidden drawbacks you can recall? If they are just magic potions that work snake oil isn't the right term.
Answer: Was it by any chance The Divide?  (Also mentioned in this question.)
From Goodreads:

When Felix's parents take him to "The Divide"--a spot in Costa Rica
where the waters that run down to the Pacific and Atlantic oceans
separate--Felix finds himself in a bizarre parallel world where
mythical creatures and magic are a reality. There, he meets Betony, a
tangle child and herbalist who becomes his friend in this strange
land. As Felix explores this new world he soon discovers that its
mythical beasts and fairy folk think Felix is a legendary creature who
uses practical science instead of magic! Will Felix ever find his way
back home...and will he want to?

The plot involves a ruthless pixie businessman who is making a fortune selling potions on an industrial scale, in a kind of skit on the real-world pharmaceutical trade.  The potions do work, but they've been insufficiently tested and some of them are highly dangerous... also, the pixie's name is Snakeweed.
Answer: The Coven Tree series by Bill Brittain:

Book 1: Devil's Donkey (1981)

Book 2: The Wish Giver: Three Tales of Coven Tree (1983)

Book 3: Dr. Dredd's Wagon of Wonders (1987)

Book 4: Professor Popkin's Prodigious Polish: A Tale of Coven Tree (1990)
Comment: Hi, welcome to the site. You could improve this answer by editing it to provide a bit more info on the book/s, and specifying the ways in which it/they match/es the one described in the question.


How to enable abbreviated port names in Atmel Studio?

Question: Good day! I have been working with Atmel Studio lately and am a bit confused about notation. Thus far, when I reference a pin, I usually just use the PORTxn notation (example: PORD0). However, I constantly come across code samples on the internet that employ an abbreviated form Pxn (PD0). I tried using this form because it seems very convenient but anytime I do it Atmel underlines it in red and throws an error, saying that it does not exist even though I have included the avr/io.h header in my file. Any ideas what might be going wrong? Here is my sample code. You can see the red underline for PD2. Thanks for the help!

Comment: Do you see PD2 in the io.h header ? I see that you defined PD5 , why didn't you define PD2 ?
Answer: Weird. avr/io.h includes avr/portpins.h which has the abbreviated forms. Maybe it has something to do with that first include you have? Try removing the #include <io.h> and the #define PD5 = 5 lines, and also check if you have the correct microcontroller configured in your project settings.


1997 Dodge Ram 1500 Stereo Wires Different

Question: My Aftermarket Stereo Doesn't match the colors of my truck. I don't have the Yellow or black wires like as the aftermarket radio has it.
Comment: I am sure you have a question hiding somewhere in there. You'll need to edit this post to make it more clear to use.
Answer: Wire colours don't have to match, wire functions need to match. Some car munfacturers have the function of wires printed on the wires themselves, or on the top or back of the original stereo. Match the function of the wires.


Are there different types of sage modes?

Question: Why are some sage modes evil and make the user violent like Jugo's clan and Kabuto's sage mode? And why is Naruto's sage mode "less dark" ? Are there different types of sage modes? They all use natural energy so shouldnt they be the same?
Comment: Yes there is different types of sage modes. I think there's one for different animals.
Comment: but..dont they all use natural energy? Then why the difference..?
Comment: They all use natural energy, yes. I think the animals they represent is the only difference, and the powers they get. Now remember, I'm saying "I think" as in it's my theories, you could say..
Comment: oh..but i still dont get why using natural energy transforms you into different creatures...how could using the same thing transform you to different creatures depending on where you learned them?
Answer: Yes there are different types of sage mode, depending on summons. But I think you're asking if there is like an evil sage mode. Well...to put in similarity terms: No. Sage mode is basically the opposite of when Naruto loses control over his tailed beast. You have to be in perfect control, and if you're not, you become literally an animal or stone, not some rampaging demon. Now this doesn't mean that Sage mode is only reserved for good guys. It really depends on the summon. If the summon you use is evil and wants to teach you sage mode for your evil reasons, by all means you can do that. Like Kabuto....and Orochimaru....
Comment: It could be argued that Jugo enters sage mode and it turns him into an insane murderer. He is somewhat unable to control his natural ability to absorb nature energy, and we all know enough nature energy transforms people.


Why is fuel leaking from the carburetor on my generator?

Question: i have Honda clone gx 160 Chinese generator, fuel is leaking from side which is attached to intake of head, i have cleaned carb checked the float. float is working properly. i have sucked air turning it upside down and could not suck any air hence fuel will also not pass. i have replaced intake side gasket too, this also did not worked. what could be the problem.
Comment: I'm voting to close this question as off-topic because this is not about home improvement
Comment: Please explain how your question is related to home improvement.
Comment: Repair of major appliances is specifically on-topic. A generator falls under the same category as a furnace if it's your primary power source, in my opinion. We also support repair of lawn mowers, for example.
Comment: How do you know that the float is working properly? Sounds to me like it isn't. Is the needle clean and in good condition?
Answer: On my generators I turn the fuel off and run the carb out of fuel for several reasons the first being a tiny pice of crud in the seat for the float valve would be impossible to detect in most cases even my Onan will leak like this some times so it's a good idea to turn off the fuel, reason #2 when fuel is left in the carb the methanol eats up some of the seals and absorbs moisture, while doing this debris from the degraded rubber parts and fuel lines cause leaks. It is a good idea when done running your generator to remove the load and turn the fuel off letting it run until it dies this helps keep the carb clean and the only negative is you have to open the fuel valve and wait a minute for the bowl to fill up prior to starting. This also provides some additional cool down time for the alternator.


Appropriate to say "Nice to meet you" over a phone interview?

Question: I have a phone interview for a tenure-track position. It's always awkward because you want to say "Nice to meet you, Prof. X" but it sounds so weird. What would be the alternative? You wouldn't just want to say "Hi Prof. X". Would you?
Comment: Interviewing can be very stressful but you are certainly overthinking this and you are meeting them just over the phone. You may not want to say something along the lines of "Good to see you" though. Try to relax they won't remember your greeting even a minute later unless it was very out of.the ordinary.
Answer: There are surely plenty of alternatives.  "It's a pleasure to speak with you."  "Thanks for taking the time to speak with me."  And so on.
However, even if you do say "Nice to meet you", the most that will happen is someone will say "Though I guess we're not really meeting, are we?  Ha-ha-ha."  And you'll say "I guess not, ha-ha-ha" and chuckle politely for about half a second, and then move on.  Nobody will care or remember, and it will have no effect on the outcome of the interview.
Answer: Nate identifies a typical three-way exchange: One party says, "Nice to meet you," the other says, "Though I guess we're not really meeting, are we? Ha-ha-ha," and you conclude, "I guess not, ha-ha-ha." This can be avoided with a phrase such as:

Nice to virtually meet you.

However, as Nate also notes:

Nobody will care or remember, and it will have no effect on the outcome of the interview.

There's no need to plan for the mundane, focus on selling yourself.


Do I need to wrap email messages longer than 72 characters in a line?

Question: Occasionally I've seen code wrapping email messages to make sure a single line is no more than 72 characters long. Is there really need for this and what is this all about?
Comment: Good answer is here: http://stackoverflow.com/questions/2696433/is-it-necessary-to-wrap-long-lines-when-sending-emails/2696542#2696542
Answer: RFC 2822 contains this text about line lengths, which is where this likely comes from:

There are two limits that this
  standard places on the number of
  characters in a line. Each line of
  characters MUST be no more than    998
  characters, and SHOULD be no more than
  78 characters, excluding    the CRLF.
The 998 character limit is due to
  limitations in many implementations
  which send, receive, or store Internet
  Message Format messages that    simply
  cannot handle more than 998 characters
  on a line. Receiving
  implementations would do well to
  handle an arbitrarily large number
  of characters in a line for robustness
  sake. However, there are so    many
  implementations which (in compliance
  with the transport    requirements of
  [RFC2821]) do not accept messages
  containing more    than 1000 character
  including the CR and LF per line, it
  is important    for implementations
  not to create such messages.
The more conservative 78 character
  recommendation is to accommodate
  the many implementations of user
  interfaces that display these
  messages which may truncate, or
  disastrously wrap, the display of
  more than 78 characters per line, in
  spite of the fact that such
  implementations are non-conformant to
  the intent of this    specification
  (and that of [RFC2821] if they
  actually cause    information to be
  lost). Again, even though this
  limitation is put on    messages, it
  is encumbant upon implementations
  which display messages
Comment: Is this still necessary these days?
Answer: To expand on Joe's response, the 72-char limit basically allows for bodies to then be quoted, so it gives room for the additional chars added to a line, e.g.,
<code>From "scratch":
> From Joe Bloggs, 24 Sept 1985
>
> > Probably some flame about emacs vs vi, eulogising one over the other.
> > The quote chars have added four characters to the start of the line, so
> > forcing wrapped lines at 72 chars pushes this to 76 chars, without
> > affecting the formatting of the paragraph.
>
> Some rant accusing Joe of talking crap, and throwing out some random
> evidence to the contrary. Quote char adds 2 chars. Again, paragraph
> formatting retained.

Someone else chimes in deciding to eulogise pico over either of the
other two editors. All sides about to turn on this person. :-)
</code>
So giving an extra few chars allows the parapgraph formatting to be retained on 80-character terminals, for at least two levels, and potentially more depending on how the quote characters are added/used.
Comment: Is this still necessary these days?
Comment: Probably not, as most email readers will wordwrap properly. There's still an issue with quoting older bodies as smart word-wrap can distort the text, making it tricky to see where text has been quoted. Ultimately, to *not* do this breaks the internet's Robustness Principle of "be conservative in what you send". This basically states that if you don't know what the recipient is using to receive/read mail, so don't make assumptions, and play safe. Of course, if you know what the recipient uses, you can make allowances accordingly.


Decorating A Method In ASP.NET?

Question: Me again..  I hear the phrase 'decorating / decorate' a method being thrown about a lot in tutorials I have read / watched.  But I just don't understand what it means AND what it actually does??  Can anyone point me in the direction of some information on beginning to use them (Very novice tutorial would be good)
Answer: .NET does not have "decorators" but it does have attributes.  Developers often use the word "decorate" to indicate the usage of attributes.  Here is a good article explaining how they work and how to use them.
Comment: Fantastic thanks for the link, just what I was looking for - This site is fantastic
Answer: Take a look at this article for an introduction and tutorial.
To Decorate in .NET you use attributes which act as metadata that is available to you at runtime which helps describe the items in your code.
Answer: If your talking about the Decorator design pattern there is a very clear example on dofactory.com.
Hope this helps

Decorating A Method In ASP.NET?


Finding an equation relating the mass of a blade of a wind turbine to its velocity

Question: I'm writing up my physics coursework and I thought I'd try and find an equation described in the title. This is my attempt:

Is it correct?
Answer: I think that you are overestimating the importance of the blade mass. The blades rotate due to aerodynamic forces which are determined by blade geometry and size, and the fluid properties of the air impinging on them. The mass does not impact the aerodynamic properties of the blades. For a fixed wind speed, neglecting small effects like friction in bearings and the opposing torque of the generator, the blades will gather speed until their motion relative to the incoming wind reduces the angle of attack to approximately zero. At this point, the blades no longer generate lift thus the rotational speed of the blades will stay the same. This maximum "steady state" speed can be controlled somewhat by changing the pitch of the blades. In fact, that its one way to prevent the blades from rotating too fast in powerful winds. Ultimately, the mass should not affect the stady state blade speed. It will, however, affect how much time it takes for the blades to reach steady state speed since the torque is fixed by blade geometry and wind conditions. More mass means greater moment of inertia, which for fixed torque yields smaller acceleration. It is advantageous to make lighter blades because of sturctural considerations, not max attainable blade rotation rate. All of this is somewhat oversimplified because we ignored opposing torques and made no mention of aerodynamic drag, but the core idea doesn't require those considerations.
Answer: That only gives you the linear velocity. Since the blade is rotating, the angular velocity $\omega$ = $v/r$. Also, since the blade is not a point object, you'd have to use the moment of inertia rather than the mass.
Comment: Could you possible give me an example of how I would do that? Thank you.
Comment: Well, the wikipedia article about moment of inertia that I linked to is quite clear... if you read that and you still have questions about this, I'll be glad to answer them. :)
Comment: How do I algebraically manipulate the moment of inertia if its a summation with two variables? Can I assume m and r are constant so its just Nmr^2?


WiFi and data connection switches on automatically although I repeatedly turn off the two features

Question: The WiFi feature and data connection in my tablet turns on automatically. After resetting, the problem goes away but as soon as I download programs that I need, the problem comes back. Anyone with suggestions?
Comment: Related: [Wifi and Data switching on automatically in my HTC Desire 820 device](http://android.stackexchange.com/q/120522)
Answer: Either an app that you have given permission to modify system settings is doing this which should be easily solved by checking each of your apps permission settings?
...Or maybe you have something like WiFi "Scanning Always Available"?
If you feel up to it, you may also find more information by looking at your Android's log files (either via an app that can look at the logs or connecting a computer and using "adb logcat")


Erdos Ko Rado for hypergraphs of bounded degree?

Question: The Erdos-Ko-Rado theorem states that if $H$ is a $k$-uniform hypergraph on $[n]$ which is intersecting, then $|H| \leqslant  \binom{n-1}{k-1}$. The easy example which shows this is tight is just take $H$ to be all $k$-subsets containing the element $1$. This example however the degree of the vertex $1$ would be $|H|$. I'm interested if the bound can be improved if we assume bounds on the max degree of $H$, in particular if the max degree is on the order of the average degree. Does anyone know of such a theorem?
Answer: A good bound was obtained by Frankl in his paper "Erdos-Ko-Rado theorem with conditions on the maximal degree".
His result is as follows. For $\ell \geq 0$, define the family
$$
F_\ell = \{ S \in \binom{[n]}{k} : 1 \in S \text{ and } S \cap \{2,\ldots,\ell+1\} \neq \emptyset \} \cup \{ S \in \binom{[n]}{k} : S \supseteq \{2,\ldots,\ell+1\} \}.
$$
If $k \leq n/2$ and $F$ is a maximal family whose maximal degree is at most that of $F_\ell$, then $|F| \leq |F_\ell|$.
Comment: Is Frankl's result new enough?
Comment: Not really. It's from 1987.
Answer: I returned to this problem after awhile and I can get a slight improvement and show a nice connection between simple graphs and multigraphs. Throughout the following, I will assume that the uniformity, $k$, is fixed and the max degree, $\Delta$ is tending to infinity.
Now, let $g(k,\Delta)$ denote the maximimum number of edges in a simple intersecting $k$-graph with max degree $\Delta$, and let $g^*(k,\Delta)$ denote the equivalent number for multigraphs. In my previous post, I argued three things:

$g^*(k-1,\Delta)\leq g(k,\Delta)\leq g^*(k,\Delta)$
$g^*(k,\Delta)\leq k\Delta$
$g^*(k,\Delta)\geq (k-1+{1\over k})\Delta$ for infinitely many $k$.

I can show an improvement to item 1. when $k$ is fixed and $\Delta\to\infty$ which gives an answer of $g(k,\Delta)\leq (k-1)\Delta+C_k$ where $C_k$ is some (large) constant depending only on $k$.
In fact, I'll show that $g(k,\Delta)\leq g^*(k-1,\Delta)+C_k$. To do so, let $G$ be a simple intersecting $k$-graph with max degree $\Delta$ and set $C_k=k!\cdot k^k$. The value of $C_k$ comes from the Erdos-Rado sunflower lemma. In particular, if $|E(G)|>C_k$, then $G$ contains a sunflower with $k+1$ petals. Since this is the case, we can pull off sunflowers $S_1,\dots,S_\ell$ from $G$, each having $k+1$ petals, where $\ell$ is the smallest integer with $|E(G)|\leq\ell(k+1)+ C_k$..
Now, let $S_i'$ denote the core of $S_i$. Since $G$ was a simple graph, each $S_i'$ has size at most $k-1$. Thus, if $G'$ is the multigraph with edge set $S_i'$, then $G'$ is $\leq(k-1)$-uniform. I claim that $G'$ is actually intersecting as well. Indeed, this follows from the fact that each $S_i$ is a $k$-uniform sunflower with $k+1$ petals, so since $G$ was intersecting, it must be the case that the cores of each of these sunflowers intersect as well.
Finally, if $\Delta'$ is the max degree of $G'$, we have $\Delta'\leq \Delta/(k+1)$ since each core corresponds to $k+1$ edges of $G$. Hence, $\ell=|E(G')|\leq g^*(k-1,\Delta/(k+1))$. It is not difficult to observe that $t\cdot g^*(s,\Delta)\leq g^*(s,t\Delta)$ by stacking multiple copies of a graph on itself, so we finally have
$$
|E(G)|\leq \ell(k+1)+C_k\leq (k+1)\cdot g^*(k-1,\Delta/(k+1))+C_k\leq g^*(k-1,\Delta)+C_k.
$$
Thus, $g(k,\Delta)\leq g^*(k-1,\Delta)+C_k$. This immediately implies that $g(k,\Delta)\leq (k-1)\Delta+C_k$, which is better than the trivial bound of $k\Delta$ for large $\Delta$.
Unfortunately, I do not know any way to improve the trivial bound of $g^*(k,\Delta)\leq k\Delta$.
Comment: So, you can actually take $C_k=k!(k-1)^k$ since you actually just need sunflowers with $k$ petals to make the argument work. But this doesn't really make much difference.
Answer: I just asked the same question myself and came across your question. Any chance you found an answer?
After thinking about it for a bit, I have a couple bounds.Let's first note that this question is also interesting if $H$ is allowed to be a multigraph. Further, if I have a $k$-uniform intersecting multigraph $H$, then I can create an intersecting $(k+1)$-uniform intersecting simple graph $H'$ with $|H'|=|H|$ and $\Delta(H')=\Delta(H)$ by simply introducing a ``dummy vertex'' on each edge in order to separate multiedges. This being the case, I'll consider multigraphs for the remainder of this post.
Let $k\to\infty$ and $k\mid\Delta$. If $H$ is a maximum $k$-uniform intersecting multigraph with $\Delta(H)\leq\Delta$, then $|H|=(1-o(1))k\Delta$.
Firstly, by looking at a single edge and realizing it must intersect every other edge, you get the trivial upper bound of $|H|\leq k(\Delta-1)+1\leq k\Delta$.
Now for a construction to show a lower bound. Let $q$ be a prime power and consider the projective plane of order $q$ as a hypergraph. This is an intersecting $(q+1)$-uniform graph which is $(q+1)$-regular and has $q^2+q+1$ edges. Form the multigraph $H$ by stacking $c$ copies of the projective plane on top of each other (so each edge has multiplicity $c$). As the projective plane was intersecting, so is $H$ and clearly $\Delta(H)=(q+1)c$ and $|H|=(q^2+q+1)c$, so we have $|H|=(q+{1\over q+1})\Delta(H)$. Therefore, if $k$ is one more than a prime power and $k\mid\Delta$, we can find a $k$-uniform intersecting multigraph $H$ with $\Delta(H)=\Delta$ and $|H|=(k-1+{1\over k})\Delta$.
While this implies the above claim for $k\to\infty$, it is quite unclear to me what the right answer should be for fixed $k$. For $k=2$, it is easy to convince yourself that if $\Delta$ is even, then the answer (for the multigraph case) is $|H|={3\over 2}\Delta$ which is realized by stacking $\Delta/2$ copies of the triangle on top of itself. Even for $k=3$, I'm unsure. The above bound and construction shows that ${7\over 3}\Delta\leq|H|\leq 3\Delta$ where the lower bound is realized by stacking $\Delta/3$ copies of the Fano plane. My intuition says that ${7\over 3}\Delta$ should be much closer to the right answer, but I don't know.