How do you find the height of the recurrence tree $T(n,k)=T(\frac{n}{2},k)+T(n,\frac{k}{4})+nk$

Question: I try to find tree height such that first i define:
$H(n,k)=H(\frac{n}{2},k)+H(n,\frac{k}{4})+1$
then find height of left branch of tree=logn & right branch of tree=logk,but now why height of tree is equal to logk+logn?i guess height of tree is Max(logn,logk)why my geuss is not true?
Comment: The height of your recurrence tree is roughly $\max(\log_2n,\log_4k)$. Your recurrence for $H$ should have a $\max$ instead of a $+$.
Comment: please if you can explain why my argument(my guess) is true?in  solution manual used + instead of max but i say it's not true
Answer: Here is a recursive definition of a height of a tree $T$:

If $T$ is a leaf, then its height is 0 (some people prefer to use 1).
Otherwise, the height of $T$ is the maximum height of any of its children, plus 1.

Equivalently, the height of a tree is the maximum length of a root-to-leaf path (in edges; if you measure it in vertices, leaves should have height 1).
This makes it clear that the correct recurrence for the height is
$$
H(n,k) = \max(H(\tfrac{n}{2},k), H(n,\tfrac{k}{4})) + 1,
$$
with an appropriate base case. The solution is roughly $\max(\log_2 n, \log_4 k)$, depending on the base case.
Comment: $H(n,k) = \max(H(\tfrac{n}{2},k), H(n,\tfrac{k}{4})) + 1$ is not correct.


Can we override an interface method with visibility that is not public?

Question: Could you please just provide a simple yes/no answer. It would be sufficient and much appreciated.
Comment: .............No
Answer: If the method signature you defined in interface has public access specifier then you have to override that method, with the same method signature (that means with public access specifier) whenever you implement the interface to any class.
Answer: No. We cannot override an interface method if it's visibility is not public.
And if it has its visibility as public then you can override it with the same method signature (i.e., with the same access specifier public) whenever you implement the interface to any class.


Why is the constant of magnetic fields called permeability and that of electric fields called permittivity?

Question: Basically the title, I found it weird that we use two different names for each fields. What were the reasons for doing so, historically speaking?
Comment: Are you asking why these names were chosen, or why they are different?  The latter should be obvious: they represent different things.
Comment: In what sense do you mean different things? They both are constants which go along with the expressions you use to evaluate the fields, why call it permeability for one field and permitivitty for the other? @CarlWitthoft.
Comment: They are totally different things, they are orthogonal their values are different, the question is disturbing in that it is like the difference between pressure and density of water they must be separated. Maxwell derived these two constants and then proceeded to calculated the speed of light by math that includes both these constants.
Answer: Whilst we now call it electromagnetism, it was originally electricity and magnetism. They were seen as two separate phenomena. Hence the terms permeability and permittivity arose from two distinct fields of study that were only later unified.
It was Oersted in 1820 who first published a link between the two. He had discovered that a magnetic compass needle was deflected by a nearby electric current. This motivated research into electrodynamics, and, forty years later, in 1862, Maxwell published his equations that unified electricity and magnetism. It was one of the earliest unifications. Incidentally, Oersted is often said to gave discovered the link accidentally. This is simply myth. The truth is he was researching for a link between electricity and magnetism for around two years before he made the above discovery.
Whilst one could argue that the two terms - permeability and permittivity - should be unified into a single term, the terms remained as they were, as they had already been established for some time. In fact, recently standards organisations have moved to calling them the electric and magnetic constants.


How to access Google Family Link from within child device?

Question: I want to install an application directly from .apk file on my child's phone. This operation is blocked due to the fact that the device is controlled by a parent.
On my child's phone I have an application called "Parental Control" installed. It is clearly from Google (help icon points to Google resources) though I have no idea what is it and how does it differs from Google Family Link.
Tapping (?) icon in the top-right corner opens a Family Link help where I can read (in "Unlock your child's device" section):

On your child's device, click Parent Access.
Enter the password for the parent's account used to supervise the child.

The problem is that I cannot find even a trace of "Parent Access" button or menu item. Neither in this "Parental Control" nor anywhere within the system (Readme 9A, Android 11).
Trying to resolve the above, in addition to this "Parental Control", I have also installed "the original" (?) Google Family Link app (also on child's phone). But when I am trying to run it, I am falling into a never-ending loop of:

Welcome to Family Link
Continue as [child name] (button)
The Family Link app is for parents
Parent sign-in (button)
Welcome to Family Link

I don't know what am I missing or doing wrong.
How can I access "parent mode" in Google Family Link-supervised child's phone? Or temporarily disable this supervision? How can I install some third-party application directly from .apk file on Google Family Link-supervised device?
This Redmi 9A phone is used as a spare device when the actual phone (Redmi 11S) is being repaired. But I recall that I had exactly the same problems (i.e. never-ending loop in Google Family Link) on Redmi 11S.
Answer: To gain access to "Parent Access", lock child's device from Family Link app on your own device then you'll see the "Parent Access" button on lock screen of your child's device(See attached screenshot I got from Internet).
BTW, Family Link app is for parents while "Parental Control" is available on supervised devices.


How to access changeset without data access?

Question: I want to ask a serious concern due to data privacy. As I have to work from outside country and due to data protection production user data is not allowed to share with me as I have stay outside country.
I have to do deployment on production on different stages. Now the question is, possible to have only deployment feature via changeset so that I should not have access to data but only the changeset on salesforce production? I think I should not have administrator rights but then how can I access changeset?
What are the possible solutions to this problem so that data privacy should be in place and the development work should be done?
Thanks in advance.
Answer: Request a dataless developer sandbox.
In developer sandboxes you can be an admin and prepare packages, as well as outbound change sets.


Does 'tuned' need to keep running?

Question: On my CentOS 7 systems, I use tuned-adm to set a profile appropriate to the environment during configuration, but after that, I never subsequently change that profile. It seems that the tuned system spawns a process (/usr/bin/python -Es /usr/sbin/tuned -l -P) for dynamic monitoring and adjustment.  This process uses noticeably more memory compared to other daemons on my system.  I would like to reduce nonessential services on a certain memory-constrained server.  If I do not use a profile that involves dynamically adjusting parameters such as power consumption, does the tuned process need to keep running? Can I safely stop the process and have the profile that I originally set up persist from that point on?
Answer: Tuned sets the performance optimizations at boot time. If you disable the process and reboot your server, optimizations would be lost.
You can; however, stop the process after boot and keep whatever settings tuned created at boot time. At least, this is what my testing showed.
Comment: I tried turning off the `tuned` service (`systemctl stop tuned`) and then checking the system parameters (via `sysctl`), but in my testing, turning off the daemon reverted the settings back to the values before `tuned` was running. I am curious why this is different from your environment. Can you explain how you did your testing?
Answer: As of CentOS 7.2 tuned now has a no-daemon mode which can be turned on by setting daemon = 0 in /etc/tuned/tuned-main.conf.  This is mentioned in the RedHat Performance Tuning Guide.

Does 'tuned' need to keep running?


How to copy a file to a pendrive in Ubuntu terminal

Question: What is the command to copy a file to a pendrive in Ubuntu terminal?
Comment: The same way you file copy to anywhere else. Where in the filesystem is your pendive mounted?
Answer: When you insert your pendrive, it is automatically opened in the GUI. Press Ctrl+L in the file manager window to see the path where your pendrive is actually mounted (it will be usually /media/username/label where username is your username, and label is the label given to your pendrive when it was formatted). In the terminal, just copy files to this path using cp command: cp filename.txt /media/username/label.


What happens to Lilypads in the rain?

Question: If you have a funky Lilypad clothing and it gets rained on or you spontaneously decide to go for a swim in it  :)   what happen?
Comment: Note that if any electronics gets wet and stops working, you may be able to resurrect it by thorough cleaning in nonconductive solvent.
Comment: That reminds me of this video of the folks at Adafruit spraying some circuitry with a hydrophobic spray coating.  It's pretty entertaining: https://www.youtube.com/watch?v=GNJ4CEoOg4g
Comment: Does the decision HAVE to be spontaneous? What if it's not. What if it's pre-meditated? Does that make a difference? Think about it.....  !! Why not try it with your iPhone in your pocket first, just to be sure.
Answer: If the circuit is powered when you put it in water
Water would add random paths where the current can flow in your circuit. Most probably something will short out. If you're lucky, the circuit will just not work, in the worst case you can damage the chip on the Lilypad. If you predict that your circuit will have contact with water, you can experiment with:

enclosing it in something waterproof
(some synthetic material, maybe?)
using waterproof fixatives from art supplies (these are in spray and coat your electronics with a thin waterproof film of chemicals). There are also some specialty products for coating electronics, although I haven't tried them.
to make your LilyPad really safe, you can cast it into epoxy resin or something of the like.
be sure to insulate every exterior wire, too. (For example wires that go to an LED somewhere)

If the circuit is not powered when you put it in water
It shouldn't be a big problem. The circuit will be okay AS LONG as you let it dry completely before powering up again. Most cell phones can survive trips to the bottom of the lake (the batteries don't). It is a good idea, if you consider spontaneous swimming, to put the battery out. The problem you may have is the circuit rusting prematurely, but that shouldn't be the case of arduino and lilypad.
Answer: Not owning one myself, I'd need to guess.
According to the arduino website, the pad itself won't get harmed:

Washability
  Wash at your own risk - we do ;). We recommend washing projects by hand with a mild detergent. Drip dry. Make sure you remove your power supply first!

Electronics and water don't mix usually for two reasons:

short circuits: the ions in the water short circuit the board, rendering it infunctional or even destroying it. The latter happens when power from the supply voltage goes to places it shouldn't go. This is especially important for high voltage devices.

rust: water reacts with certain materials and corrosion occurs over time

I'd guess that a coated PCB designed to be washed won't rust (that easily) and probably also don't react to short circuits that easily. So in rain there is a good propability that it will work as expected. Submerged under water, however, I'd expect it to fail (primarily due to the open pins on the outside) and you should specially protect your power supply and leads. (hence the warning in above quote)
You have to make similar reasonings about the other components of your clothing. If they are designed to withstand washing they'll probably work in some rain, too. But only really waterproof connections will work with that much water you have when swimming.
Answer: I'd vote for corrosion, here's a photo from my collection:

