File Server - One large LUN or multiple smaller LUNs?

Question: We're about to replace a bunch of kit (servers, SAN etc.) and migrate our servers across from their current platform.
Our file server has around 8tb of data on it right now, spread across 5 LUNs (all on the same SAN mind you).
To my mind the pro's of multiple LUNs mainly come down to "what if" things, such as file restores, impact of file system corruption, and the con's are allocation of space i.e. I might have 500gb free on one LUN but no space free on the LUN where I need it.
How would you do it and why?
Thanks.
Answer:
Check whether there are any limitations on max LUN size on your SAN or at any other point in your stack. For example, if you're running this as a VM within ESX then you have a limit of 2Tb per LUN without hacking around it.
Inspect the payloads. If you're serving several distinct kinds of content from the same server (e.g. Install ISOs, User Shares, Email Archives) you may want some of them to be on faster disks while some sit on cheaper disks. Could this tiering be of value in the future even if it's not required today?
Evaluate the likely future growth of your storage requirements. Is it likely that you'll ever have to increase the available space within one of your storage areas? Can you do this while the LUN stays online? Can you do this while the server stays online? You may find that by splitting your data logically across several LUNs, you can expand one of those storage areas while serving from just 1 server, and without down-time.
Weigh up the probability of ever needing to split one of your storage areas off to a separate server. Performing this operation is simpler if that storage is on a separate LUN, as you can de-provision it to the current server and provision it to the new host.
Are you replicating your storage to another device? Is this on a per-LUN basis? Do you need to replicate all of the data, or only part of it? You may want to split into seperate LUNs to cut your replication traffic down to just the important data.
Comment: SAN shouldn't care (P4000), LUNs may be RDM in which case yes 2tb limit applies, or they may be presented within the guest from the MS iSCSI initiator.  I think point 2 is very relevant as with a single large LUN it does seem I give myself fewer options.
Answer: I dont see a real reason to split it over multiple LUN.


System Variable missing for QTP?

Question: Anyone ever had this problem - I open QTP on my Primary machine and it tells me the resources are missing.  This is odd since all QTP files are stored on a central file server.  If I correct this it works fine.  But, I open QTP on my secondary machine where I run the tests after building them, and I get the same missing resources.  Opening the test on different machines and resetting the path to the resources is causing the missing resources.
I am guessing I am missing a system variable, but I am not sure what.  I tried looking at the two machine system variables, but nothing look obvious that it is pointing to the QTP files.
Note- this just started occurring when I got a new primary machine.  Unfortunately, I did not notice this until after they have already wiped my old machine.  Again, I would expect that I need something in the System's Environment Variables, but I am not sure what.
Any ideas?  Suggestions on something to read that might help?  The name of a good psychic to direct me in finding the answer?  :-)
Thanks,
Jamie
Answer: I'm not sure what you mean by If I correct this it works fine but I sometime see problems with a network mapping going stale, in that case just accessing the remote drive (cd /d x:) or re-preforming the net use fixes the problem.

System Variable missing for QTP?


What happened to the 50 points bounty I awarded a user before my question was migrated to DBA?

Question: I asked this question on SO, put a 50 point bounty on it and awarded the bounty to a user's answer. The question was subsequently and unfairly migrated to DBA. Furthermore, the bounty was stripped from the user and I was not credited back the 50 points.. What happened to these points?
Answer: I've deleted the stub of your question on Stack Overflow, after which the rep you offered for the bounty was returned (less the reputation gained from the up-votes that were on the question).
It's confusing only because the rep awarded for the bounty is attached to the answer (which is deleted immediately upon migration), while the reputation paid for offering the bounty is attached to the question (which normally isn't deleted until some time later).
None of this is all that "fair" of course - the guy who worked to provide the answer still loses out on the bounty. Good reason to migrate early or not at all.
Comment: As with most things involving bounties, the rules are a balancing act between those that allow them to work, and those that prevent them from interfering too much with the normal operation of the site. I'm not particularly happy about this migration, but I do agree that the question itself is probably a better fit on DBAs; that said, the choice should really be *yours* - the next time you see a question of yours migrated and don't feel it should be, don't hesitate to flag for moderator attention and state that.
Comment: Well, thank you for the reimbursement!.. Perhaps the logic for handling bounties and migrations should be re-visited to provide fair and realistic handling of these situations?.. I will now wait 2 days, proceed to place the 50-point bounty on the question and rightfully award it to the user who invested time and energy to answer my question, albeit I still feel this question should've never been migrated to DBA. I only see 9 Informix-related questions there and most of them actually don't have anything related to DBA, rather Informix-specific SQL, etc.
Comment: EDIT: If the 50 rep cannot be credited to the user on SO, perhaps I should start a bounty on another SO question, hope the user answers and award him the 50, however this does not reflect the real reason and intent!
Comment: I'll certainly flag for moderator attention, next time something like this happens. I'm surprised that no one has migrated my most recent SO[Informix] question to DBA, since it strictly has to do with the DB's server!.. However, the question only has Informix tag. Perhaps users who follow this tag (which has a more limited audience than MySQL, etc) want it to stay there?.. Again, thanks for your understanding and help related to the posting of my Informix question!
Answer: Like all bounty points, they were dead to you from the moment you placed the bounty. They're never automatically restored under any circumstances (although perhaps mods or developers have the ability to do it manually.)
It's a shame that the answerer lost the points, but again, points don't transfer when questions are moved, that's just the way it works.
Now, for what it's worth, I agree with the move; that's absolutely a question about database administration, and not a question about programming.
Comment: I do think it's a shame the user lost the points. But how does being specific to a given database version make it inappropriate for DBA? That seems like it would make the question *more* appropriate for the specialized site.
Comment: Moderators have the ability to refund a bounty, as long as it is still in play (hasn't already been awarded to someone).  We only do it under exceptional circumstances, though.
Comment: It is unethical since the user invested substantial time to provide the correct answer!.. This question should've never been migrated to DBA, it's specific to Informix 11.70.
Comment: Users who follow Informix have always done so in SO, DBA has no visibity as far as Informix Q&A's are concerned!.. It's irritating to have to go to yet, another Forum for Informix related topics. It reflect an agenda of promoting yet, another forum which will struggle to gain acceptance. Keep Informix-related stuff together in one place!
Comment: How come this user got his 50 points back in a similar situation? `"I agree. This happened to me before and I ended up getting them refunded a few days later I assume some script must run periodically. So maybe find another of Jonathan's answers to reward if and when that happens? – Martin Smith 9 hours ago"`
Comment: Well, if you analyze the circumstances with the question I placed a bounty on and awarded, you'll realize that it was unfair for both of us, especially the user who provided me the desired answer!.. Think about it, fair is fair!


Blender Preferences Window Size

Question: Is there a way to remember and keep size of the Blender Preferences window?
It's too small and I have to adjust it each time I start Blender.
Comment: Do you want to open it everytime you use Blender?
Answer: You may want to setup your own layout configuration.
I'd suggest:

Open Blender
Make necessary changes you want to the windows so that you'd get to the exact screen you want every time you open the Blender.
Press Ctrl + U {or go to top-left corner and click on File > Save Startup File > Save
Startup File (confirmation)}
Now, close the Blender application window and try to re start the application. You'll see the applied changes to your interface.

Something like this:

You can learn ways to setup the configuration reading the documentation here:
https://docs.blender.org/manual/en/latest/interface/window_system/screens.html
There are tons of videos on customizing the layouts/ start-screen. One that I can recommend:
https://www.youtube.com/watch?v=yqPJJGzqrQk
Hope that helps!
Comment: I believe this question is about remembering the preferences window size specifically, and that can't be changed the way you describe.
Comment: Worse: If you have a big screen, it starts TINY, in the top left corner and it is not even properly scaled to show all content. This is very badly broken. So you end up resizing it EVERY TIME you use it.
Answer: I believe this is not possible. You can upvote this feature on https://blender.community/c/rightclickselect/TBdbbc/

Blender Preferences Window Size


Would there be any advantage to employ once enemy mercenaries to fight in a medieval war?

Question: Imagine 2 kingdoms are constantly at war and both sides would hire mercenaries for this cause, usually they will hires mercenary soldiers from the adjacent villages but this time one of the King's long time advisor suggested hiring mercenaries whom they have fought many years ago to have a better chance to score a decisive victory in the coming battle. I am wondering if there is any advantage to hire an ex-enemy to fight in the war? We assume these mercenaries are professional and they are not double agent/trojan.
Comment: This was the common and most usual approach. Mercenaries are mercenaries, they fight for whomever pays their wages. It would be harder to find and example where a ruler *did not* want to employ a company of mercenaries for the silly reason that once upon a time they fought for somebody else.
Comment: What examples in history that have had happened you want to avoid because I think the naswer will just cite those occurences and benefits.
Answer: This happened quite frequently in the past, and has indeed quite some advantages.
As you state, they are often professional. Their loyalty is with the money, and they will follow whomever pays (the most), or whomever they have a contract with.
You need to consider that a hired solder has nothing but their integrity. If a solder is known to back stab and turn coat, no lord would think about hiring them as they would be useless in combat. Meaning they would be out of a job.
Experience
For soldiers as much as any profession, experience counts. It doesn't matter where this experience was collected, it is quite often a better idea to hire a seasoned veteran than a freshly trained recruit.
Survival
Apart from getting paid, a solder would prefer to stay alive to spend their money. If they have intelligence on the enemy, because they used to fight for them, there is a fair chance they would share it to up their chances of victory. Or more importantly, surviving and getting paid. The same applies for knowledge about the terrain, or ideas about battle tactics.
Monopoly
If you hire all the mercenaries your enemy would normally use, the enemy can't hire them. This means they have a smaller pool of soldiers to choose from, and could end up with a smaller army than you.
Please note: Lords would be aware this happens, and your mercenaries might end up with the enemy in the future. Therefore crucial tactical intelligence and details would mostly be kept secret from them, and their instructions would often be "Just show up here and fight". This is why I didn't mention this specifically as a tactical advantage.
Answer: In addition to what Plutian the employment of mercenaries may lead to less bloody battles as less people are willing to die for coin than for honor/glory/etc. Furthermore I do recall that I read somewhere that the Italian peninsula saw less pillaging, raping and looting than it was "the norm". The argument for that was that the condottieri did not want to kill/offend somebody that may be their employer in a week or so.
Comment: I like that eye for future employment angle.  I like the idea that when your people encountered these guys before, the mercenaries were tough, professional, and left a business card.
Answer: Normally, it wouldn't be a problem. However, there are few concerns.
1) Loyalty. Do those mercenaries have reputation? If they had fought for multiple employers and honored their contracts, hiring them should be no problem.
2) Past offenses. Did those mercenaries commit atrocities against the kingdom? Do they have an ill reputation similar to GoT/ASoIaF Brave Companions among the people? If it is so, they still can be helpful against the enemy, but hiring them may create a friction within the kingdom itself. Many nobles and regular soldiers would rather settle scores with this company than fight alongside them.
Answer: If they are simply the best available, many advantages. This was very much a Norman/Viking/Rus characteristic. One disadvantage would be they might have a vested interest in prolonging the conflict/stalemate to maximise their income.
Answer: Those former enemies probably know how to fight well with you or even defeat you. So by hiring them you are making sure that your enemy wont get them. And as a bonus, you could improve yourself based of knowledge of you weakness brought by those mercenaries.
Answer: Hiring soldiers who are intimately familiar with the enemy, their strengths and weakness, their thinking, and their long-term plans? I can see plenty of advantages in doing that.
Comment: King A wants to hire mercenaries who fought against him in the past, and will be used to fight King B. These mercenaries have never fought King B before - they have no familiarity with the enemy they're being hire to fight. They have familiarity with their employer's military, not their enemy's.
Answer: You won't feel bad about sending them off to be slaughtered as a sacrificial unit; and you won't make the mistake of trusting them too much.
Also, if the enemy really wanted/needed them (because of a shortage of cavalry/pikemen/bowmen/whetever the mercenary unit is), then hiring them deprives the enemy of a crucial resource.
And because you can then use them to  bargain down the rates of local mercenaries when they realise they're not actually needed and might be unemployed.
Answer: There is a big-time advantage to hiring once-enemy mercenaries. If you do, they will be aware of some of the typical battle plans and strategies of your opponents, but you do need to be careful that they do not turn on you. And watch how much they tell you of your enemy's plans. If they spill the beans without demanding huge sums of money, they are definitely still working for your enemy. It's a bit of a gamble, but there are probably good uses for these soldiers, even if you don't think you can trust them. It will also add crazy awesome politics to your world, while trying to maneuver the mercenaries into fighting for you and being careful that they do not betray you.
Answer: Read 'The Prince' by Machiavelli. Its quite short and easy to find. It addresses this and related issues in some of its chapters and generally gives an insight into the art of states craft and politics as practiced by the kings and rulers that period when mercenaries were regularly employed. It also includes examples of what Machiavelli regards as 'classic mistakes' made by real leaders of the period.
(Note; he disproved of their use and gives his reasons. Regardless of that fact however they were as I said quite widely used during his time so other political figures of the time obviously disagreed.)
IMO. Mercenaries have some advantages if they have a reputation for reliability.  Their prime benefit being cost - standing armies are expensive. Mercenaries will probably cost you more per man, per day than a 'standing' domestic army might but they also only need to be paid for the  term of their contract. So on that basis they could potentially be useful additions to an army provided;
a) They have a specific skill set or niche in battle that your domestic forces struggle to supply e.g. skilled siege engineers and assault troops or light cavalry etc; and/or
b) They are not the numerically dominant (largest) part of your army. Because then you are totally reliant on them for victory and they may well try to either 'renegotiate' their terms of employment at some critical moment or alternately if you win decide they should be the ones who get to keep whatever the prize is. And of course if you lose they might try to sell you out to the victor! So be alert to what could happen, not will happen if you employ them.


