Fiction stories like Harry Potter

Question: Is taking Harry Potter quizzes online or watching the movies just for fun haram or shirk in any way?
Comment: Why would it be ?
Answer: Alsalam alikum brother / sister. I will not give you a direct ruling because i hav'nt watched these movies to be honest but i will give you a genreall ruling that you can apply.
If there is anything haram in the movie then watching it is haram like affectionte scenes and all that stuff and it is better to optain from watching them.
And rember brother this world is nothing but a test so if you do good now you will live later with whatever you desier inshallah.
May allah guide me and you.
And Allah knows best.

Fiction stories like Harry Potter


Create a function to be called at an exact time each time an event has been created to a specific date in the calendar with ionic, php and my sql

Question: I have created a mobile application with ionic that is used to create sporting events among several participating users. When creating an event, the participating users are added and a date must be scheduled for the sporting event. These events are stored in the mysql database with their respective dates.
When it is the day of the event, I must send a notification to all the users who participate in said event.
I already have the functions to create the notifications, I also have a function to list the events, their respective hours and send the notifications to the participants. The only thing I need is to know how I can make this function be called at an exact time each time an event has been created.
What do you suggest to me to do this?
My backend is made with php. The databases are with mysql and firebase. I think that cronjobs do not work since they do not execute a specific date.
Thank you very much for your help.
Answer: I found the solution with cronjobs executing them through the database and doing a function that covers the difference in minutes. It works perfectly. Thank you very much


How do I draw a Lewis diagram after drawing the orbital diagram

Question: The question says "Oxygen can form compounds with every period 3 element except argon. Determine which would be ionic or covalent compounds, and draw Lewis diagrams to represent each one." I started with oxygen and fluorine and I'm having a hard time. I don't know if there should be lone pairs, double bonds, or even lone electrons.Here's my attempt at it:
Comment: Your Lewis structure for $\ce{OF2}$ is almost correct, but as it stands right now, it is missing one lone pair on oxygen. A Google image search for "oxygen difluoride" should show you the correct answer.
Answer: First of all, oxygen follows "the octet rule", which states that certain elements are stable when they have 8 electrons around them. Now this rule is by no means absolute, does not work with d orbitals onward, and should only be used in very elementary chemistry, unless you actually know its cause. In the case of that picture, you are missing 2 non-bonding electrons on the oxygen.
Remember that a covalent bond means that electrons are being shared by the 2 atoms. In the case of O and F, the pauling electronegativities are quite similar, so the electrons are actually "shared".
However, when you try to put oxygen together with group 1 or group 2 elements, you will find very different electronegativity values. What this means is that oxygen has much more affinity to electrons than Na or Mg. The rule I was taught at school was that a difference of 2 or more in electronegativity between the elements results in ionic compounds, meaning the oxygen "steals" the electrons, becoming a negative anion, whereas Na for example becomes a positive one.
The last guideline you should take into account, is that an atom tends to lose or gain electrons because it "likes" to have its most outer shell full. So when you look at the principal quantum number ($n$) of the most outer shell, you should create compounds where it is full. In the case of oxygen, that quantum number is $2$, which can have 8 electrons, hence the octet rule. For Na, you have 1 electron in $n=3$, so if the atom looses that electron, it will become more stable, therefore we have $\ce{Na+}$.


What is the effect of water molecules in an oscillating electric field?

Question: Say, we have an alternating current source of max voltage V, and frequency v= 1 GHz connected to 2 plates as in a capacitor with an air gap of distance d, thus we get an oscillating electric field E, inside the capacitor plates, Emax = Vmax/d;, if atomised water is sprayed in between the capacitor plates the water molecules being permanent electric dipole experiences a force and torque in an non uniform oscillating electric field and thereby loses its energy in the form of heat to the surroundings. is this true?
Answer: I think you are rediscovering the microwave oven. Microwave ovens operate by rotating water molecules similar to your layout. However, we are talking about water molecules and you must rely on quantum mechanics (i.e. think photons and rotations are quanties).
Answer: Correct. The microwave oven works in a similar manner. Although the explanation is bit more precise when put in this way -
Since water molecules are polar in nature, they have a dipole moment; and they align themselves with the electric (electromagnetic, to be precise) field. If the field is oscillating, the molecules start rotating also. As the field reverses, the molecules also change direction. These molecules collide with each other, distributing energy throughout. This energy appears in the form of heat.
This is known as dipole rotation, and is used to raise the temperature of an object. This is the principle behind dielectric heating, which is used in microwave ovens.
Comment: yeeah correct. if that is the case, how much is the amount of heat dissipated due to collision and what is the amount of heat dissipated
Comment: When an electric dipole rotates in an oscillating electric field does it dissipate its potential energy in the form of heat or is that the heat that is dissipated is due to the collisions between molecules??
Comment: Look into Dielectric Loss -  https://en.wikipedia.org/wiki/Dielectric_loss


Formatting the Clan Description in Clan Info

Question: I have seen some clans formatting their clan info in point form, and I would like to do the same for my clan.

Does anyone have any idea how is that done?
Thanks! :)
Comment: On a side note: does that last line say no under 18 kids ?
Comment: Another thing is that you can write something on you're main computer, send it to your phone using email or google docs etc., then if you're phone's keyboard supports it copy and paste to Clash of Clans.
Answer: As far as I'm aware it's only possible by using 3rd party keyboard apps. Such as SwiftKey for Android and iOS devices.
Whilst editing the text within your clan description you can popup the emoji page (Which is essentially a page of emiticons). This will allow you to add images such as the "tick" and "no entry" symbol. In SwiftKey in the emoji page there is also an "Enter" key which will add a carriage return and start a new row.
To open the emoji page you just hold down the submit button.
Others may be able to suggest other 3rd party apps which offer similar functionality.
Comment: Apple also has its own built-in keyboard for emojis. It can be accessed by adding a keyboard with a new language in settings
Comment: SwiftKey for Android works perfectly, just what I needed. The "Enter" key was probably what was needed to format it into 'point form'. Great recommendation, DMK!
Comment: I am not able to find the "Enter" key to add the carriage return, can you please point out which emoji is that?


Returning to university

Question: I graduated from an undergraduate maths course from a prestigious university. However, I was rejected from attending it's master's program due to poor showing in the final exams. I'd like to study at said university again sometime within the next few years, applying for the same course. In applying though, I will almost definitely have to use the same final exam results. What can I do to show that I have improved, if I indeed have? I am not currently enrolled in any graduate level program.
Comment: Did you actually improve?
Comment: In the next 2 years. :)
Comment: Oh, is your question about what to do in the next two years in order to show the admission committee that you've improved, such that you can join the master program in two years?
Comment: Yes. I've looked at the admissions process and it was mentioned that there will be no interviews. So I'm guessing that there might not be an entrance exam. I've asked about it, but they have yet to reply. I plan to do some self-studying the next two years in preparation for graduate level maths.
Comment: In that case, you might want to edit your question to emphasize more that fact.
Answer: At many schools, particularly those rated highly, the most important parts of your PhD application are your letters of recommendation.  What many applicants don't grasp is that a PhD program is so different from undergrad that past performance in the latter is only a poor indicator of future performance in the former.  For most students, the hard part of a PhD is doing original research.  So, as an applicant, you must convince the committee that you will excel at doing research.
One way to make your case is to have already successfully done research (or some "research-like" project).  In the absence of this, you must somehow convince your letter writers that you will succeed in research (and then they convince the admissions committee).  Meet with your letter writers and ask them what they suggest.  You might even ask them if you could work on some research with them (prior to being admitted to the PhD program).
Answer: Have you considered directly contacting the admissions committee or a former teacher and asking for advice? They'll probably be wary of saying anything that sounds like "if you do x,y, and z, you'll be accepted", but even if they're unwilling to share specific advice they might be willing to tell you what other experience (beyond the exams) they consider during the admissions process. A bonus of contacting the admissions committee in a respectful and professional manner is that if you do indeed follow through on any recommendations they give you, you can mention this in you application as evidence of your commitment to improving.
You might also ask if you can retake the test--either officially (i.e. if they'll replace your old results with your new ones) or unofficially (i.e. your old results will still be the official ones, but at least you have some metric showing your improvement).
Another option is to talk with a professor in the department with whom you have rapport and ask them about how to frame your rejection in your application when you reapply. For example, is it considered good form in your field to discuss what led you to do poorly on the exams (whether this was some unrelated life experience, or a lack of preparation)?

Returning to university


"Cannot find name 'ServiceWorkerRegistration'" error when creating a firebase cloud function using Typescript

Question: I'm receiving the following error (photo below) when I deploy my cloud function with the module firebase installed.
I've tried installing @types/firebase and firebase and receive the same error.  I'm pretty sure this error has something to do with this module because when both firebase and @types/firebase are uninstalled, the function deploys properly.
Also, the cloud functions are not calling this module yet so I don't think the error is in the function.  I've provided the code for my package.json file and ts.config file.  Any idea why I'm getting this error and how I can import modules without getting this error?  Let me know if there's another file worth reviewing.  Thank you.
./package.json
{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "lint": "./node_modules/.bin/tslint -p tslint.json",
    "serve": "firebase serve --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log",
    "build": "./node_modules/.bin/tsc"
  },
  "dependencies": {
    "dom": "0.0.3",
    "expo-server-sdk": "^2.4.0",
    "firebase-admin": "~5.12.1",
    "firebase-functions": "^1.0.3",
    "typescript": "^2.9.2"
  },
  "devDependencies": {
    "eslint": "^4.12.0",
    "eslint-plugin-promise": "^3.6.0",
    "ts-loader": "^4.4.2"
  },
  "main": "lib/index.js",
  "private": true
}

