How to find the exact category of a published article in a multiple-category journal?

Question: I need to find the quartile of a journal(Advances in Space Research) in the specific year that my article was published. I can reach the journal metrics on Scopus and see the quartiles and details. However, the problem is that since 2018, the journal started to list six categories and our article is actually an interdisciplinary study, which falls into three categories at the same time. In that article, we are reporting our studies about some ionospheric measurements. So the article fits in atmospheric science, space and planetary science, and general earth and space science category. According to Scopus, the journal has different rankings/quartiles in all these categories. As the ionosphere is part of the atmosphere, I feel the study is closer to atmospheric science and I am listing it as in the atmospheric sciences category, but I can not be sure if this is correct. The journal web page does not show which category your article belongs to, either. So, does anybody know of a way to tell the exact category of an article? I would greatly appreciate it.
Comment: What does it mean for a journal to have a "quartile"?
Answer: None of this matters intrinsically or objectively: what it means to be in a quartile, what it means to be in a given field, etc, are all imposed subjective measures.
You say you "need to find the quartile" but I very much doubt you need to do this for your own purpose. Rather, perhaps someone has requested that you do this, and in that case, what is most important if you want to make that someone happy is that you provide them information that they are satisfied with. If they have determined that "quartile as defined by Scopus" is the measure they care about, then you have that part of the puzzle solved. The other part is "quartile of what category", so you'll have to either A) Use guidance provided by the person/organization requesting the information in the first place, or B) Use your best judgment of what you think is right or think you can justify if they question your choice. You might find it easier to justify a particular field if the journal organizes papers by field and placed yours in one of these categories, but not all interdisciplinary journals will do such a thing.
In summary, unless you have more specific guidance about how to do this, the category is the category you feel fits best and that you feel you can best justify.


If plaintext is random, how does it affect my choice of encryption algorithm?

Question: I want to encrypt a key file, which is assumed to be truly random (generated with hardware RNG, for instance). Given that there are no patterns in the plaintext, what implications are there for my choice of encryption algorithm? Could I get away with something as trivial as a Vigenere cipher (or XOR equivalent)? Assuming the keyspace is substantially large to prevent brute-force attacks, what other vulnerabilities are there when the plaintext is random?
Comment: In the research community there is some work in what we call [entropic security](http://en.wikipedia.org/wiki/Entropic_security) which deals with this kind of question. In practice, however, is there a particular reason to not us a widely accepted standard?
Comment: No good reason. Mostly just so I didn't have to put in the effort of finding, using, and distributing a library to do the encryption. But given the potential risks, I guess I'll just suck it up and find one =). Thanks for the lead on a new topic to study.
Comment: As there is no connection between the plain texts, you may consider using symmetric ECB encryption. It's the one use case where it does no harm. Of course, ECB encryption does have very few benefits over CBC or - for parallelism/speed - CTR mode encryption, so you may as well forget about that too.
Answer: Generally, no, but it depends somewhat on what you want to do with your random file.
For example, let's say you want to send the random file to your friend for use as a one-time pad.  Since you're worried that someone might be intercepting messages between you and your friend, you decide to encrypt the pad with a simple Vigenère cipher, like this:
$$P'_i = (P_i + K_{i \,{\bmod}\, L}) \bmod N$$
where $P$ is the original one-time pad, $P'$ is the encrypted pad, $K$ is a key (of length $L$) known to you and your friend, and $N$ is the size of the alphabet.
However, let's say that an adversary does intercept the encrypted pad $P'$ and saves a copy of it.  When your friend uses the decrypted one-time pad $P$ to send you a message $M$ encrypted as
$$M'_i = (M_i + P_i) \bmod N$$
the adversary intercepts that too, and uses the encrypted pad $P'$ they captured to decrypt it:
$$\begin{aligned}
M''_i &= (M'_i - P'_i) \bmod N \\
&= (M_i + P_i - P_i - K_{i \,{\bmod}\, L}) \bmod N \\
&= (M_i - K_{i \,{\bmod}\, L}) \bmod N
\end{aligned}$$
Now they have a string $M''$ which is simply $M$ encrypted with the same simple Vigenère cipher that you used to encrypt $P$ into $P'$ (except that the key has been negated, but that's a minor detail), and they can use standard Vigenère cipher breaking techniques to try and recover $M$ fairly easily.
Comment: Thank you, a very clear answer. I feel stupid for not thinking of this =).


Do push ups build/increase mass?

Question: I've added 300 push ups per day for the last few months to my routine. Is this building muscle mass?
Comment: If you've already done it, shouldn't you be telling us?
Comment: Maybe you could describe those other variables? The information you've given is not sufficient to form a coherent question.
Comment: It was an addition, so too many variables to make a sound conclusion.
Comment: Dave, the question is simply, can push ups increase muscle mass? Other variables would be the rest of my workout, flys, chest press, etc. including nutrition
Comment: For some people, walking can increase muscle mass. For others, it's can be merely cardio.
Answer: Most likely if you're able to do 300 a day then the answer is YES, probably, but NOT significantly, it isn't build any significant mass. If your able to do 300 push ups then, for your body weight / strength ratio, it's more than likely below 15% of your 1RM in say bench press. Therefore, this activity is best described as an aerobic or endurance training without adding much in strength or mass.
When you go beyond >15% of your 1RM then there is little measurable increase. With the traditional Push up, you're lifting around 65% of your body weight. I assume that if you're doing 300 that you're probably doing 50-75+ in each set. There has bee considerable amount of research on this subject. This article explains it very well.
In order to build mass you need to be lifting at a higher weight / lower rep ratio. With extreme of the bulk building exercise philosophy, typically this means lifting weights that are around 85%-95% of your 1RM with a lot of sets resting around 2-3 min between and targeting around a maximum of 6 in each set. You could adjust it to as low as 50% of your 1RM, though there may be some, there wouldn't be much of an increase in mass.

Thant said push ups can increase muscle mass under certain circumstances. It's all relative to your 1RM and your body weight. For example, if the person doing push ups can only do =<25 at a time. This follows the high weights/less reps model. So, if you're only able to do less than 25 per set than this could definitely have a measurable impact on mass/strength.
Nutrition also plays an important factor. For example it your not getting enough protein your body will not have enough resources to build mass with. See protein calculators like this one for more info. Personally, I think it over estimates how much you need but it gives you a general idea.
Some endurance activities will have some measurable effect on strength but when it is this low of a percentage relative to your 1RM, it will have very little effect on mass/strength.
To sum it up, it's all relative you your 1RM how much any given exercise will potentially increase your mass. The lower the percentage of weight relative to 1RM the lower the mass and strength gains. The gains in strength will decrease exponentially as the weight goes down.
For More Information See:  http://www.jtsstrength.com/articles/2014/09/15/percentage-based-programs-revisited/  http://www.bodybuilding.com/fun/bbinfo.php?page=MassGainPrograms  http://www.bodybuilding.com/fun/topicoftheweek11.htm

Do push ups build/increase mass?


Sampling Audio Signal

Question: I generate a 19kHz audio signal with sampling frequency of 44100 using Matlab. Due to the sampling, some other frequencies are generated in addition to the 19 kHz signal. When I play this audio, I hear additional voices. How I can remove these additional sides? I think it needs aliasing filtering, but I cannot filter signal after DAC, because I generate the audio signal and play it with phone or computer, I cannot put any filter after A/D.
Comment: If you hear any additional voices, it's not due to sampling at 44100 Hz alone; the images (on D/A side, it's "images", not "aliases") introduced by that are impossible to hear for a human. Your 19 kHz tone, by the way, is also impossible to hear for humans unless they are young-ish.
Comment: Anyway, a reconstruction filter (the filter you need to put after a D/A converter to avoid spectral images) **has** to be analog.
Comment: (I hope I'm interpreting "I generate a 19 kHz signal at a sampling rate of 44100 Hz and play it" correctly, as in you're *digitally* generate that signal and play it through a D/A converter (playback side of a soundcard))
Answer: If your code is working correctly, than there should be no aliasing.
Most likely this is a problem with your playback system. Most sound cards in computers are terrible and will create a lot of noise and other artifacts. Since the 19 kHz tone is inaudible for most people, you just hear the artifacts.
It's also possible that you turn up the volume too high. The 19 kHz may easily clip your playback hardware. You can't tell if it's "too loud" since your auditory sensitivity  at 19 kHz is basically zero. You may have also clipped the sine wave when sending it to the sound card.
There is also the software stack: On Windows, most sound will go through the kernel mixer, which often applies sample rate conversion and other processing. It's default behavior is quite bad, so this is also likely to create a lot of artifacts and noise.
Playing sine waves cleanly requires decent equipment. Typically a good external sound card and a dedicated SW driver that bypasses the operating system. You can try saving it as a wave file and play it over some "known good" hardware.

Sampling Audio Signal


Is there any limitation on the number of applications that can be signed with one certificate?

Question: I bought a code signing certificate (in my name) for windows and I signed 2 apps with it (the 32 bit and 64 bit versions of my app), both apps seems to be signed properly but I don't know if each certificate should be used for one app or can be used for multiple ones? could it cause any problems? thanks
Comment: Only as many Angels as can dance on the head of a pin.  No, there should not be any limit, and it would be quite difficult to enforce one even if they wanted to.
Comment: I think the signature will work for all apps as publishers release many apps with the same certificate.
Answer: There is no limit.
It is worth noting that in most cases, the purpose of a signing certificate is not to certify the contents itself (in this case, the app), but its origins. Multiple apps signed with the same certificate would point to the fact that they're originating from the same source.
Answer: Whether you have adopted code Signing Certificate of any certificate Authority, there is no limit to sign Application, Software or Documents.
You are allowed to sign any number of Apps, Software & documents.


Simulation of a dynamic search and matching model

Question: I want to simulate a search and matching model very close to the canonical model developed by Pissarides. I am interested in representing the trajectory of the unemployment rate when the unemployment insurance parameters are changed by the government.
I have never done numerical simulations of general equilibrium models before so I don't really know where and how to start. I am coding in Matlab, and I began by calculating the steady-state equilibrium values of the endogenous parameters but I would also like to model their dynamic behavior, in particular the transition to a new steady-state. Do you know how I can do that ?
Thank you !
Answer: Not yet search and matching, but QuantEcon may be a useful start to get into the computation.