What happens to Lilypads in the rain?


Forgotten PostgreSQL Windows password

Question: This morning I've been trying to connect the PostgreSQL database on my Windows 7 Professional desktop.
The default value is 'postgres', but sure enough I forgot what password I used when I originally installed it.
I have googled and found a post related to resetting your password. I followed the steps, but the end result is a bit different then mentioned in the post. I used—
net user postgres postgres

to reset the password for my database but instead of a success message I am getting:

"System error 5 has occurred. Access is denied."

system error. How do I avoid this error and reset the password?
Answer: (Note: Not much of this is relevant to readers using PostgreSQL 9.2 or above from the EDB installers, which now have a greatly simplified default install using the NETWORK SERVICE, though you can still configure other accounts).

I have used net user postgres postgres
  to reset the password for my database but instead of a success message I am getting "System error 5 has occurred. Access is denied."

You've reset (or tried to reset) the service account password. PostgreSQL won't run as Administrator for security reasons and the installer generally sets it up with a "postgres" user account in PostgreSQL 9.1 and older1. On Windows you can't start a service as a user without saving the password of the user in the registry, so that's what the installer does.
If you change the password for the Windows user account postgres, the PostgreSQL service can no longer start. So don't do that, you'll have to fix the service configuration to store the updated password.
Thankfully I think another mistake prevented you from doing that. It looks like you're probably running your command prompt without using "Run as Administrator" on an unprivileged Windows user account or a machine with UAC, so it isn't running with the access permissions required to change the password for the postgres user.
Before you try to change that password, make sure it's really what you want to do. What's the problem you're trying to solve here? Are you attempting to install a database update or something else that's asking for the password for the postgres Windows user?
Most likely you're just trying to log in to the database. For that, you use the (unfortunately completely unrelated) password stored in the database its self. Since you've lost/forgotten it you'll have to reset it:

Find your pg_hba.conf, usually in C:\Program Files\PostgreSQL\9.1\data\pg_hba.conf
If necessary, set the permissions on it so that you can modify it; your user account might not be able to do so until you use the security tab in the properties dialog to give yourself that right by using an admin override. Alternately, find notepad / notepad++ in your start menu, right click, choose "Run as administrator", then use File->Open to open pg_hba.conf that way.
Edit it to set the "host" line for user "postgres" on host "127.0.0.1/32" to "trust". You can add the line if it isn't there; just insert:
host all postgres 127.0.0.1/32 trust
host all postgres ::1/128      trust # if IPv6 is in use