./tsconfig.json
{
  "compilerOptions": {
    "lib": ["es6"],
    "module": "commonjs",
    "noImplicitReturns": true,
    "outDir": "lib",
    "sourceMap": true,
    "target": "es6",
    "allowJs": true,
  },
  "compileOnSave": true,
  "include": [
    "src"
  ]
}

Comment: You probably don't want to be using `firebase` inside a Cloud Function, but rather [firebase-admin](https://firebase.google.com/docs/admin/setup)
Answer: If like me you actually need to use the client firebase module inside a cloud function, the problem, along with a work-around, is described in #880:

A workaround is to add "dom" to the "lib" compiler option in your tsconfig.json
Our packages assume that DOM types exist. The problem is that importing firebase/app imports typings of all packages.
Some of our packages (like Messaging) only work in the browser. These packages (or their types) should not be imported in a Node environment.

Edit: here is a safer answer that was posted in the issue thread

The suggested/promoted workaround here of adding "dom" to compilerOptions.lib is NOT safe. That would be telling the compiler that any and all dom type references are valid in my code, which is clearly not the case since Node.js is not a browser environment. If this library is meant to be used as a Node.js TypeScript library, then it should not depend on ambient dom-specific type definitions. A safer workaround for TypeScript 3.0 users is to import firebase as follows:

/// <reference lib="dom" />
import * as firebase from 'firebase';

That first line is a "triple-slash lib directive" (https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html) first available in TypeScript 3.0. It's like adding dom to compilerOptions.lib but only for that one file. Note that the triple-slash directive must appear before any statements or it gets interpreted as just a normal comment.
Comment: In my case, I could fix the issue by not importing anything from `"firebase/app"` (e.g. I changed `import { firestore } from 'firebase/app';` to `import { firestore } from 'firebase-admin';`)
Comment: This answer is very close, but a better solution (and reasoning) is this comment further down on #880

https://github.com/firebase/firebase-js-sdk/issues/880#issuecomment-483423711
Comment: The safer answer is actually not safe because the included definition is not scoped to only that included file. See https://github.com/firebase/firebase-js-sdk/issues/880#issuecomment-577523198.
Answer: I've run into this problem several times in the past. You can try adding the following to your tsconfig.json:
tsconfig.json:
  "files": [
    "node_modules/typescript/lib/lib.es6.d.ts"
  ],
  "exclude": [
    "node_modules"
  ]

So your complete tsconfig.json should look as follows:
{
  "compilerOptions": {
    "lib": ["es6"],
    "module": "commonjs",
    "noImplicitReturns": true,
    "outDir": "lib",
    "sourceMap": true,
    "target": "es6"
  },
  "compileOnSave": true,
  "include": [
    "src"
  ],
  "files": [
    "node_modules/typescript/lib/lib.es6.d.ts"
  ],
  "exclude": [
    "node_modules"
  ]
}

Comment: thank you this fixed it, but can you tell me why please??
Answer: Michael's comment is correct so flagging this as answered.  I was using firebase, but should have been using firebase-admin.
Comment: I don't agree with this. The "firebase" package is the only way you can send password reset emails from Cloud functions for example.
Comment: I'm upvoting this. In my case, I have a project with `firebase` installed on a root package, and `firebase-admin` installed on the /functions package. In one of my files, I was importing `firebase` to get a certain type, which is incorrect because `firebase` uses DOM libs. I should have been importing from `firebase-admin` instead.
Comment: this is not a correct answer for this question. With firebase-admin SDK you can't send the default reset password you can just get the url link and then you need to send it on your own.


How to load test a workflow system with stages linked by email

Question: I want to load test a web site that provides a workflow system. In this system, users register and then create a record. An administrator sees the new record in their task list on a web page; they modify the record in the system and an email is sent to the user with a link to a web page for the updated record. The user clicks the link and adds information to the record and the administrator's task list is updated. The workflow continue with administrator updates sending emails to the user and user updates being seen on the administrator's task list. This workflow is strictly sequential, records move from stage to stage with emails and task list updates providing links between the stages.
How can I handle the emails linking the stages of the workflow? I would like to access the links within these emails to get the correct page but I do not know how to read emails within a web test. There are also a concerns about the time that emails take to pass through the various email systems and the order they would arrive; but I am sure that these concerns can be handled.
The only test method option I have found is to load lots of records into the system's database before the test runs. This data would have records at each stage in the workflow. The test cases would be data driven with the URLs for handing each record.
Are there any other methods?
My test system uses Visual Studio Web Performance and Load tests.
Answer: I can see a few directions you could take with this situation:

Break it up: You could build load tests for each phase - that is, you have one test that registers a user, has an administrator open the task list, modify the record, and send the email. The next test opens the link (since you know the format of the email and the link this is doable), adds information, has the administrator check the task list and modify information, and so on, so that each group of steps between emails has a load test.

You'd want to run these in sequence first, in order to isolate load issues through the registration process without any other interaction masking potential problems.
You want to do this on a test server that mirrors the expected environment as closely as possible. Partly this is to reduce outside interference, and partly so you can use a known starting point.
Your starting point should be a database with a selection of records. You shouldn't need to actually send the emails and trawl them for links to click unless the link is generated on the fly with a random or quasi-random seed that isn't stored anywhere (this is unlikely, since that information is usually stored in the database for verification purposes).
You would want to restore your test database into the application database before beginning your tests. This ensures that every run of your load tests has the same starting point.

Run it together: You could use the test database to have a variety of records for each stage, and have your load test run actions from each part of the workflow. This is closer to the real-world usage scenario, and should probably be part of your strategy as well. Building a load test like this will make it more difficult to isolate specific load issues, but will give you a more accurate idea of your application's capacity, particularly if you can load to failure (this isn't always possible - I've seen load tests bring down the company intranet without stressing the application under load, and there are hard limits to some types of request queuing that could act as a throttle on your application).
Step by step: You could have a load test for each individual step, which you can then run in sequence or concurrently. That is, one test for registering users. One for the admin task list. One for user response. And so on. This approach would let you do a mix and match approach.
Build the links yourself: You could take an end-to-end approach by building the email links yourself from the data that should have gone into the application database after the administrator completes the edit, then going directly to that URL.

This isn't a complete list, just a few thoughts on directions you could take.
Answer: I have used something like Mailtrap.io to perform similar tests.  I can send a request to create a user, then in a validation rule or post request event handler check the email service api to get the email link so the next step can then confirm the new user, etc.  The problem I am having is that the free version of Mailtrap only allows 2 emails per second and if you have an email heavy workflow you don't get much of a load before you hit that.


Spacetime inside the horizon of a black hole

Question: According to Susskind a bit of information crossing the event horizon of a black hole instantaneously encounters the singularity.  Also, time appears to gradually slow down for an object approaching the horizon.  Is this tantamount to saying that the curvature of spacetime approaches and becomes vertical exactly at the horizon?   Or could you say that the curvature just becomes close enough to vertical at the horizon to trap light/information?
If the latter is true then there is finite spacetime inside the horizon.  This spacetime could not be observed by an observer outside the black hole.  Again, referencing Susskind, black hole complementarity suggests that an observer passing into the horizon would not experience anything and that the observer would hit the singularity.  Yes, but not instantaneously that would be paradoxical to experiencing nothing.  The question then is when will the observer hit the singularity.  And furthermore, could the space time inside the horizon be very large to the internal observer when you consider a variable transformation for the ratio of the speed of the clocks for the internal and external observers?
Answer: The general understanding is that inside a black hole space and and time change their places, see for example explanation here: https://www.einstein-online.info/en/spotlight/changing_places/ . If I understand it right, one should correctly speak about distance and not time for reaching the singularity. Another interesting and unconventional explanation I have heard is that if you crossed (without noticing) by car the event horizon on your Monday, then no matter where you go, how you drive, cross and across, back and forth, it comes Friday and you cease to exist in the singularity. It came me in mind that it is the best description of live, too. You are born without noticing, do a lot of things, driving, too, and on some day you cease to exist. Nice, isn't it?
A more enlightening explanation I have heard from Gerard t'Hooft is:
... .
"An exact solution helps: consider a black hole formed by matter that goes in by the speed of light. Doesn't change the physics very much but makes it easy to understand. If all particles (basically without rest mass) would enter in a spherically symmetric mode then you can write the solution exactly. One finds that the horizon already opens up at a space-time point at the center (but no singularity there or anywhere else). As soon as the matter passed the horizon the outside world is in the Schwarzschild metric. Now you have to understand that in the inside region, surrounded by the horizon, space and time interchange roles. What you thought is space (such as the r coordinate) is actually time and what you thought to be time (the t coordinate) is actually space. The singularity is at r=0 but that is actually in the future. Not only that, it is, in a sense, the infinite future because outside observers will never see anything that has passed the horizon. For the outside observer, that never happens.
For a black hole formed by matter, there is no past singularity. For quantum mechanics however, everything has to be reformulated. Singularities disappear or become physically immaterial.
There are many more such things that people fail to understand, while it isn't difficult.
G. 't Hooft"
I hope, I could help.
Answer: An observer from outside the black hole watching someone travel towards the black hole will begin to see them slow down to an almost complete stop, and then they will slowly see them fading away since the photons that were being bounced off of the person falling into the black hole going towards the observer, cannot escape the immense pull of the gravitational field. Also, I don't think it would be accurate to say that the curvature becomes 'vertical' since depending on your model of the black hole, the geometry pass the horizon is definable. So your second response to your own question would be true, ''information passing the horizon cannot leave [unless via black hole evaporation which is a whole other issue].''
For example, the Schwarzschild metric omits a horizon from $f(r) = (1-2GM/r)\rightarrow r = 2GM$. But, you can get around this horizon and have smooth geometry past the horizon by switching to Kruskal-Szekeres coordinates. However, the physical singularity still remains, which is where curvature blows up ($Riem(g)\rightarrow \infty$).
With regards to switch space and temporal coordinates, yes this happens past the singularity if you assume continuity past the singularity. This is best represented by Penrose diagrams.
And finally, for the question of, ''when will the observer hit the singularity?'' For that, the person falling into the black hole will not instantaneously hit the singularity, but in a finite amount of time, they will eventually reach the singularity.
Hope that covers most of your question!
Answer: The question of when a bit of information reaches the singularity may not be the right question.  How long it takes to get a bit of information out via Hawking radiation may be more to the point.  Susskind says it takes about 10^66 years.  So, the black hole does not function simply as a source of information for timeframes on the order of the age of the universe. Logically you would expect that massive black holes in the center of galaxies have heretofore acted as entropy sinks as one explanation why the observable universe seems to favor low entropy permutations.
When two black holes collide, they merge to form a new single black hole.  Assume the information for the newly formed black hole has information distributed across its event horizon in plank size elements and characterized as captured strings.  One could speculate then than when a black hole forms from a collapsing star that its horizon merges with our universe's surface and increases the information at the source of the holographic projection.  This leads to an "it's turtles all the way down" scenario but it preserves the second law in less than almost infinite time.  There is also a symmetry here where our observable universe gains information and the black hole gains entropy.  For an observer inside the black hole, I guess the opposite would be true.