How to limit access to manage/create contacts by type via user roles?

Question: Have a small franchise type non-profit organization in which multiple level users within the org need access to tools within civi, however, we do not want base level users that are managing their individual school sites to be able to add higher up organizational type contacts (like other school or club locations or regional type centers). We just want them to work on their individual members only, and to limit the availability of specific management/access of contact types based on their specific roles.
We are using the Relationship extension to manage permissions on their own members down the chain of command, but we need to cutoff the chain of possible contact types they have access to and also hide those possibilities in the nav menu.  Any help is much appreciated!!!  *using civi 5.2.2 and drupal 7
Answer: This may not be the answer you hope for, but the way we have approached this for other multi-level sites is to keep the 'lower level' users completely out of civicrm and give them everything they need via Views and Webforms.
Comment: Thanks for the reply, and yeah, definitely not the answer I was hoping for, as this contact type management is the only aspect we really need to limit for our site locations (that we currently know of), and would really be a bit of a pain to add all those other types of pages and options.  And unfortunately I am just volunteer help that doesn't know coding well.... That's really too bad to hear... everything else is lining up really nicely.
Answer: We have done this by creating groups in OG, synching them and adding ACL's for each group. This way, they are able to view and edit their own contacts. Furthermore, we created some super-roles which are allowed to view and/or edit all. Doing so we are even able to have one contact which may be a member of two groups.
Comment: are you manually creating each ACL? we did work to automate this and also to eg build an OG for everyone with Relationship type X with Contact Y, and separately, everyone who signs up for Event Z, ie if Event Z is of type Q then create an OG, then add everyone who registers.
Comment: I have created the ACL's via the OG Sync. Then I duplicated them to differentiate in read/update permissions.
Which extension are you referring to, @petednz?
Comment: sorry it didn't get published as an extension, was part of a custom module for a couple of clients. we can probably extract it but may not happen in the near future


Who introduced the mixed fraction notation?

Question: Who introduced mixed fraction notation? This notion is a source of confusion to me because it may be interpreted as multiplication.
Comment: Please don't write in ALL-CAPS.
Comment: I would guess notation $2\frac12$ is far, far older than juxtaposition for multiplication.  And older than decimals $2.5$ for fractions.
Answer: in 1202, Leonardo of Pisa (= Fibonacci) was the first European to do it, but Arabic writers preceded him.  He wrote the fraction to the left of the whole number (e.g. $\frac12 12$) following the Arabic usage; note that Arabic is written right-to-left. At the time it was not confusing, because he did not write products by juxtaposition.

In Wikipedia
we find a discussion of historical notations for fractions.  In particular

The same fractional notation—with the fraction given before the integer[30]—appears soon after in the work of Leonardo Fibonacci in the 13th century.[33]

References are
[30]  Miller, Jeff (22 December 2014). "Earliest Uses of Various Mathematical Symbols" link

The horizontal fraction bar was introduced by the Arabs. "The Arabs at first copied the Hindu notation, but later improved on it by inserting a horizontal bar between the two numbers" (Burton).
Several sources attribute the horizontal fraction bar to al-Hassar around 1200.
When Rabbi ben Ezra (c. 1140) adopted the Moorish forms he generally omitted the bar.
Fibonacci (c.1175-1250) was the first European mathematician to use the fraction bar as it is used today. He followed the Arab practice of placing the fraction to the left of the integer (Cajori vol. 1, page 311).
According to the DSB, Abu Abdallah Yaish ibn Ibrahim ibn Yusuf ibn Simak al-Umawi (14th or 15th century) insisted that the horizontal fraction bar be used, whereas easterners continued to write it without the bar.
The bar is generally found in Latin manuscripts of the late Middle Ages, but when printing was introduced it was frequently omitted, doubtless owing to typographical difficulties. This inference is confirmed by such books as Rudolff's Kunstliche rechnung (1526), where the bar is omitted in all ordinary fractions but is inserted in fractions printed in larger type and those having large numbers (Smith vol. 2, page 216).

[33]  Cajori (1928), p. 89  link


Succulent (aloe?) with strange growth coming from the stem

Question: I inherited a mystery house plant that I assumed was some type of aloe. Honestly I wasn't too worried about it (it seemed happy and pretty enough) until it got these yellow growths where the leaves meet the stem. I've never seen it before and the rest of the plant seems to be business as usual.
Can anyone identify the problem and/or the plant?
Comment: Couple of queries - how long has it been in the same pot, and how much direct sunlight  does it receive?
Comment: Thank you for replying! It was repotted maybe 6mos ago as it needed a larger pot. And no direct sunlight. It's in a very sunny bathroom thanks to the skylight, but tucked away from direct light due to the angle of the roof.
Answer: Those are roots! Most likely because you have it where the humidity is high. Great time to propagate if you want! ❤
Answer: I think your plant is an aloe of some variety - its growing rather haphazardly, probably because of the lack of direct daylight.
The brown things are adventitious roots, which may well be a signal that the plant  is not entirely happy with its growing conditions, and the roots will grow longer in an attempt to locate themselves in better conditions. They also do better in non transparent pots, just an ordinary pot with drainage holes  will do.
Care instructions here https://www.almanac.com/plant/aloe-vera but note that not all Aloes are Aloe vera - I am not sure which yours is because it's so leggy, so don't use the juice from cut leaves if you are not sure of the variety.


acceleration of particles - thought experiment

Question: The Large Hadron Collider accelerates particles to 99,9999991 % of the speed of light. And I understand that you need infinite amount of energy to accelerate it to the speed of light. What would happen if the Collider was vertical and you could use the force of gravity - would that change something? I understand that light has no mass and therefore no acceleration is possible - but the particle accelerated has a mass and therefore gravity should have an accelerating effect, or am I wrong?
Answer: Your reasoning is correct in theory, but flawed in magnitude.  Placing the Large Hadron Collider vertically would have little to no effect on the final velocity of the particle.  Since the particles fired through the collider are nearly massless, the potential energy of the particles is very, very small.  The corresponding increase in final velocity will be insignificant compared to the final velocity in either case.
In addition, as Kyle Kanos points out, building the collider vertically would present some severe engineering challenges, which easily would wipe out any minimal gains in terms of increasing maximum particle velocity.
Answer: Since the collider is a big circle, even if you mounted it vertically it would make no difference, because half of the time, the particle would have to oppose the gravity.  But the other answers are also correct in that the magnitude of any effect due to gravity is too small to make a difference anyway.
Comment: yes but when it is slowed by gravity you only need a finite amount of energy to keep the speed constant until the particle reaches freefall, where the additional acceleration comes to play.
Comment: @Bobulou if you need to _add_ extra energy to get the proton up over the top of the hill so that you get back the exact same amount of extra energy when it comes down the other side, then what have you gained?  Might as well just leave the ring where it is, and add the extra energy.  Unfortunately, the amount of extra energy that you are talking about is so small compared to what they are already using that I doubt their instruments could even measure it.
Comment: What would happen if you reach those  99,9999991 % of the speed of light at the top?
Answer: It really won't help much. It's the weakest of the fundamental forces, and it can't be used to overcome fundamental issues regarding the speed of light without some exotic features (wormholes, negative masses) which we don't have good access to on Earth.
Comment: Plus the support structure needed for a ~few km long linac might be a bit extreme.
Comment: @Bobulou: You are correct if you replace "velocity" with "acceleration", and with the caveat that we're talking about "close to the surface of the Earth." Even in totally classical mechanics, you would need a path of length $1/2 g (c/g)^2$, about 10000 times the orbital radius of Neptune, to get to speed $c$. If you factor in the $1/r^2$ dependence of the force law, it turns out that there's a parameter called the "escape velocity" which is the speed of a particle which falls into earth from an infinite distance, which is only 0.003% the speed of light. It just won't help much.
Comment: But velocity is constant for any mass, or am I wrong? So no matter ho small the particle is it has a mass and therefore a velocity of 9,8 m/s^2 in freefall.


Can one reduce the monero pruned blockchain further below 25gb?

Question: Bitcoin core has the ability to prune its blockchain all the way down to 550MB, but monero after pruning is 25GB. Why can't monero also give users the ability to prune to an amount of our choosing?
Answer: Technically, it is possible to decrease the size further.
However, there are diminishing returns, pros and cons of futher pruning (currently, a pruned node can still serve some of the blockchain, by design), pros and cons of ease and speed of accessing data (some data is kept duplicated in the database for lookup purposes), etc.
You bring a comparison with Bitcoin, and one important point of difference between the two is that Monero's RingCT outputs are pretty much never known spent, so you can't drop these ever, whereas Bitcoin can.
Answer: See also this great response: https://monero.stackexchange.com/a/12290/12417
An important point is that you still want the pruned nodes to have at least some value to the network, and for that they need to keep some blocks at least.


Binomial Pricing Model d and u

Question: In the binomial pricing model, why do the magnitude of the up factor $(u)$ and down factor $(d)$ have to be multiplicative inverses? I have read from multiple sources that the reason for this is that an up move followed by a down move $(ud)$ will have the same effect as a down move followed by an up move $(du)$, which simplifies calculations. However, doesn't this property still hold when $u$ and $d$ are not inverses? For example, $1.1*.8 = .8*1.1$
Comment: It is just convenient that an up move followed by a down move is the same as no move. So up 10 times, down 9 times, in any order, is the same as up once.
Comment: To expand on @DimitriVulis s answer: this is the so-called *recombining property* of the tree. It has been put there deliberately so that the number of nodes increases only linearly in the number of steps instead of quadratically. You could easily drop the assumption (but you have to *fill* the degree of freedom) and come up with another tree - which will not be recombining, though.
Answer: It does not need to be so always. You can always relax that assumption and come with the pricing by using the fundamental principles. As @Kermittfrog and @Dimitri Vulis commented it is just a matter of convenience for calculations and is called the recombining property.
You can find an example in this link here which does not use this assumption to price the options.

Binomial Pricing Model d and u


Output of Python script not shown in Eclipse console

