Insert item into a string from multiple list

Question: I'm working on create the schedule using APEX. But I would like to schedule the time dynamically. So, I create five different lists: Second, Minute, Hour, Month, and Day. Each list contains its own value. Then I add all five lists into one master list and try to loop through the sublist's value.  The reason is I want to create the String CRON EXPRESSION. For example, when it loops the Second list, the value in the Second list will add into the first position of the String CRON EXPRESSION. The CRON EXPRESS format looks like this: 'Seconds Minutes Hours Day_of_month Month'.  When it loops through the Minute list, the value in the Minute list will add into the second position of the String CRON EXPRESSION and so on. Can anyone give me the idea how I can achieve this? Is it possible?
Answer: If you're trying to schedule time dynamically, I don't think you want to loop through an array of all your different lists. If you loop through the array of lists, you're going to get something that looks like this:
<code>list <String> Dys = new list();
list <String> Mnth = new list();
list <String> Hrs = new list();
list <String> Mins = new list();
list <String> Scnds = new list();
String TmInstnce;
list<String> CRON_EXPRESSION = new list();
For(integer x=0; x<12; x++){
   Mnth[x] = String.valueOf(x+1); // month has to come first because of impact on days
   For(integer y=0; y<31; y++){
     If(x==1 && y==28) y=31; // handles Feb being 28 days long
     If((x==3 || x==5 || x==8 || x==10) && y==30) y=31;
     // handles Apr, Jun, Aug & Nov = 30 days
       Dys[y] = String.valueOf(y);
          For (integer z=0; y<24; y++) {
            Hrs[z] = String.valueOf(z); //use 12 if you want to use a 24hr clock
            // add a For loop HERE (a=0; a<2; a++) to get AM/PM if you want 12 hour time
              For (integer w=0; w<60; w++){
                 Mins[w] = String.valueOf(w);
                    For (integer v=0; v<60; v++){
                       Scnds[v] = String.valueOf(v);
                       TmInstnce = Scnds[v] +':'+ Mins[w] +':'+ Hrs[z] +':'+ Dys[y] +':' + Mnth[x];
                       // assumes you want colons separating everything in your string
                       CRON_EXPRESSION.add(TmInstnce);
                    }
              }
          }
   }
}
update CRON_EXPRESSION;
</code>
As you can see, what you get from the above is a list of all possible time combinations for every second that exists within a 12 month period (excluding leap years)!
If you want to put time together dynamically, I suggest you explore using the datetime.now() methods in Apex instead. You can easily parse the results as a string to get only the portions of it you want using the variety of datetime methods that exist.
Finally, if you you can also use system functions to get the time and/or only the portions of it you may need, which might also serve your purposes too depending on what they are. Those are primarily used for scheduling batch jobs and similar tasks. Datetime methods are what the APEX compiler is going to expect to see in your code.
Using the Apex time functions you can add hours, minutes, days, etc to the current DateTime to create the dynamic time that I suspect you're actually looking for. Once you have it as a string, you can use the parse command to convert into DateTime Format that APEX will recognize as valid. The APEX documentation is pretty extensive on how to use it, but if you have questions, post back for clarification. Actual code you're trying to work with would be helpful.


Building circuits with BuildCraft

Question: I'm making a large logic circuit with ProjectRed, and there are a lot of parts of the circuit that are repeated in a line, so I'd like to "copy and paste" a block several times. To do this, I've built the block I want to copy and I'm using the architect table and builder from BuildCraft. I surround the block I want to copy with land marks, put the architect table next to them, and produce a blueprint. However, when I put the blueprint into a powered Builder, the Builder immediately removes the blueprint from the blueprint slot and puts it in the inventory. Is this an issue with BuildCraft and ProjectRed not working together? If so, is there another way to do this? I'm using the FTB Inventors pack.
Answer: Unfortunately, Buildcraft is not compatible with ProjectRed.
There was a convenient  article I found was on the BuildCraft FAQ, under the section What mods do the BuildCraft Builders support?, which gave me this information:

In the second list, there is an item called RedLogic.  This mod is the replacement for PR2 which is why there is no support for for it on this list.
To sum up, you cannot use the BuildCraft Builder for ProjectRed specialty blocks.
Comment: So what options do I have? Is there a similar thing from another mod that does work with PR?
Comment: How many times do you want it pasted, if it's around 10 or less, you're better off building it over again, it will take less time than trying to find a solution.
Comment: I need it pasted at least 32 times, but don't worry I found my own solution.
Answer: So it looks like it's impossible with buildcraft. However, I did solve my problem by using ProjectRed's customisable IC gates to massively reduce the amount of space and copy/pasting required.

Building circuits with BuildCraft


Win10 File copy speed over network drops to 0

Question: Copying files from desktop to drive attached to my router starts fast but quickly slows then stops. How can I fix this?
Answer: never had this problems But your question is poor in terms of description:
no type of connection specified (ethernet or Wifi)
no wifi dongle specified
no router model specified
so i guess the standard  steps you should follow are:
if you are using wireless connection:
1) if your dongle is a usb 3.0 device use it on a usb 3.0 port (if you have one)
2) check the signal your dongle receives from the router.
3) update your wifi dongle's drivers
4) if nothing of these works try working with an ethernet connection.
if you're working with ethernet connection:
1) it's always a good thing to check your cables condition
2) since ethernet rarely brings problems try first restarting your router
3) if router still gives trouble try to upgrade its firmware


Is MLlib compulsory to work with distributed data?

Question: I am new to the field of machine learning and recently learned the basics and working out various algorithms in python using libraries such as pandas, numpy, matplotlib, scikitlearn , etc.
                    I started learning about working Bigdata by distributing it and using Apache Spark's library MLlib to load and apply algorithms on it. So is working with MLlib the only way on Spark or is there any other way to use pandas and other libraries on distributed data?
Answer: Yes. There are a million ways to engineer a solution.
You can use pandas for data wrangling and distribute this task via parallel python.
I personally use python for distributed - data acquisition, data wrangling, and algorithmic computation. This way i get the capability of Multi-machine, multi CPU, & multi GPU.
If you want to use python all they way, i recommend recording all the different options in terms of libraries, then order them by most active in development releases, or by whatever criterion you value the most.


Whats the word for this type of person?

Question: What do you call a person who takes a stand on an ideology but has no real practical experience or knowledge of it?
Answer: The question appears to be too broad. You should necessarily narrow down your request by providing one or two sample sentences. But off the top of my head, the closest thing that I can think of would be the noun dilettante:

A person who cultivates an area of interest without real commitment or knowledge.

Example sentence:

It takes an experienced veteran, not a political dilettante, to see policies and processes brought to reality in any meaningful way.
Source: Tom Homan Is the Right Person at the Right Time to Run ICE
Answer: "Ideologue" can work. Merriam Webster, "an impractical idealist", "an often blindly partisan advocate or adherent of a particular ideology".
"Chauvinist" has one sense related to this (this is actually from the definition for "chauvinism"), "excessive or blind patriotism".
Answer: a naif

n.
  1. a naive or inexperienced person. adj.
  2. naive.

TFD
As in:

In 2012, Popkin had learned about trees to cure this blindness in
  himself and went from a naif who could barely pick out an oak tree to
  an amateur arboriculturist who can distinguish hundreds of trees.

Whats the word for this type of person?


Mathematica Manipulate[] slider initial position

Question: the initial position of a slider when using the Manipulate[] command is always the left side. Is there an option to set a different position at which the slider is positioned when the notebook is opened?
Answer: Instead of the usual {a, 0, 10}, replace with {{a,5},0,10} to initialize a.
Answer: Read the documentation page for Manipulate carefully. Example:
<code>Manipulate[Plot[3*x + a, {x, -2, 2}], {{a, 2}, 1, 3}]
</code>


what is the validity of a german conference visa

Question: I intend to travel to Germany for a conference in June this year, can I apply
for my via now. Shall this visa still be valid by the time I intend to travel
Answer: You will need an uniform short-stay Schengen visa.
The earliest time you can apply for such a visa is three months before the start of your intended visit. (Schengen Visa Code, article 9).
So you will have to wait a bit yet. Within that time limit, though, it is recommended to apply as early as possible.


FileMaker Pro PHP ODBC Connection

Question: How do I connect to a FMP database using an ODBC connection?
The name of the server is fmserver, and there is no Username or Password.
This is what I try:
<code>$name = 'fmserver';
$conn = odbc_connect($name, '', '');
</code>
But for some reason, when I try it out, it brings me to a page that says (on chrome):

Server error
The website encountered an error while retrieving [URL]. It may be
  down for maintenance or configured incorrectly.

Is there some method that I'm implementing wrong? I have the IP address too, and have tried that, but I can't seem to get that to work either.
Answer: Do you have the FileMaker ODBC driver installed and configured with "fmserver" as the DSN?
I would highly recommend you take a look at the FileMaker PHP API vs. ODBC.
http://www.filemaker.com/support/technologies/php.html

FileMaker Pro PHP ODBC Connection


How does a neutral wire add any protection from near-by lightning strike