How long do Apache processes stay alive?

Question: When apache forks a process for mod-php, how long does it stay alive?  Does the process die as soon as the response is sent, or will it stay alive until the browser receives the full response?
Answer: If you're using mod-php, then you're likely using the prefork MPM, that spawns child processes to handle requests. The number and lifetime of these children as governed by directives in your main apache2.conf (or httpd.conf, depending on your distro) file.
Look for the part that looks like this (your values may vary):
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

Apache spawns StartServers children automatically. These processes will idle until a request comes in. If children become busy, it will spawn up to MaxClients children to handle the load, trying to maintain MinSpareServers idle children to pick up new requests. Once things calm down, idle children will be killed off until the count is down to MaxSpareServers.
The bit you're asking about is handled by MaxRequestsPerChild. Set at 0, this means that children can live forever, which is the default value in most apache installations. Set at anything else, it means each child process will be forcibly killed and restarted, regardless of current load, once it has handled that number of requests.
More details on the prefork MPM here: http://httpd.apache.org/docs/2.2/mod/prefork.html
Comment: Thanks, that gives me a better understanding of Apache.  My specific question is: when the response is sent back to the client, what does the child process do?  Does it sit idle waiting on the client to acknowledge or can it immediately handle a new request?
Comment: Once a response is sent and the client acknowledges it, the TCP connection stays open for a further (I think) 15 seconds, by default. During that time the child will be first to receive any further HTTP requests from the same client.  If none are received then the TCP connection is closed and the child is dealt with according to the above rules. Typically it stays alive and goes back in to the idle pool. This behaviour can be modified by both the client and server. (It may, for instance, be preferable to close the connection immediately)
Comment: Also, if you haven't used it already, http://www.wireshark.org is a great tool for analysing traffic between client and server. It'll give you huge insight into what's happening under the hood.
Comment: MaxClients was renamed to MaxRequestWorkers during apache 2.3.
Answer: httpd doesn't fork a process for mod_php. It forks a process for itself, which has mod_php embedded in it. The child will stay alive until it has fulfilled MaxRequestsPerChild requests. mod_php itself will keep handling each request for a PHP script until either the script exits or the time limit is exceeded.


What are some good resources on medieval German culture and mythology?