before any other lines. (You can ignore comments, lines beginning with #).
Restart the PostgreSQL service from the Services control panel (start->run->services.msc)
connect using psql or PgAdmin-III or whatever you prefer
ALTER USER postgres PASSWORD 'postgres'
remove the line you added to pg_hba.conf or change it back
restart PostgreSQL again.

See: How do I reset the postgres password for PostgreSQL on Windows?

1. 9.2 now uses the NETWORKSERVICE account, which doesn't require a password, so this problem goes away.
Comment: You may also need an ip6 entry as well: "host all postgres ::1/128 trust"
Comment: @EvanCarroll If you're using `NETWORK SERVICE` there's no password to reset. If you installed  on 9.2+ using a different account, the same information applies. And there's no change to the part around resetting the *postgres superuser database account* password. So there's not really any change needed.
Comment: Still got me out of trouble with postreSQL 9.6 on my dev machine. Unsure why people think it doesn't help > 9.2
Comment: @darwindave Depends on your install. If you installed to use the `NETWORKSERVICE` user account, there's no servce account password. If you installed to use a dedicated service account like `postgres` or a domain account, then it can help.
Comment: Can you bring this answer up to date with 9.2+ too showing both methods for Windows?
Comment: Some people are asking this question about 9.2 I'm not a windows user, I would just explicit in your answer what *NETWORKSERVICE* is and how it works differently. I just flagged probably 5 similar questions (windows pg password resets) to this none of them really explained NETWORKSERVICE and I thought you explained this the best here.
Comment: @EvanCarroll That's more a matter for the MSDN documentation, but the simple version is that `NETWORK SERVICE` is a local-Administrator-like account with no password that can only be used to run services.
Comment: New user @WestonPace suggests that the `ALTER USER` command should be terminated by a `;`, al least for use in `psql`.
Comment: What is the hba.conf file supposed to look like? I can't start my server.
Comment: @DanielL.VanDenBosch New question please. Post a link to this one in your new question for context if you think it'll help.
Comment: I had this same problem using PostgreSQL 15, so no, I do not believe the problem has 'gone away', but maybe my problem was different? I followed these steps to reset the postgres user as configured in Postgres (not Windows) and it worked.
Comment: I realized my previous comment wasn't really applicable to the OP question, which was for the Windows user, not the PostgreSQL user...
Answer: You need to distinguish between your system (Windows) user called "postgres" and the database user with the same name.
Find your pg_hba.conf file - this controls access to the PostgreSQL server. You will need to edit it as a user with Administrator rights. Look for lines that mention user "postgres" and temporarily set the mode to "trust". Restart postgresql and then you should be able to connect without a password. Reset the password, then restore the file to its original settings and restart PostgreSQL.
The manual has details on authentication methods and the pg_hba.conf file.
Answer: If anyone else encounters this problem, while also using pgAdmin, I suggest you take a look at this: http://www.homebrewandtechnology.com/blog/graphicallychangepostgresadminpassword
Comment: You may want to add salient points of the article you link to directly to your post, otherwise this answer will become useless when (not _if_) the link goes stale.

Forgotten PostgreSQL Windows password


How does one use the Fairlearn metrics to make a decision on whether a feature is biased or not?

Question: Can anyone suggest best practice guidelines on selecting thresholds for the disparity metrics to determine if a sensitive attribute is biased or not?
Answer: This is a great question!  To figure this out, it really helps to frame the impact of these analytical choices in terms of how it measures real harms to real people.
If you're into research papers, Language (Technology) is Power: A Critical Survey of "Bias" in NLP (Blodget et al. 2020) suggests some ways to approach fairness work that can lead to more productive conversations than focusing on bias alone.
More practically, framing the conversation in terms of real harms to real people then allows you to express the impact of the threshold choices for fairness metrics in accessible human terms.  That can go along way to illustrative to various stakeholders why this work matters and is worth doing.
To sketch this out a bit more, false positives often lead to different harms than false negatives, and if there are human review processes this influences how you might quantify these kinds of harms or risks.  Upstream labeling noise can influence how much trust you put in the thresholding procedure to capture real harms.  For decision support systems, downstream engagement, adoption, and trust in predictive systems often influences whether human decision makers actually make use of model predictions.  A few lines of code can show stakeholders the impact of that kind of upstream or downstream noise on fairness metrics, and show stakeholders other ways that the technical system may be amplifying real harms.
If you want to chat more, or dig into more specifics that would help you explore this or kick off those conversation on your team, feel free to ask in https://gitter.im/fairlearn/community as well.  Like most software engineering work, it's easier to give more actionable suggestions within a specific application, context or set of constraints.


Molasses - dry vs. wet

Question: My gingerbread house dough recipe calls for 1 cup of molasses. I live in Europe and could only find a dry version (texture is similar to brown sugar, and is sticky). How do I substitute this dry ingredient when the recipe originally called for the syrupy-version of molasses?
Comment: I believe that this maybe a cultural issue. Living in the U.S. my 'culinary experience' does not extend to "dry molasses" but my [cattle ranching experience DOES](http://www.amazon.com/GreenSense-Dry-Molasses-50-lb/dp/B00025H2T0). **This is a feed supplement for livestock** and I hope this is _not_ what you are looking at.

Can you provide a manufacturers link to the product you are looking at?

One alternative is that you may have what we would call [Dark Brown Sugar](http://www.foodnetwork.com/recipes/alton-brown/homemade-dark-brown-sugar-recipe/index.html) which is white sugar + molasses
Comment: You might have better luck finding treacle, which is the same thing.
Comment: Can you provide label information for the product you found?  I have *never* heard of dry molasses.
Comment: Do you insist on using this thing? Because if you don't, there are lots of other substitutes for molasses, just about any liquid natural sweetener will do. In fact, gingerbread originates from Europe, and is normally baked with honey, in that sense the American recipe uses molasses as a honey substitute.
Comment: I have only seen dry molasses in the garden center.  Is it safe for human consumption?
Answer: The American English term 'molasses' translates to 'dark treacle' in British English. Dried molasses, at least that which I am familiar with, is sulphered blackstrap molasses (the darkest, most bitter variety) and typically used as animal feed or as a soil amendment.
If you can't find dark treacle and your recipe calls for white sugar substitute golden syrup (similar to a very light molasses) or honey for the molasses and substitute brown sugar (which is a mixture of white refined sugar and molasses) for white sugar to up the molasses flavor with dark brown sugar preferred as it has more molasses added. Pack the brown sugar and substitute 1:1 on a volumetric basis.
Answer: The dry molasses is an excellent commodity in case you run out of the regular version. It is great for boating since it is easier to store. It can be used in BBQ sauce, banana bread, ginger cookies, rye bread. If you need to add moisture to it, the recommended ratio is 3/4 molasses powder to 1/4 water.
Answer: Use honey instead, it's not worth it.
Comment: That would give a *very* different flavour than molasses. It could be very good, but if they *want* the flavour of molasses, then honey won't do. Also, I find honey usually isn't as thick as molasses so it might not produce the same texture.

Molasses - dry vs. wet


Is it possible to fix garbage disposal leaking due to corrosion at outlet?

Question: I had to replace the drain pipe on my garbage disposal because of a hole in the pipe.  When attempting to replace it I am unable to get a good seal at the outlet because corrosion has damaged it.  Is there any tricks that can be used to improve the seal here to better prevent leakage?
This is what the corrosion looks like:
Comment: Why don't you clean that debris out of the outlet so that the underlying material can be seen?  As it is, there is no way to tell.
Comment: I agree with the above comments; clean it and see if it's damaged, and if it is, toss it.  That said, I've never had any luck getting a disposal in such a bad state to remain leak-free for more than a couple of months.  The connection to the tube isn't so amazing even when it's new.   To the point that I'd be very unmotivated to spend time cleaning that up and buying parts knowing it probably won't last.
Comment: I'd say there's far less "corrosion" and just a large collection of "gunk". It looks like the hole has reduced in size because the rubber washer was squashed out of place and has "frozen" into that shape from all the gunk. If that truly is metal that's deformed like that, then odds are really good you'll have to replace the whole thing. I doubt you can get just the outlet part. However, if you search "replacement parts ` `" of your disposal, you might just find it's available.
Answer: Most sink drain parts are made of polypropylene plastic. It turns out that there's not much that sticks to PP so an adhesive based seal is a big ask. A gasket or o-ring of some sort will be needed. Those require clean, smooth, and flat surfaces, so let's start there.
The gunk looks like it might be a combination of rust, mineral scale, and semi-dried food slime. Some combination of mechanical and chemical work might clean things up. Maybe manual scraping or sanding, or soaking with an acid like vinegar. A rotary tool ("Dremel") with a wire brush or sanding attachment might speed the work.
If you can get it clean then you've got to find a sealing element. A big fat o-ring might do the trick if the flange on the outlet pipe is wide enough, or maybe a replacement outlet pipe will include a new gasket. You could even try using RTV silicone -- but note that silicone won't actually stick to the PP plastic. It might work to apply the silicone to the disposer outlet port, assemble the parts loosely, wait for the silicone to cure, and then tighten the parts so that there's mechanical pressure holding the PP drain tube to the silicone.
To be clear -- based on its apparent condition, most people would replace that disposer. But if you're up for a challenge and the time-vs-money balance makes sense, maybe these ideas will be some help.
Comment: That last paragraph is the key.


Time evolution in an oscillating magnetic field for spin-1/2 particles

Question: This might be a rookie mistake.
For a magnetic field oriented in the z-direction of form, $B = B_0 \cos(\omega t) \hat{k}$.
The Hamiltonian in this case will be $H = \omega_0 \cos(\omega t) \hat{S_z}$.
For an initial state of,  $|{\psi(0)} \rangle  = |+z \rangle $.
By solving the Schrodinger's equation, I obtain $$|\psi(t) \rangle = e^{-\frac{i \omega_0}{2} \sin(\omega t)} |+z\rangle $$.
But when I tried to find the time evolution of the state by using the relation  between
the time evolution  operator and the Hamiltonian, of form $$\hat{U} = e^{- \frac{i \hat{H}t}{\hbar}}$$
I got the state to become into, $$|\psi(t)\rangle = e^{- \frac{i \omega_0 \cos(\omega t) t}{2}} |+z\rangle $$
The second solution does not seem to agree with the Schrodinger's equation, is this because the Hamiltonian is explicitly dependent on time?
Comment: I guess this happens because the relation of the provided relation for time evolution operator with the Hamiltonian is only applicable for time independent Hamiltonian!
Comment: For this case you only need to integrate the time-dependent Hamiltonian and don't need that long series because the Hamiltonian at different time commute.
Answer: Recall that the Schrodinger equation
$$
i \frac{\partial}{\partial t} | \psi \rangle = H |\psi \rangle
$$
yields the time evolution
$$
|\psi(t)\rangle = e^{-i H t} | \psi(0) \rangle
$$
only when the Hamiltonian is time independent.
There are two other situations:
(1) If the Hamiltonian commutes with itself at all times, then the solution for the time evolution operator is given by
$$
|\psi(t)\rangle = e^{-i \int_0^t H(t') dt'} | \psi(0) \rangle
$$
(2) If the Hamiltonian does not commute with itself at different times then the formal time evolution is a Dyson series
\begin{align*}
|\psi(t)\rangle = \left(\mathbb{1} + \sum_{n=1}^\infty\int_0^t dt_1 \int_0^{t_1} dt_2\cdots \int_0^{t_{n-1}} dt_n H(t_1) H(t_2)\cdots H(t_n)\right)|\psi(0)\rangle
\end{align*}
For more on to handle these situation see pg. 72 of Sakurai.
Comment: although in the case of a spin-1/2 system the solution is easily found without the perturbative series.


Taxonomy term title as page title in custom view

Question: I have a custom view where I show a list of nodes by taxonomy term. Since there are many terms in dictionary, I can't describe every view page manually. Is there any way to set the page title as a taxonomy term title?
Answer: You can use the argument added into the filter and there will be option to override the title, there  you can pass %1 which will automatically replace the title with the Taxonomy term title.
Comment: In my case it prints term id.
Comment: Ok, When I specified validation criteria it worked. Thanks!
Answer: For Drupal 8 this would be <code>{{ arguments.name }}</code>.


What's the difference between RouteLink and ActionLink in ASP.NET MVC?

Question: I think that the title pretty much sums it up:
What's the difference between RouteLink() and ActionLink() in ASP.NET MVC?
i.e. when do you use Html.RouteLink() and when do you use Html.ActionLink() in your View?
Answer: Action and Routes don't have to have a 1:1 relationship.
ActionLink will generate the URL to get to an action using the first matching route by action name.
RouteLink will generate a URL to a specific route determined either by name or route values.
Comment: +1 for a great blog post. Really handy. And shows there's just too many possibilities. MS guys should only implement the fastest. But people rather use the fancy lambda slowest one.
Comment: hey thanks But I think the link is broken didnt reached.
pls will you again provide me the link
thanks
Answer: Actually, the output from the two methods is the same, but it is generated in slightly different ways:
Html.ActionLink() makes it easy to generate ActionLinks fast, and will give you basic control over what is rendered. If you don't have too many routes, or don't need to give too much or too specific information, this will do the work just fine.
The Html.RouteLink() method takes slightly different arguments, and thus gives you a little more detailed control over the way things are handled. I tend to use this method when my scenario is a little more complicated, or when I have a more detailed route structure.
One example is a recent project where I (for flexibility) rather had several different routes, which were all quite simple, than one complex one that would allow for a lot of information. Thus, I ended up with four or five routes for the same Controller, all with a default action specified. I mostly used the RouteLink version, because when I specified a route name, the default parameters were entered automatically.
Use them as you feel like, and as they make sense to your project. There is really no upside/downside to either of them (that is not matched by some other...).
Answer: In addition to the other answers given here, RouteLink is a little bit faster, and cannot ever match the wrong route because you changed your routing table.
Comment: Simone Chiaretta did some performance analysis here: http://codeclimber.net.nz/archive/2009/04/17/the-performances-implications-of-the-expression-tree-based-actionlink-helper.aspx
Answer: RouteLink takes the name of a route, so if your route names are reliable and fairly unique then this will be the same even if the action name to be used changes. ActionLink links to a specific action of a specific controller instead. I use both in my views, depending on what kind of link I'm after!


Partitioning with Spark Graphframes

Question: I'm working with a largish (?) graph (60 million vertices and 9.5 billion edges) using Spark Graphframes. The underlying data is not large - the vertices take about 500mb on disk and the edges are about 40gb. My containers are frequently shutting down due to java heap out of memory problems, but I think the underlying problem is that the graphframe is constantly shuffling data around (I'm seeing shuffle read/write of up to 150gb). Is there a way to efficiently partition a Graphframe or the underlying edges/vertices to reduce shuffle?
Answer: TL;DR It is not possible to efficiently partition Graphframe.
Graphframe algorithms can be separated into two categories:

Methods which delegate processing to GraphX counterpart. GraphX supports a number of partitioning methods but these are not exposed via Graphframe API. If you use one of these it is probably better to use GraphX directly.
Unfortunately development of GraphX stopped almost completely with only a handful of small fixes over the last two years and overall performance is highly disappointing compared to both in-core libraries and out-of-core libraries.
Methods which are implemented natively using Spark Datasets, which considering limited programming model and only a single partitioning mode, are deeply unfit for complex graph processing.
While relational columnar storage can be used for efficient graph processing naive iterative join approach employed by Graphframes just don't scale (but it is OK for shallow traversing with one or two hops).'
You can try to repartition vertices and edges DataFrames by id and src respectively:
val nPart: Int = ???

GraphFrame(v.repartition(nPart, v("id")), e.repartition(e(nPart, "src")))

what should help in some cases.

Overall, at it's current (Dec, 2016) state, Spark is not a good choice for intensive graph analytics.
Comment: @John Can you share the update on How you resolved this performance issue ?
Comment: Appreciate the insight. I found that I can boost performance by creating a custom column in the edge dataframe using the GraphX [partition schema](http://note.yuhc.me/2015/03/graphx-partition-strategy/) and partitioning on that.
Comment: @John I couldn't figure it out, do you have an example on how to do the partitioning on a custom column?
Comment: @John +1 for a coding example describing how you implemented the partition schema
Answer: Here's the partial solution / workaround - create a UDF that mimics one of the partition functions to create a new column and partition on that.
num_parts = 256
random_vertex_cut = udf.register("random_vertex_cut", lambda src, dst: math.abs((src, dst).hashCode()) % num_parts, IntegerType())

edge.withColumn("v_cut", random_vertex_cut(col("src"), col("dst")).repartition(256, "v_cut")

This approach can help some, but not as well as GraphX.

Partitioning with Spark Graphframes


What is the difference between "Have you got a runny nose?" and "Is your nose running?"

Question: When you are talking to a patient as a doctor or while asking a friend what is the difference between "have you got a runny nose?" and "Is your nose running?". How do you choose which one to say/ask?
Answer: You might have a "runny nose" (which means that, as a result of a cold or nasal infection, you tend to have lots of liquid mucus)  but right now your nose isn't running (no liquid is dripping from your nose).  A runny nose might last for a few days.  But your nose won't be running for all the time.
The solution to a running nose is to use tissue or a handkerchief.
The solution to a runny nose might be to carry a handkerchief, or you might use a decongestant or try steam inhalation.
Answer: A runny/running nose is producing or discharging  more mucus than usual.
It is better to say/ask 'Have you got a runny nose?
'Runny' is more common.


Shape key import with unwanted rotation

Question: When I export an obj with settings so the vertex order is intact and then import it back into Blender with import settings set so vertex order is still intact, the resulting shape key works but the entire model rotates 90 degrees depending on the orientation settings from import/export obj settings.  I have found no way to remove this rotation data.  In other applications the way it would be fixed easily would be to reset the Xform or freeze transformation.  I know Blender doesn't have this type of function so I have no idea how to fix this issue.  Here is a link to a youtube video I made of this problem.  Youtube video showing problem.
Comment: If you watch the video you have posted again. You will see that your original object has Z pointing up. One the imported model you will see that it's Y is pointing up. That's the root of the problem. Y up is for exporting to game engines like UDK. If you have intention to use your export in blender make sure to export it Z up.
Answer: Everything is working exactly as it should.
When you import an object blender will rotate it so that it lines up with the blender world. The rotation is determined by the import settings Forward and Up.

All you have to do is apply the rotation ( CtrlA > Rotation ) on your imported object before making the shape key.
You will have to remake the shape key, or rotate the mesh in edit mode.
If you use the edit mode option you will want to set the 3D cursor to the original object's origin then set the Pivot Point to 3D cursor ( . ).

Shape key import with unwanted rotation


error since update to Meteor Version 0.4

Question: i have a template with list of input-elements. their value is the title-element of an document. The input-elemnts have an keyup-event, so that when i wrote in the input-element, the title will updated. when i focus the input-elemnt, the Session-variable selectedDoc is set with the id of the document. until then it works. In another template i have a following function:
<code>Template.content.isSelected = function () {
 return !Session.equals("selectedDoc",null) ? 'small' : '';
}
</code>
When i used the function above in my code, the following error occurs.
when i focus an input-element and write something, after the first letter the the focus disappeared. the error occurs only by the first time, i focus an input-element.
what am I doing wrong? with Version 0.3.9 everything worked well.
thanks
Answer:
What am I doing wrong?

You're not following Meteor or reading the changelog, so you haven't noticed the API changes.
If you read them, especially Spark, and adapt your code accordingly; your code will work on 0.4.
Comment: I have read the documentation and use the template preserve-function as follows:                                     Template.name.preserve({
  'input[id]': function (node) { return node.id; }
});


Rest in peace (RIP) phrase

Question: How to ensure whether once a person man or woman passes away, his or her soul (RIP) is resting in peace now?
Comment: By repentance toward God and by faith in the Lord Jesus Christ is rest obtained from sinful works and from legal works and from death and hades. There is no other way. We cannot be certain of the condition of the dead. All will be reconciled at the Great Judgment when the Lord returns.
Comment: My own pursuit in this life is to fulfil all the wishes and desires of God whom I serve. _Then_ shall my soul 'Rest in Peace'. Not otherwise.
Comment: My opinion is "If all person's wishes and desires were/are fulfilled" then his/her soul will remain in peace after departing.
Answer: God alone determines the state of those who have died physically, telling us that their bodies rot in the grave until the Day of Resurrection and Judgment, when every one who has died will be raised from the dead in a new resurrection body that God has made fit for the eternal state. Their invisible, spiritual part is elsewhere, awaiting that day when it will be 'clothed' in that new body, to then stand before the Great White Throne, for judgment. That is the orthodox Christian teaching.
No human who is alive can do anything to affect the eternal resting in peace of the deceased. However, quite a few Christians disagree with that, thinking they can actively help their departed loved ones to eventually 'merit' getting a place in heaven. But I'm not here to go into that as I want to stick to what the Bible says to answer your question.
The Bible has Jesus giving an account of two Jewish men who died, and their very different experiences with their spiritual part. He answers your question. It's in Luke's gospel chapter 16, verses 19 to 31.
The rich man died and found himself in torments in hell. The beggar who sat at his gate died and found himself carried by angels to bliss in "the bosom of Abraham". The formerly rich man cried to his Father Abraham for mercy due to the flame, to have the former beggar sent down to cool his tongue with some water. But Abraham said the beggar was now comforted [obviously at peace] while he was in torments. There was a great chasm between the two, which could not be crossed. So the rich man begged for Lazarus to be sent to Earth to warn his brothers of the terrible torments he was now in, so they could avoid ending up there when they died.
Abraham said that they had Moses and the prophets - to listen to those ones. The response to that? "Nay, father Abraham: but if one went to them from the dead, they will repent."
Abraham's response in turn was, "If they hear not Moses and the prophets, neither will they be persuaded, though one rose from the dead."
Consider what Jesus was warning us of - Moses and the prophets are in the Old Testament part of the Bible. The prophet greater than Moses, who rose from the dead three days after crucifixion, is alive today, still warning us who read his words in the New Testament that he is the only assurance of resting in peace when we die, if we have found peace with him, through total faith in what he did to save us from the judgment we deserve. Only then can we experience the peace Jesus gives to believers in him. It's not the peace that the world gives - read John 14:27 & 16:33. Those who confess their sins and put faith in Christ, and in no-one or nothing else - experience that peace before they die. But not due to anything they do - entirely due to what Christ has done to deliver them from the condemnation of their sin.
This proves, from Jesus' own lips, that no human who is alive on Earth can do anything to affect the eternal state of the deceased. If they are in torments when they die, before the Day of Resurrection and Judgment, they will experience that for eternity. Read Revelation chapter 20 verses 4 to 15. The Bible is your best source of information on this topic. It will require hours of diligent, prayerful study to sort out this huge topic but I have directed you to a good starting point (Luke 16) and the conclusion of the matter (Revelation 20).
Comment: I solmenly agree with your teaching that the living cannot do anything to influence the state of the dead. Whether a dead person is peaceful depends on whether they accepted Jesus while they were still alive and kept his commandments. If they did then they are at peace with their eternal destinies but if they didn't then they are not at peace because the wrath of God remains on their souls which implies hell
Answer: The first thing is to not base your conclusions on mere feelings. Peace is not an emotion to pursue such that if you feel it very strongly you know that you are in good standing with God and will go to Heaven.
The surest foundation for a life of peace now that concludes with a promise of eternal peace is to pursue it consistently and comprehensively.

Turn away from evil and do good;
seek peace and pursue it. (Psalm 34:14)

Some of the dimensions of peace are:

Peace with God
Peace with your family and neighbors
Peace with yourself

If possible, so far as it depends on you, live peaceably with all.
(Romans 12:18)

Part of the pursuit of peace is to not neglect any of the three aspects of your person that need to participate:

mind: Learn the Bible's teachings on Peace, to "be transformed by the renewing of your mind"
heart: Approve of God's teachings and make pursuing peace a priority
hand: Discipline yourself to prioritize peace and bring your daily habits into line with this goal

The Bible has specific teachings on different aspects of peace.

Ecclesiastes: Maps out a path to maturity from birth to peace, in the poem in chapter 3. Solomon's name means "peaceable"; he is an excellent teacher. The rest of Ecclesiastes comments on how to navigate the problems of key stages in life.
Romans: Romans 5 is about peace with God. The Apostle Paul speaks of peace more than any other writer in the Bible by a factor of two, so read all his letters. Peace is in the list of the fruits of the Holy Spirit in Galatians 5.
Matthew: Jesus is the prince of Peace and Lord of the Harvest. He describes how to reap a spiritual harvest, thirty, sixty or a hundredfold. In the Sermon on the Mount he preaches about how to overcome anxiety by treasuring the right things. A person who brings in a great harvest will be at peace.
Exodus: The Ten Commandments speak of the sabbath rest. Hebrews 4:9 also says "So then, there remains a Sabbath rest for the people of God..." The Psalms are a commentary on the Law and many of them can guide the weary soul toward peace, like Psalm 23, where the good shepherd leads you beside still waters to restore your soul.

Meditating on the above will transform your mind, reform your heart, and spur you on to love and good deeds. When your life is so dedicated, eternal peace will invade this temporal world.
To all these things, add this from the Beatitudes:

"Blessed are the peacemakers, for they shall be called sons of God."
(Matthew 5:9)

If you share with others the peace you have received from God, then nothing can take that peace away from you.
The above thoughts are distilled from my personal meditations during the first two years of the Covid pandemic, when my singular focus was to pray and meditate on the path to peace amidst troubling times.

Rest in peace (RIP) phrase


How would an "Atari Asteroids" type toroidal universe work?

Question: The universe in which Atari's Asteroids is played would be a toroid when embedded in three dimensional space. I am interested in a universe where space is actually curved into a toroid. My question is, Could a toroidal section of the universe exist isolated due to curvature of space by an object such as a black hole? In other words, could some condition exist such that a toroidal piece of space would exist within the universe, could the asteroids game type world theoretically exist?
Comment: Why do you say it would be toroidal when it could as easily be spherical. The only thing that is required is that the universe be finite and closed, the game has nothing to say about curvature.
Comment: @A.C.A.C.The game absolutely *does* have something to say about curvature. The Asteroids game field is a topological torus, with zero intrinsic curvature. You could make a game otherwise identical to Asteroids, but with spherical topology, but the classic game is indisputably a toroid.
Answer: This wouldn't occur naturally, this wouldn't last long
Of course other universes aren't bound to the same laws we are.
Here's a picture of a black holes effect on space:

To make a toroidal space you would need one at the center and then many making up a equatorial perimeter. The logistical problem then becomes this:
You would have all the black holes pulling on each other and the center black hole constantly pulling everyone in. In summation, all the gravitational forces are directed inwards, so the system would always collapse.
But, if you made all the outer black holes equal in mass and equidistant from the center and each other. Then gave the outer ones each enough velocity to maintain some kind of orbit. Then, yes, this could exist for some momentary amount of time.
Then, yes, you could play 3d asteroids anywhere in the toroid. Space wouldn't wrap it would compress allowing you traverse great distance. Though, getting out of the gravity would be a trick.


Is there a space requirement for the Kinect?

Question: Is there a certain amount of space needed in order to use the Kinect? How much of an area do you need to move around in?
Answer: Yes, there is a minimum amount of space required:

The Kinect sensor has a practical ranging limit of 1.2–3.5 m (3.9–11 ft) distance when used with the Xbox software. The area required to play Kinect is roughly 6m², although the sensor can maintain tracking through an extended range of approximately 0.7–6 m (2.3–20 ft).

A bit more practical advice is offered by this article:

Microsoft suggests a space of six feet by six feet in front of the Kinect sensor for one player, and eight feet by six feet for two players.

In "real life terms," my couch is far enough away from my TV that I can pull a queen sized sofa bed out of it without having to move it and still walk between the bed and the TV stand.  I still have to move the couch 2-3' back from where it sits to play with the Kinect, and that just barely makes it happy.  If you've got a coffee table or anything else between your couch and your TV, you're going to have to move it as well.
Nyko makes a "small room" zoom lens for the Kinect, although I've heard mixed results from using it.
Comment: So your saying you really need space to use the Kinect. For my use I have only about 4 feet in between the couch and the TV. Will this be a practical space to use it in?
Comment: I don't think so, no.  6 feet is pretty much the absolute minimum, as far as I can tell.


How to cross compile for linux x86 with linux amd64, cmake and g++?

Question: +1 for each piece of information that helps to complete the whole picture. You don't need to know the whole answer. I'll appreciate individual pieces of the puzzle just as much. Thanks.
I am about to attempt my first cross-compilation. I have searched both SO and the web and found many pieces of information, but I don't always know how to put those pieces together because there are still some missing pieces.
My host: linux Kubuntu amd64.
Target: linux kubuntu x86 (32bit) (should be easy, no?)
Tools: g++ and cmake.
Here is the information I found:
How to compile a 32-bit binary on a 64-bit linux machine with gcc/cmake
mentions export CFLAGS=-m32. That's one piece.
Cross-platform: selecting data types to use 32/64 bit
mentions data types. I may have to pay attention to that within my code.
#ifdef for 32-bit platform
 #ifdef for 32-bit platform
links to the following, although I am not too sure yet how to use it:
http://predef.sourceforge.net/prearch.html
http://ww.ubuntuforums.org/showthread.php?t=1377396
I did: sudo apt-get install g++-multilib
missing pieces:
Ideally, when I do 'make' (with cmake), it should spit out both a amd64 binary and a x86 one.
Part of my CMakeLists.txt looks like this:
add_definitions(-Wall -pthread)
add_executable (../run.amd64 user.cpp time.cpp init.cpp utils.cpp main.cpp)
target_link_libraries(../run.amd64 cppcms dbixx config++ ctemplate)

How do I introduce the flag -m32 to create a second executable?
Should I want to make only one executable (e.g. for testing and debugging), how do I tell cmake to make either one or both binaries?
Also, you can see that I use some third party libraries, some of which I had to compile myself. Does this mean that I need to compile each of those binaries for the target host as well? Some use cmake and some use: ./configure; make;
How would I do about compiling those libraries for the target host (flags to use, etc.)?
Note: the dynamically linked libraries are already compiled and installed on the target computer, so maybe I don't need to worry about this step... I am not sure: this is one of my missing pieces...
What I need is a kind of tutorial, or at least some of the missing pieces. I'll update this post with more details on what I achieved and how.
Thanks.
P.S.
Is it possible at all?
Searching more, I found this:
http://email@example.com/msg26265.html
"The original design doesn't seem to be designed for anything more than windows-linux or linux-windows cross compiles."
cmake is NOT tested for linux amd64 to  linux x86.
http://www.cmake.org/Wiki/CMake_Cross_Compiling#FAQ.2FPotential_Problems
"On mixed 32/64 bit Linux installations cross compilation cannot be used to build for 32/64 bit only."
??
Answer: If you want to use a toolchain file there is an easier solution (IMHO) than what is proposed by @auledoom. You do not need to write the shell wrapper scripts at all, simply put this in the toolchain file:
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Linux)

# Which compilers to use for C and C++
set(CMAKE_C_COMPILER gcc -m32)
set(CMAKE_CXX_COMPILER g++ -m32)

This will make it a "list variable" in cmake. This solution works for me. Benefit of the toolchain file is that you can there also define paths for 32bit libraries etc, which is usually different from standard paths.
Answer: This solution will allow you cross-compile your cmake project on a linux64 host targeting 32bits, on systems with multi-arch support.
It's uses a "fake" cmake toolchain so CMAKE somehow "believes" it's on 32bit system, so no additional modifications are needed inside your cmake project files, no special configurations, no special settings (well almost).

Install multilib support:
$sudo apt-get install gcc-multilib

Create a "fake" linux32 toolchain

First, we create a "fake" i686 compiler. Go where your CMakeLists.txt resides and create a bin directory. Open your preferred editor and create this simple bash script for gcc compiler.
#!/bin/sh
/usr/bin/gcc -m32 "$@"

As you see, it's just make a call to the system compiler adding the -m flag. Save this as i686-linux-gnu-gcc. Do the same for the g++ compiler
#!/bin/sh
/usr/bin/g++ -m32 "$@"

Save it as i686-linux-gnu-g++. Remember to set the executable flags on this scrips
Create also a symlink to the system ar binary in this form
$ln /usr/bin/ar i686-linux-gnu-ar

At last create the toolchain-linux32.cmake file
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Linux)

# Which compilers to use for C and C++
set(CMAKE_C_COMPILER ${CMAKE_SOURCE_DIR}/bin/i686-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER ${CMAKE_SOURCE_DIR}/bin/i686-linux-gnu-g++)

and create the build directory and call cmake with the toolchain file as argument
$mkdir build && cd build
$cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-linux32.cmake ..

and your done!!!!!
I'll write a more complete guide here, which covers some problems i have with libraries not multi-lib compliant
Answer: this is a simplified version of what I use, and it does create x86 binaries:
set( TargetName myExe )
set( SOURCES a.cpp b.cpp )
add_executable( ${TargetName} ${SOURCES} )
target_link_libraries( ${TargetName} m pthread stdc++ )
set_target_properties( ${TargetName} PROPERTIES COMPILE_FLAGS -m32 LINK_FLAGS -m32 )

furthermore you'll use add_definitions to set compiler flags like -W -Ox -Dxxx etc.
All the lines above are actually split in seperate cmake files, and to get one file to build a number of executables, I generate a master cmake file containing all different configurations I want to build:
project( myProject )
set( SOURCES a.cpp b.cpp )
if( ${ConfigurationType} strequal "Debugx86" )
  include( debugopts.cmake )
  include( x86.cmake )
  include( executable.cmake )
  ...
elseif( ${ConfigurationType} strequal "Releasex64" )
  include( debugopts.cmake )
  include( x86.cmake )
  include( executable.cmake )
  ...
etc

Then there's a driver shell script to build it all. It takes commandline options to set some extra options and select to build everything or just one configuration. Here's a piece of it:
if [ "$myConfig" = "all" -o "$myConfig" = "Debugx86" ]; then
  mkdir -p project_Debugx86
  cd project_Debugx86
  cmkake "$sourceDir" "$cmakeOpts" -DConfigurationType="Debugx86"
  make clean
  make "$makeopts"
fi
if [ "$myConfig" = "all" -o "$myConfig" = "Releasex64" ]; then
  mkdir -p project_Releasex64
  cd project_Releasex64
  cmkake "$sourceDir" "$cmakeOpts" -DConfigurationType="Releasex64
  make clean
  make "$makeopts"
fi

While this is not exactly what you ask for, it works flawlessly and does the same. (Not sure if it is possible in cmake to define any number of targets in cmake itself, and have them built all together by one file.) It just takes some time to write the generator for this files, but once that is done all I have to do is point the generator to a directory with sources, let ir run, then invoke the build script to make everything.
Comment: +1 Thanks for the detailed write-up. I'll study all this and see what I can do.
Answer: All you need is to add -m32 to CFLAGS and CXXFLAGS when running CMake. This can be done via environment variables:
$ CFLAGS=-m32 CXXFLAGS=-m32 cmake .

or by setting corresponding CMake variables:
$ cmake -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 .

This can easily tested with a simple CMake project:
$ uname -m
x86_64
$ CFLAGS=-m32 CXXFLAGS=-m32 cmake .
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
....
$ make
Scanning dependencies of target foo
[100%] Building CXX object CMakeFiles/foo.dir/foo.cc.o
Linking CXX executable foo
[100%] Built target foo
$ file foo
foo: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x5b1871446c92cbdcbf905583e16189f68f3bf5f2, not stripped

where CMakeLists.txt is a trivial CMake file:
project(TEST)
add_executable(foo foo.cc)

and foo.cc is as follows:
int main () {}

Answer: Here is the basic recipe I use all the time for cmake projects..
OPTION(FORCE32 "Force a 32bit compile on 64bit" OFF)
IF(FORCE32)
    if(APPLE)
        SET(CMAKE_OSX_ARCHITECTURES "i386")
    else()
        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
    endif()
ENDIF()

IF(APPLE)
    set(BIN_LIBROOT "macosx")
ELSE()
    if(CMAKE_SIZEOF_VOID_P MATCHES "8" AND NOT(FORCE32) )
        set(BIN_LIBROOT "linux64")
        set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86_64")
        set(BIN_RPATH "\$ORIGIN/lib64")
    else()
        set(BIN_LIBROOT "linux")
        set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86")
        set(BIN_RPATH "\$ORIGIN/lib")
    endif()

    set(CMAKE_SKIP_BUILD_RPATH TRUE)
    set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
    set(CMAKE_INSTALL_RPATH ${BIN_RPATH})
    set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
ENDIF()

Then every target automatically has the .bin.${arch} extension and I never have to think about this for any targets I add.   the ${BIN_LIBROOT} is useful if you have a bunch of precompiled libraries as you as you can use that to dynamically search for libs in your private lib dirs based on the target platform/arch.
Comment: Now I primarily only use this while developing on my 64bit desktop.  When I build my final release linux binaries I build them in a CentOS 6 chroot (2 of them.. one 32bit and one 64bit) using mock.


Get Cart Tax Total programmatically in WooCommerce

Question: How do you get the tax total in WooCommerce in the functions.php page in WordPress,  Using :
global $woocommerce;

$discount = $woocommerce->cart->tax_total;

But is not returning any value.
How can I get Cart Tax Total?
Essentially I want the Tax to calculate for the user, but then have it reduced as the customer will pay the taxes on COD.
Full Code below:
add_action( 'woocommerce_calculate_totals', 'action_cart_calculate_totals', 10, 1 );
function action_cart_calculate_totals( $cart_object ) {

    if ( is_admin() && ! defined( 'DOING_AJAX' ) )
        return;

    if ( !WC()->cart->is_empty() ):
        $cart_object->cart_contents_total *= .10 ;

    endif;
}

//Code for removing tax from total collected
function prefix_add_discount_line( $cart ) {

  global $woocommerce;

  $discount = $woocommerce->cart->tax_total;

  $woocommerce->cart->add_fee( __( 'Tax Paid On COD', 'your-text-domain' ) , - $discount );

}
add_action( 'woocommerce_cart_calculate_fees', 'prefix_add_discount_line' );

Answer:
global $woocommerce; $woocommerce->cart is obsolete for Cart. Use WC()->cart instead.
Here you can use directly $cart (object) argument instead…
The correct property is taxes instead of tax_total.
Is better to use WC_Cart get_taxes() method intead to be compatible with WooCommerce version 3.0+

To achieve what you are trying to Your code is going to be:
// For Woocommerce 2.5+ (2.6.x and 3.0)
add_action( 'woocommerce_cart_calculate_fees', 'prefix_add_discount_line', 10, 1 );
function prefix_add_discount_line( $cart ) {

    if ( is_admin() && ! defined( 'DOING_AJAX' ) )
        return;

    $discount = 0;
    // Get the unformated taxes array
    $taxes = $cart->get_taxes();
    // Add each taxes to $discount
    foreach($taxes as $tax) $discount += $tax;

    // Applying a discount if not null or equal to zero
    if ($discount > 0 && ! empty($discount) )
        $cart->add_fee( __( 'Tax Paid On COD', 'your-text-domain' ) , - $discount );
}

Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested and works.
Answer: You are using wrong function name. Correct function is as below :-
WC()->cart->get_tax_totals( );

Instead of using $woocommerce->cart->tax_total; to get cart total tax, you can do this by subtracting cart total excluding tax from cart total.
You can do this by following code :-
$total_tax = floatval( preg_replace( '#[^\d.]#', '', WC()->cart->get_cart_total() ) ) - WC()->cart->get_total_ex_tax();

If you want to get array for all taxes then you can get through below code :-
WC()->cart->get_taxes( );

Answer: We can use this function taht worked for me.
WC()->cart->get_total_tax();


Is a clean install better than upgrading?

Question: Is it better to install Ubuntu completely new or is the upgrade process just as good? In other words, will my computer run just as problem-free and efficiently when I upgrade as opposed to a fresh install?
Comment: From a brief look it doesn't look like you can use APTonCD to do a release upgrade. And I'm pretty sure it won't help you to backup/recover you documents in case you go for a clean install.
Answer: Typically, upgrades are just fine in Ubuntu. It's not like Windows where you have a huge registry to carry over from your last system. As long as you haven't had to follow many tutorials or done any workarounds to fix problems in a unique way (i.e. using a special application to enable your wireless card or made some major changes to your kernel for whatever reason) you'll be fine.
In fact, I'd say about 90% of people who are asking this question will be fine with the upgrade.
If you want to stay absolutely safe, you can always wait for the vetted point release upgrade, or even maybe wait for the next LTS release in a few years. It's your choice. You'll still be supported for the next three years with updates if you're on 10.04 right now.
Answer: That depends what you use Ubuntu for.

If your installation is only a toy or an appliance (e.g. just for web browsing) and you haven't customized it, reinstall. Make sure you save any personal data (typically you'll want to back up your home directory and restore selected parts).
If the only customizations you've done on your installation are to install additional drivers or make other tweaks because your hardware was poorly supported under the old version, it may be better to do a clean reinstall.
If you've customized your installation in any other way (configured system settings, installed more than a couple of additional programs, etc.), upgrade. If you've used Ubuntu actively, this case probably applies (if nothing else, you're likely to have installed a bunch of packages).

At the system level, Ubuntu is very good at smooth upgrades. Upgrades are tested before each release. This is a supported mode of operation, and it's more likely to leave you with the system you want than reinstalling and trying to remember all your customizations.
At the user level, Ubuntu's default interface is Gnome, which is not so good at importing settings from one version to another. Thus the choice is between

starting from a fresh home directory and restoring all documents and selected settings from a backup; and
keeping your home directory across the upgrade, and looking into the problem if something goes wrong.

In either case, you might as well do a system upgrade.
Comment: @latusaki You can't skip a version when upgrading, so you'll have to go 13.04 → 13.10 → 14.04LTS anyway. 13.04 is no longer supported so I recommend upgrading to 13.10 now. Upgrading doesn't delete anything, except when a package has disappeared. On a typical development machine, upgrading is painless unless you were relying on a compiler bug.
Comment: Here http://askubuntu.com/a/368099/169736, they made an exception for 13.04 since it reached EOL before 12.10. Also here http://meta.askubuntu.com/a/7813/169736
Comment: How safe is it to upgrade a development pc? Is upgrading going to delete existing cmd line tools etc? Also what about existing proprietary drivers (radeon graphics)? Im thinking if I should upgrade 13.04 to 13.10 or wait for LTS.
Comment: 13.04 is an exception tho. They enables upgrading from 12.10 to 13.10 and to 14.04.
Comment: @Braiam Uh? Where do you get this? I've always seen "only from one release to the next or from one LTS to the next". [UpgradeNotes](https://help.ubuntu.com/community/UpgradeNotes) still says that today, no mention of upgrades from 12.10 to 13.10 or to 14.04.
Answer: Generally a fresh install is preferred for the reason I have seen a lot of issues with the upgrading process. Upgrading process generally ends up going in some crappy graphic driver problem or a GPU one. I even got weird problems, like non availability of shared folders and data loss. Well its all up to you, as problem also persists when you are going for a clean install. But clean install problems are generally easily understood and recoverable.
Well enjoy installing Ubuntu :)
Comment: I would go for the fresh install, if you can. Several people ran into problems when upgrading. The new install works very well, BTW. Have fun, ....Erik.
Comment: I can confirm this: Tried to upgrade Kubuntu, but then got various system errors. Right now I'm installing a fresh 12.04 (yes, can use Firefox during installation ;-))
Comment: yeah thats the spirit what i was talking about. :)
Comment: I agree I would do a fresh install. I upgraded mine from 11.10 to 12.04 and it upgraded ok but soon after I was getting program crashes, etc. So save your self time back up your files via Dropbox or Ubuntu one, etc and do a fresh install.
Comment: What dou you mean a 'fresh install' ? It means format my drive, then install ubuntu ?
Answer: There are no guarantees in life
You can have crashes in a fresh install or in an upgrade. Most people will not experience a crash. If you are in that unlucky minority it is best to:

have a backup you can restore or,
test the install/upgrade on a separate partition.

Clean install advantages and disadvantages
For a clean install all that old garbage you've installed over two years between LTS versions is gone. This however can be a disadvantage as you often forget the good stuff you've added in /usr and /etc subdirectories.
Upgrade advantages and disadvantages
In the process of upgrading you are told for each configuration file what each new package version will be changing. You can select to keep the old or take the new version. For example during Ubuntu 16.04 LTS to 18.04 LTS upgrade these changed on my system:

Scanner configuration - /etc/sane.d/dll.conf
/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
Sound override to keep HDMI TV active - /etc/pulse/default.pa
Grub override to hide menu at boot unless Escape pressed - /etc/grub.d/30_os-prober
Cron(you would loose all on fresh install!) - /etc/cron.d/anacron
Total network traffic monitoring utility - /etc/vnstat.conf

Running the upgrade on May 6, 2018 I was told that 203 packages will be removed. Over time support for more packages will be added so fewer will be dropped during upgrade. It is best to ensure all your critical needs packages are there or you have alternatives from other developers to use.
Backup first or run upgrade on cloned partition
Backing up and restoring is a pain. It's time consuming and often times your restore doesn't proceed as planned. An alternative is to clone your 16.04 LTS (or whichever version) to a new test partition and upgrade to 18.04 LTS (or whichever version) there.
I use a script to clone Ubuntu to a test partition for upgrading: Bash script to clone Ubuntu to new partition for testing 18.04 LTS upgrade
The script will:

Use rsync to ensure mirror image from real partition to test partition
Update test partition /boot/grub/grub.cfg with proper UUID's for booting
Update test partition /etc/fstab with proper UUID's for booting
Run sudo update-grub to add test partition to boot menu
Allow you now reboot and run upgrade on test partition

After upgrade on test partition you can take your time exploring all the new features and checking for bugs. You still have your original Ubuntu installation for day to day work. If you find bugs in the new version, you can rerun the cloning and upgrade a week or two later after they have been fixed. You would also re-clone and re-upgrade if packages critical to your work were not supported but now support has been added.
Comment: Nice coverage of pros and cons. The Backup first advice is sound.
Answer:
Do a fresh install if at all possible.

I was presented with this choice last year.
Best of all I had TWO systems to upgrade so I could compare by doing each.
In summary, as others have noted, if you can do a fresh install, that's the best option.  It will clear out things that miht otherwise be issues going forward.  It'll make you ensure that all your important data and personal programs are not fixed to that machine (obviously you'll be backing them up in this case).
My 'production' machine was the one I upgraded because I was using that for key work stuff.
One thing I would recommend though, as I know hard nerve-wrecking this process can be: Get another machine (you can get a bar bones machine for < $300 now.  Set THAT up with your key stuff and then when it's really working ok, do your core machine.  That way if something goes wrong, which with an OS install/upgrade can be pretty scary, you can use your other machine while you resolve it.  You'll also end up with a physical backup of your data plus a 'go-to' machine if yours fails in the future.  Its basically insurance.
Answer: For me upgrading always led to problems, sometimes big sometimes small. And most of them was in old config files in home folder.
So my usual flow is like this -

Backup critical data which may reside on root partition like mysql dbs for example
Boot into live cd
Carefully delete hidden files in your home folder, but you may leave some of them like .purple, .VirtualBox, .wine etc
Format root partition and use old home partition
Answer: For an inexperienced Ubuntu user a clean installation of Ubuntu is probably safer than a distribution upgrade assuming that you have the self-discipline to backup all your personal data before upgrading, the same way you would backup all your personal data before completely reinstalling Ubuntu.
If you are prompted for an upgrade, that means it's a supported upgrade, but how do you know that a supported upgrade will be successful? Even upgrading a brand new installation of Ubuntu can go wrong. I've seen this happen, but the error that was caused by this upgrade was petty and easy to fix.
Sometimes the upgraded system will contain many unnecessary files, config files which aren't working with the new system, etc. Config files which aren't working are identified by the Ubuntu installer when upgrading. When I upgraded from Ubuntu 18.04 to Ubuntu 20.04 it took about an hour and I received one notification about a config file that needed to be edited. I copy/pasted the suggested edit into a text file and edited the config file after the upgrade was completed. It should be noted that if I hadn't watched the terminal output for the entire hour that it took to upgrade to 20.04 I would have missed the suggested edit which worked perfectly.
For removing unnecessary files from the upgraded system I use the following commands:

sudo apt autoremove
sudo apt clean
deborphan - Install this package management tool with sudo apt install deborphan.

Running these commands after upgrading takes me about 5 minutes. My workstation has a lot of installed software. If I had done a fresh install instead of an upgrade configuring all the installed applications  on my workstation would have taken me 2-3 days.
A successful upgrade is almost entirely dependent of your level of understanding of the Ubuntu operating system. Problems caused by an upgrade can almost always be solved if you have the level of skill necessary to solve them. When I am upgrading Ubuntu I keep a second laptop running alongside the computer being upgraded, so that I can immediately search Ask Ubuntu for the solution as soon as something goes wrong. I rely on my own experience and the experience of others to help me to solve problems that are caused by an upgrade. Otherwise you're gambling on any distribution upgrade – especially if you're an inexperienced Linux user.
Comment: I like the gambling analogy. Well said.
Answer: Sometimes new features (e.g. the update from ext3 to ext4) are only enabled on fresh installs. I'd recommend you check release notes or changelogs for that, but otherwise there is no real difference.
Comment: AFAIK you can update `ext3` to `ext4` at any time: https://www.cyberciti.biz/tips/linux-convert-ext3-to-ext4-file-system.html
Answer: A clean install is the best way to insure you're getting the experience the developers intended for the release, whereas upgrading can use old data, configurations, packages, etc. or create scenarios developers didn't anticipate or failed to tolerate correctly.
If you're asking - fresh install. Just copy your home directory to the base and change the name to something not used by the system, then during the installation select that partition as "/" and make sure not to select "format" This will install the operating system, but you'll have access to your data without a re-format or anything.
Comment: First, I am not sure if it's possible to instruct the installer not to format the partition that will be mounted as /. Second, In case the partition is not formatted the old data/ configurations etc that you mention would still remain, isn't it ?
Comment: Of course best is to have a separate system and documents partition to begin with.
Answer: The AptOnCD software is used to create an offline repository of your downloaded packages in a cd. You can use your AptOnCD (created by you, with all your downloaded packages) as a repository source. It is a useful tool for those with less bandwidth. (I have used this before). You can also have a metapackage which install all the installed packages.
you can get more information about AptOnCD here.

Actually you can restore(install) all the packages in a single AptOnCD compilation with a metapackage, if you choose the 'create a metapackage' option. From the metapackage description: "Auto generated meta-package that contains as dependencies all packages in APTonCD media, previously generated by APTonCD".
But you can backup the list of packages by entering command dpkg --get-selections > packages_list, where packages_list is the filename. You can later use this list to install all your packages with the program synaptic or dpkg. this may help you. But make sure your newly installed system also has the repository sources which was in your previous installed system. otherwise, it will not work.
To install all the packages using 'Synaptic Package Manager', follow these

Install synaptic with sudo apt-get install synaptic
Open synaptic by typing synaptic in the dash
Select 'File' from menu, Click 'Read markings'.
In 'Open Changes' window, select the file which you created using dpkg --get-selections command. In this context it is packages_list file.
Then click 'Apply' button.
Comment: can i use AptOnCD to restore my installed programs back on the freshly installed ubuntu...i have a low bandwidth internet connection...
Comment: Added more info on the answer, since comment has a limited character size.
Answer: I've encountered a few problems with upgrading from v11.10 to v12.04-LTS, however I was able to perform first an automated cleanup via ubuntu-tweak, and then later I followed that up with a manual cleanup from the command-line by first running 'updatedb' to update my location database of all items within the filesystem, then 'locate oneiric' to locate any objects that called to the 11.10 distribution specifically, then I simply opened a 2nd terminal and deleted each object tied to oneiric that wasn't obviously something that needed to be handled differently, such as via an uninstall/reinstall, first.
I did have to reinstall my graphics drivers for my laptop's Nvidia Go chipset, and I've encountered a few problems from some of my screenlets that I carried over from oneiric, but overall it's not been a bad deal.
I'll say this about upgrades:  If you have a lot of experience with troubleshooting an Ubuntu or other Linux based system, then upgrading is not a bad deal because it doesn't seem to produce any problems that a competent Linux technician cannot sort out fairly quickly.  But, if you do not fit into this category of users, then I recommend backing up all of your personal data from the system before you start, along with a package list of everything you have installed on the OS you want to replace, and then do a clean install.   Personally, I have 15 years of experience in working with Linux based systems, so for me... working out the problems after an upgrade were pretty simple.
I had done some testing with the Beta 2 release in preparation for the final release so I would know what I would need to adjust for when the final release was available.  This has helped immensely.  For instance, I knew from my testing that in order to get manual login capability to lightdm, I would have to add "greeter-show-manual-login=true" to /etc/lightdm/lightdm.conf.  I also knew that I would have to make a few slight adjustments to /etc/sudoers and /etc/group in order to allow flawless management and login of my system by any member of the "Domain Admins" group in Active Directory, which I require since I run AD on my home LAN for single-sign-on authentication across all of my systems, both Windows & Linux based.  Knowing these facts up-front have served me very well, since I'm now running Ubuntu 12.04-LTS final on my laptop that I'd been running Ubuntu 11.10 on the previous day, and for the past 6 to 8 months.  With this system-upgrade being a stunning success overall, I have much less in-trepidation about upgrading several of my other systems to Ubuntu 12.04.  However... that said, not all of my Ubuntu systems are equally loaded out, so in some cases I will still want to do a clean install and base that install on the particular hardware I'm working with.  My Zotac ZboxHD ID-41 Plus will require much more care where the upgrade is concerned, because it's a dual boot system that runs Windows 7 and Ubuntu 10.04-LTS.  Fortunately, I'm well versed enough to perform the installation without wrecking the system overall and having to start from scratch.  I will simply backup all of my personal data from the Ubuntu partitions and reload after I've wiped those partitions to ensure a clean environment.  I also have to take into consideration that each of my systems are configured to be connected to via an xrdp gateway on another system (a virtual server, running Ubuntu 10.04-LTS Server), and so I must have XDMCP capability.  But, I've already researched and tested the solution for that, using lightdm, vnc4server, and xinetd.  The main thing there is to simply remove 'vino' up front so that port 5900 is freed up for vnc4server.  The rest is a standard installation and configuration.  I will publish several articles soon in regard to my research and howto's on www.stormnine.net.  But, it may be a few weeks before I get around to that, since I have a fairly large group of systems that I want to port to Ubuntu 12.04 first, which could end up leading to my writing a few more articles and howto's based on that experience.
Anyway, I know this response is kinda long winded, but I hope that it gives some insight into the upgrade process from a resulting-experience perspective, coming from a technician that works with multiple operating systems professionally.  Good luck, everyone, in your own projects.  :)
Answer: The upgrade can have some issues on certain software and it definitely isn't full proof against idionsyncries with older packages.  For the most you shouldn't have problem but remember to back up any settings or data that is important to you.
For a full proof installation reformatting and installing from scratch is the best option.  Though it will take much longer of course to set it all back up correctly.
Answer: Both of them should not be (necessarily) true.
Upgrading is always supported from:

previous to current (for example, from 11.04 to 11.10)
previous LTS(*) to current LTS (for example, from 10.04 to 12.04)

Updating online: no reason either, except for time and bandwidth. If you download the ISO, and update from the ISO, the update experience would be better than online, if you do not have a fast Internet connection. Of course, I am not counting the time to download the ISO, but this is usually a fire & forget action: we start the download, and go do something else.
This is all supposing you did not install packages from external sources, or manually built & deployed other things. In this case, it is difficult to say if an update will work flawlessly or not -- it depends on what you installed, and where you installed.
(*) Long Term Support
Answer: People mess with their systems. Adding this and removing that. A fresh install from a Live CD with the / partition being formatted will start off with clean configuration files. And this sometimes fixes some annoying little problems that are difficult to solve.
Do not forget that when you install from a CD with an internet connection, the install process will update the system as the process moves along. As for danger this is no worse or better than upgrading over the internet.
I have found it quicker to download the iso and upgrade from that with an internet connection than when upgrading directly over the internet. This is just my impression. It is not scientific fact. I also like to have a copy of the latest live CD available in case I mess up my system so much that a fresh install is needed.
At the moment I am in two minds as to whether I upgrade 11.04 to 11.10 or fresh install 11.10. I may wait until 12.04 to do the fresh install. It is a matter of personal preference. People should not make comments that suggest one method is more dangerous than the other. It is misleading.
Answer: I'd suggest one of two things:

Back up critical files and data in Dropbox.  This way no matter what
you do, ever, you can retrieve them (even on completely new
computers)
Back up critical files and data to a thumb drive.  This might be the
best option for you, as it will not require a high-bandwidth
Internet connection.

I suggest you do (2) in either case.  If you upgrade, you risk losing data.  If you do a fresh install, you will lose data.
Comment: what about the software APTonCD ??
Comment: @mayank, APTonCD only backs up installation packages, it doesn't backup things like configuration files, or local user-generated state such as family pictures.
Answer: I suggest you wait and see how other upgrades went. Then see what issues they caused, since the release before this was a LTS, no need really to jump ship until your sure, its stable. :)
just my opinion, really! there are some cool features 10.10 though FONTS for example. also something to do with clouds :P
Answer: I did a fresh install of 12.04 Beta 2 after backing up my home folder on an external hard drive, then joined the AU community.  It was the best learning experience ever.  I updated every day and experienced issues others were having and when 26th April came around I was done and the ride was smooth. This way I had the best of both worlds, trouble free and highly recommended.
Answer: Upgrading is fine but if you are "that" active and have so many softwares and packages installed, you will be having "obsolete package" alerts.
So,

if you are a Common user do Upgrade
If you are an Active user do fresh install
Answer: Hands down always prefer to do a fresh install. The success of the Infrastructure as Code approach and containerized software deployment (Dockerfiles) has taught us that the best way to set up a computer system for a specific purpose is to always start fresh and have an automated way (a script) to install exactly the customizations/tools that you need for your work.
Stop maintaining snowflake machines manually in irreproducible ways.
A script to set up your computer(s) for the way you work might grow quite large, but having this knowledge of how you set up your computer in an executable form that is executed regularly (maybe monthly, at least a few times as year) is unbeatable.
The only disadvantage is that a setup from scratch might take a bit longer than just updating bits and pieces of software here and there, but we should always prefer to rely on as little of the (supposed) functionality of our tools as possible.
Clearly, the manufacturer of any type of software tests the fresh-install usecase if they want to aquire any new customers (which probably everyone wants), but they might not test each and every imaginable update scenario on every type of system with who-knows-what other software and updates installed.
For reasons of isolation, if you can afford it, you should even have one dedicated physical computer, or one VM, or one docker container with only the minimal dependencies for any individual tool you use. This is the devcontainers idea.


Are all the boost dlls and .lib files needed for the boost compilation?

Question: the total size of the boost dlls and .lib files is coming to around 3.6 gb.I may not use all the dlls and lib files. Assume that I'm only including the Boost/Date and time. Are all the other files needed for the boost compilation ? Are the dlls and the lib files specific to windows and linux ???
Answer: You don't need .dlls to compile something at all. Technically, you don't even need .libs to compile; only to link, but I'll assume you meant both. You need .dlls to run however, so I'm not sure what that buys you.
And yes, .dlls and .libs are specific to the platform. And in the case of .libs, the compiler.

the total size of the boost dlls and .lib files is coming to around 3.6 gb.

What configurations did you build for? You only need a debug and a release version. If you built a DLL version, then you don't need to also build a static library version (you'll still get .libs though).
My static-library-only variation takes up ~800MB, and I could probably chop that in half, since I see what appears to be duplication in there.