DiffPlex does not ignore html tags while comparing two html codes

Question: Well I am using DIFFPlex for comparing two html code fetching from db but i want to ignore html tags and their styling (only content), is there any way to achieve this.
I am waiting for your answer guys.
Thanks
Answer: I would suggest using the HtmlAgilityPack to strip all the html tags.
See the following question: https://stackoverflow.com/a/16875574/12919
Comment: You need three versions of each side of your diff (docA / docB).  The original html from the database, the content (stripped of html) and the html with extra formatting used to display the differences.  You will diff docA content and docB content after using HtmlAgilityPack to strip the html.  Then build a new set of html with extra formatting to display the differences.
Comment: but still want html tags when displaying compared code as page. want to compare text only not html tags


SmartCards And Android

Question: I'm a C/C++ programmer with good windows and linux development experience and I also know a bit of java too. Recently, a client asked me to develop an Android app for him, wich, will most likely run on a Samsung Galaxy S or Galaxy S II, with Android 2.3, that basicaly consists in connecting a standard smartcard reader on the USB port of the device and using it to access the smartcard.
I have programmed smartcards before, but I have no experience with android. So my questions are:
Is it possible to do what I need in this hardware and O.S.?
Will I have to write my own driver to interface with the USB?
Going into more detail, I need to at least be able to execute APDU commands with the cards.
Something like the PC/SC standard. Are there any solutions in this subject already implemented?
Any ideas of where to begin?
Thanks in advance.
Answer: Short answer: not really.
Long answer: you might need to use custom firmware (Android build) to do this. Here's a project that does this, although their focus is on using embedded chips not external readers. They have a PC/SC implementation for Android.
Android has USB host support since 3.1, not sure if that is sufficient to implement a reader driver, so you can talk to your card: http://developer.android.com/guide/topics/usb/host.html
Even if you do though, you will need to somehow bridge it to your PC/SC stack.
Please open source it if you implement it :)
Answer: Did you test to connect a external smartcard reader to connect to a android device. What where results?
Greetings,
Wouter

SmartCards And Android


Video doesn't work well in skype