Question: Using Eclipse Juno under Windows I have configured an external tool that calls the Python.exe program, with a Python script file to run as argument (the latter in between double quotes, like "C:\script.py").
I have also double checked that in the external tools configuration window, in the "Common" tab the option "Allocate console" is set.
However, when I now run this external tool, no Python output at all is shown in the Eclipse console.
On the other hand, when I define another external tool, calling cmd.exe, then I can see all output from that shell in the Eclipse console fine.
Moreover, when I run python.exe "C:\script.py" directly from a Windows shell window, then I can also see all output comming from this Python script. Also when I run the Python script in Eclipse using PyDev directly (where I have developed the script), then again its output is shown nicely in the Eclipse/PyDev console.
So, the Eclipse console does theoretically work fine with external tools, and the called Python script does print output. But running the Python script as external tool does not show any output in the Eclipse console.
Any ideas?
Answer: This might be a limitation of Windows that some output cannot be read other programs. I don't understand it myself yet, but it might be related to this.
Comment: Well, I switched to PyCharm and it works great, IMHO much better than Eclipse. At least in this case :)


Cloning a dual boot system from HDD to SSD

Question: I'm planning on replacing my laptop's HDD with a 256GB SSD, but I have a dual-boot (12.04 and Windows 7) setup and I'd like to be able to directly migrate Ubuntu over without having to reinstall and lose all of my settings. GParted reports the following partition setup on my HDD. I am, of course, able to modify it if necessary.
/dev/sda1 (NTFS) 66.92 out of 200.00 MB used