Pspice error for vpulse

Question: why am i not getting square wave in vpulse pspice?What could have been the possible error?
Comment: You pulse should have different V1 and V2 values. In this schematic, you are simply feeding your circuit with DC! Remember that the pulse has minimum and maximum values of V1 and V2, respectively.
Answer: Your low and high voltage values are the same at 0.5V. Change V1 to be 0 and V2 to whatever you want the pulse high to be. You may get unstable operation with your ideal rise times and fall times of 0.

Pspice error for vpulse


What are the considerations and steps to Change Data Type from Text Area (Long) to Text Area

Question: As described in the title. I need to build reports in Tableau with data from salesforce and Tableau doesn't support fields with Text Area (long). So the only solution is the convert those fields to text Area.
I have checked that in the system, those fields actually contain data less than 4096 characters which can be fit into text area.
But are there any pitfalls in doing this? what are the other considerations?
Comment: textArea only supports 255
Answer: As mentioned by @cropredy textArea field only supports 255 characters. If any of the record data contains more than 255 characters there will be data loss for those fields. Please find the below article for considerations while changing the different datatypes.
Answer: I have made the changes to the field and changed it to "Long Text Area (4096)" so far , it works fine, and no data was lost because luckily in our org no value was longer than 4096 bytes.
Answer: text area stores only 255 characters where textarea (long) supports more than 255 characters .if you change from textarea (long) to textarea then textarea field will store only 255 characters and the remaining characters will be lost
Comment: downvoted as I'm not quite sure why you posted the same exact answer as SaiPraveen after them.