Question: My built in cam works fine in cheese. However in skype it doesn't show me at all. In test skype show myself view doesn't work either. How to solve this problem? Thanks!
Comment: I hate to say this, but get used to it. While most things work well, or well enough, a few software companies don't care enough about linux to test extensively -- or at least, not as extensively as in other OSses. Skype is one of these. Also, Microsoft recently bought Skype, so it won't be getting any less buggy.
Comment: Whether skype or microsoft are a pain is irrelevant ..this person actually needs an answer or we lose 'em
Answer: Well the answer depends on your webcam not just because you have Linux!
Maybe you have a webcam that lots of people have had problems with in both Linux and Windows
First perhaps you could help us to understand more if you let us know what make of webcam you have
Please open a terminal and type
lspci
Then paste the results back here
It might be that you have a logitech webcam  ( they are a pain BUT fixable)
IF you have a look at this page you may get some help
How to fix webcam problems in Skype
If you are still around ...let us know how you get on :)
Answer: After fighting with skype, getting just banality results that finishes in the correct usage of skype at the time that the up to 3 days setup is needed to work properly, just to find skype to become useless for videoconferencing simply after a reboot I stopped using skype for videoconferencing. Which I don't suggest you to but if you are in need to have a videoconference soon you may be interested on several Websites Flash Player based alternatives, which includes but not limits to those mentioned in this list:
http://www.moreofit.com/similar-to/www.tokbox.com/Top_10_Sites_Like_Tokbox/
Of which I have successfully tested the MeBeam Video Chat (http://www.mebeam.com), Boostcam (http://www.boostcam.com) and Ubiqq (http://www.ubiqq.com) which is also my favorite.
If you experience an issue with your Flash Player that won't reach your webcam, I suggest you take a look at this answer: Webcam not detected by Flash which also offers a few alternatives for that issue.
As I said in the beginning of this answer, this won't fit your skype issue but will allow you to have a yet decent videoconference, fast and without need to face lots of procedures in order to try forcing skype to do what it can't for now.
I am following your question closely in order to see if somebody else come and drops a good answer for this issue, which I have been facing since 9.04 and is not yet fully supported and may be it won't as fast as we'd like.
Good luck!

Video doesn't work well in skype


My wireless/WiFi connection does not work all distro after new installation of ssd

Question: i am in this situation :
i upgraded my Ubuntu installation to the latest release that the software updater offered me. WiFi worked before, but not now on the new release.
i can see my wireless access point, but i cannot establish a connection.
i post the result of this script as My wireless/WiFi connection does not work. What information is needed to diagnose the issue?
here :
http://paste.ubuntu.com/23616141/
any help thank you very much?
later addition:

#

I have made several subsequent checks and I have achieved some achievements.
First record that the problem came after adding a new ssd drive in the dvd bay of my laptop.
I have unmounted all the hard drives and I have tried to access my wifi from a live usb of lubuntu, with success.
Then I've been adding hard drives and it was still working to a point I tried with a ubuntu live usb and I've failed.
After that I tried to connect with the live usb of lubuntu with which I previously had success with that configuration of disks and I have failed again, so I deduce that it may be related to some parameter of the bios.
Any suggestions on where to continue?
Edited after:
Making new inquiries the failure seems to be when the pci express power management is activated in the BIOS, and then it starts from the live ubuntu usb.
Although if I activate the pci express power management in the BIOS and then start from the live lubuntu usb, this fault does not occur.
This is very very rare.
Also leave evidence that with the hard drive adapter for the usb bay inserted the reception of wifi is noticeably smaller.
Some idea to which it may be due.
Answer: Please open a terminal and do:
<code>sudo -i
echo "blacklist b43" >>  /etc/modprobe.d/blacklist.conf
echo "blacklist ssb" >>  /etc/modprobe.d/blacklist.conf
exit
</code>
Reboot and tell us if it is working.


Why don't we see inverted image while wearing spectacles?

Question: We know that the lens in our eyes forms an inverted image on retina and brain reverses it to give the correct image. But when one wears specs the image would get reversed twice so we should see things inverted.
Specs forms inverted image on lens -- lens again inverts it on retina -- brain again inverts it.
Please explain.
Comment: Your assumption about the behavior of "specs" is unjustified.  If you can prove your assertion about the image being reversed or inverted by them, show that.
Answer: When you have two lenses that are close to each other, to an approximation they function as a single lens whose diopter value is the sum of the individual lenses' diopters. Here, "close" means "at a distance small relative to the lenses' focal lengths". Only when lenses are "far apart" will they introduce new behavior (such as image inversion).
Typical (convex) eyeglass lenses have diopter values of 3 or less, which corresponds to a focal length of 1/3 meter or more, which is far longer than the distance between the glasses' lens and the lens in your eye. So, the lens doesn't add an inversion.
You can try this yourself with a (convex) eyeglass lens. Hold it close to your eye and you'll see the world slightly magnified, with the focus closer than usual. Now move the lens slowly away from your eye, and you'll see the image magnify further and further, until there will be a point where it's all a blur. Moving it further still, and you'll see the image come back, inverted. The distance where you only see a blur for distant objects is the focal length of the lens.


why i cant bent my plane?

Question: I want to bend my plane in y-axis but it's not happening. I have been facing this problem from many days
Comment: yeah I have subdivided the plane too but I'm not able to bend it
Comment: Is this different from your [other](https://blender.stackexchange.com/questions/174078/how-to-bend-the-plane) question?
Comment: Probably confusing global and local object axis, have you tried the other axises in the modifier panel?
Comment: yeah I have other axes it's working with the x-axis but it's not bending on neither y nor z
Answer: Simple deform modifier is sometimes... not very intuitive.

You need to rotate the origin point by 90 degrees, so that all axis work
Check Tool > Transform > Origins and use the Rotate tool. Then uncheck.
When using an Empty as origin, the same rule applies.

I'm not sure why it works like this :).

why i cant bent my plane?


Isomorphism between $U(15)$ and $\Bbb Z_4\oplus \Bbb Z_2$

Question: I am having trouble finding an isomorphism between $U(15)$ and $\mathbb Z_4\oplus \mathbb Z_2$. What we learned in class to create an isomorphism we typically find the generators and go from there. However, I can't find a generator for wither group. I am supposed to list where each element of $U(15)$ is mapped and also check three cases such that $\varphi(ab) = \varphi(a)\varphi(b)$. I know the elements in $$U(15)=\{1,2,4,7,8,11,13,14\}$$ and in $$\mathbb Z_4\oplus \mathbb Z_2=\{(0,0),(0,1),(1,0),(1,1),(2,0),(2,1),(3,0),(3,1)\}.$$ I found the order of $(0,0)=1$,$(0,1)=2$, $(1,0)=4$, $(1,1)=4$,$(2,0)=2$,$(2,1)=2$,$(3,0)=4$,$(3,1)=4$. In $U(15)$ $4,11,14$ have order $2$ and $2,7,8,13$ have order $4$ and $1$ has order $1$.
Comment: Please format your post with proper MathJax markup.
Answer: You have that $\mathbb Z_4\oplus\mathbb Z_2$ is generated by two commuting elements, one of order $4$ and one of order $2$ (namely, $(1,0)$ and $(0,1)$).
On $U(15)$, we want generators $a$ of order $4$ and $b$ of order $2$; if we take $a=2$, the table below shows that $b\ne4$; taking $b=11$,
$$
\begin{matrix}
a=2\\
a^2=4\\
a^3=8\\
b=11\\
ab=7\\
a^2b=14\\
a^3b=13
\end{matrix}
$$
So $a,b$ generate $U(15)$ and we can define $$
\phi(n,m)=2^n11^m.
$$


highcharts: bubble-chart drilldown to donut-chart

Question: I have a bubble chart with a dynamic amount of bubbles, dependent on how many rows a user selects in a gridview.
A bubble in the chart represents a so called "system" which consists "products".

Example 1: bubble "x" consists of 3 products "A", "B", "C".
Example 2: bubble "y" consists of 2 products "D", "E".

Is it posible to fire the click event of a specific bubble to fire a donat drilldown with exact this additional information?
I simply want to change the chart type!
Click on a specific bubble -> changing the chart type to a single big donut in the same container -> "back-button" to get back to the bubbles again.
I only saw column-charts with pie-chart drilldown.
Has somebody a short and easy example in JSFiddle I can play with?
Regards!
Answer: In the drilled serie you need to define type as pie.
Example: http://jsfiddle.net/uqthr1zb/


PHP MySQL query submit buttons

Question: I have constructed the following query
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO selection (student_id, id_project, level_of_want)
VALUES ((SELECT id FROM users WHERE Username = ".$_SESSION['MM_Username']." ), %s, %s)",
GetSQLValueString($_POST['Project_id'], "int"),
GetSQLValueString($_POST['Want'], "text"));

mysql_select_db($database_projectsite, $projectsite);
$Result1 = mysql_query($insertSQL, $projectsite) or die(mysql_error());
}

The student_id comes from the session information that is compared in the table.
The id_project comes from a hidden field that should contain the current id, and the level_of_want comes from the two submit button. When one is selected, that value is applied to the database. Below is how that looks in the form.
<input type="submit" name="Want[]" id="Want_0" value="Really Want" />
      <input type="submit" name="Want[]" id="Want_1" value="Partially Want" />

      <input name="Project_id" type="hidden" id="Project_id" value="<?php echo $row_Test['Project_id']; ?>" />

However when i execute this no information is applied to the database, nor is an error message shown when the button is selected. Does anyone have any possible clue to whats wrong?
Answer: I'm guessing because "SELECT id" is returning an empty resultset
try the following:
SELECT id FROM users WHERE Username = '".$_SESSION['MM_Username']."'

Notice the extra single quotes around the double quotes
Answer: Nathan,
Saw on your submit input is an array
<input type="submit" name="Want[]" id="Want_0" value="Really Want" />
<input type="submit" name="Want[]" id="Want_1" value="Partially Want" />

so to getting value should be
GetSQLValueString($_POST['Want'][0], "text"));

Tomz

PHP MySQL query submit buttons


Is there a relation between the connected components of a Lie group?