I'm honestly not sure what this partition is for. Maybe for Windows 7 system files? I'm hesitant to mess with it. (edit; it turns out it is a partition for Windows recovery files in the event of OS corruption, so I don't want to remove it. Plus it also appears to be a major pain to remove anyways)
/dev/sda2 (NTFS) 116.35 out of 339.06 GB used (boot)

This partition is the C:/ drive on my Windows installation. I don't use it on my Ubuntu installation, except it is the boot partition and thus has grub on it.
/dev/sda4 (extended)
> /dev/sda5 (ext4) 14.49 out of 91.34 GB used
> /dev/sda6 (linux-swap) 5.92 GB

These are my Ubuntu partitions. /sda5 contains my documents and all of the files I use on Ubuntu, and (as far as I know) the system files for Ubuntu itself (it's the partition I created when prompted by the Live-DVD installer). /sda6 is, of course, the swap partition which I only need for hibernation (6GB of RAM).
/dev/sda3 (NTFS) 9.89 out of 14.75 GB used

This is an annoying partition that Lenovo created to store some drivers and files that I might need later on. For example, it allows me to use OneKeyRecovery for a quick factory recovery if absolutely necessary, not sure if that'll work on an SSD. It also contains not-so-important files for bloatware installation.
In total, my HDD only has about 150GB of files on it so it should fit comfortably on the SSD. The problem is, I want to exactly migrate my files, partitions, OSes, MBR, etc. from my HDD to my SSD and I'm not quite sure how to do this. I've seen CloneZilla referenced before, but I'm not all too experienced and the documentation for it quite frankly seems a bit like a foreign language to me.
So, put simply, is there any way I can exactly clone this HDD to an SSD without a massive headache? Also, if it matters, I'll probably be using an external hard drive case (as recommended in online tutorials) to externally attach the SSD to my laptop during the cloning process due to the lack of two hard drive slots in the machine.
Answer: Since you are moving from a large HD to a smaller SSD, you will need to copy partitions rather than "clone" the original hard drive.
Regarding the use of Clonezilla and "the documentation for it quite frankly seems a bit like a foreign language", have you seen the following two references?  Both indicate how to resize the HD partitions, and copy the reduced-size partitions to the smaller SSD.
How to Clone Hard Drive to Smaller Drive
http://geekyprojects.com/storage/how-to-clone-hard-drive-to-smaller-drive/
Replacing A Disk With A Smaller One Using Clonezilla Live
http://preview.tinyurl.com/cnjm6yg
For me, the "foreign language" came in the form of Clonezilla's interface.  I have never seen so many error/warning messages and had to fight my way through multiple text-based menu screens.  However, the good news is that, once you have prevailed with the setup procedures, Clonezilla actually works flawlessly.
Finally, be prepared to use a Windows Recovery Disk to reset the MBR (since Windows seems to object to partitions being moved around) and perhaps also Rescatux (http://www.supergrubdisk.org/rescatux/) to re-establish the GRUB menu after Windows "thinks" it is back in control.
Comment: quick question: will simple cloning work for a dual boot system?
making it a separate question might make it a target for the label duplicate.
Answer: You should use Clonezilla Live. It's sort of like the Linux equivalent of Norton Ghost. Just boot off the CD and make an image of the entire disk onto an external hard drive.  It does not matter what O/S you are trying to backup or restore. It will take a "snapshot" of the entire disk and lay it back down onto the new disk. It is very useful for whole-disk recoveries when disks sizes may have changed.
Answer: Clonezilla allows you to fit the drive data to a smaller drive if there is enough space.
Read the following Question and Answer taken from the "FAQ/Q&A for DRBL and Clonezilla" web page:

Is that possible I can restore to smaller HDD when the image was taken from bigger one? Or to clone a larger disk to a smaller one?
This is always a challenge to Clonezilla because it's block-based tool, not file-based one.
Two possible solutions:

Method 1: If you are sure the used data blocks on the source disk are within the disk boundary of destination one, yes, it's possible to make that with the options "-k1" and "-icds" enabled in the expert mode.
Method 2: Use Clonezilla live >= 2.6.7-28 or 20200703-focal. For older version it does not always work.

First use GParted live to resize and move the partitions in the source disk, and make all partitions to be equal to or smaller than the size of that in the destination disk. You have to make sure the boundary of last partition in the source disk is within the limit of destination disk.
Then boot Clonezilla live.
For disk to disk, follow this.
For image to disk, follow this.
The only difference is, just remember to choose expert mode, and enable "-icds" (while do not choose any option about "-k*").

You might have to re-install GRUB2 once the cloning process is finished.
Answer:
Make separate images of your partitions to an external usb disk using Clonezilla.
Format your SSD disk and create at least one partition (ntfs).
Copy the image of your windows partition on the SSD disk. Restart the computer.
Install fresh ubuntu beside windows. Restart the computer.
Copy the image of your ubuntu partition on the new ubuntu partition (overwrite it).
Now you can resize or create new partitions with Gparted.
Answer: Recently I faced the same problem. I managed to solve the problem using below method.
Warning: please create a backup if you aren't aware of what you are doing. Since, we are manipulating grub. If there is some error grub, you won't be able to boot into the system.
Since, our main focus is to shift Windows + linux from one disk to other.
So, firstly make a clone of all the necessary partition on SSD.
Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048   1023999   1021952   499M Windows recovery environment
/dev/nvme0n1p2   1024000   1228799    204800   100M EFI System
/dev/nvme0n1p3   1261568 312763164 311501597 148.5G Microsoft basic data
/dev/nvme0n1p4 312764416 314572799   1808384   883M Windows recovery environment
/dev/nvme0n1p5 314574848 666136575 351561728 167.6G Linux filesystem

This is my SSD partitions. Window + linux partition.
So try to clone all the partition except the other unnecessary partition like D:// or E:// or other.
NOTE: for Cloning you can use Macrinum software. Free version will work for this case.
Now, we have ssd with all the necessary partition(Window + linux + other).
So, we just need to add entries in grub for new OS in other drives.
Boot to linux and try updating grub using command update-grub in terminal. And, try to reboot the system. Usually this fix the problem.
But, there exist a problem. In my case, when I was trying to enter the SSD partition from the Grub entry during boot. I was facing a problem that it was booting with HDD instead of SSD. The main reason behind this UUID.
Since, we are cloning HDD so the new SSD partition have same UUID. It creates a problem as grub confuses which partition to use as two partition have same UUID.
So, we will change the UUID of linux partition in SSD using tune2fs.[https://unix.stackexchange.com/questions/12858/how-to-change-filesystem-uuid-2-same-uuid][1]
Now, we have unique identification of partition.
Again, try to upgrade grub using update-grub.
You can use grub-customizer tool in linux for manual modifying the entries of grub.
This solved my problems.


Why does HSBC ask whether one plans to receive or send international wire transfers when creating a new HSBC Direct savings account?

Question: Why does HSBC ask whether one plans to receive or send international wire transfers when creating a new HSBC Direct savings account?
Comment: I don't know for definite, but a good hypothesis would be to help reduce fraud. If you tell them you never plan on doing that, then they will ignore fraudulent attempts from overseas.
Comment: Just guessing but it might be because it is a foreign bank and that is their requirement?
Comment: What's the context of this question? Does it feel more like a contractual promise on your part to never use wire-transfers (in which case the wording would seem unusual, since it's hard to know that I'd _never_ want to use a wire-transfer), or does it feel more of a "survey" type question where they are perhaps trying to get an idea of how many customers _expect_ to make use of wire-transfers?
Comment: @TripeHound feels like some time-wasting paperwork, just like most of my HSBC experience. No idea if that's some contractual or something else.
Comment: Have you asked them why they want to know? There may be a simple but company-specific and unknowable-to-us answer (i.e. as part of their marketing plan, they have different products available for people who are likely to do a lot of international transfers).
Answer: Banks have to consider money laundering and other risks in providing you with an account, and the approach they take is risk based - they will want to more information and evidence for a riskier account.
For international transfers there are more federal regulations and a particular requirements to flag up suspicious transaction individually or collectively over $10k, especially if international. (just as you have to declare it if you carry >$10k in cash going through customs). So if you are going to want to use the account for international transfers there will be additional KYC and monitoring.


Difference between JVM and HotSpot?

Question: What exactly is HotSpot and how does it relate to JVM and OpenJDK? Is it a library? What exactly does it do?
Also, what is the difference between OpenJDK and HotSpot?
Answer: The definition of what exactly is a Java Virtual Machine is stated in the Java Virtual Machine Specification
The JVM is by definition a virtual machine, i.e. a software machine that simulates what a real machine does. Like a real machine, it has an instruction set, a virtual computer architecture and an execution model. It is capable of running code written with this virtual instruction set, pretty much like a real machine can run machine code.
HotSpot is an implementation of the JVM concept. It was originally developed by Sun, and now it is owned by Oracle. There are other implementations of the JVM specification, like JRockit, IBM J9, among many others.
See List of Java Virtual Machine Implementations
The OpenJDK is a project under which an open source implementation of HotSpot (and many other pieces of the JDK  e.g. compiler, APIs, tools, etc) is developed.
Answer: Note: AdoptOpenJDK has changed its name to Adoptium after moving to the Eclipse Foundation in late 2020-06.

Difference between JVM and HotSpot?

A Java Virtual Machine (JVM) is an imaginary computer that has never been physically built as hardware. A JVM runs programs compiled to its imaginary instruction set written to storage as an intermediate representation known as bytecode.
At runtime, the bytecode must be translated from the imaginary instruction set to the actual instruction set of the CPU of the host machine. This can be done on-the-fly by an interpreter. Or the bytecode can be fully compiled and cached, to run faster than through the interpreter, in a process known as Just-In-Time (JIT) compiling.
Over the decades, there have been many implementations of the JVM. Most have fallen away.
HotSpot is one implementation of JIT technology that starts by running interpreted, and watches the actual performance of the app. Parts of the app are then selected to be fully-compiled as native code and cached, for much faster execution. HotSpot was developed at Sun as a commercial product. After acquiring Sun, Oracle further evolved HotSpot by combining important parts of their competing product, JRockit.  HotSpot is now open-sourced through the OpenJDK project, available free-of-charge.
Another such implementation in OpenJ9, developed by IBM, and now open-sourced through the Eclipse Foundation and available free-of-charge. Some JVM distributions built on OpenJDK replace  HotSpot with OpenJ9 while still using the rest of OpenJDK such as the Java SE class libraries. For example, the pre-built distributions available at AdoptOpenJDK provide your choice of HotSpot or OpenJ9 on some hardware.
Diagram showing history of HotSpot & JRockit merging, and OpenJ9 both available in AdoptOpenJDK.

What exactly is HotSpot and how does it relate to JVM and OpenJDK? Is it a library? What exactly does it do?

HotSpot is an implementation of the part of a JVM that interprets and/or compiles Java bytecode to be executed on the host CPU.
OpenJ9 is an alternative.

OpenJ9 is generally known for much faster starting and much lower memory usage initially, while HotSpot may run more efficiently overall for long-running apps. Both are well-regarded, well-worn, and available with distributions of OpenJDK.
OpenJDK is an open-source project that fully implements the Java Specifications, JSRs, and JEPs that define the Java platform. Major contributors include Oracle, IBM, Apple, and others.
Every JVM implementation I know of today is based entirely or mostly on the OpenJDK codebase and uses either HotSpot or OpenJ9 technology.
Besides the JVM, OpenJDK also provides an implementation in source code for all classes required by the Java SE specifications, such as java.lang, java.util, java.time, and other packages.

Also, what is the difference between OpenJDK and HotSpot?

The source code for HotSpot is housed, maintained, and further developed as part of the OpenJDK project. The alternative, OpenJ9, is housed, maintained, and further developed at the Eclipse Foundation, while replacing HotSpot in some distributions of OpenJDK.
Some distributions of Java technology choose to ship with HotSpot. Some distributions choose to substitute the portion of the OpenJDK codebase that is HotSpot with the alternative, OpenJ9.
Here is a flow chart graphic to help you choose a vendor for a distribution of the Java platform.
Comment: Very helpful  answer .Thanks sir
Comment: Man, now I wish all answers on SO were this detailed
Answer: OpenJDK (Open Java Development Kit) is a free and open source implementation of the Java Platform, Standard Edition (Java SE).The openjdk is a project started by Sun Microsystems, nowadays care by many companies and the community for build a Java Development Kit absolutely in open source. As per the official documentation.
OpenJDK is an open-source implementation of the Java Platform, Standard Edition (Java SE) specifications. In May 2007, Sun released a fully buildable Java Development Kit (JDK) version for Java SE to the OpenJDK Community as free software under the GNU General Public License version two (GPLv2). Sun announced the Interim Governing Board for the OpenJDK community. Sun also announced that OpenJDK-based implementations can use the Java SE 6 Technical Compatibility Kit (JCK) to establish compatibility with the Java SE 6 specification.
The OpenJDK project consists of a number of components - HotSpot (the virtual machine), the Java Class Library and the javac Java compiler.For more on it, visit its site.
The current JVM provided by Sun/Oracle is called HotSpot because it seeks hot spots of use in the code (places where code is more intensively used) for "just-in-time" optimization. From the wikipedia, HotSpot, released as the "Java HotSpot Performance Engine" is a Java virtual machine for desktops and servers, maintained and distributed by Oracle Corporation.
Comment: I heard OpenJDK also uses HotSpot to execute code? Is that true?
Comment: @TheNewIdiot, so you are saying HotSpot is part of OpenJDK? Or is there also a proprietary HotSpot as the answer above suggests?
Comment: @NINC, So Hotspot is both part of OracleJDK and OpenJDK? Hotspot = JRockit = OracleJDK = OpenJDK?
Answer: HotSpot is, as mentioned above, a cross-platform implementation of the Java Virtual Machine (JVM) Concept, and is distributed with the OpenJDK (Java Developer Kit), under the GNU General Public License. HotSpot is written mainly in C++, and was originally developed under Sun Microsystems. It is currently developed under the OpenJDK Project, at www.java.net. The HotSpot JVM was available as an add-on for Java 1.2, and later was used as the default Sun JVM in Java 1.3. The JVM is currently in Version 7, Build b147, and has an active development community behind it.
For more information, goto:
https://www.java.net/
Happy Coding!
Answer:
JVM is an abstract machine (specifications). HotSpot, OpenJDK and JRockit and so are implementations of JVM.

Free and open source implementations

HotSpot, the primary reference Java VM implementation
OpenJDK — Open Java Development Kit is a free and open source implementation licensed under the GNU General Public License (GNU
GPL) with a linking exception.

Proprietary implementations

JRockit (originally from Appeal Virtual Machines) acquired by Oracle for Linux, Windows and Solaris

for more implementations
link explains differences between HotSpot and JRocket

Difference between JVM and HotSpot?


url rewriting in php

Question: Hai
I have one more doubt in apache mod_rewrite.
 I want to rewrite the url
mydomain/index.php?category=1&id=1
To
mydomain/index/category/1/id/1
How I write rule in .htaccess
And what is the link that i have to give inside the a tag

Please give me a solution..
Answer: Not tested, but worth a shot:
RewriteEngine On
RewriteRule ^index/category/([0-9]+)/id/([0-9]+)$ index.php?category=$1&id=$2

Your URLs can look exactly like the way you mentioned:
Category 1
Product 1
Product 2
Category 2
Product 3
Product 4

Answer: Inside the  tags you will use the nice link, that is category/1/id/1 (that's exactly why you're using mod_rewrite, to be able to use nice URLs!)
As for the rule, try something like (untested):
RewriteRule category/(.*)/id/(.*)$ index.php?category=$1&id=$2&%{QUERY_STRING} [L]

Actually I would rather use
RewriteRule (.*)/(.*)$ index.php?category=$1&id=$2&%{QUERY_STRING} [L]

So you can call directly mydomain/1/1 but you got the idea I hope
EDIT: the &%{QUERY_STRING} part is not necessary for what you asked, but I generally include it in case I want to pass any extra parameter to the page.

url rewriting in php


How to display a block to a specific user?

Question: I need to display a block just to a specific user.
I don't want to create a role just for a user. that does not make sense!
Answer: I would implement hook_block_view_alter() and remove the block's content when the uid is not the user you were aiming at. In this example we only show the block content for uid 2.
function hook_block_view_alter(&$data, $block) {

   if ($block->module == 'somemMdule' && $block->delta == 'someDelta') {
         global $user;

    if ($user->uid != 2) {
       $data['content'] = array();
    }
  }
}

Answer: You can also write php code in block visible settings.
<?php
global $user;
if($user->name=="admin") {    return TRUE;}
else {   return FALSE; }
?>

Comment: This is a nasty solution, it is not recommended to add PHP in your database. Why: http://drupal.stackexchange.com/questions/2509/what-are-the-downsides-of-using-custom-php-code-in-blocks-nodes-views-args
Answer: Below is an answer for a user with uid = 2 (change to whatever uid fits for your case).
Part 1: Rules block visibility
You should be able to get this to work using the Rules block visibility module. Here is a quote from its project page:

The Rules block visibility module allows Rules components to be used to control block visibility. This provides Drupal administrators and developers extreme flexibility in controlling when blocks should be displayed on their websites, in addition to the default visibility options provided by Drupal.
The general idea is that if you can do it with Rules, you can use it to control block visibility, so the possibilities are limitless:

Need to show a block only for users registered more than a month ago?
Perhaps you have a block that must be shown only between 8am-5pm on weekdays?
What about displaying or hiding a block based on current weather conditions?

All of this can be done by using Rules block visibility.

With that, and as per the "if you can do it with Rules, you can use it to control block visibility" above, you've reduced your question to making Rules intercept the actual user who's using the site, i.e. if it is YES or NO (a boolean, right?) the user with uid = 2.
Part 2: Create an appropriate Rules Component
The Rules block visibility module doesn't have a lot of documentation, except in the README.txt that comes with this module. Here is what the crucial part of it is (to get the idea):

Configuration is done on a per-block basis. To control a block
  visibility using a rule component, go to the block settings page,
  scroll down to the "Rules" tab, and select the Rules component that
  you want to use.
Notice that to be able to be used by this module, a Rules component
  must be constructed in a very specific way. See the next section for
  more information.

This module comes with 2 sample Rules Components, that should help to understand the KeepItSuperSimple concept behind it.
By looking at these samples, I was able to create another Rules Component which looks like so:
{ "rules_block_visibility_hide_block_for_user_2" : {
    "LABEL" : "Hide block for user 2",
    "PLUGIN" : "rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "USES VARIABLES" : {
      "module" : { "label" : "Module", "type" : "text" },
      "delta" : { "label" : "Delta", "type" : "text" },
      "result" : { "label" : "Result", "type" : "boolean", "parameter" : false }
    },
    "IF" : [
      { "data_is" : { "data" : [ "site:current-user:uid" ], "value" : "2" } }
    ],
    "DO" : [ { "data_set" : { "data" : [ "result" ], "value" : "1" } } ],
    "PROVIDES VARIABLES" : [ "result" ]
  }
}

You should be able to import this rule in your own environment.
What this Rules Component does is "only" return a boolean (1 or 0), based on the condition if the user's uid is YES or NO equal to 2.
With that, we're coming close to an actual answer to your question.
Part 3:
Head over to the "Block" settings for the block you want to hide for the user with uid = 2. At the bottom of it's settings, within the typical "Visibility settings", there is now (after you enabled the Rules block visibility module as in Part 1) an extra tab labeled "Rules". Using that tab will allow you to select a "Rules Component" that will do what's documented below that selection list field, ie: "Show this block only if the selected rule returns a positive value. Important: to be listed here, a block visibility rule must have specific parameters and return values.".
And guess what, in my case I just selected my Rules Component from Part 2
Note: it doesn't matter what type of block it is (created by a view, or something else), it works in all cases.


KBC to ETH transaction

Question: I withdrew KBC from my HitBTC account to my countries local crypto app LUNO which only supports ETH.
This transaction was sucssesfull however I can not retrieve it from my Luno account. They say it cannot be recieved.
Is there anyway to reverse it or get this crypto back
Answer: KBC appears to be a token, via a smart contract, on the Ethereum blockchain.
If LUNO only supports ETH and you sent KBC to your LUNO account, that means their development team has not built the tools necessary to interact with ERC20 or like tokens. As in, your KBC balance will not how in their own systems.
Your KBC balance will continue to exist on the account you sent it to.
There is no way to reverse this with generic ERC20 tokens.
Your only hope at this point, from what I know, is to continue contacting support and see if they have a way to manually transfer those coins. This won't be easy as you're going to prove that you owned them in the first place as well as convince them to go through that effort.
In the future, I would take your time and take the proper precautions before sending tokens between 3rd party exchanges and 3rd party wallets. You're at their mercy.

KBC to ETH transaction


can't login Kali 2.0 after fresh installation

Question: Installed new instance of Kali 2.0 graphical in Virtualbox. Created a normal user say "user1" and set the Password of root as "pass123".
After installation (no error encountered), tried login into Kali 2.0 using normal user "user1", can't get in and received "wrong password" related error.
Then, tried using root user and password "user1" (was set during installation); user root is not recognized in the login window and same only User login window just bounces back
Comment: The answer below is what you need.
Answer: When you login to kali you need to use username root and password that you used during installation.
In live mode, or any other mode. default username is root and password is toor.
Answer: I tried below steps to recover the root password what I set during installation.

restart Kali Linux after the installation
select option "*Advanced options for kali GNU/Linux"
then select option "Kali GNU/Linux, with Linux 4.0.0-kali1-amd64 (recovery mode)"
Note: I am using x64 bit machine for i386 you might see related machine type
enter the root password (the one you had set during installation) for the recovery and you get the root prompt. that's it :-)
type " init 6" and hit enter key to restart Kali 2.0
after reboot the user "root" and associated password just works

I am not sure if one of the above is an standard way to solve this problem. However, it unlocked me without making any additional changes into the system and allowed me to use the same password that was set during Kali installation


Data from WebService is not retained in page history

Question: Here is my scenario:
I am using a web service to pass back search results. To do this I am using ToolkitScriptManager with a ServiceReference to my web service and calling the web service up with javascript. The javascript call looks something like this:
<code>WebService.GetResults("search term", OnSuccessGetData, OnFail);
</code>
If the request is successful the "OnSuccessGetData" function is fired and the results are inserted into a DIV tag. Because the resulting search results can be large I wrote the service to only pass back the first 20 results on the first trip. After that I make calls again to the service to return the next 5 results and continue to do this until all the results are loaded. This all works wonderful.
You can see it in action at www.lsbio.com and use the search term "human mouse". My problem is that when the user clicks on a product and then hits the 'Back' button, the search results have to be fetched again from the webservice.
Is there a way to keep the search results in the DIV tag to remain as part of the page so when the user navigates away from the search page and uses the 'Back' button to navigate back, the search results are still there without having to hit the webservice again?
If I did not make myself clear enough on what I am trying to do, please test the site www.lsbio.com, use the search terms human mouse, click on a product, and then hit the back button.
Answer: Maybe you can store the result somewhere, i.e. in a hidden field? Than on page load you first test if the result is in the hidden field, if so you insert it in the result area, if not you use the webservice.


Purpose of Serialization in webapplication

Question:
Where is the usage of serialization in a webapplication.
Is it necessary that a form bean is serializable.
In tomcat what is the usage of sessions.ser file..
Comment: Can you please elaborate why the given answers didn't satisfy you? You seem to have added a bounty a few weeks after the answers being posted, but you didn't seem to respond/comment on any of them.
Comment: perhaps because the "start a bounty" looks tempting :)
Comment: we're all just internet hitmen.
Answer: 1) It is an app server dependent feature but the Servlet Spec says that if the servlet container wants to support distributed environments (sharing sessions across instances) and the like that it must accept objects that implement Serializable and be able to migrate them.  Tomcat also supports storing the session state across server restarts for session objects that are serializable.  You can turn this feature of Tomcat on or off in the conf/context.xml file (see comments there).
2) It would only be neceesary for a form bean to be Serializable if a) it is session scoped and b) you are using either distributed sessions or a feature such as Tomcat uses to persist the session which requires it.
3) The sessions.ser file is the file containing the serialized objects from the session.  Tomcat uses this to preserve them across restarts of the server if you have it configured to do so (see above).  In general a .ser file is a serialized Java object, which is a binary representation of the state of the object.
Answer: For your first and second question, have a look at this SO thread. Regarding your 3rd question, sessions.ser is a serialized session. However,