What am I supposed to present in my Schengen visa application?

Question: What exactly am I supposed to present when applying for a Schengen visa? I have an invitation letter from my friend in Germany. Will it also be necessary for me to include my bank statement when I have a letter of assistance from my host-friend?
Answer: Your friend might be willing to sign a Verpflichtungserklärung. That's much more than a letter, it is a promise to pay the government if you do not leave on schedule. Depending on your friends' income, he might have to post a bond.
Even so, the consular officers will want to know your financial situation to understand your intentions in travelling.

Follow-up: Germany (or any other Schengen country) will want to know if you are a genuine visitor or an illegal immigrant. The length of stay will not really matter. Once you are in, if only for a day, how do they know that you will leave again?

Do you have an understandable and documented explanation of who will pay for your visit and why? Even if your friend is going to provide housing and food, the stay in Europe is going to be expensive. It would look very bad if you have to borrow money for the flight, because then they question arises how you intend to pay it back.
Do you have ties to your homeland that make it seem likely that you will go home again?

The best answer would be a steady, well-paid job and an account where that salary goes. If you are very young, it would be understandable that you have no account of your own, then you have to explain who pays for your living.
Comment: so what am i to do because i do not have a bank account and im only visiting her for 40 days. So what can i do?
Comment: ok thank you . So if my brother will also provide his bank statement will it be neccessary?
Comment: @leo, is your brother paying for part of the trip? Then you have to explain that and why he does. If he isn't paying then his money won't help. It is a very bad idea to show any money that is not genuinely yours, either earned or from an understandable source.
Answer:
What exactly am I supposed to present when applying for a Schengen visa