Question: As an amateur radio operator for 60 years now I have been aware that a major worry vis-a-vis lightning is not so much the very rare "direct hit" that blows up the house, but the far more common "near miss" in which a very large electromagnetic pulse will spread at the speed of light whenever lightning strikes nearby. I have been taught that this pulse (EMP) will induce a substantial voltage on antenna structures but also on power lines coming into the house.  In this context, how does having the neutral wire (grounded at the home's AC service panel) provide ANY protection against a voltage surge on the AC supply going into the  house? I am confused about this despite much reading on this great web site.
Comment: What makes you think neutral adds any protection?
Comment: Read [Lightening Protection PDF](http://lightningsafety.com/nlsi_lhm/IEEE_Guide.pdf) for the usual safety protection of people inside. But if you are wanting to protect sensitive electronic devices from EMP, I'm not sure you can take any reasonable measures to prevent that. There are unreasonable measures that work, but they are expensive (multiple stages of Faraday cages, in layers.) Also, read this and associated links: [EDN, EMP Damaged TV Tuner Teardown](https://www.edn.com/5G/4437296/Teardown--Ethernet-and-EMP-take-out-TV-tuner)
Comment: What "makes me think the neutral adds any protection" is the frequent mention I have found in some sources that the neutral being grounded "offers lightning protection".
Answer: The induced pulse from a nearby lightning strike is a common-mode signal with respect to the power line, which is a balanced (differential) connection to the pole transformer. (I'm assuming that you're in the USA, with the usual 120-0-120 "split phase" power connection.)
The neutral is grounded at both ends — i.e., at the pole transformer and at your service entrance. At least one connection is required to keep this link from "floating" to arbitrary voltage levels with respect to ground. Two connections serves to short out the common-mode surge from lightning strikes.
In other words, if the neutral (center tap) was grounded only at the pole transformer, the common-mode surge induced along the length of the cable would enter the house, rather than being shorted to ground. Similarly, if the only ground was at the service entrance, then the pole transformer would experience the surge, possibly exceeding its ratings and causing an internal breakdown.
Answer:

simulate this circuit – Schematic created using CircuitLab
The best protection is an MOV and a good line filter.


Best way to bake a breakfast casserole and reheat a ham in the same oven

Question: I'd like to bake my breakfast casserole & reheat ham chunks at the same time in the same oven. I fear the breakfast casserole may taste like ham. If I cover the ham will that help?
Answer: Covering your ham (with a lid or foil) will not only mitigate the mingling of aromas, but will also allow you to reheat the ham in a shorter amount of time.  You could add a small amount (1/4 - 1/2 cup) of boiling water to the pan with the ham to generate some steam.


How do I save the game?

Question: I just got Lego Star Wars - The Complete Saga for my son. It seems to autosave in some fashion. But it also warns me on exit that my progress will be lost since the last save. How can I save manually?
Comment: The only reason it asks to save if you exit the game is because it is possible to have picked up coins in the "level select" level.  There aren't really any "normal" autosave points there.
Answer: It can't be done. You can trigger an autosave by finishing a level or buying an item, though.
Comment: In addition to these, it appears that I can save during free play.  At least, it offers to let me save, though if I enter the same level again, it puts me back at the beginning.  I guess it keeps track of canisters, studs, etc.
Answer: Don't worry about it - many games that use an autosave feature give a warning like this, even if it's just saved the game. You can read it as 'make sure you hit a checkpoint before you quit, otherwise you'll lose everything you've done since the last one'.
As long as you quit after hitting a checkpoint your progress will be saved.
Comment: So in this game, what's a checkpoint?  Do I have to completely finish a level to trigger a save?
Comment: Yes, according to [this LucasArts help page](http://yodashelpdesk.lucasarts.com/faq.asp?sid=120442101223066249072013&pid=1587&pnm=LEGO%20Star%20Wars:%20The%20Complete%20Saga&seid=400001952&pos=Windows%20XP⊤=All&rid=400002250) The link refers to the Windows version but I imagine the console versions are the same.
Answer: Playing on iOS I've found a way to trigger a save in the cantina without having to purchase an item. View one of the minifigs in the cylindric water chamber, change at least one of their parts using the white arrows and exit the edit mode. This brings up the Death Star briefly in the upper right corner indicating a save is happening.
Answer: Go to the bar in the start of a new game and you can create a new autosave under the character option. You can visit bars within the game to save at anytime...
Answer: For all the people who have a problem with saving the game Star Wars TCS, here's a solution which worked for me.
The problem lies not in the Xbox 360 game or Xbox One or an Xbox Live account. It lies in the hardware. It is in the WiFi router at the settings. Make connection to your WiFi router and see if cloud security is on. With me the cloud security was enabled, which should be set to disabled. Save the new settings on your WiFi router. Then you go to your Xbox One. Start the game Star Wars TCS and you will see that it automatically recognizes your user profile and starts downloading it  for your Xbox 360 game. Then, after playing each level, you can save the game. If this still does not work the stop your WiFi firewall. It must certainly succeed.

How do I save the game?


Decoding Failed: Syntax error

Question: Hi i use csv file to "import"  bulk products. Checking Data with no error.
but when i import the csv file, " Decoding failed: Syntax error"come out if anyone know why ?
Answer: The 'check data' just checks the columns are okay, it does not parse the whole file.
Here is an approach to find the data that is causing a problem.
Cut your CSV file down to one product and see if that imports. If it does not then cut complex data out of fields until it does import. In that way you can determine if it is a column that is causing the error.
If the one row imports fine then it will be in the rest of your data. Try the same 'bisect' approach. Cut the file in half, try again. If it still not works then cut it in half again.
By taking this approach you will be able to hone in on the data that you are getting wrong.
Without you posting your attributes and your CSV file it is not possible to spot what the mistake is, however, by using the above approach you will be able to find the data that upsets the import.

Decoding Failed: Syntax error


Sound Proofing For use of power tools in a room located in a house located in a residential area in the utmost clandestine fashion possible

Question: As the title as pretty much covered, I am a night owl and my mother goes mental if I do anything more than type on my computer. What do I buy from a the local hardware store would be a huge help
Comment: Please try to edit your question with a shorter title and describe your question inside. Provide house plans or measurements, wall material, what kind of tools you use etc, if you want to have a chance to get an answer. Having said that this is not a sound proofing forum. But someone might help.
Comment: This is way too broad to even start on.What's the building made of? How much physical separation do you already have? How much can you modify it? What's your budget? What kind of power tools [ie drilling walls has zero method of isolation] Sounds insulation requires mass & air-gapping. If you can't add those, you can't isolate it.
Comment: It's not an acoustic problem you have, it's a mother problem. Go the the pharmacy and buy her some earplugs.
Comment: Well I guess I should really google the subject before asking a stack exchange question, I have a chronological disablility
Answer: Short answer, forget it.  Short of major structural work, you won't be able to reduce the sound of power tools enough to satisfy your mother.


Should the chazzan say amen after the Priestly Blessing?

Question: The chazzan says the words of the Priestly Blessing word after word, and Kohanim (priests) repeat after him.
Should the chazzan say "amen" after each blessing?
What about "amen" after the blessing that Kohanim say in  the beginning?
Answer: Orach Chaim 128:19 "Chazan does not say Amen after the Kohanim say the Beracha". Be'er Hataiv 34 says "that this is even the case if the Chazan is sure he will not get mixed up". Be'er Hataiv says further "that this is only on the Pesukim not on the original Beracha where there everyone says he should say Amen". However the Mishna Berura 71 says that if he is davening from a siddur and will not be confused he may say Amen. The Mishna Berura also brings down from the Ellya Rabba that there are those that hold you should not answer Amen on the original Beracha.
הלכות נשיאת כפיס סיק קכח
Comment: Arukh HaShulḥan brings those who say that you should answer amen to the אשר קדשנו bracha but not to the verses, and that seems to be the practice in his milieu.


Why can't we see infrared light?

Question: While explaining to my nephew about the physics of light, I told him we cannot see infrared color, and he kicked back with a very simple question: why can't we see it? I could not tell him. Is the human eye unable to sense such light or can it indeed but the brain can't understand the signal? any other reason?
Comment: Hello, interesting question, but might it be better suited to biology Stack Exchange?
Comment: I'm voting to close this question because it is not about physics, but about human biology and evolution.
Comment: What infrared? Near, mid, thermal, or far? The visible spectrum is extremely narrow. Infrared on the other hand is rather broad.
Comment: The idea that we cannot see infrared light is a little bit of an over simplification. In some situations it is possible to see infrared light with your eyes. It just isn't very useful. https://source.wustl.edu/2014/12/the-human-eye-can-see-invisible-infrared-light/
Comment: @SebastianRiese There is actually really interesting physics present in how the eye interacts with light. It is not a purely biological quesiton
Comment: As it is phrased, it is. The focus is decidedly not on the physical processes involved. (And actually it's even worse: As stated is not even a scientific question, because this kind of why-questions has no ulterior answer. "because we evolved that way" is not really satisfactory).
Answer: A nephew-friendly, physics-based explanation:
Our brains and nerves work based on electrical impulses, which are little bursts of electrical current.  Electricity is what happens when you remove the electrons from one atom or molecule and move them to another one nearby.  In some materials, like metals or heavily ionized liquids like blood, it's easy to move electrons around and make electrical current flow.  In other materials, like plastic or rubber or bone, it's harder to make the electrons move.
It takes energy to make an electron move away from an atom.  In conductors, it takes only a little energy; in insulators, it takes a lot of energy.  How much energy it takes to liberate an electron is called the "work function" or the "ionization energy," depending on exactly what you're doing, and is measured in volts.  (Well, technically it's electron-volts, but that compound word makes people fall instantly asleep.)   If you push the same number of electrons --- the same current --- out of a nine-volt battery, you do about six times the amount of work of a 1.5-volt AA battery.
If you hit an atom with some energy but it's not enough to knock the electron completely free, you can sometimes make the electrons around the atom vibrate. But the atom can't vibrate any old way: only certain frequencies are allowed.  If you try to give an atom energy in some amount that's not allowed, the atom's electrons just ignore you.  It's kind of like finding a vending machine that says "quarters only": if you have a pocketful of dimes and dollar coins, then too bad for you.
We happen to live in a world where ionization energies for stuff are typically three or five or ten volts, and electronic excitation energies are typically one or two or three volts.
Light is the way that electric charges exchange energy with each other.  Light comes in lumps, called "photons," which each carry a certain amount of energy.  It turns out that the energy in each lump is directly related to its color: violet light has more energy per lump than blue, blue more than green, green more than yellow, yellow more than red, and red more than infrared.  When visible light hits the pigment proteins in the retina, it makes the electrons vibrate; that sets in motion the machinery to send an electrical impulse to your brain.  When ultraviolet light hits those pigment molecules it ionizes them, which makes the molecules fall apart and sets in motion a different mechanism ("cleanup on aisle four").  And when infrared light hits those pigment molecules, it doesn't have enough energy to make the electronic vibrations go, so you get zero information about the infrared light: you're at the vending machine, but only with dimes.
Visible light photons have energies from about 1.8 volts (red) to about 3 volts (violet).
The whole story is more complicated than this because the different ways a molecule can vibrate depend very sensitively on its shape, but that's the basic idea.  This is also why ultraviolet light is more dangerous than visible light: in addition to breaking up pigment molecules, ultraviolet photons have enough energy to break up DNA molecules.
Infrared light can make an entire molecule vibrate, which is what we call heat.  (It's easier to make a whole molecule vibrate because molecules are big and floppy, while the electrons are held near their atoms on a short, stiff leash.)  The pit snakes have a delicate membrane which seems to detect radiant heat by causing warmed air to flow through a pore; you can see right away that this thermo-mechanical sense is completely different from the electro-optical method that we (and the eyed snakes) use to see visible light.
Answer: Infrared radiation is absorbed by water, both atmospheric water vapor and liquid water.
Below is a graph of water transmission at various wavelengths. Notice that some rather large bands are completely missing. This light can't reach your eyes because the air absorbs it.

Also, our eyeballs are filled with water. This water also absorbs infrared radiation before it hits our retinas. Below is a graph of the how much light is absorbed by liquid water by wavelength.

This explanation also explains why we can't see UV light. Here's a graph of all wavelengths we could see versus how much can be transmitted through air.

Essentially, our eyes evolved to see visible light because that's the only light there is to see.
Answer: Hot objects, such as humans and warm-blooded animals, emit IR-radiation. Few creatures have IR-vision, such as snakes. Significantly, snakes are cold-blooded. IR-vision would be advantageous in a struggle to survive for most creatures; with IR-vision, you could distinguish (hot) living creatures with camouflage from their backgrounds and see (hot) living creatures at night.
There could be many obstacles to evolving IR-vision - you must consider whether IR-sensitive eyes could evolve in gradual, incremental advantageous steps. However, given that snakes have IR-vision, whatever obstacles exist must be surmountable.
The big problem, I think, is that humans are warm-blooded. That means the head behind the eyes and the eyes themselves (I assume the eye is also at body-temperature), emit IR-radiation. This background noise might make it impossible to have a useful IR-sensitive eye. It would be like trying to read a book while someone shone a bright torch into your eyes.
We might have been able to get around this by having eyes outside our bodies, like a strange antennae, by evolving a sort of goggle that transforms IR- to visible light at the front of our eye, or maybe be some kind of shielding behind the IR-sensitive cells. I think these things are probably sufficiently "irreducibly complex" to make them very difficult to reach by evolution.
This might only be a problem for IR-radiation of particular wavelengths similar to human body temperature. Perhaps we could see other IR wavelenghts. However, since most warm-blooded animals are similar temperature to humans, $\sim37^\circ$, there would be no advantage to seeing such wavelengths, so it is no surprise that we did not evolve this adaptation.
Comment: @innisfree I find the background noise argument weak since we still sense heat through the skin despite being warm blooded. Also, our ears work pretty well despite the background noise of breathing and the heart beating.
Comment: @innisfree It is possible. That's how thermovison cameras work (some of them at least). They use pyroelectric detectors and modulate incoming beam with a chopper. But semiconductor detectors that were used earlier were indeed cooled with cryogenic liquids or Peltier modules.
Comment: @KalenGi right, you sense temperatures different to your body temp. i'm saying that localizing objects at ~37 deg is difficult if you're also at ~37 deg. localizing objects at hotter or colder temps may indeed be possible.
Comment: I think that saying that the temperature of our body would produce a background noise in terms of IR radiation is an exaggeration. Using Wien's  displacement law, one finds that a black body at 310K (roughly the temperature of the human body) has a peak at about 9350 nm. This somehow leaves a room in terms of range of wavelengths we could detect without having a background noise due to our own body.
Comment: The only advantage of IR-vision is seeing living creatures (which are at about 37 degrees), though. So whilst maybe there's no problem with seeing other wavelengths, there's also no advantage.
Comment: So let me clarify my comment: maybe someone can elaborate on whether an instrument sensitive to IR-wavelenghts emanating from objects at 37∘ is possible, if the instrument itself is at 37∘
Answer: The human eye is indeed not able to sense such light(*). The retina, which basically covers more than half of the internal wall of the eye has 3 different types of cones (which are photoreceptors, i.e. cells that will transmit an electric signal to the optic nerve if they are excited by light they can sense) that are only sensitive to visible light. The reason of why they are sensitive to only visible light lies in that the cones have a size and proteins that make them well suited to aborb visible light only and not UV, infrared and other EM radiation of other wavelengths.
Visible light corresponds to the portion of the electromagnetic spectrum ranging from roughly 400 nm (violet) to 700 nm (red). Infrared on the other hand corresponds to wavelengths greather than 700 nm and up to 1 mm.
(*) sidenote: The real story is a little bit more complicated, apparently the human eye can detect an infrared laser with a 1064 nm wavelength emission, but it appears either red or green due to some complicated process ocurring on the retina.
Comment: Doesn't this somewhat beg the question? We want to know why the eye can't see IR light? This answer is that it is because the eye is only sensitive to visible light. True, but I'm not sure that gets us anywhere.
Comment: Snakes don't use their eyes for IR detection. They use so called pit organs for this. Above mentioned limits are often revised now to state that 780 nm is the IR limit. Cut-off is smooth here - you can see 808 nm diode laser without any problem, but it's really intense light.
Comment: I've edited my reply and included more details. What do you think now?
Answer: Look at the Plank Spectrum for a blackbody with a temperature of our Sun (roughly 6000 Kelvin). Here is a link to one.
http://www.physics.usyd.edu.au/~sflammia/Courses/StatMech2014/advanced/2/blackbody.jpg
From my understanding, the reason we cannot see outside the visible range is that our eyes evolved to match the spectrum of our sun. So for example with solar systems with much hotter stars, where the peak of the black body spectrum is in the ultraviolet range, it is conceivable that life evolving around such a star would likely see in the ultraviolet range.
Comment: Are you saying IR-vision wouldn't be advantagous in a struggle to survive? With IR-vision, you could distinguish (hot) living creatures with camouflage from their backgrounds, and see (hot) living creatures at night!
Comment: @innisfree : I thought [this](http://physics.stackexchange.com/questions/147746/why-human-and-most-of-vertebrates-cannot-see-near-infrared-light-720nm-1500nm) was pretty good.
Comment: @innisfree No I wasn't saying that at all. But on your point, I have to say it depends. What about creatures that are the same temperature as their surroundings like cold-blooded creatures? If you are a creature that can see only in IR, then you would not even be able to see such cold blooded creatures. And if those cold-blooded creatures were your predators, well then a creature relying too heavily on IR vision is now something's lunch...
Answer: For the same reason we cannot wag our tail
Ask him: "Can you wave your hand about?"
Answer: "Yes, like so!"
Ask him back: "Can you wag your tail?"
Answer: "No."
Ask: "Why can you wave your hand about but not wag your tail?"
Answer: "Because I have a hand to wave but I have no tail to wag."
It is the same thing with infrared light and visible light: we can see visible light because we have things (cones and rods) needed to see it. But we cannot see infrared light because we were not given anything to see it with.
"But why were we not given that?"
"For the same reason we were not given a tail: it just did not happen".
If he presses the issue you will have to start explaining evolution. Mutations and changes happen at random, and if a change is useful to us in a way that makes us more fit, then the change sticks around and will eventually become more pronounced. So somehow this mutation either never happened, or it did and it just was not very useful and faded away.
...which is the case with our tail that we do have. Our ancestors had a tail, and us humans have it too while in the womb. But the tail in a fully grown human has gone away over time because it was not needed.
Answer: I stumbled upon this thread while looking for a source in which I once read that opsins evolved to detect light from UV (in insects) all the way to the red part of the spectra is due to the nature of light. It is not only, that it coincides with the pure abundance of the photons but also with the energies they carry. The short wavelengths can be detrimental and for an organism, that reaches sexual maturity around 13 years and has to raise its young for at least a few years the effect would be that we would go blind and would have difficulties in continuing our line. Insect don't have those problems as they live a shorter life. So this sets the useful lower limit. As wavelength increases the energy of photons falls. In the range around 700 nm it becomes so low, that the opsins would have to be so close to the tipping point of conversion that the thermic vibration would be a problem.
The UV photons have too much energy, while IR has too little for a well enough built opsin molecule to efficiently detect it.
Answer: For my opinion,we in real can see the IR,that's why we can't see it because of our cornea of our eyes.The cornea stopping the UV and IR from entering our eyes.It is the good filter from dangerous sun light like UV rays to burn our eye and retina.As we know our cornea has 5 pieces slice of cell to always keep it better.So here why i wanna say that we could see infrared.our cone cell and rod cell exactly can see the near IR and further but i'm not sure for UV.I by myself can see the IR with clear even on day light.But on day light it becomes the recessive light.the seen light is dominant light.The IR is also powerful if we can see it.→The question why i can see IR is because my eye cornea was burned  in an accident.and become thinner.I also can see the IR where the common cameras didn't see it.The human eye is brighter than camera.For example the general camera can't see the IR from the dead IR LED,i mean there is no battery or switching off,but i still can see it permanently emitted the  IR rays.Night is bright for me with a tiny light and the sky changes the colors every night.i mean that is not black darker sky like i've seen before.I can see the IR with different colours depending how much sensitive my eyes is.But one thing the IR can't focus well for the physical material as well as seen light,the physical material absorb the light more than reflect it.Our eye lens may be blurry for IR and may be accept a few percent.however i still can see the image well.There is true for former post that our eyes is producing the IR stronger than another parts of our body,i can see it.when i show something with my hand,its also flashing with IR.  IR reflecting well with strong light for the life creatures(warm blood creatures),the weakness is the daylight becomes so bright and i need to wear the dark sunglasses.I live in equator line where  got much of sunlight. →.But there is no longer i can see the IR because my eyes was healing normally.my eyes is ok now after treatment and for the period of time.i can't see IR anymore.Thank you for reading.I hope this is little help.

Why can't we see infrared light?


Electric potential vs potential difference

Question: What is the difference between electric potential and potential difference? In our course book, they are given as separate topics but their definition is given the same.
Comment: The electric potential is the (electrostatic) potential energy per unit charge, $\Phi = E / Q$.
Comment: The difference means a subtraction. For example, the difference between 13 and 6 is 7. So if two potentials are 13 Volts and 6 Volts, then the potential difference is 7 Volts. There is no new physics term to be understood in "potential difference". One must just understand basic English and 1st grade basic school arithmetics.
Comment: sorry for the inconvenience but now the question is corrected. I meant "potential difference" not "potential energy"..
Answer: What is the difference between "electric potential" and "potential difference"?

What is the difference between age and age difference?
If $\text{age}(\text{person})$ is the function so that $\text{age}(\text{you})$ is your age, $\text{age}(\text{mom})$ is your moms age and $\text{age}(\text{dad})$ is your dads age, then $\Delta\text{age}:=\text{age}(\text{dad})-\text{age}(\text{mom})$ is the age difference of your parents.

The elecrical potential $\Phi$ refers to a quantity with some numberic value. It is usually dependent on space and time $\Phi(\vec x,t)$, so it's a field where for every place and moment you get some number.
By potential difference $\Delta\Phi$ one denotes the difference between two such values taken at different positions. For example,
$$\Delta\Phi:=\Phi(\vec x_2,t_0)-\Phi(\vec x_1,t_0)$$
is the potential difference of the field $\Phi(\vec x,t)$ for the two points $\vec x_2$ and $\vec x_1$ at the particular moment $t_0$.
So for example, if you have a one-dimensional capacitor with electical potential $\Phi(l)$, with one plate at the position $l=0$ and the other at position $l=L$, then the potential difference $\Delta\Phi$ for these two points is the number you compute via $\Phi(L)-\Phi(0)$.

I think your question might arise because only the potential difference is the physical quantity which determines the electical field and therefore the acceleration of charges. While as age difference between persons as well as age of one person are both interesting quantities with practical value (Did I miss my mom's bithday? Am I allowed to drive? How much years will I get for homicide?), the value of the electical potential as such will eventually only be used to compute potential differences.
Comment: But isn't potential always relative to something? How can you have some absolute, definitive potential?
Answer: Their definition may appear the same but quite different. I'm explaining it somewhat differently based on my sleepy experience in Electrostatics (which is pretty simple)...
Electric potential at a point in an Electric field (for instance, let's take it as uniform) is the amount of work done in moving a unit positive charge from infinity to that point against electric forces. (attraction or repulsion)
whereas Electric potential difference between two points in an Electric field is defined as the amount of work done in moving unit positive charge from one point to another point against the electric force.
In other words, Potential difference is simply the difference of scalar potentials between two points or anything you consider...
Now let's take an example. (I'm good at painting these stupid arts...)

Say, you're placing a charge (+q) at the point O. Also, There are two points A & B in the electric field $E$ (It acts outward since the line charge is positive). Now, you want to move a charge (say +q) from B to A. Then, you've to do some work against the force of repulsion. This work done is the potential difference between two points or Voltage (i.e.) $W_{B\to A}=dV$ which further equals $-E.dx$. Electric field is simply the force experienced by unit positive charge.
If you bring the same charge from $\infty$ instead of B, it's electric potential. Using the above figure & integrating for total work done (with limits $\infty$ to some scalar distance $r$), one could derive Electric potential at a point. It's given by $V=\frac{q}{4\pi\epsilon r}$. But, you could ask, "Why this work is not stored as some potential energy?"
Yes, It is. But, Potential energy requires the magnitude of another charge also... If $r$ is the distance of separation of two charges, P.E. is given by $E_p=\frac{qQ}{4\pi\epsilon r}$. In other words, $E_p=VQ$
That's why @Lubos pointed out that $V$ is the $E_p$ per unit charge... Hope you understand :-)
(Note: These could be used only in the presence of an Electric field..!)
Answer: electric potential is the potential energy of a unit charge in any electric field. where as electric potential difference is the difference of electric potentials of two different points. it is equal to work done in carrying a unit positive charge from infinity to any point.
Answer: Potential is like the height position of water on the land. Under gravity, water will not flow between two points which are at the same height (zero potential difference).
Answer: The amount of work done in bringing a unit positive charge fron infinity to a given point in electric field is called electric pontial at that point mathematically,
$$\phi=\frac{W}{Q}$$
Work W and charge Q.
The work done in moving a unit positive charge from the point of lower potential to point of higher potential at the point is called electric potential differnce between two point
However both SI unit are volt. But they differ from each other.
Answer: The potential difference between positions $A$ and $B$ is $V_{\rm AB} = V_{\rm A} - V_{\rm B}$ where $V_{\rm A}$ is the potential at position $A$ and $V_{\rm B}$  is the potential at position $B$.
The potential $,\, V_{\rm A},$  at position $A$ is a shorthand way of stating/writing the potential difference, $V_{\rm AC}$, between position $A$ and position $C$ where position $C$ has arbitrarily been chosen to be a zero of potential, $V_{\rm C} =0$.
The potential difference between two positions is the same as the potential at one position when the other positions is at zero potential.
$V_{\rm AC} = V_{\rm A} - V_{\rm C} = V_{\rm A} - 0 = V_{\rm A}$


Does the terms stream and block ciphers apply to both symmetric and asymmetric ciphers?

Question: Does stream and block ciphers only apply to symmetric key algorithms or does it apply to both symmetric and asymmetric?
Answer: Stream and block ciphers are usually used with symmetric keys. This is for performance reasons as public-key cryptography is much more expensive.
That said, public key encryption also encrypts blocks of data (block sizes in RSA are based on the key size), so it technically uses block ciphers, we just don't usually focus on that.
In short, it's more about the cost of encryption/decryption than anything else. It would be prohibitively expensive to do public-key encryption for large amounts of data.
Symmetric keys give you cheap computation but the problem of a shared secret. Public keys give you expensive computation but easily shared information needed to communicate securely.
This is why the common approach is a hybrid one:

Key encryption key: use public key cryptography to encrypt a symmetric key generated on the fly
Data encryption key: use the symmetric key to encrypt/decrypt the actual data
Comment: So for asymmetric key algorithms we don't divide them to block or stream ciphers?
Comment: @YousifShibeika No, we don't categorise asymmetric ciphers as block or stream; that would make no sense.
Comment: There's still a concept of blocks in the sense that there's a maximum size for a unit of encryption. eg: one encryption operation in RSA is a little under the key size, so if you want to encrypt more than that you need to split your data into "blocks". But you'll rarely see blocks and stream ciphers being brought up in the context of public key crypto.
Comment: Usually? Are there any cases where an asymmetric cipher is categorized that way?
Comment: Nothing stops you from using RSA as a block cipher. It just isn't called that way because block ciphers usually mean that we're processing so much data as to make public-key crypto too expensive.
Answer: Public key encryption is not a block cipher in the standard definition of the term (a pseudorandom permutation family), nor under that of a stream cipher (an encryption scheme that XORs the messages with the output of a pseudorandom generator seeded with a random, shared secret key).
I think you're asking this out of some form of the common preconception that the concepts "block cipher" and "stream cipher" are general taxonomy of ciphers, two buckets into which we generally sort all objects that are suitable for use as ciphers.  But they're not so; "block cipher" and "stream cipher" are two fairly narrow types of object that have simply been of great interest to modern cryptographers.  There are designs that are based on different, less well-known concepts, e.g. the concept of an enciphering schemes that serves as the foundation for AEZ, one of the current candidates in the CAESAR competition.


How to change pip3 command to be pip?

Question: I uninstalled pip, and I installed pip3 instead. Now, I want to use pip3 by typing pip only. The reason is I am used to type pip only and every guide uses the pip command, so every time I want to copy and paste commands, I have to modify pip to pip3 which wastes time. When I type pip I have an error which is pip: command not found which means pip command is not taken. Is it possible to make pip points to pip3?
Comment: `alias` or `symlink` is one option, but I think going with `update-alternatives` would be better. Since, you don't want to _update_ your `.bashrc` file time and again, nor make a bunch of **symlinks** for similar cases such as for `python3` and its different versions.
Comment: please consider my answer, that, I think, is proper than an alias
Comment: As an aside, for this specific case, I'd consider using `virtualenv`.
Answer: You can use pip3 using the alias pip by adding alias to your .bashrc file.
alias pip=pip3

or by adding a symlink named pip to your $PATH, which points to the pip3 binary.
If there is no ~/.bashrc in your home directory on macOS, inputting
alias pip=pip3

in your ~/.zprofile file has the same effect.
Comment: How can I find ~/.bashrc? I retagged my post based on your recommendation.
Comment: This is the wrong answer. And a bad approach. The correct way would be to use `update-alternatives`. Check @c-z's answer.
Comment: This does the trick for me in Ubuntu 18.04 as the .bashrc checks for .bash_aliases existence:

`alias pip=pip3 >> ~/.bash_aliases`
Comment: @Ambitions actually, this only concerns Linux/*nix (Mac including), so if you're using Windows, I can't help you. In unix based systems ~ stands for home directory (or if you don't use BASH it may be some other file like .zshrc )
Comment: alias pip=pip3 >> ~/.bash_aliases worked for me, thank you TeddybearCrisis
Comment: @Ambitions For MacOS, goto Macintosh HD/Users/yourname/ directory. Putting this alias in any .bashrc or .bash_profile would work.
Comment: @Qumber do you really think that "right approach" is the one that works only on select Linux distributions and requires root privileges?
Comment: Technically `alias pip="pip3"`
Comment: it worked for me well, but whe I input the command inside a `bash` file I still receive a `pip: command not found` error
Answer: Rather than manually creating your own alias in bash and hoping this doesn't conflict with anything, most package managers should allow you to register the version you wish to use whilst maintaining dependencies.
For instance on Linux:
sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1

Or on Mac (MacPorts):
port select --set pip pip3

Comment: I can confirm that the Linux statement works. Best answer. Why change the .bashrc with alias like the accepted answer suggests, this here seems more professional.
Comment: questionto42, more professional (update-alternatives) and easier to be automated, I would say... the other solution I would say it is more error-prone. Agree, this should be the selected answer.
Comment: Selecting 'pip3' for 'pip' failed: The specified group 'pip' does not exist.
Comment: @ndemarco As far as I'm aware it just creates a link and then tracks that link to make sure it is updated when the application is updated, removed when the application is removed, and doesn't conflict with another application. The technical details of this process I'm not sure of and probably depend on the package manager. I've found Macports in particular is quite good at handling different versions of Python side-by-side, keeping the binaries separate but helpfully telling the user to (re-)run the `--set` command if they'd like to change the default version that is used.
Comment: @user3424037 Could be an older version of MacPorts (which didn't support this - see https://stackoverflow.com/questions/12557114/macports-and-the-bash-path), or Pip has been installed by a method other than MacPorts.
Comment: Now just do pip3 install --upgrade pip that will remove pip2, if you are lucky! Case here on Debian Testing! Python 2 is gone.
Answer: Solution 1
Check which version pip is pointing to
pip --version
pip 18.0 from /usr/lib/python2.7/site-packages/pip (python 2.7)

If your pip is pointing to pip2, locate where is the pip "binary".
which pip
/usr/bin/pip

This is a simple python script:
cat /usr/bin/pip
#!/usr/bin/python2

# -*- coding: utf-8 -*-
import re
import sys

from pip._internal import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

So just change the shebang from #!/usr/bin/python2 to #!/usr/bin/python3.
Now pip is pointing to pip3.
pip --version
pip 18.0 from /usr/lib/python3.6/site-packages/pip (python 3.6)

Solution 2
Remove /usr/bin/pip make make a symbolic link from the wanted pip version to it instead.
sudo rm /usr/bin/pip
sudo ln -s /usr/bin/pip3.6 /usr/bin/pip

Comment: re: Solution 2, It's worthwhile to note that since El Capitan you have to use `sudo ln -s /usr/bin/pip3 /usr/local/bin/pip` (you might have to `sudo mkdir -p /usr/local/bin` first if `/usr/local/bin` doesn't exist) see: stackoverflow.com/a/36734569/2764290
Answer: You can install pip after install pip3 by the below command:
pip3 install --upgrade pip

after that:
~ pip --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

Comment: It works only for current user:
$ which pip - >
~/.local/bin/pip
Answer: Since you uninstalled pip, this solution assumes you're only going to use pip3.

Open your terminal.

Create a simple link. To do that type:
sudo ln -s /usr/bin/pip3 /usr/bin/pip

Now when you type pip, it will invoke pip3.
Check that it worked by typing pip --version
pip --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

You're all set!
Comment: It's worthwhile to note that since El Capitan you have to use `sudo ln -s /usr/bin/pip3 /usr/local/bin/pip` (you might have to `sudo mkdir -p /usr/local/bin` first if `/usr/local/bin` doesn't exist) see: https://stackoverflow.com/a/36734569/2764290
Comment: It worked for me, besides I need to "rm -rf /usr/local/bin/pip" first.
Answer: You can write pip for pip3 after changing bashrc file in the home directory.
In mac -
Open bashrc file -
vim ~/.bashrc

Add this line at the end of the file -
alias pip="pip3"

Close the file. Don't forget to source this file in the terminal by
source ~/.bashrc

You are good to go. Now, whenever you will use pip in any command. it will be interpreted as pip3
You can check it by running the command -
pip --version

Comment: This repeats the core solution of the accepted answer of MacHala. A bit looking at the posting dates: Though this answer explains a bit more what to do with it, I do not see an upvote here for an answer 2 years after the accepted answer. A comment / edit would have done it. Apart from that. The probably best answer is that of @cz which was also before this one.
Answer: Pip is installed in /usr/bin/. If you don't have pip at all, I would suggest to install pip3 only. Make sure you don't need older version.
You can check available pip versions using following command.

ls /usr/bin/pip*

If you have multiple pip you need to prioritize your pip versions. I had only pip3 so I add it to the first priority. You can use following command and it is done.

sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1

You will get output as :

update-alternatives: using /usr/bin/pip3 to provide /usr/bin/pip (pip) in auto mode

Test now:

pip --version

You will get:
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
If you have other version for python2.7, you can use same update command and change last digit 1 to 2. This will make it second priority.
Answer: I believe one shouldn't do such a thing. Actually I would argue it's even better to not use the pip, pip3, etc. scripts ever. Instead one should always prefer the more explicit and surefire way of using pip's executable module for one specific Python interpreter:
path/to/pythonX.Y -m pip somecommand

References:

https://snarky.ca/why-you-should-use-python-m-pip/
https://snarky.ca/a-quick-and-dirty-guide-on-how-to-install-packages-for-python/
Comment: I was happy to have this answer remind me that, even though I installed `pip3` via my package manager (`apt`) rather than `python -m ensurepip` (which wasn't available on my distro), once `pip3` is installed, `python -m pip` works (assuming that python points to my python3).
Answer: This can be done by simply creating an alias for the command.
To create an alias just type
$alias new_command="existing_command"
In your case,
$alias pip="pip3"
Although this isn't permanent. OT make it permanent edit your bashrc file
$ vim ~/.bashrc
an to the end of it append the line.
$alias pip="pip3"
Answer: It depends on how you manage your python versions (system, brew, pyenv, ...) and which python installation you are currently using.
For example if you use brew then creating a simlink is a good option:
ln -s -f /usr/local/bin/pip3 /usr/local/bin/pip

validate that pip uses the correct version:
which pip

will give you
/usr/local/bin/pip

Answer: Open the shell configuration file (such as .bashrc or .bash_profile) in a text editor.
For example open it with nano sudo nano .bash_profile or with vim vim .bash_profile.
Add this function, which checks if pip3 exists and pass all the arguments received by the pip function to pip3:
function pip {
    if [[ $(which pip3) ]]; then
        pip3 "$@"
    else
        echo "pip3 command not found. Make sure Python 3 and pip3 are installed."
    fi
}

If pip3 is not found (i.e., it doesn't exist on your system), it displays an error message indicating that pip3 is not available.
Answer: Copy the pip3 file and rename as pip:
sudo cp /usr/bin/pip3 /usr/bin/pip
pip --version

and
pip3 --version

Works now.
Comment: it's really better to symlink as described in [this answer](https://stackoverflow.com/a/56512469/2764290)

How to change pip3 command to be pip?


1987 Schwinn Tempo Maillard hub rear axle

Question: I have a 1987 Schwinn Tempo with 32h Maillard "Sealed mechanism" hubs. (I'm still confused about that phrase, maybe it's a bad translation? They're completely unsealed cup-cone hubs). The axle is slightly bent near the drive side, and maybe it's distended or maybe just the axle, but the cone no longer fits flush. I can still adjust it to spin freely and with no axle play, but the freewheel and rim wobble. I am looking for either an axle or a donor hub I can take the cup from. What is the thread diameter of these axles? Wheels Mfg has nice looking rear axles which are advertised as "Shimano/ fits most japanese hubs" or "Fits most Taiwanese hubs", and ebay has a plethora of 36h hubs of the same vintage which look extremely similar. Would I be able to use the cones and axles from 36h hubs?
Comment: In case it's helpful: the dropouts are 128mm, six speed freewheel.  According to Sheldon Brown I should be looking for axle that's 10-11mm longer than the spacing, so I am looking for 137mm axles in particular.
Comment: Axle diameter: 9.5 x 26 TPI should I stock up?  seems to be a pretty rare length/dia/thread combination.
Answer: Replacing the axle has worked, but the new axle takes un-keyed washers.  It's much harder to adjust pre-load correctly between the cone, washers, locknut, and quick-release.  Bikeforums.net suggest these hubs are garbage, so I am looking into building a new wheel.


What to do with threshold for door that used to be exterior but is now interior?

Question: We converted the garage into a laundry room and 4th bedroom and are not quite sure what to do about the transition/step down/threshold from what used to be an exterior doorway. Any ideas or input is greatly appreciated.
Comment: Welcome! Are you keeping the door and its jamb but want to remove the threshold? We'll be able to make more effective suggestions if you'll provide a photo of the area.
Comment: To misuse an old saying, "pics or we can't help you"! Is it a 1" drop, several steps? Hard to tell from your description.
Comment: Sorry Gents but I can't seem to figure out how to add a picture to my question. Keeping the current jamb, replacing door and threshold. The drop is roughly 3 inches.
Comment: @FreeMan I figured out how to add a picture. See original post.
Comment: @Greg Hill I figured out how to add a picture. See original post.
Answer: Yeesh... 3" is tough.
Unless you need wheel chair access a ramp/slope is not appropriate
Yellow & black safety striping is appropriate to prevent trips, but really ugly for interior.
This is what I'd do:

I'd remove what looks like a metal threshold at the edge of the tile (just under the shop-vac). It'll probably come up by removing a couple of screws.

Then I'd cut a piece of the laminate flooring to cover the riser of the step and glue it on. Even though it's probably not supposed to be glued, that's the only way it would stay in a vertical mount.
Alternatively (as suggested by manassehkatz in a comment), use a piece of solid wood of the type that the laminate simulates for this step and the next. i.e., if you've got "oak" laminate flooring, get a strip of oak to use for this. The drawback is that you'll probably need:

Some tools (a thickness planer - either powered or hand) to make the new wood the proper thickness so as to not increase the height of the threshold, and
To spend some time with a collection of different stains and the scraps of your lumber to find a color combination and application technique to match the color of the laminate so that it looks natural. I'd suggest a trip to the Woodworking sister site for loads of details on finishing.

Next, I'd lay a strip of the laminate flooring across the door sill, covering the top edge of the vertical piece. It might need some stain or paint on the visible edge of the flooring to hide/minimize the different color of the interior vs the surface.

Finally, I'd use a plastic/vinyl or wood transition strip to cover the gap between the tile & the newly laid door sill.

I don't know what code has to say about a 3" step, but you probably didn't chew up much height from the original concrete garage floor, so you're probably OK with this.
Comment: Fair point, @manassehkatz-Moving2Codidact. I just figured that the laminate was convenient/handy.
Comment: +1 You beat me by 1 minute - I deleted my answer in progress. The only thing I would recommend differently is to *not* use the laminate. Instead, find some wood of a similar color - it does not need to be an exact match. Then cut/fit 2 pieces (one vertical, one horizontal) to match the exact contour of the step.
Answer: In all honesty... I'd entirely remove the door and jamb and wrap drywall around this instead. That'll go a long way toward minimizing the feel of "converted garage." But you have your reasons for keeping the jamb and door so I'll indulge. :-)
First get the threshold out of the way. There may be fasteners going through the threshold down into the floor, especially if this is not the original threshold for the doorway. Look for any removable strip on top of the threshold that might be concealing fasteners. If it's original the threshold is almost certainly attached to the bottom end of the jamb on both sides as well. Freeing the threshold from the jambs might take some combination of cutting/shearing the threshold as with a saw blade or a chisel, a bit of prying but not so much as to damage the jamb, etc.
Transitions like this are needed in flooring often. Choose some materials to build a bullnose to cover the concrete. To match the color and style of the lower floor you might pick unfinished or pre-finished wood like oak, maple, or alder. To match the color and style of the upper floor you might pick a strip of real or cultured stone like marble. IMHO it looks nicest when the nosing matches the upper surface so I'd choose the stone.
If you have a few spare matching tiles in storage or can get more it might help things if you cover part of this space in tile. It looks like you have about 7 inches of floor to cover, whereas nosings are often offered in narrower widths like 4 inches.
Whichever material you choose it's probably easiest to fasten with construction adhesive applied directly to the well-cleaned and dry concrete.
Photo credit: www.peakoak.co.uk and www.tileshop.com.
Comment: I considered getting rid of the door all together but this goes from the kitchen to a laundry area and then to the 4th bedroom so wanted to be able to separate the 3 different rooms as much as possible. I think I do have some extra tile but I think it would look odd as the tile that ends under the threshold is only 3/4 of a full square. So, if I went that route I'd feel like I would have to bust up the 3 tile and lay new. Matching grout would be tricky as well. This is a renthouse that's been off the market for a year due to Hurricane Laura damage and I'm trying to get it back on mkt asap.
Comment: I think I'm going to go the route of laying down some wood that matches the LVP that I have down already.
Comment: A pre-fab bullnose threshold or stair tread, eh? Why didn't I think of that?
Comment: @FreeMan Due to the width required it may yet be necessary to fabricate a custom bullnose!
Comment: I actually saw a video not long ago of a guy that used LVP on his stairs by using a stair tread as his mold and clamping the plank to it, heating it up and bending it over the nose then clamping it down while it cooled. Once it was done he'd pull it off and it was a perfect fit.


Cocoa - is there a way to check in code if the device has GPS?

Question: I want to check if the device has GPS or not.
Is there a way to do that?
Answer: Using the CLLocationManager you can see if location is enabled.
+ (BOOL) [CLLocationManager locationServicesEnabled];

However there's no way to see if this results in a location determined by cell towers, gps or wifi.
Answer: A problem exists when you are on a device with no cell and no gps.  If wifi is turned off, locationServicesEnabled still returns YES even though there is no way for the device to get location updates. This is why we need to check for gps and/or cell -- assuming they always come as a pair.  Unfortunately there is no good way to check for gps/cell.
Oddly, locationManager:didUpdateToLocation:fromLocation: still gets called in this situation, but locationManager.location is set to nil.
So the thing to do to see if locationServices is available is the following:
if ([CLLocationManager locationServicesEnabled] && [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized && locationManager.location) {

}
locationServicesEnabled checks if location services are on for the device, authorizationStatus checks if services are authorized for your app, and locationManager.location checks if location is updating.
Or so I think.


Is there a way to track a specific question through the UI?

Question: I would like to flag specific questions and either be notified of any activity on them or have them show up on my personal page. Did I miss something obvious? Can this be done in stackexchange?
Answer: Just click the little star beneath the vote count -- that will mark the question as a favorite and notify you of any activity. :)
Comment: OK that is way to easy!  There has to be something more obscure and complicated.  thanks.
Answer: I was just waiting one of my favorites was changed to answer to this question, but then other users answered it.
I was going to suggest using the favorites, which is done through the user interface, but there is a problem with how you are notified about changes.
Let's start from the beginning. First you need to set a question as favorite. (The screenshots are taken from Meta Stack Overflow, but you should do similar things on any SE sites, meta or main site.)
Visit the question page, and click on the star that you see under the voting buttons.

That's all. It was quite easy.
How do you know there are changes to the questions you have marked as favorites? You don't get any notifications from the Super drop-down menu.

Instead, you need to go to your user profile, and see if you see an asterisk on the "favorites" tab.

Select the "recent" tab, and you will see your favorite questions sorted by when they have been changed: The most recently changed question is on the top. To notice that a question is considered changed when the question itself has been edited, when somebody adds a new answer, or when somebody edits an existing answer.

If you don't visit this page much, you need to remember when you last checked the "favorites" page because you are not reported how much questions have been changed; you just see an asterisk, and the asterisk is shown whenever there is a single question changed, or the changed questions are more than one.
The suggestion made from Kevin Vermeer is the one I make too. The "favorites" tab doesn't help much, compared to the answer feed, even though you have to subscribe to a feed for each question you are interested in.
Comment: You can request a feature on meta.stackoverflow.com. Be sure the feature has not been already requested, before to create a feature request.
Comment: thanks. That's an ok workaround. I would prefer to get notified if someone posts an answer to a question where I previously posted an answer. Most likely the other answer offers a better solution and I can learn something from reading it.
Comment: Only the OP gets notified for answers provided for the question he asked. If you write an answer for a question, you don't get notified of any new answer, if you don't set the question as one of your favorite. Even doing so, you don't get an automatic notify; you just notice one of your favorite has been changed, if you check your user page.
Comment: thanks. Is there a place on SE to put in a new feature request?
Comment: thank you. There is a topic posted but without any new updates: http://meta.stackexchange.com/questions/83343/adding-favorites-to-the-stack-exchange-global-inbox. I'll be patient ;-)
Comment: Nice answer! Very step by step and graphical! I want you to answer all my questions from now on.
Answer: Since you asked for a more difficult way, I'd suggest using the RSS feed, which also allows you to track changes to a question.  If the question URL is:
http://meta.drupal.stackexchange.com/questions/559/is-there-a-way-to-track-a-specific-question-through-the-ui

then the feed is:
http://meta.drupal.stackexchange.com/feeds/question/559

You can also get this link through the "question feed" link at the lower right corner:

This isn't the same as the https://drupal.stackexchange.com/feeds recent question feed, which is in the same place.
Sorry if this wasn't obscure or complicated enough for you.


What are the costs of generating master key for symmetric ciphers?

Question: I recently read that generating large master keys for symmetric ciphers is very expensive. But what exactly do they cost? Any references would be much appreciated. I have checked NIST but actual costs seem hard to find.
Comment: Do you have some context for us? Was it in context with TLS connection establishment?
Comment: For example, using non-deterministic random number generators to produce data for a symmetric encryption master key, from which encryption keys will be generated.
Answer: The cost for generating master keys is not very expensive. It just requires secure random bit string of the same size as the key. Compare this with RSA, where a random prime needs to be generated. This may require repeated calls to the random number generator; you'd expect at least the same number of random bits for the RSA key size. Generally the largest symmetric keys are about 256 bits - far lower than the key size of even moderately secure RSA key pairs.
Now it completely depends on your requirements on the secure random number how much this will cost. If you require your master keys to be build directly upon (whitened) entropy then this may be a very expensive process if your entropy sources are slow. If you're OK with pseudo random numbers or if you have fast entropy sources, it will probably not be slow.
So it depends on the requirements and the implementation of the underlying RNG. I've seen several instances of Linux completely halt when large amount of data is retrieved from the (blocking) /dev/random. Usually it is possible to configure use of /dev/urandom instead. And usually this is as secure.


Firefox and Chromium not opening

Question: Firefox and Chromium do not open any longer. I fixed firefox by re-installing the snap. But re-installing chromium-browser did not help.
The error points to permission issues. What is the correct permission for the files and how could they have changed?
chromium-browser
/snap/chromium/2011/snap/command-chain/desktop-launch: line 52: /home/username/.config/user-dirs.dirs: Permission denied
sed: can't read /home/username/.config/user-dirs.dirs: Permission denied
/snap/chromium/2011/snap/command-chain/desktop-launch: line 261: /home/username/.config/user-dirs.dirs: Permission denied
cp: cannot open '/home/username/.config/user-dirs.locale' for reading: Permission denied
/snap/chromium/2011/snap/command-chain/desktop-launch: line 266: /home/username/.config/user-dirs.locale: Permission denied
Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
Trace/breakpoint trap (core dumped)

-rw------- 1 username username 633 Apr 24  2020 /home/username/.config/user-dirs.dirs
-rw-rw-r-- 1 username username   5 Apr 24  2020 /home/username/.config/user-dirs.locale

Ubuntu 22.04
Answer: This fixed it; purge was essential
sudo snap remove --purge chromium

Firefox and Chromium not opening


Convex mirror cut in half

Question: if I cut the convex mirror in half then how will  the image be formed??
suppose I have a convex mirror and I cut it in half then how will the focal length of the mirror change?
Answer: Focal length will remain unaffected as it depends only on radius of curvature which is constant in this case.
What will change is the intensity of the image formed because only half the light is getting reflected as compared to full mirror.
Answer: the focal length will be unchanged but only the clarity of the image will be diminished since only a part of the light is being reflected

Convex mirror cut in half


Toilet problems

Question: When it rains my toilet will act as if it is going to overflow when flushed. It goes down slowly. I live in the city and the main sewer line is in my front yard. My line connect to the main from my back yard. I've called the city out several times and they keep telling me this is normal during heavy rains. Well I think not. No one else is having this problem but me. I've called out a plumber to make sure it's not my pipe that is cracked or any other problem. There is nothing wrong. Please help!!!
Answer: Assuming the plumber has done a video inspection of your sewer line and not found any problems, if it only occurs when it rains, it would imply that you are either experiencing a backup from the city, or are close to having one.  This is not that uncommon in large rainstorms, especially in areas where there is a single storm sewer and waste sewer.  Newer areas might two separate sewer systems so this doesn't occur, but otherwise, all that rain is trying to enter the same sewer as your households waste system.
If you haven't had a video inspection, that should be your first step.  There's no other way to definitively know about an issue like roots or a collapse in your sewer line.
The next t thing I would be checking is to ensure you're not actually experiencing a backup.  A backup will occur in the lowest drain in your house - often a floor drain in the basement, or perhaps a basement bathtub or toilet.
Do you know if you have a backflow valve? If so, you should visually inspect this to ensure it is not closed.  It will automatically close if the city is backing up.  This prevents all of the cities sewage from entering your house, but it also prevents your waste from existing your house and it will instead build up in your pipes until it backs up.  If you don't have a backflow valve, I would suggest you put one of these in urgently.  The cost of the valve will be small compared to dealing with 4' of sewage water in your basement.
Comment: +1 For suggesting video inspection.  My plumber found a big wad of roots that could only be removed by replacing the section of pipe.  Chemicals didn't even scare it.
Answer: No guarantees, but this has a good chance of working.
The following sounds a bit exciting - it is. If you are able to deal with potentially dangerous stuff that is OK enough if used sensibly this may work for you. If not, get somebody else to try, or pay an expert.
It seems likely that you waste pipe is clogged either by paper and "misc other stuff" or by tree roots or similar that have entered the pipe. You don't say what the plumber or others did to check for problems but if they did not run a cleaning device down it or check it in some manner then there is no certainty that it is clear. So ...
Obtain say 500 grams / one pound of caustic soda flakes or strong caustic soda solution. This may be sold as Drain-O or perhaps lye or other names depending where you are. The chemical name is Sodium Hydroxide = NaOH.  While much less than the amount above MAY work, this much does no harm and has best chance of working.
Dissolve flakes or add solution to about on large bucket of water. This is nasty stuff - as you'd hope. Do NOT use an aluminum container. Wear old clothes. Wear eye protection. Consider wearing rubber gloves. You can " safely enough" dip your hands in a full strength solution as long as you wash it off immediately. I do not suggest you ever do that (but I have) but it helps to add perspective. It's "safe enough" if you are sensible. Solution may get hot while being made. If it all will not dissolves in amount of water used, use just enough more water to dissolve it.
When ready, pour the lot steadily into toilet. Maybe pour a little more water after it but minimise water flow for a day or so. The aim is to get concentrated solution "down there". This will make toilet paper and associated nasties water soluble and will clear many blockages. It will work on tree roots but takes longer and main effect short term is probably to remove paper tangled on roots.
If it works for days to weeks then starts to get bad again, try adding a smaller does occasionally, to deal with stubborn obstructions over time.
Comment: Red-Devil brand lye is also NaOH.
Answer: Exciting answer from Russell McMahon, but I can't help thinking its either the city or major obstructions in your run to the sewer that's the problem.
Have you done a thorough survey of all your neighbors? If you see a trend, that might move the city to action.
And if its not the city, its your plumbing. Did your plumber actually scope the line? That info would help you move forward.
Answer: The city will check the connection between the main and the sewer line going to your house. If they came out a couple of times it's probably OK, because otherwise they would have cleaned it.
If you are there when they are checking, you can try giving them some money to clean the portion of the sewer line that goes into your house.
The other option is to call a plummer and have them run a camera to inspect your sewer.
Finally, it could be just storm water backing up in your sewer line like the city says. If your sewer line is fine and the connection to the main sewer is fine, than it's probably that.

Toilet problems


Is it OK to delete uninstalled packages from Ubuntu?

Question: I ran aptitude from the terminal, and it said that I have 69,000 uninstalled packages. Can they safely be deleted without affecting system stability or functionality?
Comment: What is your definition of "uninstalled"?!
Answer: If they're 'uninstalled', they're not present on your system, so don't need to be deleted.
This number is just the count of packages available in the repositories, but not present on your system.
Answer: No doubt those packages wasn't installed in your system to be uninstalled and deleted!!!
This number in deed is number of packages available in your added repositories.
But you should know a concept when installing a package first it will download its .deb to /var/cache/apt/archives and then install this package. So indeed when you install a package its .deb binary is still available in the above directory. This directory could be cleaned using commands:
sudo apt-get clean

or
sudo apt-get autoclean

Also another important concept sometimes you install some package which needs some other dependencies. So to install this package you need to install that dependencies. Now suppose you remove this package, then its dependencies is not used anymore and you can delete them using command:
sudo apt-get autoremove

Answer: I am using Ubuntu 14.04. From time to time when I run
apt-get update

I see a message about unused packages and a suggestion to use
apt-get autoremove

Which then cleans up the packages that are not needed. If there is really something that needs to be removed, the OS will probably let you know when you apply patches.


WSOD after upgrading to 3.1

Question: I installed the new wordpress 3.1, but it gave me some problems and I had
restore everything, you'd know it help me?
Practically after updating the site was completely white and I could not
access the dashboard. I do not know if it's in conflict with some plugin or theme
... but I do not risk coming back to update: (
Can you help me? www.talkischeap.it
Answer: I had the same issue after upgrading my local environment (wordpress/xamp).
I ran http://localhost/wordpress/wp-admin/upgrade.php and then I could get back in to the admin.
I then had to update the database and upgrade to 3.1 again.
After that all seems to be fine.
Hope it helps you too!
Comment: It can hurt badly, so make sure you backup every thing you can before any upgrade/update.
Comment: so you think I should try to update again?
Comment: It´s up to you in the end, but I would give it a try. It won´t hurt, and you want to get to 3.1 eventually.

WSOD after upgrading to 3.1


Huawei App Review rejected my application due to some regions appear as country

Question: My application got rejected in app review by Huawei App Gallery, due to some regions appear as country.
Below is the Error
We quote, "[Description]: We found that it does not display correctly when selecting a country in the purchase section in your app (for example, some of the regions should not be shown as countries)"
We are using a website link and display Countrylist as a web view within the app. It's developed that way to help our members easily navigate and register to our program. The website is directed from an external website that we do not have any control or access.
Answer: For releasing APP in App Gallery you need to modify countries label to Country/Region as Hong Kong and Macau cannot be presented as countries on the area code page.
You can check below reference link about common Reasons of Rejecting Apps in App Gallery:
https://developer.huawei.com/consumer/en/doc/distribution/app/30208


autocad in vb.net

Question: I am trying to create a software in vb.net that can read autocad files and get the dimensions out of it. How can i do that. If anyone can help me it will be very helpful and will really appreciate them.
Thank you
Comment: Hi, are you looking to automate or otherwise communicate with an instance of AutoCAD or are you looking for something which is going to work stand-alone (which does not require AutoCAD to be installed on the machine)?
Answer: Here's the AutoCAD .Net developer's API Guide:
http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html
Here's a link to their developer center:
http://usa.autodesk.com/adsk/servlet/index?id=1911627&siteID=123112
Here's a couple of forums for developer's using the .Net API's:
http://forums.augi.com/forumdisplay.php?f=215
http://discussion.autodesk.com/forums/forum.jspa?forumID=152
Here's a blog entry from someone suggesting how to get started (second to last paragraph):
http://cadingandcoding.blogspot.com/2007/07/autocadnet-programming-vbnet-or-c.html
Here's a video from AutoCAD University on the API:
http://au.autodesk.com/?nd=class&session_id=66
Here's another blog entry with hints on how to get started:
http://autodesk.blogs.com/between_the_lines/2009/07/autocad-net-developers-guide-posted-online.html
Comment: Thanks for your answer Mr. Klabranche. But i dint get the codes for the same. I am searching for a sample codes for the same. If you can help me it will be very helpful and i will be very thankful to you
Answer: You can fine the getting started tutorials and respective code for AutoCAD.Net at following link:
AutoCAD.Net Tutorials & Sample Code

autocad in vb.net


How do I transition smoothly from True Neutral to Lawful Evil without disrupting the party?

Question: In our current campaign, my character has oscillated between Neutral Good and True Neutral for a long time, but recent plot events have fundamentally changed the way my alignment works.
The Short Version
After my character's third death, and first failed resurrection, a party member tried to deal with a devil to bring me back. Since that can't happen after a failed resurrection spell, the devil instead replaced my character's soul with a devil whose memory had been replaced with that of my character, making him a "fiendish eidolon". So now my character is a devil in a high-elf body, with high-elf memories, and, at least for now, a True Neutral alignment. But my DM says that over time his alignment will shift to become more and more Lawful Evil. The party has worked with/for Evil NPCs before, and even had a Neutral Evil PC in the party for a while, so it's not as if the party is fundamentally opposed to working with Evil people.
So my question, as a first-time player (in a good party) with no experience playing an evil character, is this:
How do I roleplay a smooth transition into archetypical Lawful Evil without tearing the party apart?
Comment: Reminder: comments are for helping improve the post, not for providing small or incomplete answers. Previous answers in comments have been removed.
Answer: Even Evil has friends
The biggest issue with an Evil character is that a lot of players believe that Evil means selfish, and selfish means screwing with the PC's party members. But the party members are his friends, and source of strength. This makes them part of the in-group. The Evil character may jockey to become the party leader, but he need not go against the interests of the party.
To roleplay the transition, you can start helping the party. Your character realizes that there are things that must be done to achieve the party's goals, and the party is too lily-livered to do it. You might be surprised to find that your party members like you more.
Lawful is not the same as stupid
Your character is just as intelligent as he was before, and his impulse controls is just as good. This means that he will not go picking fights for no reason. Yes, he might want to undermine the power of a Good aligned church, but the way to do that is not to behead a priest in the middle of a service and then burn the church down.
Weigh risk vs reward carefully, and always try to get the party on board with your plans.
You can still perform Neutral acts
Not everything you do needs to be Evil, or Lawful. Characters of an alignment generally act in accordance with it, but every character is more complex than checking off two boxes. LE characters may even perform Good and Chaotic deeds if it serves their greater goals! Unlike Lawful Good's reluctance to perform evil deeds for the greater good, LE has no qualms about doing good to serve the greater evil.
Comment: +1 I just started typing and you somehow stole my answer from my brain >.>
Answer: Lawful Evil isn't Lawful Dick
One of the things to remember is that you're still in a party for the same reasons you were before. Being evil doesn't mean doing whatever you want. And as SPavel wrote, you can still have friends! In your case, being evil could mean voicing a different opinion or casting a different vote for what the party should do next. Your vote could even be the same as it would before, but for the wrong reasons. Make sure you've got a good reason to remain with the party and build from there.
Lawful Evil masquerading as Lawful Good
A common theme in stories is the villain that is doing evil that believes he is doing good, or is pretending to do good. You need to find out where the law in your Lawful Evil comes from. In your case, you're a devil, but it could be more nuanced than that. Your character could become quite religious but for the wrong reasons. Use that religion to justify evil deeds. Think of the overzealous Lawful Good Paladin, whose standards for good are so high, none can possibly pass and therefore becomes too judgmental. His wrath turns to bloodlust. Or the High Priest who justifies Necromancy for the good of the people. "I was just trying to save them!", he cries in vain. Use these themes when interacting with the party; always pretend to be giving the good option but use evil means to get it done.
Evil people don't always know they're Evil
You need a motivation for being evil. In keeping with the aforementioned theme, you can justify many evil actions under the pretense of the ends justifying the means. Remember, your character isn't necessarily aware of his alignment. He might still think he's neutral or good, but his actions tell a different story. This is a great way to keep the party guessing whether or not you are actually evil. In my experience, when the DM and group have discussed a character's changed alignment, there's usually a lot of "Oooh, i remember he did that" and "Oops, I didn't think about that". It's part of the fun to look back on your story and see what came of it. This can be one of those things.
The world isn't black and white
Always remember that there is a middle ground between neutral and evil: you don't always need to pick the most extreme evil to be evil. You can be Lawful Evil and still avoid killing babies and burning down orphanages for no reason. If you feel you've become too evil, dial it back a bit. Find the right amount of evil for your group.
Avoid doing Evil on the side
Finally, avoid killing random people or sneaking away to do "what my guy would do!". You may have the desire to play out your evilness, but try to avoid doing things on the side. For one, it has a tendency to take the reigns from the group and hand them over to you and only you. Not everyone likes watching one person role play for an hour. For two, you can adversely affect your party unknowingly and then you may become Lawful Dick instead of Lawful Evil.


Filling a container with boxes

Question: I have a problem in my Algorithms Class which i am trying to solve for the past two days but I can't. I want to fully fill a container with the MINIMUM number of given boxes with dynamic programming. My container has a certain size and I have different box sizes AND quantities of them (so i have 24 boxes of size 20, 15 boxes of size 48 etc). I think that i gotta somehow modify the knapsack problem? But the knapsack is not necessarily fully filled whilst in my problem i have to fill the container completely. Also I gotta somehow connect the hypothetical value of the knapsack with the sizes of the boxes. Any hints?
Comment: Rather than thinking about how to modify the knapsack problem, I suggest thinking about how to define subproblems. As a side issue, with the knapsack problem, if values are proportional to weights, then the knapsack *will* be fully filled, if it's possible to do so.
Comment: In order to define the subproblems you mean make the recursive equation? I sure can't do that. Also, there's no any special relation between # of boxes - quantity of them.
Comment: Yes, I mean that.  Usually a good first way to try is to define a series of $n$ subproblems, where the $i$-th subproblem consists of the first (or last) $i$ items.  Have a look at the recursive equation that is being solved by the "usual" pseudopolynomial-time algorithm (I believe this is the one on the Wikipedia page) for the knapsack problem, and maybe the equations for other DP-solvable problems, to get some inspiration.  I have to work now, but I will come back to this tonight.
Comment: We get asked a lot about how to solve dynamic programming exercises, so we've written some guidance about how to approach that systematically: https://cs.stackexchange.com/tags/dynamic-programming/info.  I encourage you to read that, try applying those methods, and if you're still stuck, edit the question to show how far along that chain you've gotten, what progress you've made, and where you got stuck.
Answer: Stripping away the "story", your problem is that you have a list of numbers $v_1, \dots, v_k$ along with a target $t$ and you're looking for a set $I\subseteq \{1, \dots, k\}$ such that $\sum_{i\in I}v_i = t$.  (That is, you're looking for a collection of the numbers that add up to $t$ and you can't use any number more times than it appears in the initial list.) This is known as the subset sum problem.
You can solve it with classical dynamic programming.  The intuition for all such dynamic programming problems is the following.

Step through the values $v_i$, $1\leq i\leq k$ one at a time.
Any sum that can be made from $v_1, \dots, v_i$ either contains $v_i$ or it doesn't.

If it contains $v_i$, then its value is $v_i$ plus some sum you can make from $v_1, \dots, v_{i-1}$;
if it doesn't, it's just a sum from $v_1, \dots, v_{i-1}$.

Naively, you'd do this by recursion but that involves lots of recalculation so it's very inefficient. Instead, you build up a table that tells you, for each $i$ and each possible sum $s\leq t$, whether you can make sum $s$ from $v_1, \dots, v_i$.

Filling a container with boxes


Loading image in several passes

Question: I know it is possible. I have seen it a couple of times, but it always struck me with: "how did they pull this off?". Those images that build up while loading, it's some kind of progressive image loading. It starts out with a low res version, and then a slightly higher res, and then slightly higher until full quality is loaded. Would anyone know how to do this?
Answer: While progressive jpgs now display in flash (up until fp 8 or 9 they didn't, I can't quite remember which version), I don't believe they actually load progressively. There are some solutions out there for faking it, you can always load and resize smaller images, but that's not very efficient.
Ted on flex has another solution to display an image as it loads, but it's not exactly what you're looking for.
http://www.onflex.org/ted/2007/12/progressive-image-loading-with.php
Answer: You probably just want to use an image saved as a progressive JPEG. It's up to the image display to show the image as each pass is rendered, however, and I'm not sure if Flash does this, or waits until the completed image is ready.
Answer: I've never done this myself but I'd probably just take 6-7 different resolution versions of the image and alpha-tween them on top of each other. In other words have the lowest res version tween from 0%-100% alpha and then have the next lowest res version tween in on top of that etc, etc.
You might need to manipulate the images in photoshop beforehand to get the effect you want.

Loading image in several passes


Is 'SELinux enforcing' responsible?

Question: My HTC android mobile is rooted after unlocking the bootloader, but it is with S-ON. When I write some files(I mean copy and paste) inside my '/system' partition for the purpose of applying a 'Mod', it works , but whenever I make a reboot, those files vanish. Is it due to 'S-ON' or is it due to 'SELinux enforced' ? What for is 'SELinux permissive' required?
Answer: It is due to S-ON, so changes made to /system while the phone is running is not permanent, and will be reset upon a reboot of the device.  For information on SELinux in Android, review this link https://source.android.com/security/selinux/.
A brief explanation, taken from the above link:

"With SELinux, Android can better protect and confine system services,
control access to application data and system logs, reduce the effects
of malicious software, and protect users from potential flaws in code
on mobile devices."
"Permissive mode - in which permission denials are logged but not
enforced."
"Enforcing mode - in which permissions denials are both logged and
enforced."

Is 'SELinux enforcing' responsible?


Which sci-fi short story had musically talented teens who must choose between long life or normal life span and musical immortality?

Question: I remember a short story where talented teens had to choose between extended long life or a normal life span. They had to choose before a certain age and the procedure, once started, could not be reversed. The story was about a teen boy and teen girl, both music prodigies, who had to make the choice. The girl chose long life but the boy decided to turn it down, thus making his music immortal instead.
Comment: I don't believe it is what you are looking for, but Orsen Scott Card's [*Songmaster*](http://en.wikipedia.org/wiki/Songmaster) matches a few points and may be in a similar vein. The Wikipedia page notes its relationship with a short story "Mikal's Songbird".
Comment: Yeah, I do remember this. They started off on a spaceship when they were really young kids, just separated from their parents because they were prodigies. Then they were transported to this school area, where only mortals lived and taught them - there was this old female teacher, a musician, who wrote a magnificient symphony which they performed. The girl witnessed the old woman dying, which made her choose immortality. It was all very poignant, primarily dialogue-driven. I read it in Hungarian, in a later Galaktika, so it was definitely written before 1985. I'll try to dig up that issue.
Comment: I think I remember this. They were on a space station of sorts, no? The choice was all the more meaningful because immortals lost their talent to "create", so this system of choice for prodigies was in place to prevent the stagnation of the race. I think. I'll dig up my books in a day or two.
Answer: I think this is one of Sharon Webb's stories, later a book series.
Series: Earthchild
When all the people of Earth become immortal through the Mouat-Gari process, Kurt Kraus, minister of World Culture, realizes that all creativity has died, and he must find a way to restore it.
"Earthchild Rising" may be the story (IASFM July 1981) or "Variation on a Theme from Beethoven".

Comment: Yes! The one I was thinking of is *Variation On A Theme From Beethoven*, I'm pretty sure this is what Morgus is looking for too. It's a mighty fine short story. I'm surprised and glad to hear there's more of it :)
Comment: You're correct. I just reread "Earthchild Rising"; that's the one in which Kurt learns of his immortality.