Question: Let $G_0$ be the identity component of a (compact) Lie group $G$ and $G_1$ one of its connected components. Is there any relation between $G_0$ and $G_1$? For example, is there a $g\in{G_1}$ such that $L_g\left(G_0\right)=G_1$? Here $L_g$ is the left-translation-by-$g$ map. Also, let's consider the map $\varphi\equiv{L_g}\circ\exp\colon\mathfrak{g}\to{G_1}$. Is this map injective or surjective?
Answer: All the connected components are diffeomorphic to $G_0$. Choose some $g \in G_1$. Then $L_g : G \to G$ is continuous, therefore $L_g(G_0)$ is connected; since it contains $g = L_g(e) \in G_1$, you get $L_g(G_0) \subset G_1$. Similarly $L_{g^{-1}}(G_1) \subset G_0$. The two maps $L_g : G_0 \to G_1$ and $L_{g^{-1}} : G_1 \to G_0$ are in fact inverse to each other, and they're both differentiable, so you get a diffeomorphism $G_0 \cong G_1$.
Answer: For the second question: if $G$ is compact, then so is $G_0$ and hence also $G_1$ (using that $G_0\cong G_1$ as Najib Idrissi showed). The exponential map of a compact connected Lie group is surjective (but that is difficult to show, see for example Knapp's book "Lie groups beyond an introduction"). So $\exp:\mathfrak{g}\to G_0$ is surjective and hence $L_g\circ\exp:\mathfrak{g}\to G_1$ is surjective. But it is not injective in general. (Take for example $G=S^1$).


How to decide when to use Ajax vs Javascript for maintainability

Question: During ASP.Net development i am often unsure weather i should be performing some functionality using an ajax request vs handling it all on the client with JavaScript. I often will want to use Jquery ajax functions in order to speed development up and improve maintainability even though i can achieve the same result without contacting the server.
Here is one example. In my MVC view i need to update a partial view in response to a button click. Here is a simplified version of my partial view
  @foreach (Requestbox.Code.XmlContentField xmlControl in Model.RequestContentControls)
    {
        if (Model.IsInEditMode)
        {
          ViewContext.Writer.Write("

          Edit
          Delete");
        }

        switch (xmlControl.ControlType)
        {
            case "TextBoxField":

                  @Html.DevExpress().Label(settings => {
                 settings.Name = xmlControl.FieldName + "Label";
                 settings.AssociatedControlName = xmlControl.FieldName + "TextBox";
                 settings.Text = xmlControl.LabelText;

             }).GetHtml()

                      @Html.DevExpress().TextBox(settings => {
                     settings.Name = xmlControl.FieldName + "TextBox";
                     MvcExtensionHelpers.SetTextBoxSettings(settings);
                     settings.ControlStyle.CssClass += " full-width";
                 }).GetHtml()

                break;
            case "Header":
                string header = string.Format("<{0}>{1}</{0}>",                                     xmlControl.HeaderType,xmlControl.Value);
                @Html.Raw(header)
                break;
        }

        if (Model.IsInEditMode)
        {
            ViewContext.Writer.Write("
");
        }
      }

When the Edit button is clicked i need to wrap each of my sections in a div and add 2 anchor elements with onclick functions inside. I can do this by using an ajax post request and setting the Model with "IsInEditMode to true" here is the code i could call, which replaces the current partial view with the new one.
function EnableEditClick() {
$.post(rootDir + "Admin/EditClick",null,
function(partialViewResult){
  $("#refTable").html(partialViewResult);
 });
}

Here is the Action that could handle the ajax request
public ActionResult EditClick()
{
MyModel model = new MyModel();
model.IsInEditMode = true;

return PartialView("CustomRequest", model);
}

This is one solution, another would be to handle this all on the client by using jquery to select each of my elements that are needed and to insert the anchor elements directly. I would also be able to take some code out of the view. So something like this (Haven't tested this code but i hope you get the idea)
function EditClick()
   {
      var elements = $('.myTable .clearfix')
      elemtns.append(' Edit
          Delete');
}

I am torn on which will be better maintainability wise, as with the ajax way i don't have to write html in JavaScript pages and i think it will be clearer and more readable when revisting the code. However i am then using a unnecessary request to the server when i could it handle all on the client.
So my questions is should i always be doing everything on the client if possible even at the result of maintainability. Any feedback on my example is much appreciated as well.
Answer: I recommend you to use AJAX for operations, which require some background calculations on the server or to retrieve some DB data from the server. For GUI generation I would use JS, as it is quite quick, thanks to V8.
If you need to generate GUI by embedding some server data into it and this page has complex layout, I would use server side template engine.
Answer: In the example you've given, I would recommend the JS approach to control the availability of the edit and delete buttons. Or possibly a combination of the two.
When you make an Ajax call it creates a background request that causes some HTTP traffic. Unless there's some processing needed on the server to fulfil the request, then there is not much use sending that request to the server.
From looking at your code then the action you want to perform is to add two anchors to the page. This can be done easily with JS. You could even combine the two by including a partial view on your page that contains the elements you wish to include, wrapped in some markup to hide them.
You could create a partial view with the button markup.
Edit
Delete

And then include in your view.

    @Html.Partial("_ButtonView")

Your JS would become.
function EditClick()
{
    $("#buttons").toggle("display");
}

Check this JSFiddle for an example of what I mean.
In the context of this question, I would consider using an Ajax request for the actual edit action that returns a Json result with the action output. This would end up with something like.
$.ajax({ // ajax call starts
    url: "YourArea/YourController/EditClick",
    data: {"your data"},
    dataType: 'json',
    success: function(data) {
        //handle json response
      }
  });

This Ajax request would call the controller code.
public JsonResult EditClick()
{
    var myResult = Helper.Edit();

    return Json(new { result = myResult });
}

Conclusion: If an event/action only affects what the user can see on the UI (i.e. controlling visibility and initiating animations) then you would probably only want to use JS/jQuery. If there's something more happening like server processing or fetching data from DB required then consider using Ajax.
In your example it seemed like the choice was between adding the elements dynamically to the page with JS or executing an Controller method via Ajax to get the elements as a partial view. I hope this answer provides a good solution for you.


How do I transfer garbage from my full landfills to my incinerators?

Question: Eventually every one of my landfills gets completely full and is constantly blinking at me warning me it's full. I've even built incinerators but they aren't taking the garbage from the landfills. The incinerators are just collecting new garbage. How do I transfer garbage from the landfills to the incinerators?
Answer: I was at first a bit confused as to the button "empty building to another facility" thinking that would just move it to another landfill.
In order to move the trash from the landfill to incinerators you must click "Empty building to another facility" on your landfill:

After you set it to emptying mode garbage trucks will start transferring it to incinerators where it will be burned:

Also, just want to point out, this works with cemeteries and crematoriums the exact same way.
Comment: I was going to punch my computer in the face because of this. How did I even miss it >_>
Answer: In the case that your having (the landfill moving to another landfill): try turning on "move to another landfill" on all the landfills besides the ones closest to an incinerator that way when the ones closest fill up theyll be forced to unload in an incinerator. At least that's what I did; I turned on all my garbages on right after reading this and started from the inside outward of my city... sure my people where unhappy for a few short years but it didnt really affect much. I agree with the bad logic in the game though. As soon as that button is activated it should immediately unload into an incinerator/crematorium.
Answer: Looks like it's bugged. If a landfill is available it will always transfer to another landfill, meaning you can't open a new landfill, effectively, until all landfills are empty. bad logic in code.
Comment: This is not my experience, I successfully emptied the above landfills to incinerators. Perhaps something else was going on in your case, like the incinerators were too far away or something else


Why does the rate of melting of an ice block vary in different methods?

Question: I saw that an ice block melts faster when it is placed in a microwave rather than when it is exposed to flame. Could it be because the flame creates a layer of water vapor between the flame and ice? If not, what is the real reason for this?
Comment: Without quantifiable conditions, this has little meaning.  Is the energy rate (e.g. watts) impinging on the ice the same for both sources?  What if you apply a hundred mini-flames (same total wattage) at different locations?  And so on.
Comment: Directly over a flame or on a pan over a flame.  On a pan, as the ice melts over the plan, it can also vaporize and push the ice up off the surface which slows down the melting.  Both the energy going into vaporization and the tendency for the ice not to stay in contact with the hot surface would slow down the melting. A curious effect can happens where a hotter plan melts ice more slowly than a colder one.   This happens with dry ice too and I think, Liquid Nitrogen as well.  Over a direct flame I think the effect would be much less.
Answer: When you heat An ice cube over a flame then heat is absorbed due to conduction and heat flows one sidedly only however in a micro wave the electromagnetic radiations have a greater penetrating power and they start moving dipoles present in ice because of which there is an increase in their vibrational energy, now because of friction between layers heat is generated which melts  the ice. These radiation have an advantage as they can cover a larger volume of ice as when you heat ice by conduction thus ice will melt faster in an oven than when you put it over flame.


Is it bad to eat cheese after its expiry date?

Question: I accidentally ate some packaged shredded cheese without knowing its expiration date. It expired in December and it is now February. it tasted fine, and it wasn't moldy. will I be okay? or should I worry about being sick? if so, how long would it take for me to get sick?
Comment: Some further reading on the dates on packages: http://cooking.stackexchange.com/questions/46722/do-best-by-xx-xx-xx-foods-have-an-expiration-date http://cooking.stackexchange.com/search?q=sell+by p
Comment: @Stephie Regarding your concern that this question may be off-topic, it isn't. It's a food safety question, despite the references he makes to getting sick.
Comment: I regularly eat out of date cheese :) never been ill yet...
Comment: At least for milk, the cows tells the squeezer when the milk goes bad ;)
Comment: I'm closing this, because predicting what will happen to one specific person after having eaten expired food is impossible. We have more general questions which describe the spread of risks.
Answer: Speaking in general about expiry dates, because I haven't seen them posted in other answers to this or other questions...
Expiry dates are (in some jurisdictions) entirely optional for most goods, and determined by the manufacturer (one example, anecdotally).
Another recent-ish article, which I found enlightening, from National Geographic that suggests that strict adherence to these "dates" results in wasted food that's perfectly safe. There's no doubt a balance between economics... and helpful suggestions for general health/safety.
There's clearly also examples and counterexamples: food that's spoiled before the expiry date because of poor storage, contamination, etc.; unopened shelf-stable food that might be safe indefinitely.
Plenty more questions about this topic, in general, also by searching SA for "expiry" and/or "expiration" in addition to the other suggested search topics.
Be safe out there! :)
Comment: +1 for adressing the expiry dates. One anecdote from Germany: A TV chef sells "gourmet salt" from the Kalahari desert. Another TV chef mocked this on his show: "This salt has been laying around in the desert for millions of years - once L. puts his label on it, it goes bad within five years..."
Answer:
It may well be a can of worms, but your question is very valid when, according to Wikipedia:

every year in the USA there are 76 million foodborne illnesses, leading to 325,000 hospitalizations and 5,000 deaths.

That aside, it is worth pointing out the facts about hard cheese and its longevity. Firstly it is a high fat product. Fat goes rancid, not bad unless it develops mould. Therefore if it looks mould-free, smells and tastes fine, there will be no problem. Indeed, even if the cheese has developed a mould, it does not necessarily mean it will make you ill, as the human gut has been made to deal with many moulds which naturally occur.
Historical facts: hard cheese was "invented" as a way of preserving a product made in times of plenty, to see over the times of hunger. The inherent properties and content (fat and salt) are long-life products which no amount of industrialisation can destroy. These cheeses include Cheddar, Parmesan, Emmenthal and Edam.
My personal experience: I currently have cheese in the refrigerator bought abroad and three-four months past its "use by" date. This happens regularly every year, because I cannot live without my Extra Mature Cheddar. At no time have we ever been ill as a result of eating out of date cheese. HOWEVER, it is not low-fat nor grated. If grated cheese is nearing its best-by date and you do not intend using it in the near future, simply pop it into the freezer.

Shelf Life A UK initiative to reduce food-waste may be of interest. WRAP (Waste & Resources Action Programme) is a registered UK charity working with "businesses, individuals and communities to achieve a circular economy through helping them reduce waste, develop sustainable products and use resources in an efficient way". It is pertinent that the whole "use by" labeling is being scrutinised. According to WRAP, 33% percent of all food produced is wasted along the cold chain or by the consumer. At the same time, a large number of people get sick every year due to spoiled food.
Which brings us back to your question of how long will it take before you get sick if the cheese was "bad"? The incubation period i.e. the time between eating contaminated food and the onset of symptoms, can be as short as a few hours or as long as several weeks. Hard cheese is less likely to cause serious food-poisoning, but Salmonella and Listeria and other bacteria may be found in a range of chilled, ready-to-eat foods including cheeses such as soft blue cheese, Brie and Camembert. It will also develop and grow in a refrigerated environment more information here It is also worth mentioning most deaths from food poisoning are from E.coli and Listeria, with the very young, the aged and those with a compromised immune system at greatest risk.
Answer: You're fine. Cheese gets moldy when it goes bad. If it looked fine, and tasted fine, you have nothing to worry about. Cheese is often aged for years upon years, and for safety's sake we say to leave a bit of buffer if you cut off mold from a solid chunk of cheese, the rest is still fine to eat. Of course, if shredded cheese gets moldy, you throw it out, but you would have seen mold.
Answer: you'll be fine. cheese is mold after all.
Comment: I guess this, now edited, version counts as an answer, so I have to leave it here. I also think it is a spectacularly wrong answer.


Canning tomato sauce without citric acid

Question: I've seen similar posts but none that address how pressure canning changes the flavor. I am trying to make tomato sauce without citric acid because my mom is allergic to it and the foods that contain it because that's how that works (a lot of googling suggest vinegar or lemon juice in place but that's also just citric acid) I saw a similar thread with some debate. I am looking for answers on safety of canning without citric acid specific to tomatos as well as if folks have found the flavor to be significantly altered by pressure canning.I'm new to this so hopefully following the rules well enough!
Comment: You know tomatoes contain a lot of citric acid, right? (In contrast, vinegar contains none.) And that it is literally impossible to avoid citric acid without dying of malnutrition or scurvy?
Comment: Vinegar is acetic acid, not citric acid.
Comment: What do you mean 'without citric acid'? Do you mean 'without *added* citric acid'? I've never added *more* acid to tomatoes for canning (more than what's already in the tomatoes already anyway I mean).
Comment: Roel: if one is canning tomatoes at 90-95C, one needs to make sure that they're sufficiently acidic, which often they're not.
Answer: The purpose of adding acid to canned tomatoes (and tomato sauce) is to lower the acidity of the food in order to inhibit the growth of the botulinum bacteria (a pH of 4.6 or lower does the trick). Citric acid is traditional for this as it doesn't alter the flavor much, but other acids are also usable such as acetic acid (vinegar), ascorbic acid (Vitamin C), or malic acid.
Canning without the use of acid is an option, but it's not a recommended one. That's because food canned without acid is susceptible to botulinum growth. As such, if you do this, you should keep a very close eye on it and it shouldn't be kept for longer than a couple of weeks... which, frankly, defeats the purpose of canning. There's a reason that it's hard to find any tomato canning recipes that don't include acidification of some kind - botulism is extremely serious and should not be taken lightly.
Also, you should have a talk with your mom. Tomatoes naturally contain citric acid, so if she can have tomatoes but not canned tomato sauce, it might be worth investigating what she's actually allergic to.
Answer: Pressure canning tomato sauce would likely give a result very similar to a majority of commercially-canned tomato sauce, taste-wise, since pressure-canning is fairly normal at the commercial scale.
However, you'll have to find a process recipe to follow that does not include acidification, which rules out many of the published processes, even for pressure canning sauce. i.e. https://nchfp.uga.edu/how/can_03/tomato_sauce.html clearly specifies non-optional acidification for their processing times.


Probability of a result of a game.

Question: Problem statement:
Two players play the following game of several rounds. If some player wins a round, the winner is given $1$ point, and loser is given $0$ points, and there are no draws. The game ends when some player gets $a$ points.
It is known that probability that first player wins a round is $p$. Find probability that difference between winner's and loser's score is equal to $b$.
My approach:
First, notice that if the difference between winner's and loser's score is equal to $b$, then the final scores must be $(a, a - b)$ or $(a - b, a)$.
Suppose that the final scores are $(a, a - b)$. Consider an integer lattice with points $(0, 0)$ and $(a, a - b)$. Number of paths from $(0, 0)$ to $(a, a - b)$ such that we move only up or right is $\binom{2a - b}{a}$. Now suppose that probability of "up"-movement is $p$, then the probability of "right"-movement is $1 - p$. Hence, because any such path consists of $a - b$ "up"-movements and $a$ "right"-movements, the probability for such final scores is $$p_{(a, a - b)} = \binom{2a - b}{a} (1-p)^{a} p^{a - b} .$$ Similarly, the probability for final scores $(a - b, a)$ is $$p_{(a - b, a)} = \binom{2a - b}{a - b} (1-p)^{a - b} p^{a} .$$
Hence, the final probability:
$$ p' = p_{(a, a - b)} + p_{(a - b, a)} = \binom{2a - b}{a} (1-p)^{a} p^{a - b} + \binom{2a - b}{a - b} (1-p)^{a - b} p^{a} .$$
Is my approach correct? I've tried to simulate the game in Python and got different result ($\approx 0.06$ by the simulation vs. $\approx 0.105$ by the formula for $a = 11, b = 3, p = 0.3$).
Answer: It seems that your calculation includes the possibility, for example, that one player wins $a$ times and then the other player wins $a-b$ times, since this would be among the counted paths from $(0,0)$ to $(a,a-b)$, right?
Edit: To fix the calculation, I think you should consider all paths from $(0,0)$ to $(a-1, a-b)$, and then multiply by $p$ (and similarly $(a-b, a-1)$, and $1-p$).
Comment: Good catch.  Do you see how to fix the calculation?

Probability of a result of a game.


UIImage, releasing the decompression cache?

Question: I have an array of UIImages that contains some .jpg images downloaded from the net when the app starts. I also have a table view that shows some of these images in its cells. The problem is that when I scroll the table, the app's memory consumption always increases up to the point where the app crashes due to low memory conditions. The table cells seem to be reused fine, so my theory is the following.
Since the UIImageView in a table cell only retains one of the elements in the image array, when the cell gets reused, and a new image is assigned to it, the previously used image is of course not destructed (the cell releases it, but the array still retains). However, the decompression cache used to hold the raw image data (computed the first time the UIImage is displayed by a view) belongs to the UIImage itself, so it also remains. But I'm just guessing about all this.
Can this really be the problem? If so, how can I work around it? My first idea was to create a copy of the UIImage whenever it is assigned to a cell, but looks like UIImages can't be deep copied. Is there any way to tell a UIImage to keep the compressed jpg data in memory but throw away the decompression cache? (In the worst case I guess I can still download all the images and store them in local files, then load them from there and completely release the UIImages when not displayed anymore, but this doesn't seem to be an elegant solution.)
--
I can't post the original code (as suggested in comments) as it is fairly complicated with custom table cells and custom views and even a background thread downloading the images, but I've just created a small test app and it seems to show the same behavior. Here's a little function that is called when the user taps a UIButton:
<code>- (IBAction)onNext:(UIButton*)sender
{
    static NSMutableArray* images = nil;
    if (!images)
    {
        NSArray* names = [NSArray arrayWithObjects:
            @"IMG_2957.JPG",
            @"IMG_2962.JPG",
            @"IMG_2965.JPG",
            @"IMG_2970.JPG",
            @"IMG_2971.JPG",
            @"IMG_2978.JPG",
            nil];
        images = [NSMutableArray new];
        for (int i = 0; i < names.count; ++i)
            [images addObject:[UIImage imageNamed:[names objectAtIndex:i]]];
        int i = 42;
    }
    static int current = 0;

    imageView.image = [images objectAtIndex:current];
    ++current;
}
</code>
Yes, I know that the images array is leaking, that's not the point (in the original code I also want to retain the images for the entire lifetime of the app, and only release on quitting). But. According to Memory Monitor, after the first tap (all images get loaded, and the first one is displayed), the app consumes ~5MB (all jpgs loaded, one of them decompressed). After all subsequent taps, the memory consumption increases by ~2MBs (yep, I tested with 1024x768 images). So it looks like decompressed data of the previously displayed images is still there. I know this wouldn't be a problem if I released the image once it isn't visible anymore, and that would also release the decompressed buffer, but if possible, I'd like to retain all the images, and only release the decompressed data. Is that possible?
Answer: If you're reusing cells, make sure those cells implement:
<code>-(void)prepareForReuse
{
      // releasing the image
      self.imageView = nil; // Or release depending on you memory strategy
      self.labelView = nil; // get them all
}
</code>
Answer: I don't think UIImage has no memory leaks that fatal. I have been working on few applications which has to deallocate UIImage a lot due to memory constraint, but it's still working fine. I believe your image leaks somewhere. Show us some code so someone will point that out for you.
Comment: Technically, it's not a leak; if I released the UIImages, I'm sure the decompressed buffers would be released fine. However, I'd like to retain the images, I would just like to release the decompressed data.

I've edited the question to show some code.
Comment: I don't think you can do that. I also don't think UIImage will keep compressed data internally. If you really want to cache the data, I would suggest using NSData to do so.


Adding foundation to webpack

Question: I have followed the official tutorial to set up react, typescript and webpack from here: https://www.typescriptlang.org/docs/handbook/react-&-webpack.html
Until this point it runs, fine.
Now I want to use the foundation CSS framework.
So I ran npm install --save foundation
Then I modified my TSX file to look like:
import * as React from "react";
import * as ReactDOM from "react-dom";

import * as React from "react";
import * as ReactDOM from "react-dom";

ReactDOM.render(
    Default Button,
    document.getElementById("example")
);

Finally, I ran webpack.
However, when I open the generated index.html, the "button" is not there, just a link, which means the style was not applied.
In my /dist folder, I don't see anything related to css...
It seems that I'm missing something. Is there additional configuration that I have to do with webpack?
Answer: At first, foundation is installed as
npm install --save foundation-sites
then you need to include foundation in your root css file like
@import 'foundation';

and finally you need to alias it inside webpack config. For example when you are using sass loader
module: {,
  sassLoader: {
    includePaths: [
      path.resolve(__dirname, "./node_modules/foundation-sites/scss")
    ]
  }

Adding foundation to webpack


Will Allah forgive me for wishing someone's marriage break?

Question: I asked this question already. I am again disturbing you guys and i am sorry for that. But i just can't get peace in my mind. So i am telling my problem again.I was only 11-12 years old back than. There was an actor i liked. But he was married. He got married in January 7, 2013. I asked for his divorce. I used to make dua for it. I made the dua for about a month, like till 30th January 2013. But after some time i stopped doing that. They eventually got divorced in 2017. I somehow found myself guilty. I stopped making such dua way before their divorce. Will Allah punish me for that? Will my marriage to my husband break as well? Please reply..
Answer: "Tell them(O Prophet)," My servants who have committed excesses against themselves (committed sins) do not lose hope in Allah's mercy. Surely Allah forgives all sins(with repentance). He is the most forgiving most merciful."(39:53)
Don't worry, Allah will forgive you, if you repent, everyone does mistakes but the best of them is the one who repents. You are sorry for this, so Allah will not punish you, he is very merciful.


What do the dimensions of a convolutional layer represent?

Question: My understanding is that the width and the height represents a kernel (convolution matrix) that is convolved over the image. The depth is the number of these kernels. If that is the case, how would adjacent convolutional layers be connected, for Eg. If the first layer has a depth of 32, and the second has a depth of 64?
Answer: starting from the input image, assume it has depth of 3 (RGB), if the first Conv layer has depth of 32, it means we have 32 recepetive fields (or filters) of n*n*3, where n is the size of the filter. and the same for the next layer.
Example: suppose the input layer has dimensions 100*100*32, If the filter size is 5x5, then each neuron in the Conv layer will have weights to a [5x5x32] region in the input volume, for a total of 5*5*32 = 800 weights (and +1 bias parameter) and we have 64 of these filters (the depth of the second conv layer is 64). Notice that the extent of the connectivity along the depth axis must be 32, since this is the depth of the input volume.


Set parental controls on an Admin account

Question: So this is a strange question, but I'm starting to get really organized and stuff, and I want to make sure my computer shuts off at 10:00 (I'm in high school). The problem is, being the only admin on my computer, I would be able to get around it. Is there any way I can have my parents choose a password to enter, without me knowing it, and make it so I can't bypass it?
Comment: FYI, your edited question should probably be an entirely new question.
Answer: No - the admin user is the way that the system detects which accounts can modify a parental restriction either once or permanently.
You'll need to not use or (have) an admin account or come up with some other social contact like setting up a recurring alarm that you voluntarily obey when the time comes to cease computing.
Scheduling an automatic shut down would also work to give you some notice that it's time to be done and the system would take action unless you over ride the power down.
Just head to the energy saver preference pane and establish a schedule for the system to shut itself on and off would be my recommendation for a user with admin privileges yet wanting a reminder to keep certain hours.


jQuery and pseudo-elements

Question: I tried to dynamically change the position of an element which is defined in CSS with :after.
Using this:
$(function(){
    $('div::after').css({'top':'20px'})
})

But it doesn't work. Are there any ways to change the position?
Answer: You can't. Content created by :after or :before is not part of the DOM and therefore cannot be selected or modified.
If you have a look at this example fiddle and inspect the DOM in Firebug or similar you will see that the pseudo-element is not present in the DOM tree.
A potential solution would be to apply a class to the element you want to change, and to style that class appropriately in CSS:
$("div").addClass("newClass");

See this fiddle for an example.
Answer: add CSS:
p.special:before {
    content: "bar";
    position: absolute;
    top : 10px;
}

assuming the style sheet where the code above was put is the first one on the page, use this to change it:
document.styleSheets[0].addRule('p.special:before','top: 15px;');

jQuery and pseudo-elements


Sump Pump runs several times a day every day rain or shine

Question: I am looking to buy a house that has a French Drain and a sump pump installed.  The basement is dry but the sump pump is constantly pushing what I assume is ground water out.  This occurs several times an hour every day rain or shine.  Is there another solution that will prevent this constant flow of water.
Comment: do you have any information about the system? Maybe pictures would also be helpful. As a side note, my parents had a house surrounded by lots of topsoil, but built on top of a ledge of shale under the topsoil. There was a natural underground spring behind their house. You could set your watch to their sump pump, almost every 40 minutes it'd run for about 90 seconds.
Comment: Depends on the terrain. If there is a slope, to an area lower than the sump pit, you can dig  trench out to daylight and stop pumping, If not, you're stuck with it. Note that a trench typically costs a good deal more than a sump pump; but it sure is cheap to operate, and runs during power outages.
Answer: There should be a check valve on the out take pipe after the pump. This prevents water from backing up into the pump and starting the cycle all over again.
Comment: If the discharge isn't into a storm drain, or to somewhere to remove the water, he could be recirculating the same water... or he's simply in an area with odd drainage and a high water table.


Doubt on net acceleration during non-uniform circular motion

Question: During non-uniform circular motion, the direction of net acceleration is not in the direction of the centripetal acceleration, then why does a particle still move in a circular path, please explain.
Answer: Let's look at a position vector in general polar coordinates
$$\vec r(t)=r(t)\pmatrix{\cos\theta(t)\\\sin\theta(t)}$$
Now define
\begin{align}
\hat r&=\pmatrix{\cos\theta\\\sin\theta}\\
\hat \theta&=\pmatrix{-\sin\theta\\\cos\theta}
\end{align}
to make our lives easier. I dropped the time dependence but remember it's still there. You can check that
\begin{align}\dot{\hat r}&=\hat\theta \dot\theta\\\dot{\hat \theta}&=-\hat r \dot\theta\end{align}
where a dot indicates a time derivative. A general acceleration then becomes
\begin{align}\ddot{\vec r}(t)=&\hat r(\ddot r-r\dot\theta^2)+\\&\hat\theta(r\ddot\theta+2\dot r\dot \theta).\end{align}
Again this is a nice exercise to proof. For circular motion the radius is constant so $\dot r=0$. What's left of the general acceleration is
\begin{align}\ddot{\vec r}(t)=&\hat r(-r\dot\theta^2)+\\&\hat\theta(r\ddot\theta).\end{align}
The $-r\dot\theta^2$ term is the usual centripetal acceleration which points towards the center. You might recognise it if you plug in $\dot\theta=\frac v r$.
The $r\ddot\theta$ term is new. It points along the path of the particle and together with the $-r\dot\theta^2$ term it makes sures the radius stays constant. Note that if $\dot\theta$=constant this term drops out and we have regular old uniform circular motion.

EDIT I'll provide a slightly easier to read explanation.
In circular motion the velocity of a particle is always at 90 degrees with its radius. Like in this picture

When the speed says the same we have uniform circular motion. In that case the acceleration point directly at the center. We can decompose the acceleration into two components: one that points towards the center called 'centripetal acceleration' or $a_c$ and one that points along the velocity of the particle called 'tangential acceleration' or $a_t$.
In uniform circular motion we have $a_t=0$ since the acceleration is only towards the center. Also the centipetal acceleration is given by $a_c=\frac{v^2}r$.
If we accelerate in the tangential direction the speed of the particle increases. In that case the centripetal acceleration must increase to compensate, because $a_c=\frac{v^2}r$ and $r$ is constant. It's easier to see if you write it as $r=\frac{v^2}{a_c}$. If we make the speed twice as large then $a_c$ must get 4 times as big.
So long story short, it is possible to accelerate in the tangential direction but to do that you must increase the centripetal acceleration in a precise way to keep the same radius. Similarly we must decrease $a_c$ if we decelerate in the tangential direction.
Comment: This getting a bit complicated for me to understand sir....
Comment: Ah sorry it's hard to know sometimes at what level you should explain things. I added an extra section that's a little easier to read.
Answer: Think of a car going round a circular track. At an instant when it has speed $v$ it has an acceleration of magnitude $\frac{v^2}{r}$ towards the centre of the circle. The car is gaining velocity towards the circle centre. But suppose that, at this instant, the driver is making the car go faster. The car will also be gaining velocity in a direction tangential to the circle. That doesn't interfere with its gaining of velocity towards the circle centre.
Looking at it in terms of forces, the road is exerting a frictional force on the powered wheels of the car that has both a forward component, giving the car its increase in speed, and a sideways component towards the circle centre, allowing the car to go at speed $v$ in a circle of radius $r$.
Comment: As the speed  increases, the component of the friction force toward he center of the curve must also increase.
Comment: That's right, it will increase. My answer referred to a particular instant; I wasn't trying to give an account of what happened over time.
Answer:
During non uniform circular motion,the direction of net acceleration
is not in the direction of the centripetal acceleration, then why does
a particle still move in a circular path,please explain..

Assuming by "non uniform circular motion" you mean a change in speed of the particle moving in a circle, then it is because the centripetal acceleration depends only on the magnitude of the tangential velocity (the speed of the particle), not on the rate of change of speed of the particle, or change in tangential velocity (tangential acceleration).  The following explanation is offered:
For circular motion there are two types of possible acceleration: centripetal and tangential.
Centripetal acceleration, $a_c$, is the acceleration towards the center of the circular path. It is always present and it is what keeps the particle in circular motion. It is due to a centripetal force. In the case of a car, the centripetal force is the static friction force between the tires and the road and directed towards the center of the circular path. The centripetal acceleration depends on the magnitude of the tangential velocity $v_t$ (the speed of the car or its angular velocity, ω, in rad/s) and the radius $r$ of the circular motion according to,
$$a_{c}=\frac{v^{2}_t}{r}=rω^2$$
The tangential acceleration $a_t$ results from the change in the magnitude of the tangential velocity. An object can move in a circle and not have any tangential acceleration simply because the angular acceleration $α$ (rad/sec$^2$) is zero because the object is moving with a constant angular velocity ω ($\Delta ω =0$). In the case of a car in circular motion this is the acceleration due to braking or increasing the speed of the car due to the static friction force between the tires and the road in the tangential direction.
$$a_{t}=rα=\frac{\Delta ω}{\Delta t}$$
Hope this helps.


Don't see status icons in windows explorer

Question: i installed svn on my win7 machine but i don't see those colorfull icons in windows explorer showing things like file is already added in svn, file has changed etc etc. Any ideas?
Comment: Possible duplicate: http://stackoverflow.com/questions/1057734/tortoisesvn-icons-not-showing-up-under-windows-7
Answer: I had this same problem, appearing on only one of my working copies (I have many projects on my machine, and the rest were displaying icons normally).
I opened task manager, and ended the process TSVNCache.exe. Within a minute, it started up again, and when it did, I was able to refresh my view in Windows Explorer, and the tortoise svn icons appeared on the project.
Answer: Select or configure the relevant options or choices for the type of presentation of folders and file names to you like list or thumb or large icon and then select the options for displaying indicators of different types of condition or state of the files. Depends on the options available in differing version of svn.
Answer: You could try to rebuild your icon cache (kill explorer.exe, delete IconCache.db from %APPDATA%\Local and restart explorer.exe). But depending on the flavor of SVN you installed, you may not even have the shell extension stuff that provides them. TortoiseSVN should give you icons (sometimes only after a reboot after install), but some command-line-only distributions won't.
Answer: Did you install Subversion, or TortoiseSVN? TortioseSVN is a Subversion client that is independent of the command line Subversion client. In fact, you don't even need the Subversion command line client installed to use TortoiseSVN (although I highly recommend everyone does so).
TortoiseSVN is a plugin to Windows Explorer and since it is attached to Windows Explorer, it can manipulate the icons in Windows Explorer to add a Subversion status mask to the icons.
By default, TortoiseSVN does not munge icons to anything but local drives since adding icons to network drives can slow it down, You can change that in the Tortoise configuration, though.


View iPhone back up in iTunes

Question: I have backed up my iPhone to iTunes (via wifi) to my Mac.  How do I go back and view contacts, etc. on my mac?
Comment: Backups are at ~/Library/Application Support/MobileSync/Backup/ but I'm not sure how human-readable they are, even if you don't have encryption enabled in iTunes [which you ought to have, for security as well as to backup your passwords & account data too]
Answer: If you are just backing up your phone via wifi to your Mac there isn't a native tool to view the contacts.  (There are some third party tools, but I don't think that is what you need).  If you are syncing your iPhone to your Mac then they should show up in the contacts app.
More likely is that your contacts are being synced to whatever account you are using (gmail, yahoo, iCloud, etc...) and you just need to configure that account on your Mac and then you will see the contacts that way.
Answer: If your task is to view contacts on an iTunes backup of your iOS device when the original contacts have been lost you can either restore the backup to a different  iOS device, or use apps like iExplorer to export the data you need.
[Disclaimer: I'm a satisfied, paying customer who uses iExplorer every day. I have no financial stake in Macroplant.]

View iPhone back up in iTunes


.NET form that preserves text fields across sessions?

Question: Its a simple config app with 4 checkboxes and 5 textboxes, and all values must persist across sessions.
do I have to serialize the fields and restore them by hand?  I really have no idea the best way to approach this.
Answer: You could use the User settings, reading the values on load and saving on exit.
You can find info about the settings and how to retrieve and save it on runtime here.
Answer: If you are talking an ideal solution, you should think about using MVC (which win forms does NOT encourage), so that all the data you care about comes in an encapsulated, non-UI bound object (ie, the model).  The UI form populates itself from the data and the app can retrieve the data when the form is torn down.  If the data object implements ISerializable, then you're pretty much done.
If you're talking expedient and are absolutely sure that it will never need to grow or change (which never happens - I only do this in one-off apps), then I would scrape the form contents and write them to an appropriate place (user settings, data files, etc).
If you're talking about building something that makes this as easy as possible with never, ever, having to worry about it ever, ever, ever again, I would see about using data binding, or creating a mapping objects that understand how to map data from objects onto UI elements and out again (for example, you could subclass the main form elements to include a name field or use the initial text field to figure out a key to look up in a serializable hashtable or a property name in an serializable object).


What is the difference between the SPDR GLD listed on multiple exchanges?

Question: It looks like SPDR GLD (a gold-backed ETF) can be purchased on 5 different exchanges: US, Mexico, Singapore, Japan, Hong Kong. What is the difference between these? Are they just 5 different ETFs that all track gold, or are they related in some way? Why is there a need for more than one, when many (most?) investing platforms these days allow investors access to multiple markets?
Comment: Welcome new user.  **In this case** it is literally the SAME thing, but traded in different places.  Confusingly, in other cases, a product will be "different, but identical" products for different markets (I guess ultimately because of tax/regulation reasons). Again in this case, as far as I know, there's only the one GLD.
Answer: None. Shares can be traded on multiple exchanges in multiple countries. There is need for more than one - heck, why are there multiple supermarkets in one city? Or even in different cities. Not every broker works in every country, exchanges are in constant competition. There is no NEED for having more than one exchange on the whole planet to start with - if you look at the definition of need. They still are there.


fitting a door handle

Question: I want to fir new handles to internal doors. My wife (boss) wants door handles with back plate. The problem is there is a 5cm hole in the doors where door knobs have been put in, and I cant get a backplate which is bigger than 4.8cm. whats the best thing for me to do?
Answer: You may have to order them but there are all types of handle sets with bigger back plates. Some manufacturers like Baldwin, or Omni and a few others allow "a la carte" choices, where you can specify each component of the latch sets.

fitting a door handle


Trying To Identify The System That Coordinates Belong To

Question: I have architectural drawings of a bus terminal in Rochester, NY done in 1974 that lists the coordinates of the corners of each building. But I don't recognize the system of these coordinates. For example, instead of the usual "North" and "West," the first number is identified as "South," the second as "East." A full example is 49,876.06 South, 41,834.17 East. I need to convert these to lat/longs (degrees, mins, seconds) to relate to coordinates reported by the on-board GPS system of buses moving about the terminal. I thought these might be State Plane Coordinates, but I've found those have a different format. Can anyone identify the system these coordinates belong to?
Comment: if values were feet, or meters, where would the 0,0 be?
Comment: Good question.  A survey monument perhaps?   Is there a formula for locating it using that South/East number pair?
Comment: where's the bus terminal?
Comment: 1372 East Main St, Rochester, New York.  The center of the facility is at 43.1621, -77.5731.
Comment: Lazy idea: Could you skip the identification-part and go on to "I'll simply digitize the corners anew myself" or "oh look, OSM is coming around the corner and hands me the desired values"?
Answer: From the information you have, you can set up a custom local CRS like this:
<code>+proj=sterea +lat_0=43.1621 +lon_0=-77.5731 +x_0=41834.17 +y_0=-49876.06 +datum=NAD27 +units=m +no_defs
</code>
lat0 and lon_0 are the degree coordinates of your reference point, and x_0 and y_0 the projected ones (south coordinates negative). I assume they are in meters, and based on the NAD27 ellipsoid.
With that, you can create a vector grid like this:

The origin is somewhere in Lake Ontario, but placed to get only positive East and South values for data inside the county.
Answer: Most likely New York State Plane, a lot of time they originate from the state capital thus you are getting your East and South designations
Comment: I don't think so in this case, but i could be wrong. I used an online map tool provided by New York and selected State Plane Coordinates and hovered over the facility, and it displayed a pair of coordinates in the format "E: 1410975, N: 1157705."
Comment: Did you have the opportunity to change the units in the State Plane Viewer (i.e. Survey foot to international feet)? Might change your result


Queries vs. Filters

Question: I can't see any description of when I should use a query or a filter or some combination of the two. What is the difference between them? Can anyone please explain?
Comment: Official documentation is not very clear in fact
Comment: Worth noting that [queries and filters will be merged](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/_query_dsl_changes.html) in ES 2.0, hence most of what's been said and written for queries vs filters will not apply anymore. Also check the [official blog post](https://www.elastic.co/blog/better-query-execution-coming-elasticsearch-2-0) announcing this change.
Comment: Looks like there are appeared a page with more advanced explanation: https://www.elastic.co/guide/en/elasticsearch/guide/master/_queries_and_filters.html
Answer: The difference is simple: filters are cached and don't influence the score, therefore faster than queries. Have a look here too. Let's say a query is usually something that the users type and pretty much unpredictable, while filters help users narrowing down the search results , for example using facets.
Comment: Right so, if the user is doing a google type search then I would use a query?  If they are selecting possible value from a drop down (eg, invoice count > 50) then this would be a filter?
Comment: Yep, that's exactly right.  Any time you need to restrict the entire set of documents by some metric, that's usually a case that a filter is appropriate.  So maybe by age, length, size, etc etc
Comment: @activescott Yep, that's what I would do. You can also set up filtered aliases so that "user aliases" always apply the appropriate filter. Makes administration easier and doesn't require code changes to update queries, extra cruft in your query, etc.
Comment: My solution uses filters and queries in the same request and it is super fast on the test database.  We will soon get the live data in there to see how fast it really is.
Comment: @Zach To be absolutely clear, in a multi-tenant system -with permissions for users within a tenant-, it sounds like the tenant/authentication information would be a filter added to every query (i.e. a Filtered Query). Right?
Comment: We use 'function_score' where you can set a query or a filter.We only set a filter. In the functions part you can also define filters which influence the score of youre results.
Answer: This is what official documentation says:

As a general rule, filters should be used instead of queries:

for binary yes/no searches
for queries on exact values

As a general rule, queries should be used instead of filters:

for full text search
where the result depends on a relevance score
Comment: when I want to delete document, should I use a filter if possible ? I don't want it to be cached
Comment: when deleting a doc, you do not require any score, nor do you need to do a full text search. So this would be a filter than, as you just need to make a delete/not delete decision. [filter-query-context](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/query-filter-context.html)
Answer: An example (try it yourself)
Say index myindex contains three documents:
curl -XPOST localhost:9200/myindex/mytype  -d '{ "msg": "Hello world!" }'
curl -XPOST localhost:9200/myindex/mytype  -d '{ "msg": "Hello world! I am Sam." }'
curl -XPOST localhost:9200/myindex/mytype  -d '{ "msg": "Hi Stack Overflow!" }'

Query: How well a document matches the query

Query hello sam (using keyword must)
curl localhost:9200/myindex/_search?pretty  -d '
{
  "query": { "bool": { "must": { "match": { "msg": "hello sam" }}}}
}'

Document "Hello world! I am Sam." is assigned a higher score than "Hello world!", because the former matches both words in the query. Documents are scored.
"hits" : [
   ...
     "_score" : 0.74487394,
     "_source" : {
       "name" : "Hello world! I am Sam."
     }
   ...
     "_score" : 0.22108285,
     "_source" : {
       "name" : "Hello world!"
     }
   ...

Filter: Whether a document matches the query

Filter hello sam (using keyword filter)
curl localhost:9200/myindex/_search?pretty  -d '
{
  "query": { "bool": { "filter": { "match": { "msg": "hello sam" }}}}
}'

Documents that contain either hello or sam are returned. Documents are NOT scored.
"hits" : [
   ...
     "_score" : 0.0,
     "_source" : {
       "name" : "Hello world!"
     }
   ...
     "_score" : 0.0,
     "_source" : {
       "name" : "Hello world! I am Sam."
     }
   ...

Unless you need full text search or scoring, filters  are preferred because frequently used filters will be cached automatically by Elasticsearch, to speed up performance. See Elasticsearch: Query and filter context.
Answer: Filters -> Does this document match?  a binary yes or no answer
Queries -> Does this document match?  How well does it match? uses scoring
Answer: Few more addition to the same.
A filter is applied first and then the query is processed over its results. To store the binary true/false match per document , something called a bitSet Array is used.
This BitSet array is in memory and this would be used from second time the filter is queried. This way , using bitset array data-structure , we are able to utilize the cached result.
One more point to note here , the filter cache is created only when the request is executed hence only from the second hit , we actually get the advantage of caching.
But then you can use warmer API , to outgrow this. When you register a query with filter against a warmer API , it will make sure that this is executed against a new segment whenever it comes live. Hence we will get consistent speed from the first execution itself.
Comment: Interesting! I didn't realise filters happen before queries. The caching of filters makes more sense now.
Comment: Not always. The basic and primary difference between filtered and constant score query. Constant score always execute query first and then applies filter over it. Even filtered query have settings by which query can execute before filters.
Answer: Basically, a query is used when you want to perform a search on your documents with scoring.
And filters are used to narrow down the set of results obtained by using query. Filters are boolean.
For example say you have an index of restaurants something like zomato.
Now you want to search for restaurants that serve 'pizza', which is basically your search keyword.
So you will use query to find all the documents containing "pizza" and some results will obtained.
Say now you want list of restaurant that serves pizza and has rating of atleast 4.0.
So what you will have to do is use the keyword "pizza" in your query and apply the filter for rating as 4.0.
What happens is that filters are usually applied on the results obtained by querying your index.
Comment: Cant you provide an example of a request body?
Answer: Since version 2 of Elasticsearch, filters and queries have been merged and any query clause can be used as either a filter or a query (depending on the context). As with version 1, filters are cached and should be used if scoring does not matter.
Source: https://logz.io/blog/elasticsearch-queries/
Answer: Queries : calculate score; thus they're able to return results sorted by relevance.
Filters : don't calculate score, making them faster and easier to cache.

Queries vs. Filters


Updating email addresses in MySQL (regexp?)

Question: Is there a way to update every email address in MySQL with regexp? What I want to do is to change firstname.lastname@example.com addresses to firstname.lastname@example.com. Is it possible to do with SQL or should I do it with PHP for example?
Thanks!
Answer: You can search for a REGEXP with MySQL, but, unfortunately, it cannot return the matched part.
It's possible to do it with SQL as follows:
UPDATE  mytable
SET     email = REPLACE(email, '@domain.xx', '@domain.yy')
WHERE   email REGEXP '@domain.xx$'

You can omit the WHERE clause, but it could lead to unexpected results (like @example.xxx.com will be replaced with @example.yyx.com), so it's better to leave it.
Answer: UPDATE tableName
SET email = CONCAT(SUBSTRING(email, 1, locate('@',email)), 'domain.yy')
WHERE email REGEXP '@domain.xx$';

Answer: I would rather do it with PHP, if possible. Mysql unfortunately does not allow capturing matching parts in regular expressions. Or even better: you can combine the two like this, for example:
$emails = fetchAllDistinctEmailsIntoAnArray();
# Make the array int-indexed:
$emails = array_values($emails);
# convert the mails
$replacedEmails = preg_replace('/xx$/', 'yy', $emails);
# create a new query
$cases = array();
foreach ($emails as $key => $email) {
    # Don't forget to use mysql_escape_string or similar!
    $cases[] = "WHEN '" . escapeValue($email) .
               "' THEN '" . escappeValue(replacedEmails[$key]) . "'";
}
issueQuery(
    "UPDATE `YourTable`
    SET `emailColumn` =
        CASE `emailColumn`" .
            implode(',', $cases) .
        " END CASE");

Note that this solution will take quite some time and you may run out of memory or hit execution limits if you have many entries in your database. You might want to look into ignore_user_abort() and ini_set() for changing the memory limit for this script.
Disclaimer: Script not tested! Do not use without understanding/testing the code (might mess up your db).
Answer: Didn't check it, since don't have mysql installed, but seems it could help you
update table_name
set table_name.email = substr(table_name.email, 0, position("@" in table_name.email) + 1)
                       + "new_domain";

PS. Regexp won't help you for update, since it only can help you to locate specific entrance of substring in string ot check whenever string is matches the pattern. Here you can find reference to relevant functions.


Easily build a different branch of the same C# project (VS2010/TFS)

Question: I'd prefer to solve this using a Team Build/build definition, but I'm open to other solutions.
Currently, I have a build definition that builds my main branch. If I want to build other branches, what's the easiest way? Do I have to clone and modify the build definition for each branch, or is there an easier and more elegant way?
(Specifically, the build definition builds MSI files, and I'd love to just one-click to build MSI files for any previous release branch.)
<code>MyCollection
|
|-- MyProject
     |
     |-- MainBranch
     |    |
     |    |-- MySolution.sln
     |
     |-- EarlierReleasesFolder
          |
          |-- ReleaseBranch-2012-01
          |    |
          |    |-- MySolution.sln
          |
          |-- ReleaseBranch-2012-02
          |    |
          |    |-- MySolution.sln
          |
          |-- ReleaseBranch-2012-03
          |    |
          |    |-- MySolution.sln
          |
          |-- ReleaseBranch-2012-04
          |    |
          |    |-- MySolution.sln
</code>
Answer: Using just the default templates that ship with TFS2010, there's no way to change the target solution being built. You have to define the source path of the solution(s) to build as part of your build definition.
Of course, TFS Build is just a WF workflow and fully customizable; if you are so inclined you could clone the default workflow, add a "branch path" parameter, and add a custom task to change the BuildInfo object before going into the MSBuild part of the workflow.
Answer: Currently, I'm thinking:

Code against the TFS API to automatically create build
definitions for each release branch; or:
Manually create the build definitions (using Power Tools to be able to clone build definitions)
Answer: TFS Power Tools adds a Clone Build Definition menu item. It makes it easy to copy a build def, modify the source control mappings and solutions to build list and you are ready to build.
Since you mentioned building MSI's... I need to understand if you just want to start doing dev off these old releases or if this is a build reproductibility excercise where the goal is to reproduce the MSI exactly?   If the answer is the later, you need use static PackageCodes instead of * for random.
Comment: I want to easily build MSI files of the current and old releases for QAs to test different versions of the product.
Comment: Why do you need to rebuild the old releases? Why not just keep them around?


Is it safe to stop a fsck in progress?

Question: I have a server that I rebooted without using the f option in my shutdown command, and it started doing a fsck of a very large filesystem... which will take a very long time, as you can imagine. Is it safe to reboot while this is in progress to get around it?
Answer: Depends on the filesystem and the actual checking. E.g. it is usually not a good idea to interrupt a reiserfsck --rebuild-tree but nothing can happen when interrupting a read-only fsck of an ext3 filesystem.
Comment: Is there any way to tell exactly what it's doing during boot? `Alt-F` keys don't give me other consoles...
Comment: What exactly do you see? If you see this blue bubble thingy, try hitting ESC.
Comment: I just see a CLI progress bar... it's a text bootup of a CentOS 5.2 installation. In any case, it's finished now -- thank you for your input.
Answer: The filesystem check on boot is usually read-only until it finds a problem then it will prompt you before making any changes so it is probably safe to intereupt.
But is is quite possible (and not uncommon for servers that need to come back up after a power-out) for it to be set to auto-fix, so unless you know for sure that your system is not configured this way let it run to completion for safety.
Most fsck programs are written in such a way that any changes that make are as atomic as possible and they will clean-up (completing or rolling back any current change) before responding to a TERM or INT signal (SIGINT is what is sent to the active process when ctrl+c is pressed) so even an actively writing fsck should be safe to interrupt, but I woudl not recommend taking the risk - better safe than sorry!
Answer: I wouldn't stop it. Yeah, there probably isn't a problem with an auto fsck triggered byt it being the 37th or what ever mount with out needing one, but probably a good thing to do.
Get a journaled or better file system. Get btrfs (and back up :-D ) .

Is it safe to stop a fsck in progress?


BERT in production

Question: I've created a BERT model. What are the ways to do the deployment of this model? Is it possible to use it with Spark, Hadoop or Docker?
Comment: Define production here? what are you doing with it, what are your requirements? input, output form?
Comment: @SeanOwen I have a BERT model that takes CSV files as input (text) and it outputs text with some predictions (restored punctuation in this text).  The model works pretty fast on GPU, but I run it as a python (PyTorch) script. For example, if I have 100 GPU how can I parallelize computation? I cannot use Spark with it because Spark doesn't include PyTorch. Is Docker my option here? So, here, production means parallelization of computations and running it in real-time.
Answer: You can just apply it with Spark. There is no reason you can't use Pytorch in a Spark job; just add it as a dependency when you submit the job. Spark's pandas UDFs can be pretty useful for scoring large models as they let you score in mini batches. See https://spark.apache.org/docs/3.0.0-preview/sql-pyspark-pandas-with-arrow.html#scalar-iterator
One complication is that you can use GPUs in Spark 2.x, but can't allocate GPUs as resources. So you may have multiple tasks on one GPU, and need to tune a little bit to reduce contention. Spark 3 however will have GPU resource allocation.
Hadoop isn't a thing that runs computations, unless you mean MapReduce, which is obsolete, or if you mean Spark, which is above.
Docker is also an option; just bottle up your scoring code and run on a cluster. You don't really get the same help with data movement and access that you would in Spark; it's all up to you. But sure that can work.

BERT in production


Determine when object moving along Bezier Curve and an object along a line collide

Question: I have been using the method here to find the intersection between a line and a curve but, I am not too sure how I would go about solving the time for when two objects moving along their respective tracks would collide. Both objects have a constant speed and radius.
Answer: Three useful facts we can use here:

We can use De Casteljau's algorithm to split a Bézier curve into two smaller Bézier curves of the same degree. This tends to gradually straighten the child curves, as they cover less and less of the bends in the original curve.

A Bézier is that the path is always fully contained in the convex hull of its control points. For the cubic case, that's a quadrilateral, or just two triangles.

A disc somewhere inside that quadrilateral can only collide with the disc moving on a straight line only if the quadrilateral itself overlaps a capsule shape.
The capsule's radius is equal to the sum of the two discs' radii, and its start/end points are the disc's position on the straight line path at the start and end of the time interval it takes to traverse the curve segment that quad contains.
(You could check this by doing two point-in-quad checks and a circle cast if both come up negative - two circle casts if you want both entry and exit times to narrow your search window)

We can use this to quickly narrow down the range of possible collisions.
First, we check this capsule against the quad containing the entire curve. If there's no overlap, we know for sure that we miss.
Then we sub-divide the curve. There are probably principled ways to do this, but they run into edge cases, so for a simple first pass I'd suggest dividing into 3-10 even time segments between the earliest and latest overlap times.
Repeat the overlap test with each segment, using a smaller capsule - accounting for the fact that the disc on the straight line trajectory crosses only a part of its path during each of these time segments.
You can eliminate any segment that does not overlap, then further subdivide those that do. You can binary search for the intersection, pruning any quads that have no overlap, and recursively subdividing those that do. Your recursion bottoms-out when the time interval is small enough or the quad is flat enough to approximate as a straight line segment: then you can switch to a conventional swept disc collision test to get a closed-form solution for the time and location of the collision.