Here is what you need to supply:

Proof that you are returning back. This can be in the form of a job you have, kids or family that is depending on you, a business that you run, etc.
A copy of your ticket, itinerary and hotel reservation (if applicable).
Your travel documents, that must be valid for 3 months after your intended return + a copy of them.
If you are a permanent resident (in other words, not a citizen) proof of permanent residency + copy.
Proof that you have funds to cover the costs of the trip that are not being paid for already. So, if your friend is paying for your ticket and hotel (or you are staying with him/her), your friend needs to provide a document stating so. Even if he/she is sponsoring your entire trip, you still need to show a bank statement - as financial history is a good indicator that you are a genuine visitor.
One picture, white background.
Processing fees.


How to create your own shortcuts inside any application?

Question: for example when I'm in firefox I would like to press Alt+T and have chosen sidebar opened (in menu View -> Sidebar -> name of sidebar)
Is there any application that can do it?
P.S. I have used firefox as example.
Answer: On Windows there is not really a standard way (that i know of, at least) to modify a given application's keyboard shortcuts. Instead it depends on the software:

Microsoft Office will let you change its programs' shortcuts via Options > Customize.
Photoshop and certain other Adobe products will let you change their shortcuts via Edit > Preferences or Edit > Keyboard Shortcuts.
Firefox and other Mozilla products' shortcuts can be changed via directly editing JavaScript and XML files or by installing an extension like Keyconfig.