Yes, we need serialization whenever we need to persist objects in file system or send objects over the wire. You might think that in a web application we don't necessarily do that. But the server usually require a serializable thing in case it is needed in future when you switch to a clustered environment or want to pass your bean to a remote component, i.e. EJB component. Or you might want to store your bean into a session, for that reason your beans should be serializable.
Yes, for the same reason, stated above.
sessions.ser is a serialized session. Tomcat persisted it, so it can be recovered later. Now you had an idea that why we need serializable beans, because you might want to store bean objects to the session and Tomcat persist session to the file system, i.e. session.ser. So, your beans must implement Serializable so they can be persisted/recovered with the session.

By the way, the correctness of persisting and recovering of bean depends on the correct implementation of Serializable. For that I would recommend you to read the related topics in Effective Java.
Answer: Sessions (and all attributes added to it) need to be serializable if the container wants to store the session. This may have two reasons:

the session has to be passed to an other node of a load balanced cluster
sessions need to be swapped out because of low memory

Another possible reason is to pass request attributes from one webapp to another using cross context dispathing. Both webapps have different classloaders so simple cast would not work.
So your tomcat seems to write the session to a file using serialization. A form bean is typically also stored in the session, so yes, it has to be serializable.
And last, there may be much more reasons for serializable like in any other application. Caches may need it to swap out cache content (like ehcache can do). Any other data part may be serialized to be stored as blob in a database, ...
Answer: Wow, lot of questions without a lot of context.
For your #1 I will assume you're talking about serialization that in which you allude in your other points about Java's serialization, not serialization vs. parallelism.  If so, many web apps will serialize or save the state of objects to keep it durable.  That durability can be used across HTTP requests (as in session management), for longer-term storage of information, or in order to send across a "network" in terms of ensuring that all parties get a copy of said information.
One must ask oneself in HTTP if that is indeed a good idea as by design and scale stateless is "good" and if one has a backing store such as a DB why the DB isn't doing the work.  The form bean I would guess is used in this nature as servlets will pass around the form information as descrbied.
Answer:
A pretty good description from
wikipedia:

Serialization has a number of
  advantages. It provides:

a method of persisting objects which    is more convenient than
  writing their    properties to a text
  file on disk,    and re-assembling
  them by reading    this back in.
a method of issuing remote procedure    calls, e.g., as in SOAP
a method for distributing objects,    especially in software
  componentry
  such as COM, CORBA, etc.
a method for detecting changes in    time-varying data.

A real world (simple) example: Say
you create a User instance in java.
Now you want to display this object
in a web browser using javascript.
One option is to serialize the
object in such a way that javascript
can deserialize the object (using a representation that both java and javascript can understand) and
display it.
It depends on what you need to do
with the form bean as to whether it
should be serialized or not.
Tomcat Manager App is a web
application that helps you deploy
and manage other web applications to
tomcat. I'm not a tomcat expert, but
I think The Tomcat Manager tries to
remember information about the
sessions created by the web
applications that it is managing. It
needs to remember this info even
when the tomcat process is
restarted. So, Tomcat Manager
creates a file named "Session.ser"
which is a serialized representation
of the information that it needs to
remember about all the managed
applications' sessions.


processing video in android

Question: I am trying to figure out the right way to approach processing video (from file or camera) frame by frame on android.
I need to get each frame and convert it to RGB, process it (each color separately) and send it to the screen.
Has anyone done it? how could it be done (preferably without any native code processing)?
Answer: Look at this post where I suggest using OpenCV for Android. With OpenCV you can grab a video frame in RGB format and process each of the components individually in real-time.

processing video in android


Unitary evolution from a mixed state to a pure state

Question: Why is it not possible to have an unitary evolution from a mixed state to a pure state ?
Answer: Because if $A\sim B$ then
$$
A^2\sim B^2
$$
Recall that a state is pure if and only if $\rho^2=\rho$, and that time-evolution is a similarity transformation.
Answer: Because the Von Neumann entropy $S(\rho)=-tr(\rho\log{\rho})$ is conserved under unitary transformations, and $S(\rho)=0$ if and only if $\rho$ is a pure state.
Physically if we were able to transforme mixed states to pure states via unitary transformations we would decrease the entropy of the universe, and that would be funny.


type of process dump when its generated from task manager