Question: I'm writing a book about the Pied Piper, and I was wondering if anyone has any good recommendations for books, websites, etc., about German culture in the 1200s - all aspects of German culture: religion, politics, clothing, food, music - and also German mythology, specifically that focusing on mythical creatures (and preferably not the Grimms' Fairy Tales, as I have my own collection of those). Any help is appreciated!
Comment: Hi, welcome to worldbuilding! I believe (someone can correct me if I'm wrong) that things like book recommendations are off topic here - it's impossible to tell which answer (which recommendation) is better, so is (for one) opinion based, which we don't really like (sorry). If you have a specific question about medieval German culture, the [History stack exchange](http://history.stackexchange.com) would be a good place to ask. Otherwise, if you have a specific question about building a world, we'd be very happy to help here. Also @AngelPray, recommendation questions are off-topic on literature
Comment: [LINK](https://en.wikipedia.org/wiki/Struwwelpeter) 1845 -- children's morality tales -- scary but typical. Not mythology, but a good book.
Comment: Upon further looking into this, book recommendations aren't actually off-topic, but in this case, I believe it would probably be helpful if the question were more specific - see [here](http://meta.worldbuilding.stackexchange.com/q/2542/19951) and [here](http://meta.worldbuilding.stackexchange.com/q/2545/19951) for more detailed discussions about what makes a good recommendation question. Sorry if I'm causing any confusion and good luck on your search!
Comment: I can see the need to look for good material. When I wrote the book for my musical, we basically used research to create a world on the stage. That's no different from asking what items would be needed if we were to settle on Mars. Instead of looking for/recommending books, you'd be looking at scientific research, peer review papers, and TV documentaries. I think the questioner is asking as I did way back because the world I created on stage had to be my own, but it also needed to be somewhat true to the story. You can take this story, change a few things, and create a great SiFi world.
Answer: Back in 1977 I wrote a musical about the Pied Piper of Hamlin. It was produced in 1978 at a children's festival in New Jersey and made it to off-off-Broadway in 1979.
I wish I had the Internet back then, but the story dates back to 1384 if I recall from a Wikipedia link that lists all the books, at least the important ones that advanced and even changed the story over time.
You can find the list of books at List of literary accounts of the Pied Piper
And I found some interesting versions of it on websites. Just do a search.
Note: I would have rather put this in as a comment, but I lack 7 reputation points. Sorry moderators if this answer does not meet requirements.


How to take out the toilet water inlet faucet knob

Question: The water inlet got stuck with no incoming water. Suspected it's fully blocked by sand and mud. It's with slow water ingress before but still works. The knob is without screw at the top. Could anyone advise how to take out the knob in order to take out the ceramic cartridge, I think it is, apart for cleaning?
Comment: It seems to me that you should turn off the supply water and install a complete new valve. In my area (obviously not the same as *your* area) these valves are not often repaired, just replaced.
Comment: @JimmyFix-it Thanks your reply. As this type of faucet is out of the market and I don't want to replace the whole kit. Prefer to replace it and finally I did.
Answer: Finally, I fixed it. I used a big flat screw driver to pry the knob off. One step for a quarter turn. The knob is loosened in about two full turns. Then, use a spanner to remove the nickel painted copper cap that holds the faucet filter cartridge. Once removed the cartridge with a pliers, the dirt and mud is draining out. The cartridge is full of mud. I cleaned up before putting it back to the shelf to remove the faucet.


Open user login in lightbox

Question: How to create a link, which will open user login in lightbox, I have installed lightbox2 module in Drupal 7.
Answer: Or try using Ajax Login/Register, a complete solution. Here is a quote about it (from the module's project page):

... provides a smooth way for the user to login, register and request new password via AJAX at any Drupal site.
Features:

This module provides a block with 2 links (Login, Register) for the anonymous user.
When the user clicks on Login or register the requested form appears in a nice ajax popup.
The login and register forms can validate using ajax and not redirect on error.
On success the module redirects to the user page.
When user is logged in, the block provides a Welcome !username message and a link to the user page and a logout link.
This module integrates the thickbox plugin with the Ajax module and provides a simple, easy to use and cool login and register block.
Comment: This works perfectly! Surprisingly very few sites use it
Answer: You can add rel="lightmodal" to any anchor and it will be opened in a lightbox.
Also I'm almost sure lightbox2 have this option (login lightbox) out of the box, check the settings form.
Answer: Try using: http://drupal.org/project/colorbox I believe it allows for this functionality out of the box. This post explains how to make a login link open in the colorbox; http://drupal.org/node/883210
Answer: Indeed, the AJAX Login/Register module adds a block with a login button. Clicking on that button opens a popup login/register dialog.
However, I think the question was how to make any link open the login dialog (e.g. I have blog posts, and clicking on the post title should also open the dialog.
This code does the trick however unlike the regular block dialog, it takes 5 seconds until the popup loads. Anyone knows why?

Open user login in lightbox


Why does my transistor saturate when I touch the base?

Question: I have a simple setup with a BC547 C NPN transistor with nothing connected to the base as shown:

I'm using a USB cable plugged into the wall.
Why is it that when I touch the wire connected to the base, the LED brightly lights up?
Comment: Is the base of the transistor floating?
Comment: @MituRaj yes it is
Answer: Assuming you're touching nothing else (like, say, the 5V?):
You're a big antenna / capacitive load on power lines / coupling into whatever. It's hard to tell what really is the source of current here.
Together with the base emitter junction, which does act like a diode in this mode of operation, you seem to be  injecting enough current into the transistor to make it operate in saturated region.
That's in fact a bit surprising to me; the BC547C is a relatively low-\$\beta\$ transistor and it takes a bit of current to make the output current large, but here we are. If I had to take a wild guess: your USB supply is not the greatest, it has a lot of ripple at low load, and that's easily coupling into you.
It's harmless to you, but obviously changes the operation of your circuit.
That's exactly why, whenever you have a circuit that has high gain (like your single-transistor amplifier), you need to keep  its input well-protected against such interference: keeping the traces on a PCB short, don't use flying cables, don't use breadboard, always put a low-pass filter before the input to get rid of anything high frequency, maybe shield the box, use differential signaling and make sure any noise coupled in is common mode…
Comment: Thanks for the answer. I think you're right about the unusually high transistor gain, I may have a faulty batch of transistors. I doubt the power supply is an issue though, since i tested it with multiple power supplies, maybe it has something to do with the USB cable being 10ft long?
Comment: "high gain" is the opposite of a fault. Quite the contrary, most datasheet specify a *minimum* gain, but no maximum. That's no problem, because usually you never use them for anything but either pinch-off/saturation operation (i.e. "on/off"), or with feedback, where it only matters that the gain is *high enough* and more gain only makes things better.
Answer: I expect the main cause of the symptom is that you run it from a 5V charger plugged into the wall. Try the same thing again, but this time with a power bank, I guess the LED will not light up that bright as it does with the wall charger.
The reason is common mode noise emitted by the charger. "Common mode noise" means that while the "+5V" and "GND" keep having a potential difference of 5V all the time, the voltage between GND and actual earth potential can be oscillating quite strongly. As long as you do not connect anything earth referenced to your circuit, the common mode noise does not affect the operation of your circuit. But if you touch the base of the transistor, you provide a path from "actual earth" to the transistor. Your path to earth is partly leakage current, and partly capacitive coupling to earth.
The GND output of the supply oscillates between being above earth potential and being below earth potential. If you touch the transistor base, the LED lights up only during the time GND is below earth potential. As the switching frequency of these supplies is around 100kHz, you will not see any flickering of the LED, though.
Answer: Let us run a bit of math, with assumption we need 0.1 milliamp (100 microAmps) into the base of that transistor.
And we'll assume within the wall are 117VAC (160 volt peak) power cables.
We will assume the USB cable runs 1cm away from  power cables, for 10 meters.
We will use I = C * dV/dT in our final math.
First compute (estimate) the capacitance etween the USB and the power (HOT) wire.
Using the parallel plate capacitance formula (in a dense grouping of wires, not 2 wires alone, but a rats_nest of wires, parallel_plate is a fine first estimate)
C = Eo * Er * Area/Distance, which for AIR dielectric becomes approximately
C = 9e-12 farad/meter * (1mm (size of copper cores) * 10 meters)/1cm
C = 9e-12 * 1e-3 * 10 / 1e-2 == 9e-12 * (1e-3 * 1e+1 * 1w+2) = 9e-12 * ONE
And we round up to 10 picoFarads.
Can we get  0.1 milliAmps thru that capacitance?
I = C * dVdT = 10pF * 160 volts * 377 radians/second
I = 1e-11 * ~~60,000 == 60e-(11*3) = 60e-8 amps = 0.6e-6
I for a pure sinusoid (no spikes from fluorescent lights, motor spikes_

I = 0.6uA and we wanted 100 uA.

Thus our assumption ---- we need 100uA --- is only satisfied at 1% of the goal.
But there can be other Trash coupled, from other electrical activity in the cable.
And the distance can be << 1 cemtimeter. And the edge_rate will be much faster than 60,000 volts/second (more like 1 volt in 10 nanoseconds, which 1,600X faster).
Importantly, because of collector_base leakages, the base will be  self_biased within 0.1 or 0.2 volts of strong turnon. Thus even low voltages will turn on the transistor, even more.


Does the TCP protocol exist as a process?

Question: Recently, I read "Computer Networks: A Top-Down Approach". I know that applications consist of TCP + a port number. But I keep thinking that if TCP is not a process, it can't handle any task, but if it is a process, it should have a port number so that the computer knows how to find it. But the book doesn't say whether TCP itself has a port number or not.
So, can anyone tell me if TCP has a port number?
Comment: Often, a transport protocol is implemented as a handler, a library or similar. Since its API is more a framework it doesn't need to run as a process of its own. Instead, it's called by applications and by the network stack (ie. the network layer protocol). However. host configurations or implementations are explicitly off-topic here, see the [help/on-topic].
Answer: TCP is one of many transport protocols, and it is a process in the OS.

if it is a process, it should have a port number so that the computer
knows how to find it.

You are confused about what port numbers are. Port numbers are addresses for some transport protocols. Port numbers for transport protocols that use port numbers are exclusive to the transport protocol. For example, both TCP and UDP use port numbers, but TCP port 12345 is not UDP port 12345. Not all transport protocols use port numbers.
IP has no idea about transport protocols or port numbers. IP headers have a Protocol field for IPv4 and a Next Header field for IPv6 that tells IP to which process it should send the packet payload (TCP, UDP, ICMP, SCTP, etc.). This is similar to data-link protocols having something like the ethernet EtherType field that tells the data-link protocol to which process it should send the frame payload (IPv4, IPX, ARP, IPv6, AppleTalk, etc.).
For transport protocols that use port numbers, the port number is a similar function: a port number tells the transport protocol to which process it should send the transport protocol payload.
Answer: It depends what you mean by "process".
In Linux, for example, a "process" is a specific kind of thing, and TCP is not one. Same for Windows.
But if we are speaking in generic terms, a "process" means something like "a unit of running code with well-defined boundaries and interfaces". In which case, TCP is a process. Linux's "process" is something that might be generically called an "application process".
Because Linux processes and Windows processes come with a lot of overhead it's normal to group many independent processes into the same process, to reduce context-switching overhead. But this is an implementation detail for that specific OS. There are research operating systems - but nothing in widespread use - where processes are very lightweight and each TCP connection, each file, each directory, etc, is considered as its own process.
Answer: TCP (and UDP, see the answer from Ron Maupin) specifies an abstraction, called socket. Socket is identified by a 5-tuple: < sender IP, sender port, receiver IP, receiver port, and transport protocol (number)>. Each incoming packet that has transport layer header in it can be attributed to a socket, based on these values.
For each socket, TCP specification specifies maintained variables and state. Thus each packet (for TCP it is called segment), attributed to a socket can be processed according to the current state.
Further, each socket is attributed to some entity (e.g., application) that processes the data in the TCP stream.
Now, Process is a completely different concept in the area of operating systems/applications.  Network protocols do not specify this, as these are implementation details of each OS/application.
Normally, TCP processing is handled in OS kernel, which offers socket abstraction to applications. That is, each socket is attributed to the 5-tuple on one end and the application that opened this socket on the other end.
This was networking part of things, I don't know the OS part.


Displaying multiple values with Telerik ASP.Net MVC extensions with the ForeignKey column

Question: From what I've read, it doesn't seem possible to associate a ForeignKey column as a multi-select listbox. Is this true?
If it's not true, I am famiiar with using the ForeginKey column and would like to know how to accomplish this with a code snippet, if possible.
If it's true that it's not supported (I have the latest extensions of the tools), how would I go about to implement this? If Telerik doesn't have a work around, what I'd like to to is below.
The next best thing would be to display the users in multiple rows (each distinct value selected for the specified group), I guess. How would I implement this scenario using the ForeignKey or otherwise? Meaning, there can be many users for many groups. A picture is worth a thousand words. Please see below what I'd like to implement.
fyi, I have the value and text info for both columns, but the Groups column is not a listbox; it's a textbox and has the text value displayed. The Users ListBox would have the value selected for each user (assume that the users listbox contains a list of 10 users).
Grid abc
Groups column (contains text value)    Users column (this is a ForeignKey ListBox)
-----------------------------------    -----------------------------------------------------------
grp1                                                        user1
grp1                                                        user2
grp1                                                        user3
grp2                                                        user2
grp2                                                        user3

Answer: Personally I suggest you to create hierarchy of Grid to edit such relation.
e.g.
grp1
   user1
   user2
   user3
grp2
   user2
   user3

Implementation about hierarchy with editing can be found here.
Option 2 -> Since the Extensions does not have a multi select it would not be so easy to add such editor template. Anyway if you implement the multi-select somehow by hand you can use add it as editor as shown here.
Regarding ForeignKey - it is not an option.


Is it a good practice to create a database for each year?

Question:
In a HR database i need to do statistics for each year, is it a good practice to create a database for each year?

Thank you.
Comment: My guess is no. It would be difficult if you want to do statistics including several years. Simply add a "year" column can do the job well.
Comment: Usually this job is done using [TABLE PARTITIONING](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-partition-function-transact-sql).
Answer: It really depends how your HR/, Payroll application presenting it to the users. I can imagine that can be done in completely ergonomic way, so basically it would be only integration problem for some kind of external analytics. And it probably may have advantage, past year databases may be put on read only mode, and that current year databases would be smaller than big, aggregate database..
But saying this, I would like to say, I've never seen any good system for such kind of database model.
Some random thoughts:

It is troublesome in every day use, as it is quite common some operations have to change databases records even in the past, at least for short time during years change
It is very hard to use such systems in external analytics, based on normal tools: instead writing queries on database with time periods as filters, you have to manage several database connections and aggregate statistical data outside, probably using temporary tables or even additional data warehouse
Some reports may be required, for time periods which not agree with years change. For example for accounting purposes.
Exporting duch data into other systems, for example when changing HR platform to other products, is nightmare in such scenario.
Upgrade. Usually is performed on present database. Will you upgrade historical ones as well? If yes - what I advantage of having it separately? If not - you will end with several incompatible database schemas.
Maintenance. It may be a lot of effort put to maintain several databases instead of only one. It is known issue.


What is difference between PhD and Postdoc?

Question: I am a PhD student in Mathematics. I wanted to know what exactly is the difference between PhD and Postdoc. Is it just the research that one does after PhD(kind of second PhD?)?
Answer: I want to address this question by citing my current Master's advisor when I asked him the same question:

In the Bachelor's, you learn the basics of the area.
In the Master's, you learn what people are doing in the field and how to read scientific papers.
As a PhD, you learn how to develop your own research and start having new ideas on the field.
As a Post-Doc, you learn how to mentor other people's research while producing your own work without supervision.
When you reach Professorship you only have to look smart!
Comment: No, when you reach _full_ professorship you only have to look smart.  There's still "assistant professor" and "associate professor" to get through.
Comment: True, this was a very simplistic point of view but useful one I think...
Answer: In mathematics, a "postdoc" is a special kind of faculty job you get just after your Ph.D.  It may have a fixed term (not tenure track).  It may have reduced teaching, so that you can concentrate on your research.  You may have a "mentor" assigned to advise you on doing research.
But (unlike some other fields like experimental physics) you are probably not working in someone else's "lab" on someone else's research program that someone else got the funding for.
Answer: I have always understood a postdoc to be a "post doctoral" position, that is a paid post. The idea of a postdoc position is to do research roughly in the area of the PhD, with the person gaining experience that would possibly be of help in gaining a full time position.
Comment: Around here, PhD students also earn wages (unless they support themselves with a grant).
Answer: A postdoc is expected to know what they are doing, and to be productive researchers with minimal supervision. PhD students are learning how to be researchers: by the end of the process, they should be on par with a postdoc, but it will take time to get there
Edit: This comment has been copied from Barbara Robson's answer here.
Answer: The first and foremost difference between the two is that a PhD is "awarded" after defending a thesis (plus additional duties depending on the department). On the other hand, a PostDoc is a temporary working position that is assigned by some institution, whose completion does not require any defence.
What people do or do not do, researchwise, in their PhD and PostDocs is very much dependent on the area and on the department (you may look at other answers that go more in details on this and that I do not want to overwrite, as I would just copy and paste them).
Comment: Yes, please copypaste or give the link.
Answer: This is akin to asking what's the difference between research master's and PhD, or Assistant to associate professor.
A postdoc, is the next level after PhD (though not a necessary one). This is the main point.
Practically, it is different, in that it is less formal, with less specific requirements, and you are paid for it, as you are employed, not a student, as other answers here explained well.


Alternative repository for QGIS 2.0 plugins?

Question: Is there any alternative to the official repository for plugins of QGIS 2.0?
I found a source which refers to OpenGeo Explorer
For more info:
http://qgis.boundlessgeo.com/static/docs/intro.html
Answer: For what reason do you need another repository?
In theory anyone can set up a private repo for QGIS, which can then be added via the settings in the plugin-downloader.

You can find a lot of alternative on this wikipage, but many of the other repos and plugins are old/deprecated and not maintained anymore or even integrated into the main QGIS hub.
Comment: To my knowledge: No, there is no existing alternative plugin repo with working QGIS 2.0 plugins.
Comment: You said " In theory anyone can set up a private repo for QGIS". Exactly for that reason I asked if there is another repository. As an example I will bring Ubuntu which has many different repositories.
Answer: The ability to install from other repositories was more important a few versions ago. Since version 1.7 (or so?) the community has made an effort to have all plugins installed through the official repositories. I don't know of any independent repositories anymore, and there was a major change in QGIS 2.0 requiring all plugins to be adapted to the new PyQGIS API, so if you do come across any independent repositories, they are almost definitely outdated. Most plugin developers are submitting their plugins for inclusion in the official repository. Since the official repository can include "experimental" plugins (i.e., what might also be called "testing" or "unstable"), the barrier to entry is pretty low, and there is little reason why someone would choose to set up an independent repository anymore.
Note that if you happen to come across a plugin not in a repository (e.g. on GitHub), you can "install" the plugin by just copying the code to a subfolder of  ~/.qgis2/python/plugins. You could also attempt to do this with any pre-2.0 plugins you find and adapt them yourself to the new API, although it's probably worth reaching out to the developer to find out if they are already working on it, or if they feel it has been superseded by newer plugins or by features integrated in QGIS core.
Comment: Nevertheless it is a valuable question if this centralization is actually beneficial if the number of QGIS users and plugins increases even further. Like if the plugin hub suffers from some overload-breakdown...
Comment: @Curlew that is a good point. I will raise it with the guys who run the site.
Answer: Boundless Geo maintains a repository for plugins that they have created:
https://qgis.boundlessgeo.com/
It has some useful tools that are not in the official repository.


Problem with Center of mass equation definition

Question: I was trying to motivate the definition for the center of mass formula and I am getting a weird result. For simplicity let's assume two-point masses of mass $m$ and $2m$ connected by a rigid massless rod. Initially, they both are at rest, then if we provide an impulse perpendicular to the rod to mass $m$ let's say, the system will be in motion. The motion is restricted by a few rules: first is that according to rigid body constraint, the distance between both the mass should be constant for all times $t$. Now let's define a point called the center of mass such that the acceleration is zero of the point and we are doing it because it's a nice property. we can define the point like this $a_{cm}=\frac{ma_1+2ma_2}{m_1+m_2}$. Now this definition allows $a_{cm}$ to be zero due to newtons third laws because the force applied on the first mass is negative of the force applied on the second mass and their accelerations are inversely proportional to their masses so the numerator is zero and $a_{cm}$ is zero and if you integrate twice you get that point, our center of mass. So the motion of this system is just a rotation around the center of mass. But there is a huge problem with this. It's that the denominator can be anything it can be $m_1-m_2$ or any other expression. So what does this mean this means that according to our derivation, there is an infinite family of points such that when there is no external force to it it doesn't move. can someone help? Is there a mistake in one of my steps?
Comment: *But there is a huge problem with this. It's that the denominator can be anything it can be $m_1−m_2$ or any other expression.* Can you elaborate on this part? Why could the denominator be anything? This would suggest that anything times $a_{cm}$ yields the numerator, but I don't think that is accurate.
Answer: You just produced a very special part of constraint used to define center of mass, the general constraint is that Centre of mass is a point, for which, If all mass is assumed to be concentrated , will follow same equation of forces as if a point particle of same mass will follow, in This very specific case, you used acceleration to be zero inferring from net zero external force, which is just one part of constraint, more constraints like "even if the force is non zero, that net external force equals mass times acceleration of center of mass " are need for motivating definition of COM
Clarification to OP's Further Doubts:
Suppose There is a system of "$n$" particles, each having different accelerations as a result of different forces applied to each one, either internal, or external, Let mass of $r^{th}$ particle be $m_r$ and acceleration vector of $r^{th}$ particle be $\vec{a}_r$
what we can now algebraically analyse is as follows
$\sum \vec{F}_{external}+\sum \vec{F}_{internal}=m_1\vec{a}_1+m_2\vec{a}_2+m_3\vec{a}_3+m_4\vec{a}_4+m_5\vec{a}_5+.....m_n\vec{a}_n$
using newton's third law,
$\sum \vec{F}_{internal}=0$
now
$\sum \vec{F}_{external}=m_1\vec{a}_1+m_2\vec{a}_2+m_3\vec{a}_3+m_4\vec{a}_4+m_5\vec{a}_5+.....m_n\vec{a}_n$.......(1)
now for making it easy, we want this equation as a simple equation like
$$\sum \vec{F}_{external}=m\vec{a}.....(2)$$
to do that, we take $\sum_{1}^{n} m_r$ common on R.H.S of equation $(1)$
it becomes
$\sum \vec{F}_{external}=(\sum_{1}^{n} m_r) \cdot (\frac{m_1\vec{a}_1+m_2\vec{a}_2+m_3\vec{a}_3+m_4\vec{a}_4+m_5\vec{a}_5+.....m_n\vec{a}_n}{\sum_{1}^{n} m_r})$....$(3)$
Now compare $(2)$ and $(3)$ equation,The similarities are obvious, $(3)$ equation form has now become similar to $(2)$ equation form
where
$\sum_{1}^{n} m_r$ is now mass of complete  system and and the new vector
$(\frac{m_1\vec{a}_1+m_2\vec{a}_2+m_3\vec{a}_3+m_4\vec{a}_4+m_5\vec{a}_5+.....m_n\vec{a}_n}{\sum_{1}^{n} m_r})$ acts as "some acceleration vector $\vec{a}_{new}$" similar to equation $(2)$
Now this new equation is always valid for all newton's $2^{nd}$ law applications on system, now Integrate The equation $(3)$ twice and you will get that The vector quantiity then becomes weighted average of position vectors of all different particles in system, this weighted average will still be A new Position vector, This position is what we  define now "Centre of mass"
after this,
"We" Define this $\vec{a}_{new}$ as Acceleration of "center of mass", why is that so, because it is double derivative of position vector that we defined as position vector of "center of mass"
this help us solve Problems involving Application of newton's second law, as if all the mass of that system is located as point particle at position vector of center of mass
Comment: can you show that the center of mass equation satisfies the other constraints too? Such as if force is non zero that the net external force equals mass times acceleration. we take it for granted this is true but can you prove it?
Comment: Edited to clarify..
Comment: Thanks. It's very helpful, with this it's also very easy to prove that an object rotates about the center of mass if you apply an impulse to it.
Comment: @Hammock,you would still require Torque analysis to do that, And For Non zero external impulse, There are two motions, the centre of mass itself will move with some velocity, so in physical situations, object will actually rotate about centre of mass as well as translate forward


Permission Assignments Reports

Question: I would like to know if there is a possibility to generate a report on the permissions that were assigned the current month on a specific SharePoint site and document library.
Example: If Owner B assigned Edit permission to user A on a specific library.
Also if owner A shared a file with user X or external users.
Where can I generate this kind of report so we can maintain and monitor the security on the site level, and library level in one glance or view?
Could you please advise?
Any help is highly appreciated.
Thank you!
Answer: I would recommend that you check the SharePoint audit logs to find this information.

Permission Assignments Reports


Search Bar from the list I am using as a web part

Question: I have created a SharePoint page and have inserted a web part. This web part is a list from another library on SharePoint. This has successfully worked however, on the actual list (not the web part version), there is a search bar, but the web part doesn't include the search bar when inserted into the new page. is there a way to also bring the search bar with the list. I have tried inserting a search bar through web part but it just gives me a search bar for all of the SharePoint library we have. Any ideas?
Answer: Edit the web part and in the Miscellaneous Section select/check Display Search box. make sure you use default styleview.
Otherwise you can use HTML Form web part to search List/Library items.


Can I Write AddIn to MS Word which was turn on another AddIn?

Question: I Have a problem with my custom Addin to word because sometimes, MS Word was disabled my addin, and I need to write another AddIn, which Was enabled to turn - on/off my first AddIn. Is it possible?
sorry for my English  :(
Answer: I agree with divo, your first step would be to add some exception handling/logging in order to prevent the addin from being disabled. You can also refer to this article
Debugging in Application-Level Projects
However, I have also had issues with the addin somehow becoming disabled  without throwing any exception.  If the above approaches do not work you can always go and have another program forcibly set the LoadBehavior of your addin from 2 to 3, which should re-enable it.
Answer: What kind of add-in technology are you using? VSTO?
What version of Office are you using?
In general it is possible to do what you want. However, the reason that Office disables add-ins is that the add-in threw an unhandled exception. In that case Office will set the LoadBehavior value in the Registry to 2.
Maybe it would be better to analyze and handle the underlying problem causing the exception.


Experimental Data for Contact Angles

Question: I am doing some experiments with contact angle of liquids on chrome stainless steel and was wondering if in the literature there is already experimental data for contact angles of different fluids on different types of surface.  I am certain that this data has to exist somewhere, so I'm wondering if there is some particle review or research article where it is collated.
Comment: Exactly what are you trying ti measure?
Comment: I was being a bit unclear sorry, I am studying sphere impacts on a body of liquid where the type of liquid is varied (an example liquid might be 5 cSt silicone oil.  The spheres are chrome stainless steel ball bearings.  It would be useful to know the contact angles of different liquids on chrome steel, as otherwise I have to try to measure it, and I feel like there most be existing experimental databases on contact angles.
Comment: Are you looking for bounce, penetration depth, wave generation, what?
Answer: You will find tables of this sort of data within the materials science literature under key words wettability, spreading, capillary rise, contact angle, and surface energy.
You will also find surface energy test fluid sets consisting of ranked series of specially-prepared chemical solutions with distinct and well-controlled surface energies. placing droplets of these fluids on a test sample allows you to estimate the surface energy of that sample, by observing whether the test fluid balls up into spheres or spreads out into a film on the surface.
Comment: I've done many searches and not sure if what I'm looking for exists, I would simply like the contact angle for a regular chrome stainless steel sample when a droplet is placed on it of different liquids: 2 cSt glycerol solution, for example, or silicone oil.  It seems like the literature often assumes that you either talking about a modified surface and/or contact angle of water?

Experimental Data for Contact Angles


What is "oc_usd" Process on Cisco Nexus 7k and how to solve

Question: We have high CPU load on Cisco nexus 7K. The reason is "oc_usd" process.
Anyone knows anything about the process and how can we solve the issue?
Comment: That is the Octopus queuing module.
Answer: The Octopus process relates to some internal ASICs. As for issue resolution, What changed? Could be a misconfiguration, software bug, bad hardware, etc. Use basic troubleshooting to narrow down possibilities. Opening a Cisco TAC case is a good initial step as well. Look at control plane policing as well as a possible fix.
Cisco's Nexus 7000 High CPU Usage Troubleshooting Guide Root Cause Analysis of High CPU Usage states:

Symptoms of high CPU usage include control plane instability,
data plane connectivity issues caused by control plane failure,
protocol flapping such as Hot Standby Router Protocol (HSRP)/RP
flapping, UDLD error disabling, Spanning Tree Protocol (STP) failure,
and other connectivity issues.
show processes cpu history Command
If the switch was not reloaded or
switched over, run the show processes cpu history command within 72
hours of the outage in order to see if high CPU usage occurred at the
time of the event.
CoPP and HWRL
If high CPU usage was the root cause of a past outage,
and if you suspect that the outage was triggered by network traffic,
you can use CoPP and HWRL (hardware rate limiter)  in order to help
identify the type of traffic.


Why does very cold water in a thermos cause there to be strong suction on the cap?

Question: After putting ice-cold water in a thermos, the cap is strongly held on by what feels like suction. I assume the cold water condenses the air, thus lowers the pressure inside, but can someone explain why this causes suction?
Answer: When the thermos is closed, the air at the top of the thermos will be warm relative to the ice-cold water below it.  As time proceeds, the two materials that are in contact with each other at the surface of the water will exchange heat due to their different temperatures.  This will cool the air.
When gasses are cooled they move more slowly and they don't collide with surfaces as fast.  Pressure comes about from the number of molecules striking a surface per second AND the speed at which they strike it.  The molecules striking a surface per second will remain approximately the same, but with lower speed, the pressure produced will be reduced.
Meanwhile on the other side of the closed cap, the molecules will have the same speed they have always had, and they will exert normal atmospheric pressure on it.  Hence, the DP that is observed and the apparent "suction" that you describe.
Comment: What about the egg and bottle demonstration in which a hard-boiled egg is forced into a bottle with atmospheric pressure by lowering the pressure inside the bottle? In that demonstration, the air is lowered by heating the air inside the bottle. Could the same effect be achieved by somehow rapidly cooling the air inside the bottle? Or if not a bottle, then a thermos?
Comment: @user90664 The bottle experiment is exactly the same thing. Consider the situation after heating the air. You have air in a sealed bottle (the seal is the egg) and you allow it to cool. As it cools, its pressure decreases.


A bijection between the set of all sequences whose terms are either 0 or 1, and the set of all sequences whose terms are 0, 1 or - 1.

Question: Let X be the set of all sequences whose terms are either 0 or 1. Let Y be the set of all sequences whose terms are 0, 1 or    - 1.
We know that both are uncountable sets, by Cantor's diagonal technique.
 Give a bijection between X and Y explicitly. As X and Y are uncountable, there exists bijections to R, the set of real numbers, a composition of these, will give a bijection between X and Y. But, how to get an explicit bijection between X and Y?
Answer: Let $X$ be the set of $\{0,1\}$-sequences $x=(x_1,x_2,\dots)$ and $Y$ be the set of $\{0,1,2\}$-sequences $y=(y_1,y_2,\ldots)$. Denote by $X_0$ and $Y_0$ the subsets of sequences with only finitely many terms $\ne0$, and by $X_\infty$ and $Y_\infty$ the subsets of sequences with infinitely many terms $\ne0$. Furthermore we need the auxiliary set
$$Z:=\>]0,1]\>\sqcup\>{\mathbb N}_{\geq0}$$ ($\>\sqcup\>$ denotes the disjoint union). We now produce explicit bijective maps $$f:\>X\to Z,\qquad g:\>Y\to Z\ ,$$
so that $\psi:=g^{-1}\circ f$ maps $X$ bijectively onto $Y$. Namely:
$$f(x):=\left\{\eqalign{\sum_{k=1}^\infty x_k 2^{-k}\qquad&(x\in X_\infty) \cr \sum_{k=1}^\infty x_k2^{k-1}\quad&(x\in X_0)\cr}\right.\quad,\qquad
g(y):=\left\{\eqalign{\sum_{k=1}^\infty y_k 3^{-k}\quad&(y\in Y_\infty) \cr \sum_{k=1}^\infty y_k3^{k-1}\quad&(y\in Y_0)\cr}\right.\quad.$$
It is well known that $\tilde f:\>x\mapsto\sum_{k=1}x_k2^{-k}$ maps $X$ almost bijectively onto the real interval $[0,1]$, the exemption being that the two sequences $(x_1,\ldots, x_r,1,0,0,0,\ldots)$ and $(x_1,\ldots, x_r,0,1,1,1,\ldots)$ are mapped on the same number $\xi\in[0,1]$. The partition $X=X_0\cup X_\infty$ collects all zero-ending sequences in $X_0$, and $\tilde f$ maps $X_\infty$ bijectively onto $\>]0,1]$. The sequences in $X_0$ are then used to produce finite natural numbers $n\in{\mathbb N}_{\geq0}$ via binary representation. – Similarly for $g$.
Comment: Thanks for your answer. Is it possible to get a more explicit bijection?


Transferring notes into a particular folder

Question: I added a new folder in Notes but I don't know how to transfer new or existing notes into the folder.
Answer: Tap Edit, select the notes you wish to move to a folder, choose Move To… and pick the destination.
Answer:
Force touch (if not capable, see next sentence) on the note, swipe up, and select "move". If your phone doesn't support force touch, swipe left on the note and select "move".
If moving more than one note, press edit, select the notes and select "move to...".
If either of these don't work for you (need to have the updated version of notes enabled for above options), you can always select all and cut the note, then create a new one in the desired folder and paste.
Comment: What if the OP doesn't have force-touch?  The question involved 'moving' a note so cut/paste wouldn't work.  In light of not knowing the device, you should edit your answer to include the older devices or ask the OP questions to determine the device.  This will improve your answer as well as increase your chances of getting more upvotes.
Comment: @fsb thanks for the feedback! I added an alternative to force touch for those with older phones. My thinking is that even if OP has older phone, I want my answer to help others who may have newer phones (which is increasingly likely in the future); point being I don't think it's necessary to ask for version. Copying and pasting is effectively the same as moving the note, I used that on iOS before notes updated to allow moving notes on iOS, this is basically a last resort/manual/foolproof way to achieve the desired outcome.


Non-international domain names and SEO

Question: My current domain name is meow.fr. However, the website is in French AND English (we can switch the language, and it's not automatic translation, it's truly a multilingual website). Still, the websites is still visited mostly by French (coming from Google), and not many english speakers. Why that? Should I get a .com / .org instead?
Answer: You need to remember that the competition in google.com is much greater then the competition in google.fr as google.fr is localized to France. Google.com essentially is a search engine for every website in the world. Trying to rank well in Google.com is going to be much more difficult. Buying a .com or a .org is not going to help your chance in it as the TLD is not a ranking factor in Google.com. Your .fr is just as good as a .com/.org.
Comment: I'm in the UK and using Chrome, wasn't redirected to the English version
Comment: I would also suggest that you build your website to detect browser languages and display accordingly then have either French of English be the default fall back. This way as Google crawls the site they see it in one language consistently. You can also set it's language in Google Webmaster tools.
Comment: Normally it's done this way, if you go on www.meow.fr, aren't you getting redirected on www.meow.fr/en ?
Comment: Consider using the `hreflang` attribute? http://support.google.com/webmasters/bin/answer.py?hl=en&answer=189077
Comment: I'm using , it's not the right one? Mmm, I will check why this redirection doesn't work properly...
Answer: Well, one fact we tend to overlook is user's reaction when they see the search result.
If I am facing a list of websites that meant to answer my quest about England, I would prefer a .com or .uk to a .fr. Simply because .fr might be in French, plus how could a French has anything just to say about Brits :P
Comment: That's what I'm actually worried about! Would English-Speakers would click on a website with a .fr?

Non-international domain names and SEO


How can I ghostwrite a book?

Question: I want to write a book without putting my name on it. Is this possible?
Comment: http://minecraft.gamepedia.com/Book_and_Quill - without an author cited, hence, ghostwriting. I thought that was the correct word for this practice? I edited the body to hopefully make more sense.
Comment: Ghostwritting refers to an auther that writes a book but will not have their name associated with the book. So yeah, thats sort of applicable.   I would suggest looking into editing item values. Its a bit tricky as it involves fiddling with the world save. (I have only done it a few times back in the earlier days of minecraft. To allow cheats in a world created without them inabled.) You'll need to track down some program that will allow you to compile the world save into a manipulatable text file. Then save and boom. Its been too long for me to remember which programs I used. Sorry.
Comment: Also... I shouldnt have to say this, but. Make absolutely sure you have created back up copys of your world.
Answer: When finished writing a book, click "Done" and leave it as a Book and Quill. You may want to rename it in an anvil to give it a title.

This allows anyone else who gets the book to edit or sign it themselves.
If you wish to avoid this, and you have access to the world file, you can press "Sign" on the book GUI and then locate and change the author name of the book with an NBT editor:

How can I ghostwrite a book?


Read memory of a java application

Question: I need some starter advice here. Never done Java reverse engineering before, but I needed to somehow read the memory of a running desktop java application. The process communicates with an external server on an encrypted channel and fetches some files. The files as far as I know are Java bytecode meant to extend the functionality of the current application. I would like to know what are in those files, so I could later try to reverse bytecode to program code to get a closer look how it is to change the behavior of the application. Can you suggest a suitable debugging tool or tell me a bit about this methodology?
Comment: reverseengineering.stackexchange.com
Comment: If you're comfortable with command line you can use `jdb`, it's available on most linux distros
Answer: I usually use the Krakatau (dis)assember https://github.com/Storyyeller/Krakatau for examining and tweaking Java bytecode files.
The only way to get code into a JVM is to implement a class loader. The bytecode that goes into the JVM is, of course, in plaintext. So, disassemble the local classes first, locate the ClassLoader and hook the ClassLoader to dump the bytecode that would be loaded to a file (and possibly, load replacement code if you want).
Good luck, and don't do this in USA, as it is probably a DMCA violation.
Comment: @Downvoter care to explain?
Comment: I didn't downvote, but this doesn't really answer the question.  The OP is asking how to read the memory of a running process not decompile the Java bytecode.
Comment: @RoraΖ Debatable because OP said "I would like to know what are in those files [...]" so I think it's a legitimate answer to (admittedly only a part of) the question.
Comment: I see your point, but it seems to me that the problem is getting the files unencrypted first in order to decompile.  I think the OP should clarify his/her question a bit.
Comment: @RoraΖ Well that's the clever part of my solution, it bypasses the encryption because you can't classload encrypted bytecode into the JVM. So at some level the main program that has to run in a standard VM has to have an unencrypted loader that can be hooked to dump the decrypted bytecodes. Then you can hook those bytecodes in case they have another encrypted classloader and so on thus defeating any manner of bytecode encryption nested to any depth.
Comment: +1 OH, *lightbulb*  I get it now that I read things after having coffee. I was also looking at Krakatau.  Seems like a useful tool, and I might play around with it.
Answer: Can you break the encrypted channel with a proxy (if it's HTTPS being use for encryption for example?) and install the proxy's SSL certs into your local cert store so that the process trusts the proxy? Then you can capture the data from the packets (i.e. the byte code) and go from there?
This doesn't quite give you the image of what is actually running following a download but it may be enough for your purposes.
If you can't do this (because it's not a proxyable protocol for example, or the process doesn't use the local cert store) then it depends on your local setup in terms of OS and level of privilege etc.
Comment: @Downvoter - again, care to explain?
Comment: i didn't downvotet but what have this to do with the question?
Comment: It answers the question by offering an alternative way of achieving what the OP wants - i.e. to read what's in the files sent over an encrypted channel by the server. It does't directly answer the 'how can they read the memory of a running .. app' but it *does* offer an alternative way of achieving the same thing if what they want to do is read the files i.e. intercept them in a proxy if possible. Just a thought/suggestion that I thought might help the OP achieve what they needed! if they don't find it useful then fair enough.

Read memory of a java application


identify my giant rainier seriel number GK287424

Question: Please help me with any info on my Giant Rainier, serial number GK287424; it was gifted to me recently.
Comment: What are you trying to find out?
Answer: Giant sold a model with this name from 2005 to 2012, so it's a relatively-early 29" hard tail with a triple crankset and quite-decent components.  It is not a BSO or walmart-grade of bike.
from https://mtbdatabase.com/bikes/2010/giant/rainier/2010-giant-rainier/
There was some redesign in 2006, according to https://products.mtbr.com/product/bikes/xc-hardtail/giant/rainier-363498.html
For more general info, start by googling the brand/model and "review"  like this https://www.google.com/search?q=review+giant+rainier  If you have more specific questions, ask a new question (with clear photos ideally)


How anything faster than speed of light travel back in time?

Question: I know about this theory but I cannot get the picture that how moving faster than light even 100.01% of light-speed would make universe run backward.
Comment: Special Relativity forbids faster-then-light travel. Arguing about something that isn't allowed by the laws of nature is pointless.
Comment: Good, you should not.
Answer: So, rather than make some general argument, I will show how, if you can send things faster than light between two points, you can send things backwards in time.  To do this, I will need to assume two things:

the Lorentz transformations are correct;
all inertial frames are equivalent & in particular if you can do something in one frame you can do it in another.

These two assumptions really add up to the statement that special relativity is correct (in flat space).  This is very well-tested, of course.
We'll just worry about one space dimension: all motion is along $x$.  When I write coordinates I will write the time coordinate first: $(a,b)$ means $t=a$ and $x=b$.
The Lorentz transformations for an observer moving in the $x$ direction with velocity $v$ are:
$$
\begin{align}
x' &= \gamma(x - vt)\\
t' &= \gamma\left(t - \frac{vx}{c^2}\right)
\end{align}$$
Where
$$\gamma = \frac{1}{\sqrt{1-\frac{v^2}{c^2}}}$$
To make life easier we'll work in units where $c = 1$: so if our time units are seconds, our length units will be light-metres.  I'm just doing this so I don't need factors of $c$ all over the place.
In these units the Lorentz transformations are
$$
\begin{align}
 x' &= \gamma(x - vt)\\
 t' &= \gamma(t - vx)
\end{align}$$
Where
$$\gamma = \frac{1}{\sqrt{1 - v^2}}$$
(Remember that $v$ is now the velocity as a fraction of $c$).
So, OK, let's draw a picture:

In this picture we are communicating from $A$ to $B$ somehow, and as you can see, $B$ is outside the light cone originating at $A$ (drawn in grey).  Drawn in blue is the world line of someone who passes through the event at $A$ at some high velocity $v$, who I have called the 'primed observer' (because their frame of reference will have primes on its coordinates).  In our units, $v < 1$ (the primed observer can only move slower than light), but $v$ can be very close to $1$.
In this frame the coordinates of $A$ are $(0,0)$ and of $B$ are $(t, x)$.
Now the statement that $B$ is outside the light cone of $A$ is equivalent to saying that $x/t > 1$: the light cone of $A$ is where $x=t$ in our units.
So, now, let's calculate the coordinates of $B$ in the primed frame.  They are
$$
\begin{align}
 t' &= \gamma(t - vx)\\
 x' &= \gamma(x - vt)
\end{align}$$
With $\gamma = 1/\sqrt{1-v^2}$.
Well, I don't want to think about $\gamma$ all the time, so let's just look at $x'/t'$, and we can cancel the $\gamma$s:
$$\frac{x'}{t'} = \frac{x - vt}{t - vx}$$
So, what can we say about this quantity?  Let's think about the case when $v$ is very close to $1$: the primed observer is moving very fast compared to the unprimed observer.  So we'll write $v = 1 - \epsilon$ where $\epsilon > 0$ but $\epsilon$ can be as small as we like.  So
$$
\begin{align}
 \frac{x'}{t'} &= \frac{x - vt}{t - vx}\\
  &= \frac{x - (1 - \epsilon)t}{t - (1 - \epsilon)x}\\
  &= \frac{x - t + \epsilon t}{t - x + \epsilon x}\\
  &\approx \frac{x - t}{t - x} + \frac{\epsilon t}{t - x}\\
  &= -1 + \delta
\end{align}$$
Where
$$\delta = \frac{\epsilon t}{t - x}$$
and I have dropped the $\epsilon x$ in the denominator of the second-last line as it can be made as small as you like.
So, well, look at $\delta$:  By construction $\epsilon > 0$, and looking at the picture above, $t > 0$ & $x > 0$, but $x > t$ (because $B$ is outside the light cone of $A$), so $t - x < 0$.  So $\delta < 0$, but as $\epsilon \to 0^+$, $\delta \to 0^-$.
In other words we can make $\delta$ very small but it is always negative.
So what this means is that $x'/t' < -1$ but we can make it as close to $-1$ as we like by letting $v$ become very close to $1$.
In other words, in the frame of the primed observer, $B$ can be as close as you like to its past light cone, while always being slightly outside it.
Here is a picture in the primed frame:

As you can see, $A$ is still at the origin but $B$ now appears just outside the past light cone of $A$ from the point of view of the primed observer.
(At this point you should start to hear the slithering of tentacles as some great creature of the deep rises to devour you.)
Consider yet another inertial observer, comoving with the primed observer, whose world-line passes through $B$.  This observer's world-line is in blue in the second diagram (and not shown in the first).  This observer receives the message sent from $A$ to $B$ as their world-line passes through $B$.
But whatever magic we originally used to get the message from $A$ to $B$, they can use too, since all inertial frames are equivalent.  In particular, they can send a message from $B$ to $C$, and if $v$ is close enough to $1$ (how close it needs to be depends on how far $B$ is outside the light cone of $A$ in the original frame), then $C$ is within the past light-cone of $A$, and so it is now trivial to send a message from $C$ to $A$ (indeed we can pick $C$ to be $A$ if we like!).
And that's time travel: I have bargained being able to send a message faster than light into sending a message into my own past.
Answer: If you exceed the speed of light the traditional gamma factor in special relativity gets an imaginary value for the ratio of times (and also the ratio of lengths) from the viewpoint of observers which is meaningless unless you want to consider Godel metric according to which time travel is allowed in the realm of general relativity.
Comment: This doesn't really make sense. The Godel metric doesn't have anything to do with the fact that the equation for $\gamma$ gives an imaginary result when $v>c$.
Comment: It seems that the conjunction "unless" caused a misapprehension! I just wanted to say that Godel metric allows time travel.


set up Caps Lock as a shortcut for changing the input language

Question: I want to set up Casp Lock as a shortcut for changing the input language. There are some solutions like this. But it requires installing some software and doing tricks. Is there a way to do it in a neat way, say through terminal command?
Comment: Could you bind a keyboard shortcut for switching the keyboard? If so, I would recommend using KeyRemap4MacBook and PCKeyboardHack to bind caps lock to that keyboard shortcut. These utilities are vey impressive, and I was able to create a very complex keyboard layout using them along with ukelele.
Answer: Yes, you can use Caps Lock to change input language without third-party software.
All you need is a custom-made keyboard layout (usually made with Ukelele ) that has two alternative sets of characters bound to Caps lock=on and Caps lock=on and Shift=on states.
Pros: zero-lag, no weird key remapping hacks needed
Cons: buit-in input source indicator becomes useless, looking at the Caps LED is not very convenient for touch-typists.
To mitigate the "cons" I use lightweight third-party app called Capster that changes the icon in the menubar depending on the Caps lock state.
I also use small Applescript to disable Caps lock delay.
I'm using this method for many years and never looked back.
This is my bundle for Russian language (with additional Ukrainian characters bound to alt+key)
https://github.com/falcn/Caps-layout
Answer: Unfortunately no, unless someone posts a (possible veery long) command that modifies the keyboard drivers in the same way PCKeyboardHack and KeyRemap4MacBook do, but in general, using these is the way to go.
Comment: I would say use prebuilt tools people have created, used, tested, etc. That ensures you don't mess something up when modifying your operating system.
Answer: In case people who get here from search engines don't read the linked post, you can change caps lock to something like F19 with PCKeyboardHack:

And then change the shortcut for selecting the next input source to F19:


Forcing Remote Repo to Compress (GC) with Git

Question: I'm using Git to version a series of binary files. They compress pretty well, but my central repos do not seem to be compressing when I push to them. They're eating up a decent amount of my quota, so I was looking to see if there was a way to force the remote repo to do a GC.
Is this possible? I'm working on Project Locker so I don't believe I have SSH access to go in and GC the repo myself. Any ideas? Thanks.
Comment: Do you have access to the remote's gitconfig?
Answer: If you can't run git gc yourself, you're going to have to trick it into running automatically. You won't have quite such full control over it then, but you should at least be able to get it to run.
git gc --auto is run by several commands; the relevant one here is receive-pack, which is run on the remote to receive a pack as part of a push. gc --auto only repacks when there are enough loose objects; the cutoff is determined by the config parameter gc.auto, and defaults to 6700.
If you have access to the remote's gitconfig, you could set that cutoff to 1 temporarily. There should pretty definitely be at least 1 loose object in the repo, so that should cause gc --auto to do its thing the next time you push.
If you don't have access to the remote's gitconfig, all I can think to do is artificially create a bunch of loose objects. You could do that by creating a branch, committing a bunch of tiny files (with different content) to it, pushing the branch to the remote, then deleting the branch from the remote. (Important to vary the content, or they'll just use the same blobs.) Rinse and repeat.
Comment: I may try making a small app that pumps out 7000 or so text files. I don't believe I have access to the config. I'll let you know how it goes, thanks!
Comment: What is that, a shell script? Anyways, I just made something real quick in Qt and push up all the loose objects. It didn't seem to make a difference in my space usage. I will just have to try to contact ProjectLocker and see what is up. Thanks for everyone's help.
Comment: @jocull: I don't remember exactly how the objects get unpacked on the remote end. I would personally probably try going way overboard with it just in case. And yes, that's a shell one-liner... except I apparently forgot half of it. Last part should read `while read n; do echo $n > $n.txt; done`
Comment: I decided to delete my repo on Project Locker, then recreate it with the same name. I ran 'git gc' locally and then pushed the whole repo. It's now using half the space is was previously.
Comment: @jocull: Well, that's one way to run `gc`! Seems odd to me to be able to totally obliterate a repo, but not to be able to edit its config, but sure works!
Comment: I guess that's the beauty of distributed source control :)
Answer: That's really a problem that they need to solve on their end.  They can do it with a post-receive hook or a cron job or something similar, but if they're supposed to be maintaining your repositories, that's kind of part of it for numerous reasons.
Comment: I tend to agree, though sometimes you can't wait for other people to solve their problems. It could also be that they do run `gc` a decent amount, but the binary files are causing things to bloat up faster than usual with text content.
Comment: If they don't GC then they sell me more space. It almost makes sense for them not to from a business POV.
Answer: Form git-gc man page:

Some git commands may automatically run git gc; see the --auto flag below for details.

And further:

--auto
With this option, git gc checks whether any housekeeping is required; if not, it exits without performing any work. Some git commands run git gc --auto after performing operations that could create many loose objects.
Housekeeping is required if there are too many loose objects or too many packs in the repository. If the number of loose objects exceeds the value of the gc.auto configuration variable, then all loose objects are combined into a single pack using git repack -d -l. Setting the value of gc.auto to 0 disables automatic packing of loose objects.
If the number of packs exceeds the value of gc.autopacklimit, then existing packs (except those marked with a .keep file) are consolidated into a single pack by using the -A option of git repack. Setting gc.autopacklimit to 0 disables automatic consolidation of packs.

And in the end:

The git gc --auto command will run the pre-auto-gc hook. See githooks(5) for more information.