... And so on
I do recall, in my dark Windows-using days several years ago, that keyboard shortcuts could be modified by using a resource editor (like this)... but i don't know if that still applies to most modern applications, and anyway it's pretty inconvenient and occasionally risky in general. :/
Keyboard shortcuts (and many other things) can also be overridden by AutoHotkey scripts... but i've found this to be somewhat unreliable.
Answer: There is no standard solution in Windows, so one has to use a third-party product.
One solution I can propose it to use AutoHotkey, with which you can automate whatever keyboard shortcut you want, conditional on the executable being used, by translating it to whatever keystrokes and mouse clicks are required. Virtually any key, button, or combination can become a hotkey.
Answer: It might be a little overkill, but AutoIt can do that (and a lot more) if you are willing to play with a Basic-like language.


How Would I Design Realistic Fluid Handling?

Question: I'm making a game that is like a mix of many other games (Minecraft, Factorio, Don't Starve, Terraria, etc). I want to make pipes and fluid handling like it works in Factorio. I can't seem to find much information on it. I thought about making fluid even out across all connect pipes with less fluid than this pipe, but the order in which I processed pipes would matter a lot. So, how exactly does Factorio work? I also want pumps, if that changes anything.
Comment: Don't make it realistic. Make it work with your requirements. I'm betting if you take a look at your requirements, and what realistic means, they would be orders of magnitude different.
Comment: IIRC fluids in Factorio are actually quants, that just move from higher to lower concentrations.
Answer: I don't know how Factorio does it, but I have a suggestion.
You have an issue with the order in which you process your pipes. One way to remove this issue is to store two sets of pipes in your code.
Set 1: The current frame's fluid values in all sections of the pipe.
Set 2: The next frame's fluid values in all sections of the pipe.
When you are processing your current frame's pipes, store the result in the next frame's pipes. By doing it this way, order does not matter. But after you are finished processing the pipes, you need to swap Set 1 and Set 2, so that the game uses the results and not the old values.
The cost of this would be that storing the pipes would require twice the space. Swapping the sets could be done efficiently by choosing which one to read, not copying one and overwriting the other.
A weakness with this technique is that it might take a long time before fluid moves through a very long pipe. Depending on how 'realistic' you want your game to be, this might be very acceptable. If you want or need fluid to move quickly or to not be compressible, then this problem becomes a different more tricky problem.
You could make pumps by transferring fluid values from one pipe section to a section next to it.
I am assuming your pipes are composed of 'blocks' or individual sections that are connected to each other. And that each section contains a fluid value like liters, pressure or density.
Comment: Your assumption is correct, I am using a grid. I just hope that having tons of pipes won't lag with this, but the arrays would probably smaller less than 1000 values by the end game. Thank you.
Answer: If you do not need to handle viscosity (some liquids flowing faster than others) and are OK with all of them flowing essentially immediately, you could do this:

Separate your pipe-network into individual sections of connected pipes and reservoirs (pumps would separate the pipeline flowing through them into two individual sections). Calculate the maximum capacity of each section by simply summing up the capacities of all their parts. You only need to recalculate the networks and their capacities when parts are added or removed, not every frame.
Keep track of the total amount of liquid in each section (producers, consumers and pumps add or remove liquid from the sections they are connected to)
Calculate the fill-state of each individual cell by simply taking the average fill-state of the whole section. Example: If a section has a total max capacity of 4000l, is currently holding 1000l and you are looking at a pipe section with a max capacity of 10l, it currently contains 2.5l (10 * 1000/4000)

Problems with this approach:

It doesn't handle the case of multiple different liquids pouring into the same section. But the way Factorio handles it is not very realistic anyway and the realistic way of doing it (you get a mixture of liquids which might or might not be a useful resource for the player) might not actually be desirable either. You will have to consider for yourself what makes most sense in the context of your game for handling liquids interacting with other liquids.
As I said before, liquids now flow through pipes with the speed of light. For some games this might be an acceptable break from reality, for others it might not. If you want to do this, you will have to go for the cellular automat approach as described in the answer by No.Manual.