Question: Starting from Windows Vista, now one can generate a process dump right from task manager. Typically I generate a process dump either by using Adplus or right from Windbg. If I use one of these option, I have to provide some switches with my command in order to describe what type of dump is been generated. Given that all these details are hidden when I generate a process dump from task manager, does someone know what type of dump it is and what is contained in it? I remember reading somewhere that process dump generated from task manager does not contains details on the handle table. Any ideas on this as well?
Comment: It is a big one, kit and caboodle included.
Answer: The dump is a "User Mini Dump File with Full Memory", so for most tasks you're good.
However, you can't specify that the dump should be created at some specific event. Tools like adplus and procdump allow you to create a dump for various conditions (exception, work load etc). So essentially task manager only supports give me a snapshot of the process (which is usable for a hanging process). For other situations you need to use adplus or procdump.
Also, you should be aware that 64 bit Windows ships with two versions of the task manager. The 64 bit manager will create 64 bit dumps - even for 32 bit processes (i.e. the dump will contain the Wow64 stuff needed to run the 32 bit process). However, if you use the 32 bit version of task manager (located in \Windows\SysWOW64) you'll get a proper 32 bit dump.
Comment: It generates a "User Mini Dump File with Full Memory" which should be the same as the .dump /ma command. However, I just verified that I don't get any data for !handle either. Interesting (too bad I can't upvote your question again ...)
Comment: atleast its re-assuring that i am not crazy :) I guess its still a mystery why mini dump with full memeory does not include handle table
Comment: Thanks Brian for your response. My question is really about type of dump gnerated via task manager. Is it something like .dump /ma or is it .dump /mt or something else etc.  One thing I have noticed in analyzing dump file generated via task manager is that I don't get anything when I run !handle command. I assumed that it probably because dump does not have handle data


save webpages for offline browsing

Question: i am trying to create an android application that saves webpages to use it in offline-browsing, i was able to save the webpage but the problem was in the contents (images, javascripts,..etc), is there a way to do so programmatically, i use eclipse and test my work on an emulator.
Answer: hm, I am afraid you should parse html's yourself (I mean do that with a properly lib) and store all resources (css, js, images, videos etc.) too.
s. how it is done in a java crawler: open source crawlers
Answer: You will need to search for all images, javascript files, css files, etc... and download them, saving them to the same relative path to the HMTL files - Assuming the html is coded with relative paths (images/image.png) and not absolute paths (http://www.domain.com/image/image.png).
You can pretty easily search the html string for <img,

save webpages for offline browsing


Backup Ubuntu settings

Question: After reading the same question asked here at least hundred times I will ask it one more time :)
I need to backup everything, like .bashrc, regional settings, keyboard layouts, installed packages and applications, home directory in general to be able to restore all my stuff on clean system and start working in an hour or so. Ideally the backup should be done to cloud. Aptik looks like a solution, however it doesnt start on my fresh Ubuntu installation, and as I understand it cant upload backup to the cloud. In addition, as I understand, the backup is done on demand, I would prefer something that will sync my changes constantly to the cloud.

Any wonder solution?
Answer: This is my backup regime which I have been using for years. I am open to suggestions if it can be improved upon.
For a bare bones backup use clonezilla to copy your system.http://clonezilla.org/downloads.php
For backup of Home directory and other directories that are important to you, use either rsync or the backup tool that comes pre-installed with Ubuntu called "Deja Dup". To run "Deja Dup" click the applications icon on the Launcher and enter "Deja" into the search bar.
For the reinstalltion of your packages, build and restore a list of installed packages.
To build the list of packages installed on your system the packages use:

sudo dpkg --get-selections > package.list

To restore the packages use:

sudo dpkg --set-selections < package.list
sudo apt-get dselect-upgrade
Comment: with rsync you have to constantly update your script to sync stuff. and Deja Dup doesnt work with cloud, except NextCloud, I would prefer it could use something I already have, OneDrive, GoogleDrive
Comment: To kreuzerkrieg. I use Deja Dup with OwnCloud for years without problems, so I don't really understand your comment that "Deja Dup doesnt work with cloud, except NextCloud"
Comment: ??? could you elaborate? The only backup destination I see is "NextCloud", "Network Server" and "Local Folder"
Comment: It is simple! Under Destination (Speicherort in my German version) select Network Server and then add the server address in the "server address" box.
Comment: Didnt know it could accept anything except something like Samba share, FTP and such. Definitely will give it a try.
Comment: It will accept all of those, I use ftp.
Answer:
home directory in general to be able to restore all my stuff on clean system and start working in an hour or so

I reinstall my system within 20 minutes without doing any extra backup procedures. All it takes is an SSD as bootable device.

I boot from a live dvd. Format / and /home and mount my data partition where my personal documents are.
I then  start a script that adds the software I want to have on my system (that would be something like shutter, 1 extra browser, Mysql Workbench, LAMP, Eclipse, Jaspersoft studio). This script I change every so often to include other software or to remove software I do not care about any more.
I use 2 browsers (one for work and 1 private). Both are synched online so when I connect to my mail my browser settings, bookmarks and passwords are restored.

All other things I change manually; it is my experience Ubuntu is rather fluid when it comes to core functionality: we go from gnome to unity to gnome3, we go from init to upstart to systemd, we go from xorg to wayland back to xorg (in 18.04). Settings in one version often do not work in another version.
If you want to synch to a cloud: install the tool kit for that cloud. What you want is pretty specific so I would create my own script. Google cloud has a toolkit where you can use gcloud compute scp {file} {user}@{instance}:{dir/} --zone={zone} and {file} is copied to your cloud (you need to provide the project if you have more than 1). Can not be too difficult to find all the files you want synched to a cloud and add those all to a bash script.
Comment: MANUALLY is the word I dont expect to see in complete solution... You mention a script, it means that each time you add something you have to update your script. And then one say, I'll update it later, and voila, stuff forgotten. Same for cloud, you have constantly track yourself what you sync to it.
Comment: @kreuzerkrieg yes. And in my experience it is the better solution. Your automated solution is going to last for 6 months for a normal Ubuntu release; you can not expect the same plan to work in 18.04 when it arrives. It most def. will not if you come from 16.04. How many times do you expect to reinstall the same Ubuntu?! The method I picked is set such that it works on the same release but also across releases and even other Linux systems. And the maintenance to scripts: every 6 months I skim through it to see if changes to Ubuntu warrants changes to my script. Often that is not even the case
Comment: makes sense... if you stick with LTS only... in any case, what if, your machine is gone and you want as quickly as possible to bring new machine to working state? what if you want to create additional machine, for example one for office and the second one for home, both used for the same purpose?
Comment: Personally I would use clonezilla for that @kreuzerkrieg Above method does not cancel the normal backup procedures. At work though we are not allowed to store private files on work related computers nor is it allowed to store sensitive information on anything else than a USB drive (that includes password, IP addresses, SSH keys, exports of client data etc). Our work systems are wiped every friday and reset to a default we have. Dutch law is pretty strict on this: if at any moment you can not explain what happend to data you need to inform -all- clients data could have been compromized.
Comment: I would call it pretty harsh conditions :) People here use variety of OSes, including MacOS, so they have all their stuff backed up in iCloud, well, it does not contain any client info, but on the other hand it sure contains sensitive internal data like SSH keys, from here you can reach all proprietary code and IP, I guess..

Backup Ubuntu settings


Which type of oil/fat should I use for deep frying?

Question: I just got my first ever deep fryer yesterday. Looking round in the shops, I found that I can get bottled frying oil, or a white solid block type of fat which I've never used before, I guess it may be lard (but I'm not sure this is the right word, as I'm not a native speaker).
In terms of handling, is there any benefit of using the solid stuff over frying oil or sunflower oil? (For example, I'm not sure if the white stuff would get solid again when cooled ...)
Comment: The solid block type might be hydrogenated vegetable oil (shortening, Crisco is a well-known brand). Cheaper than lard (pig fat).
Comment: It might also be beef tallow, if it's in Germany.
Answer: For the very best tasting fries, onion rings and battered fish are fried in fat made from rendered beef fat. When I was a cook we rendered down a thousand pounds of beef fat a week, it took days to do. But it made the very best tasting savory deep fried foods. The burning temperature is lowish, so food needs to be cooked at 325 and changed more often. It's not good for things like doughnuts.
I'm not a fan of Canola, I find it often has a taste which I don't like. I don't use peanut mostly due to habit, too many people I've run into with allergies. I can't find rendered beef fat and I'm not going to render it at home.
At home I use a mixture of Sunflower and lard, about 1 part to 3 parts. The sunflower oil makes it easier to handle when filtering through a very fine mesh sieve (more liquid at a lower temperature) after use, then I put it in an old olive oil can which I refrigerate between uses. I leave out overnight before I use it then warm in hot water to pour it out. I don't usually use more then once a month. The more crumbs and batter bits you filter out the longer the fat will remain good. So filter, and don't pour the last bit into the can.
Refrigerated the oil mix doesn't go bad before it becomes no good to use. I get well over a years use. I love sunflower oil, it has almost no taste at all and a high smoke temp. It is pricey.
Comment: Great answer. Do you use that for fried chicken? What do you use for doughnuts?
Answer: The best thing to fry, or deep fry with is actually old-fashioned lard. Yes, it is full of saturated fats, but it withstands very high temperatures. Olive oil does not have a very high heating point, and once again, the polyunsaturated fats are transformed. I'm not saying to eat something fried or deep fried in lard every day, but once in a while, and if you want it to be good, use lard.
Answer: First and foremost choose a frying medium with a high enough smoke point. You don't want to risk your oil deteriorating before it reaches the temperature you want it to be at. Now, if you'd like to use an oil, I say go for a something neutral in flavor: canola or peanut. If you are looking at using an animal fat, lard from Pigs is the most common. If rendered properly it shouldn't affect the flavor of your foods in an overly negative way.
Answer: If it's solid at room temperature, then it's either saturated fat or largely trans-unsaturated fat.
The former is what humans have used for cooking for centuries and is biologically safe. It is also what I would personally recommend.
The latter is from a manufactured process and was originally created so as to be solid at room temperature. (There is considerable dispute about whether we should be even using this kind of fat to cook with.)
Both will return to solid after cooking.
Answer: I have found that mixing corn oil with equal parts Crisco make an oil that can be
heated relatively high, with little to very little taste.
Answer: In the interests of safety, most modern deep fat fryers say NO lard, butter, etc. (hard fats). The manufacturers  don't say why but I've heard many people conjecture that lard heats up, smokes, maybe burns when exposed to fairly high temperatures (over 370F. or 185C.). My theory is that the heating coils on the deep fat fryer overheat the lard if it is used in its hard form.
We have real lard (from a real pig raised on a real farm -- not a huge farm where pigs lead a short and brutal life). Then we rendered it ourselves which is not hard at all.
We are just about to try cooking french fries (British, chips) in our new deep fat fryer. We have melted the lard, strained it and poured it in, as one would with canola oil, etc.
Wish us luck, please. I'll try to report back on this scary adventure in cooking!
UPDATE: Okay, that didn't work too well. The fries never did brown even after 15 minutes at 320F. and then 12 minutes at 370F. (ordinarily 5 to 7 minutes at the lower, cooled, then 2 minutes at the higher). Cooked but not browned. So I threw a few in a fry pan and burned them a bit. Oh dear. Did I mention we are at 3000 feet above sea level? This makes a bit of a difference in cooking. My friend (bless her heart) said she loves blond french fries and ate them up. I was not quite so pleased!
Answer: I recently learned of an oil called " rice bran oil ". This oil has a smokepoint of 490 degrees. Since most commercial places I've contacted say foods are best fried at 350-375, this makes very good sense. I was told this frying temp keeps the food from being soggy. It cost about the same as peanut oil but has a higher smokepoint. You can buy it in bulk and it's cheaper. I got mine from Riceland Foods in Arkansas.
Answer: Hard fats such as lard or dripping I find give things much more flavour.
I normally go for a relatively neutral oil such as groundnut or sunflower.
What you are cooking will also effect what you want to use, as different fats have different smoke points and it may be that what you are trying to fry requires more heat than the fat can handle safely.
Comment: Discussing such studies is beside the point. This is a food and cooking site, not a health and nutrition site (see the [faq]); I've edited out the off-topic part of your answer.
Answer: Since I find myself unable to source certifiably natural lard, when I do fry, I use coconut oil. Coconuts are in fact, mostly saturated fat and hence more stable, having a fairly high heat tolerance. Again, if I could get my hands on quality lard, I'd use it when needed. I use butter for pan frying.
Comment: This is a food and cooking site, not a health and nutrition site (see the [faq]); I've edited out the off-topic part of your answer.
Answer: My mother used to make delicious chips.  She bought raw beef suet from the butcher very cheaply. She heated it gently in a heavy pan (with lid) until the the fat had come out. This is called rendering. The liquid fat (called dripping) was then poured into a pyrex bowl and cooled.  This is a very hard fat when cold. It can be used for some pastry recipes.  She used a chip pan - a large heavy pot with a wire basket and a lid.  The solid dripping was added to the chip pan, food was cooked and afterwards everything was allowed to cool and the dripping sat in the pan until next time. Now people think dripping is unhealthy and chip pans are dangerous but the flavour was wonderful.
Lard is pig fat.  We didn't use it much.
Answer: Lard does not contain any trans fats at all.It is also 45% Saturated fat and the rest is Monosaturated and polyunsaturated fats.
Lard is best brought to heating point for the first time and a couple of slices of bread "fried" for a few minutes without frying anything else . Then let it cool down and go hard again. The next time you use it the smell will have gone and the chips will brown nicely.
Comment: Please don't use health arguments here, they are hard to prove in any way. See the [faq] for detail.


How can I detect if an Ansible playbook is executed by ansible-pull rather than ansible-playbook?

Question: I am looking for a when condition which is fullfilled when the playbook is executed by ansible-pull.
Comment: I'm affraid you can't since `ansible-pull` actually runs `ansible-playbook` internally with no particular option once SCM checkout is done (run with `-vvv` to see the steps). If you use a specific directory on all your servers to clone your playbook repos from `ansible-pull`, you can eventually set a condition on the `playbook_dir` variable. This is way far from bulletproof though.
Answer: I found two approaches to test if a playbook is applied via ansible-pull:

Check for ansible_connection == "local". However this doesnt work in all places as local connections might also used regularily by your playbook.
Pass an extra variable to the invocation: ansible-pull --extra-vars "ansible_pull=true"


Definition of weak homotopy equivalence

Question: Recall a weak homotopy equivalence is a continuous map $f:X_1 \rightarrow X_2$ that induces a bijection $f_*:[Y,X_1] \rightarrow [Y,X_2]$ for any CW-complex $Y$, where $[Y,X]$ denotes the homotopy class of continuous maps $Y \rightarrow X$. When $Y$ is restricted to be $\Bbb{S}^n$, this results in a series of isomorphisms between $\pi_n(X_1)$ and $\pi_n(X_2)$, and by Whitehead theorem it automatically becomes a homotopy equivalence when $X_i$'s are CW-complexes.
Why don't we define it in a similar way as homotopy equivalence, namely $(f_*)^{-1}:[Y,X_2] \rightarrow [Y,X_1]$ is induced by another continuous map $g:X_2 \rightarrow X_1$? Does the latter one necessarily implies homotopy equivalence? What will the difference of the two definitions change if we restrict $Y$ to be $\Bbb{S}^n$?
Answer: The reason why the definition of weak homotopy equivalence is good is because of Whitehead's theorem. It is the weakest definition (meaning the easiest to check) that is equivalent to homotopy equivalence for CW complexes, so you would not want to change it.
As to your new question, the Hawaiian earring is a counter example. There is a map $X \rightarrow H$ that is a weak homotopy equivalence from a cw complex to $H$, but there can be no inverse that you ask for because the fundamental group of $H$ has nontrivial topology while the fundamental group of $X$ is discrete (as it is for any CW complex).
Comment: No, look up the double comb space. It is weakly equivalent to a point and so satisfies the inverse existing, but it is not Homotopy equivalent to a point.
Comment: I think my new question is: **If a inverse that induces $(f_*)^{-1}$ actually exists, does it imply homotopy equivalence?**
Comment: You must distinguish between pointed and unpointed homotopy classes. As it stands, with the notation given in the question, the definition is not that of a weak equivalence. See for instance [example 1.2](http://www.ub.edu/topologia/casacuberta/articles/crod2.pdf).
Answer: EDIT: Now that the question has been modified, this answer is no longer directly relevant.
The standard definition of weak homotopy equivalence is a map $f: X_1 \to X_2$ such that the induced maps on homotopy groups, for all choices of base point in $X_1$, are isomorphisms; see https://ncatlab.org/nlab/show/weak+homotopy+equivalence or https://en.wikipedia.org/wiki/Weak_equivalence_(homotopy_theory) or p. 352 in Hatcher. Your definition is stronger, and I think that it is equivalent to a homotopy equivalence: if $f_*: [Y, X_1] \to [Y, X_2]$ is a bijection for all $Y$, let $Y=X_2$; then there is a map $g \in [X_2,X_1]$ which maps to the identity on $X_2$, and that ought to be a homotopy inverse to $f$.
Comment: Well, I lost some restriction on $Y$. I'll add it.

Definition of weak homotopy equivalence


The Tohoku use of だ

Question: In Tohoku, だ can follow verbs and い-adjectives, as I've heard (I've never actually spoken to someone from Tohoku). What purpose does it serve? Is a sentence ending in just a verb ungrammatical in Tohoku? And is this form used by Tohoku women?
Comment: You are probably talking about a dialect in Tohoku. If so, it is just their ordinary language. There are more and more difference between standard Japanese language and Tohoku dialect. If you are not talking about Tohoku dialect, I think you should write some examples, so that people have more idea about your question.
Answer: That's a misconception. In Tohoku dialect, the copula だ doesn't follow verbs and i-adjective.
It seems some dialect(s) in Kanto or around there has/have that form. But I'm not sure.
Answer: In really rural, "pure" Tohoku dialect this is true. However, with the spread of Standard Japanese this is disappearing in young and working-age people. Even amongst the elderly it doesn't occur after everything, but it is common and grammatically correct within the dialect. This can also apply to "degasu" or "degozarusu", the Tohoku equivalent to "desu" or "degozaimasu", instead of taking the usual -ou ending to an -i adjective.
e.g. hayai > ohayou gozaimasu = ohayou gozarusu (because this is a set greeting) but [ii "de"gozaru(su)] instead of [you gozaru/gozaimasu]
Examples of this can be found in some of the example sentences on this website: https://konnok3.sakura.ne.jp/sendai01.html#sendai01

The Tohoku use of だ


Back to basics; for-loops, arrays/vectors/lists, and optimization

Question: I was working on some code recently and came across a method that had 3 for-loops that worked on 2 different arrays.
Basically, what was happening was a foreach loop would walk through a vector and convert a DateTime from an object, and then another foreach loop would convert a long value from an object. Each of these loops would store the converted value into lists.
The final loop would go through these two lists and store those values into yet another list because one final conversion needed to be done for the date.
Then after all that is said and done, The final two lists are converted to an array using ToArray().
Ok, bear with me, I'm finally getting to my question.
So, I decided to make a single for loop to replace the first two foreach loops and convert the values in one fell swoop  (the third loop is quasi-necessary, although, I'm sure with some working I could also put it into the single loop).
But then I read the article "What your computer does while you wait" by Gustav Duarte and started thinking about memory management and what the data was doing while it's being accessed in the for-loop where two lists are being accessed simultaneously.
So my question is, what is the best approach for something like this? Try to condense the for-loops so it happens in as little loops as possible, causing multiple data access for the different lists. Or, allow the multiple loops and let the system bring in data it's anticipating. These lists and arrays can be potentially large and looping through 3 lists, perhaps 4 depending on how ToArray() is implemented, can get very costy (O(n^3) ??). But from what I understood in said article and from my CS classes, having to fetch data can be expensive too.
Would anyone like to provide any insight? Or have I completely gone off my rocker and need to relearn what I have unlearned?
Thank you
Answer: The best approach? Write the most readable code, work out its complexity, and work out if that's actually a problem.
If each of your loops is O(n), then you've still only got an O(n) operation.
Having said that, it does sound like a LINQ approach would be more readable... and quite possibly more efficient as well. Admittedly we haven't seen the code, but I suspect it's the kind of thing which is ideal for LINQ.
Comment: "We should forget about small efficiencies, say about 97% of the time: **premature optimization is the root of all evil**." -Knuth, Donald
Comment: Yes, but there's still that 3%.
Comment: That 3% only counts when you actually know you're operating within that margin. If you don't know if your code is actually a bottleneck, why bother optimizing it? "Measure twice, cut once" ;-)
Comment: O(n/2) < O(n)

But like said before, you don't really worry about the constants until you benchmark your code...

How can you tell a small efficiency from a large one?  1) experience 2) testing.
Answer: For referemce,
the article is at
What your computer does while you wait - Gustav Duarte
Also there's a guide to big-O notation.

It's impossible to answer the question without being able to see code/pseudocode. The only reliable answer is "use a profiler". Assuming what your loops are doing is a disservice to you and anyone who reads this question.
Answer: Am I understanding you correctly in this?
You have these loops:
for (...){
  // Do A
}

for (...){
  // Do B
}

for (...){
  // Do C
}

And you converted it into
for (...){
  // Do A
  // Do B
}
for (...){
  // Do C
}

and you're wondering which is faster?
If not, some pseudocode would be nice, so we could see what you meant. :)
Impossible to say. It could go either way. You're right, fetching data is expensive, but locality is also important. The first version may be better for data locality, but on the other hand, the second has bigger blocks with no branches, allowing more efficient instruction scheduling.
If the extra performance really matters (as Jon Skeet says, it probably doesn't, and you should pick whatever is most readable), you really need to measure both options, to see which is fastest.
My gut feeling says the second, with more work being done between jump instructions, would be more efficient, but it's just a hunch, and it can easily be wrong.
Answer: Well, you've got complications if the two vectors are of different sizes. As has already been pointed out, this doesn't increase the overall complexity of the issue, so I'd stick with the simplest code - which is probably 2 loops, rather than 1 loop with complicated test conditions re the two different lengths.
Actually, these length tests could easily make the two loops quicker than a single loop. You might also get better memory fetch performance with 2 loops - i.e. you are looking at contiguous memory - i.e. A[0],A[1],A[2]... B[0],B[1],B[2]..., rather than A[0],B[0],A[1],B[1],A[2],B[2]...
So in every way, I'd go with 2 separate loops ;-p
Answer: ... working on one piece of data but with two functions can sometimes make it so that code to act on that data doesn't fit in the processor's low level caches.
for(i=0, i<10, i++ ) {
  myObject object = array[i];
  myObject.functionreallybig1(); // pushes functionreallybig2 out of cache
  myObject.functionreallybig2(); // pushes functionreallybig1 out of cache
}

vs
for(i=0, i<10, i++ ) {
  myObject object = array[i];
  myObject.functionreallybig1(); // this stays in the cache next time through loop
}

for(i=0, i<10, i++ ) {
  myObject object = array[i];
  myObject.functionreallybig2(); // this stays in the cache next time through loop
}

But it was probably a mistake (usually this type of trick is commented)
When data is cycicly loaded and unloaded like this, it is called cache thrashing, btw.
This is a seperate issue from the data these functions are working on, as typically the processor caches that separately.
Answer: Aside from cache thrashing on large functions, there may be benefits on tiny functions as well.  This applies on any auto-vectorizing compiler (not sure if Java JIT will do this yet, but you can count on it eventually).
Suppose this is your code:
// if this compiles down to a raw memory copy with a bitmask...
Date morningOf(Date d) { return Date(d.year, d.month, d.day, 0, 0, 0); }

Date timestamps[N];
Date mornings[N];

// ... then this can be parallelized using SSE or other SIMD instructions
for (int i = 0; i != N; ++i)
    mornings[i] = morningOf(timestamps[i]);

// ... and this will just run like normal
for (int i = 0; i != N; ++i)
    doOtherCrap(mornings[i]);

For large data sets, splitting the vectorizable code out into a separate loop can be a big win (provided caching doesn't become a problem).  If it was all left as a single loop, no vectorization would occur.
This is something that Intel recommends in their C/C++ optimization manual, and it really can make a big difference.
Answer: I apologize for not responding sooner and providing any kind of code. I got sidetracked on my project and had to work on something else.
To answer anyone still monitoring this question;
Yes, like jalf said, the function is something like:

    PrepareData(vectorA, VectorB, xArray, yArray):
        listA
        listB
        foreach(value in vectorA)
            convert values insert in listA
        foreach(value in vectorB)
            convert values insert in listB
        listC
        listD
        for(int i = 0; i < listB.count; i++)
            listC[i] = listB[i] converted to something
            listD[i] = listA[i]
        xArray = listC.ToArray()
        yArray = listD.ToArray()

I changed it to:

    PrepareData(vectorA, vectorB, ref xArray, ref yArray):
       listA
       listB
       for(int i = 0; i < vectorA.count && vectorB.count; i++)
            convert values insert in listA
            convert values insert in listB
        listC
        listD
        for(int i = 0; i < listB.count; i++)
            listC[i] = listB[i] converted to something
            listD[i] = listA[i]
        xArray = listC.ToArray()
        yArray = listD.ToArray()

Keeping in mind that the vectors can potentially have a large number of items. I figured the second one would be better, so that the program wouldnt't have to loop n times 2 or 3 different times. But then I started to wonder about the affects (effects?) of memory fetching, or prefetching, or what have you.
So, I hope this helps to clear up the question, although a good number of you have provided excellent answers.
Answer: Thank you every one for the information. Thinking in terms of Big-O and how to optimize has never been my strong point. I believe I am going to put the code back to the way it was, I should have trusted the way it was written before instead of jumping on my novice instincts. Also, in the future I will put more reference so everyone can understand what the heck I'm talking about (clarity is also not a strong point of mine :-/).
Thank you again.


What do you do with left over caulk in a tube?

Question: What do you do with the caulk when you don't need it all? Do you throw it away or can you cover it and store it?
Answer: I wrap any adhesive tape I have on hand into a tube extending a short distance beyond the tip of the nozzle and pinch it shut at the end, then I dispense some product into the tape. This allows the product itself to seal the tube on the outside of the tube.
When you're ready to use the tube again, yank off the tape and the dried plug and you should have a fresh nozzle.
Answer: Unless I think I can use it within a few weeks I either:

throw it out
go around my house or the house I am using it in and try to finish up the tube.  There is always caulking to do!

I myself used to tape the caulk ends and use it.  But after a couple of sloppy/botched uses I decided it simply isn't worth the time involved.  Think about putting iffy caulk in a tub, then getting water where you don't want it.  Think about caulking trim after you paint, then the caulk goes on poor and you have to scrape it off and repaint it.  Is it worth saving a $1?
Answer: It kind of depends on how long it will be before you expect to use it again. Often people try to store the caulk by wrapping the tip with plastic tape or plugging it with a nail or something; but if it will be months before you are going to use it again, then saving it may not work out. Once the tube has been opened, it's bascially just a matter of time before it dries up.
If it's sealed really well, it could last several months, but this is kind of a lofty goal.
Answer: I've tried nails, tape, etc, and at best have only gotten a tube to last a few months. The tubes that come with a replaceable cap seem to last longer.
Answer: I store it and when I need it later, I try to squeeze some out. If nothing comes out, I try to pull out the dried plug from the nozzle. If I can't do that, I cut the nozzle down till I get to the base of the nozzle. If I still can't squeeze anything out, I throw it away and buy a new one.
Honestly, it's usually 50/50 that it will still be viable (for me), so it's worth keeping.
Answer: do what you can to keep it from drying out, but assuming that it does dry out, make a length-wise slit in the complete length of the plastic nozzle, pull out the plug and then wrap electrical tape around the nozzle to restore the function of the nozzle.
Answer: Run a stainless sheet-metal screw into the end. It works great but still only buys you so much time. I have gotten a year out of tubes that way.


how do protons in the nucleus of an atom overcome repuulsions

Question: Why don't protons present in the nucleus of an atom repel each other being  likely charged  ?
Comment: Why, they surely repel, and that with great force. But they also attract.
Answer: The repulsive forces that exist between two like charges (protons here) are called electrostatic forces. These are strong, no doubt, when you consider a mass as small as the nucleus.
However, you are missing one more point here. The repulsive forces between two protons in a nuclei are "overpowered" by the attraction that exists between them due to Nuclear forces. These forces only exist between protons when they are present in the nucleus. FREE protons never attract each other as then nuclear forces do not come into play.
     These nuclear forces are said to be short range, although there is mo mathematical variation derived yet. Still, short range means they are VERY VERY strong over short distances, typical of the distance between two protons in a nucleus. So repuslive electrostatic forces become insignificant.


Report on user who converted lead

Question: How do you create a report that shows which user converted a lead? I want to know who clicked the Convert button on the lead. Marketing creates the lead and then we have sales development that work leads and assign Hot leads to sales managers. I need to run reports on how many leads each inside rep converts.
Answer: do the following:

New Report - Choose Leads with converted Lead Info - this will only be converted leads
Add column: Last Modified By - this will be the user that converted the Lead
Comment: Note that this is only correct if nobody in your org has permissions to edit converted Leads.
Comment: @CharlesT - very true.  I suppose one could use analytic snapshots to capture daily summaries and mitigate effects of said sysad

Report on user who converted lead


Do catalogs fall under copyright laws?

Question: I have a lot of catalogs featuring different products, and basically what I want to know is if there can be a problem to upload all those in a github repository so that anyone can download them, instead of going to the manufacturer sites one by one
Comment: Is your question if *creating* catalogs violates copyright or if catalogs can *be* copyrighted?
Comment: No. My question is if sharing with other people a catalog that is publicly available for free can be an infraction to some copyright law.
Answer: Yes
Facts are not subject to copyright but a catalog is more than a list of facts are meets the criteria for a literary work under copyright law. The choice of how to present the facts (page composition, font choice, order of items, which photos to use etc.) is what makes a literary work - after all, a novel is just a collection of non-copyright words assembled in a particular order.
Comment: Certain simple catalogs in some countries might be considered uncopyrightable if the originality threshold is not met.
Comment: But they are free for anyone to download without registration - am I not allowed to share those with other people? For example, can't I give someone a grocery store flier I've found in my mailbox, and if I can, then can't I scan said flier and upload it to share with anyone on the internet?
Comment: @Jack yes, you can give someone your grocery flier just like you can give someone your Blue Ray of Avengers Endgame. What copyright law prevents you from doing is copying them - the hint is in the word "copy-right".
Comment: "Copying" as of copying to share, or as of deriving content from. Look, I want to know if I can safely upload manuals and catalogs and not have them taken down
Comment: @Jack no, you can't

Do catalogs fall under copyright laws?