innodb_redo0 is not a multiple of innodb_page_size

Question: My Ubuntu 22.04 server is suddenly telling me that "The redo log file "./#innodb_redo/#ib_redo0 size 23289856 is not a multiple of innodb_page_size."  My innodb_page_size is 16K, so the error is correct, but I can't seem to find any advice on how to fix it.  I tried moving ib_redo0 out of the way but that didn't help.  Any ideas?
Comment: Did you make any changes to the config file?  (I do not happen to know where the redo-file size comes from.)
Comment: Same problem with MySQL 8.0.29-0ubuntu0.20.04.3 on Ubuntu 20.04 container (Proxmox). Needed to restore a backup of the container from 28.07. The update brakes it once more. Will try to investigate more later.
Answer: I also encountered this issue. It appeared to be specific to using ZFS on Ubuntu, in my case it was during an upgrade to MYSQL 8.0.30-0ubuntu0.20.04.2.
Following details in this Ubuntu issue report and this MySQL issue report I was able to come up with a solution that worked in my environment.
There are 3 commands below to be ran as root or with sudo. You should replace 8192 in the first with the result of <broken_file_size> % <default_page_size>. The default page size is usually 16384 unless modified.
You may need to replace the #ib_redo0 part of the second command with the broken file reported in the error message.
These commands are intended to pad out the reportedly invalid file with zeros.
Perform a backup before running!
# Gather required zeros to append
# Will create a "zeros" file in the current directory
# This has been calculated based upon 23289856 % 16384 = 8192 or <broken_file_size> % <default_page_size>
dd if=/dev/zero bs=1 count=8192 of=./zeros

# Append zeroes to invalid file
cat zeros >> /var/lib/mysql/#innodb_redo/#ib_redo0

# Restart MySQL
systemctl restart mysql.service

I'd be wary of remaining on ZFS, even if the above fixes things, for the sake of potentially hitting the same issue again.
Comment: Yep. Ubuntu on ZFS update of MYSQL to MYSQL 8.0.30 caused the problem. The solution worked for me as well. Thanks very much!!!
Answer: I had the same Problem in a LXD Container running on ZFS. I had to move it to a different type of storage-pool, e.g. Directory or BTRFS.
After that the solution of @DanBrown worked for me too.
Thank you.


Fast Zonal Statistics to replace velox?

Question: Does anyone know an equivalent package for the velox package for fast zonal statistics in R? This package was by far the best performing tool when working with large raster objects but has been recently removed from CRAN...
Comment: You can still install it from the source code on github - or at least try, assuming its not come off CRAN because it doesn't work.
Answer: I have moved to using the exact_extract function in the exactextractr package. One nice thing is that it returns all cell intersections with the fractional proportion of each cells intersection. You could use the proportion of intersection column as weights or to filter out small intersections.
Also, there are numerous statistics available, including some weighted ones, that are part of the C++ code, so very fast. The package takes sf class polygons and raster class raster data.
Answer: You can use the mmand package
Example:
#random sampling points:

pts <-  readOGR(
  dsn = ".",
  layer = "random_points",
  encoding = "utf8")

pts$id <- as.numeric(pts$id)

pts <- as.data.frame(pts)

library(mmand)
library(raster)

r1 = raster("G:/romain/imperviousness_project/SWI.tif")

#Let's rasterize the points based on their x y coordinates:

z <- rasterize(pts[,2:3], r1, field = pts$id)

#I want to get statistic from a zone of 3*3 pixels around my point (in my example 1 pixel = 5 meters so the total area is 15m2):

kern <- shapeKernel(c(3,3), type="box")
z[,] <- dilate(as.matrix(z), kern)

plot(z)

zonal(r1, z, fun = "mean")

It is also mentionned here: https://stackoverflow.com/questions/50398473/how-to-perform-focal-operation-mean-on-raster-using-3x3-window-in-r-i-have-la
Comment: Do you understand what the `mmand` package is actually doing here? The `shapeKernel` and `dialate` functions are from `mmand` and are just used in creating a 3x3 matrix around each point that is then rasterized and passed to the `raster::zonal` function. In this case the `mmand` package has very little to do with calculating zonal statistics and is completely irrelevant outside of the point example (ie., cannot be expanded to polygons). This also creates a huge amount of unnecessary overhead and would be massively slower than just using `raster::extract`.
Comment: Ok sorry I didn't know, I only used it once for points ! My bad !
Comment: No worries, live and learn.

Fast Zonal Statistics to replace velox?


Many British country pubs are called 'The Stag' what would a French pub be called?

Question:
Pretty much everything I'm asking is in the question head, thanks
Comment: Welcome to [FL](https://french.stackexchange.com/help). France doesn't have pubs as such. Where there is one it is often called "pub (something or other)" to get a British look.  A more relevant question would be to ask for a popular name for a *café* (or maybe *bar* or *brasserie* - although I'm not sure such a question would fit the site's rules). By the way I don't agree with you about *the stag* being a typical name for a country pub, *Fox & Hounds* & *The Plough*  for example  are way ahead where country pubs are concerned.
Comment: Thank you for the reply - I'm really hoping for a French equivalent of "The Stag" - do country village/towns just have 'Hotel de Smith St' as their name? nothing colourful like the seven ducks (or whatever)? cheers
Comment: What exactly are you looking for? Hotel names? Inn name? café names? A popular [*auberge*](https://fr.wikipedia.org/wiki/Auberge) name in the countryside I can think of straight away is *Auberge du Val* (with variants *auberge du petit val*, *auberge du val fleuri* ...). Those kind of places rarely have the owner's name. *Auberges* are found in small places, not in cities. *Le relais de poste* is also quite common and typical of country areas.
Comment: If you're looking for animal names a rather frequent  (but not very picturesque to my mind) name for hotels - not specially in country areas - is *Au Lion d'or*  because of the play on words ( *au lit on dor* → *au lion d'or*)
Comment: - *Le **Balto***
Comment: https://www.lebarbiche.fr/le-cerf-volant/ **Le Cerf-Volant** Mind the play on words.
Answer: You do find a good number of "Café du Cerf"'s, although there are other places such as hotels and restaurants that bear that name; the name might be "Au Cerf" or "Le Cerf".
Cerf
It is quite similar to Britain, where the word "stag" is used to name not only pubs but also inns and restaurants.
Stag
There is another equivalent in France, provided you tolerate a little shift in the type of establishment you are considering; it is not often going to be a café but instead it'll be an inn or hotel (where there is bound to be a bar and/or lounge). The privileged animal, not wild this time but fully domesticated, is the horse, and without exception, the white horse or the black horse. You'll find in all parts of the country  the names "Auberge du cheval blanc" and  "Hôtel du cheval blanc", "Le cheval Blanc", etc.
Cheval Blanc
Cheval Noir
You do find  in Britain an exact correspondence for this last cultural trait since there the word "horse" is often used in the names of places such as pubs, restaurants and inns, a few of these inns being as well pubs.
"White Horse"
Answer: There are four main types of names of pubs you could find in France as far as I know.

Names related to some cultural aspect of the city, region you are in (la bonne mère, la tour eiffel...)

British names (Shannon, Shamrock, Black Horse....)

Puns on names including names starting with " O' ". I believe these are so common (restaurants, fast foods, cafes, pubs..) because of the pun.  "Au soleil" would be "O' Soleil", and that would imply that your pub has a nice, sunny terrace

Name of someone, probably the owner -> "Chez Marie", "La maison de Ben"...
Comment: What has O Soleil got to do with pubs?
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Comment: the **O** in pub name is rather a way to sound irish (like Kitty O'sheas in Paris (and in many other place))
Comment: @Archemar The 'O' is indeed a way to sound irish. However, in french, it is also used to make puns (ie : O'Délices, O'Tacos, O'Epices, L'O à la bouche....).  I don't think tacos sellers/french restaurants want to sound irish


I'm using git+notational velocity and want to know how to commit after I exit the program

Question: What I'm looking to accomplish is have something trigger a git add *.txt and git commit -m "Automated Commit `date`' when I close Notational Velocity. I'm guessing I could probably accomplish this with an AppleScript but I don't know the language well enough. I looked into creating a launchd plist that would watch the main database file and that didn't seem to cause it to trigger a commit at all. Does anyone know of a good way to accomplish this?
Answer: You can use Keyboard Maestro to completely automate the task. Here's a screenshot of a macro doing just that :

You should adapt the bash script to suit your needs, I'm not sure how to include the date in the commit message (in addition, I forgot to put the git add command).
Answer: Create a bash script with
<code>#!/bin/bash
cd /path/to/notational/velocity/folder
NOW=$(date +"%m-%d-%Y")
git add *.txt
git commit -m "Automated commit $NOW"
killall NotationVelocity # or whatever its name is
</code>
Then save the script, make it executable with
<code>chmod +x name of the script
</code>
and when you want to close NV, just double-click the script.


Ubuntu 16.04 has experienced an internal error /cups/filter/hpps

Question: Ever since upgrading to 16.04, I have been getting repeated internal errors pointing to usr/lib/cups/filter/hpps. I am unsure how to correct the issue. The traceback indicates a crash with a "broken pipe error". The Lpstat indicates it involves the HP printers I use. I'm using the package 3.16.3+repack0-1. I've continuously reported these issues but they keep popping up occasionally. Is this a bug that is still being resolved or is this a driver that needs updating? Any clues?
Comment: Is it this bug? https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1446987
Comment: Well, I do have an HP printer, but I can print from it okay. It's a system error that will occasionally pop up but mostly comes when I boot up & log into an account. I submit an error report & then reboot & I get no more error boxes. It doesn't happen every time, either. Pretty random.
Answer: I have observed the same. I am pretty sure it is this bug: https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1446987
The printer driver crashes if it runs into a network problem. To quote the issue description: "As Linux distributions have automatic crash handling/reporting systems this causes annoying pop-ups which irritate the users giving the impression of a more severe problem."
So nothing too bad - just annoying. It looks like hp is working on a fix (see end of issue comments). I'm thinking about uninstalling hplip for now.


How to run old AirPort Utils 5.x on MacOS X maverics?

Question: How to run old  AirPort Utils 5.x on MacOS X maverics ? Because the new one is really ugly.
Comment: Additionally, the new one can't control older Airport devices! I just discovered that 5.6 won't run, but 6 won't work with my Airport. Did I just lock myself out of my device by upgrading?
Comment: https://plus.google.com/app/basic/stream/z13uybnpitn3hzsin04cjjbojnjqjrdxo0w Claims to have a workaround for this but I haven't tried it myself yet.
Comment: possible duplicate of [Can I still use the older Airport Utility 5.5.3 if I install the 6.0 version of Airport Utility?](http://apple.stackexchange.com/questions/38855/can-i-still-use-the-older-airport-utility-5-5-3-if-i-install-the-6-0-version-of)
Comment: @grgarside The linked question is more broad and not restricted to Mavericks.
Answer: There is a workaround detailed here: http://coreyjmahler.com/2013/10/24/airport-utility-5-6-1-on-os-x-10-9-mavericks/.
Answer: I just got off the phone with Apple support and the official answer is that you can't run AirPort Utility 5.x on Mavericks or even on Mountain Lion.

Now I did have it successfully running in Mountain Lion, so I know that it is possible in that scenario, but when I tried to use Terminal to force it to run under Mavericks, I got this error:

Maybe there's a workaround, but so far, I haven't gotten anything to work. Which means that I have to boot up my old eMac to control my Airport Express, because Airport Utility version 6 isn't compatible with my Airport Express, but Airport Utility 5.6 isn't compatible with Mavericks or Mountain Lion.
Answer: Airport Utility 5.6 is using library calls which are no longer available in the libraries provided with Mavericks (see this discussion for details). I finally used Parallels to run Mountain Lion in a VM and copied Airport Utility 5.6 into that VM. Works like a charm...


What can I use to glue acrylic sheet together?

Question: What can I use to glue acrylic sheet (Plexiglas) together?
Also is it easier to cut and shape Plexiglass or real glass?
Thanks
Answer: If by Plexiglass you mean acrylic sheets, use acrylic cement. It formulated especially for that. Old way to dissolve small pieces of plastic in dichloroethan, but it is more toxic. Cut plastic easier than glass.
Answer: It's not always easier to cut plexiglass than glass.
I recently had to cut some (very expensive, stupid panicvirus) plexi for a project and had a dickens of a time with the score-and-snap method because the plexi was too flexible. I ended up cutting it with a circular saw.*
If you have very stiff plexi, you can probably do the score-and-snap quite easily (I've done that before), just like you would with glass. If it's flexible plexi, it will be more difficult.
If you need complex shapes, especially curves, then the plexi may be easier to work with because you can use regular wood working tools to cut & shape it - just be prepared for the smell of melted plastic and work in a well ventilated area. You can cut complex shapes, even curves, into glass but it may be more work to do so - score-and-snap many short lines, then "sand" or grind the glass into the curved shape with an appropriate, hard sanding block, probably something specifically designed for working with glass.

* Make sure you wear eye protection if you're going to do this!! I had little pieces of plexi flying everywhere. I used a 6.25" battery powered circular saw with a home made track saw and just took my time to ensure that the cut was nice and clean. Man-o-man did the little pieces of plexi fly! I had several hit me in the face, though none cut/scratched me. I had a couple of pieces bounce off the safety glasses too. (Note that my saw seems to be designed to throw as much dust into the operators face as possible, YMMV.)
Comment: @user263983 glass is always (to my knowledge) a simple score and snap. Much easier than the process I described above.
Comment: "It's not always easier to cut plexiglass than glass."  When and why or how easier to cut glass?
Comment: When you say flexible plexiglass are you sure you are not referring to polycarbonate? It is much harder to score and snap (it can be bent to a 90 in a "break" without cracking where poly would shatter. They are different.
Comment: @EdBeal you may be right - it might have been polycarbonate that I had instead of acrylic. It's been a few months since I worked on that project, I used about 98% of the sheet I purchased, and the label has long since been in the trash, so I cannot confirm one way or the other.
Answer: I bought something called Poly Bonder from Fire Mountain Gems and Beads. I have not used it yet but have used something similar in the past.  It creates an invisible bond between 2 pieces of acrylic that fit perfectly together.  You might want to try it on 2 or more flat pieces first.  It alters the surface of the acrylic so it melds together to create a permanent bond.  After it sets, you can sand the shape and you will not see the bond.  I made several multi-colored blocks that way and the color changes show where the bonds are but they are not visible like glue can be and the pieces must fit together perfectly with no gaps.  The bonder changes the chemical composition of the surfaces of the pieces to be joined. The plastic top of the bottle of the stuff I used previously cracked and the bonder dried out and became unusable.  It was one of many things that I did not pack after a fire in my basement 2 years ago so I don't have the name of it or remember where I got it years before that.
Comment: Welcome to [diy.se]! This is a nice answer, but it's hard to read as one giant wall of text. If you could insert a couple of paragraph breaks (hit `` twice), that would make it much more readable. Also, providing both a phone & web site for a product recommendation starts to border on looking like spam. You do start by saying it's a product you bought, so you're probably good there.


How can a critical Adobe Acrobat security update, only available as an unsigned executable over plain HTTP, be verified?

Question: A critical security update for Adobe Acrobat Pro and Standard 9 on Mac OSX is only available over HTTP, and is unsigned code. Is there any out-of-band way to verify the download is authentically from Adobe?
Answer: You're right. If you go to Adobe's website the update is transferred over HTTP and not HTTPS, which give any hacker in the network to hijack your update file with a simple Man In The Middle Attack and inject his/her malicious file instead of the legitimate Adobe's update.
However if you go to the same page and instead of clicking the download now button you copy the link and add HTTPS as a prefix to it. The file will transferred securely over HTTPS.
here is the direct link: https://ardownload.adobe.com/pub/adobe/reader/mac/11.x/11.0.06/misc/AdbeRdrUpd11006.dmg
Comment: Alas, that site gives a browser warning, because it doesn't have an Adobe certificate - it has Akamai. That's better, perhaps I can trust the Adobe-Akamai relationship, but still a bit weak. I'm somewhat concerned because I've downloaded the update and done a Google search for its MD5 and SHA1 hex values - and there are no mentions of those strings anywhere.


Can I "lock" icons in the dock?

Question: I have lost count of times I have accidentally removed an icon from the dock by being a "bit too fast/sloppy" with my mouse movement (swiping an icon away from the dock removes it from the dock). It is beginning to irritate me :-)
Is it possible "to lock" the the icons in the dock (and/or only allow removing of them by mouse's right click action) ???
Please :-)
Comment: Check settings mouse, maybe there is something there. I dont get that so I can compare mine. Let me know.
Answer: Ctrl + Right click on Plank opens a menu. There you can find Preferences -> Behaviour -> Lock Icons and select it.
Comment: Solved, thank you @Webshaped

Can I "lock" icons in the dock?


How were missionaries able to convert native populations?

Question: What made it possible for Christian missionnaires to convert natives of America, Africa and Asia to another religion despite the fact that they already had beliefs and gods ?
Comment: Why do you think it isn't possible for someone to convert from one set of beliefs to another?
Comment: What about the natives of Europe and Australasia/Oceana? We must remember that Christianity isn't a European religion.
Comment: I don't see how this can be narrowed down. I'd imagine thousands of tribes were converted in thousands of different ways i.e., persecution, integration into their culture, bribery, deception, traditional evangelism, etc.
Comment: If you are interested in the psychology of conversion then this is the wrong site. It's self-evident from millions of examples that people do change their religion.
Comment: @DJClayworth Because it is the thing that people defend the most strongly. So those who don't defend it must be particular. Maybe I should ask this in psychology.
Answer: The power of the Holy Ghost
In "Preach My Gospel: A Guide to Missionary Service" (the manual used by LDS missionaries) it states (in Chapter 4)

The power of the Holy Ghost. The witness that comes to sincere
  investigators before baptism comes through the power of the Holy
  Ghost. "The power [of the Holy Ghost] can come upon one before
  baptism, and is the convincing witness that the gospel is true. It
  gives one a testimony of Jesus Christ and of his work and the work of
  his servants upon the earth" (Bible Dictionary, "Holy Ghost," 704).
  The Holy Ghost testifies of truth. All people can know the
  truthfulness of the Book of Mormon through the power of the Holy
  Ghost. "By the power of the Holy Ghost ye may know the truth of all
  things" (Moroni 10:5).

This applies to both native and non-native populations that missionaries have taught or are currently teaching.
Of course, this is not the only method used by Christian missionaries throughout history. Some Churches in the past have relied on coercion, unfortunately. But sincere and lasting conversion can only come via the power of the Holy Ghost.
Answer: As a title of example, in the Americas, most Jesuits missionaries shared in the daily life of the Indians, travelling with them as they moved from one encampment to the next.

The two religious traditions took different approaches to evangelism. Catholics, such as the tireless Father Pierre-Jean De Smet SJ (missionary in the old Oregon Country), sought simple expressions of faith from Indians. Protestant missionaries, on the other hand, sought not only to convert Indians to Christianity but also to convert them to a new lifestyle centered on individual labor and community-building. - Missions and missionaries

The Jesuits tried their best to understand the Native languages that they were dealing with.
St. John de Brebeuf noted that in order to be effective as a missionary, one had to master the Native language at hand.

To explain the low number of converts, Brébeuf noted that missionaries first had to master the Huron language. His commitment to this work demonstrates he understood that mutual intelligibility was vital for communicating complex and abstract religious ideas. He believed learning native languages was imperative for the Jesuit missions but noted that it was so difficult a task, that it consumed most of the priest's time. Brébeuf felt his primary goal in his early years in New France was to learn the language.
He translated Ledesma's catechism from French into Huron, and arranged to have it printed. It was the first printed text in that language (with French orthography). He also compiled a dictionary of Huron words, emphasizing translation of religious phrases, such as from prayers and the Bible.
Brébeuf is credited with composing the "Huron Carol", Canada's oldest Christmas song, written around 1642. Brébeuf wrote the lyrics in the native language of the Huron/Wendat people. The song's melody is based on a traditional French folk song, "Une Jeune Pucelle" (A Young Maid). - St. Jean de Brébeuf (Wikipedia)

One last little note, I would like to add here is that the Jesuits incorporated to some degree native languages into their liturgies:

Algonquian and Iroquoian Uses
Also called "Indian Masses", a number of variations on the Roman Rite developed in the Indian missions of Canada and the United States. These originated in the 17th century, and some remained in use until the Second Vatican Council. The priest's parts remained in Latin, while the ordinaries sung by the schola were translated into the vernacular (e.g., Mohawk, Algonquin, Micmac, and Huron). They also generally featured a reduced cycle of native-language propers and hymns. At present they are rarely used. Latin liturgical rites (Wikipedia)

St. John de Brebeuf, like the Good Shepherd, died a martyr in order to set an example for the others.

When the assault began, the two Jesuits raced among the men, shouting encouragement, urging them to pray, tending the wounded, baptizing the dying. The Iroquois prevailed, capturing Brebeuf, Lalemant and sixty Huron warriors, whom they beat and herded to St. Ignace. Brebeuf called on the Huron warriors to stay true to Christ until death.
Stripped naked, the Jesuits were tied to stakes and tortured with fire. Brebeuf suffered from noon until four p.m. on this day, March 16, 1649. When he would not scream out, but continued to pray for the salvation of his tormentors, the Iroquois heated cauldrons of boiling water and poured it over him in mockery of baptism. They cut and hacked his body, and gouged out his eyes. Before he died, they scalped him and cut out his heart, which they ate. Lalemant died of similar tortures early the next morning. - The Iroquois found John Brebeuf Brave


Visual Studio 2010 My.Settings import

Question: I have a solution with multiple projects in, and all need to share the same My.Settings, or at  least have local copies of the same set. How do I get the My.Settings from one of the projects into the others?
Comment: What do you have in there? Embedded resources, strings and such?
Answer: I think you can add it as an existing item in each project which will create a shurtcut to it. here is my reference , so no need to update each project aside.  Hope it helps
Answer: Well you need to add the settings file to your solution, then you add the existing item to your project as a link item
How can I share Configuration Settings across multiple projects in Visual Studio?
Answer: The settings defined in My.settings are available to all assemblies which reference the assembly that defines those settings as long as they are public.
First ensure that "Access Modifier" is set to "Public" in the settings designer for My.settings.
Then, to access the settings, use the defining project's namespace:
{My namespace}.Properties.Settings.Default.{my setting}

Visual Studio 2010 My.Settings import


What does words in [ ] says?

Question: for example "Everybody [is] joking about him" what does [is] stands for ?
Answer: first of all I'll let you know that this is not part of any English grammar.First question is that "where have you found this one? ". Look in there there might the case that someone might have written

Everybody joking about him.

That is incorrect grammatically.I mean he might have forgotten the is. To suggest him the corrector has made [] covering is referring he might have written

Everybody is joking about him.

And the second one is correct grammatically as well.
Answer: I'm not 100% sure but this looks like an addition by the author.
For example, suppose some politician is giving a speech and a reporter is writing about it, the reporter might add square brackets to add information that would be obvious to anyone listening to the speech directly (in context) but is necessary when just reading the quote like "He[the prime minister] should do his job." the [] are used to clarify the statement.
In your case it seems like an addition to provide proper grammar, which occurs often when quoting colloquial speech where a sentence can be understood, like "Everybody joking about him", but to make perfectly clear what is being said the "is" is added by the author.

What does words in [ ] says?


Integrate $\int \frac{dx}{a\sin x+b\cos x}$

Question: As far as I know, we could use the stereographic change of variables where $\tan(\frac{x}{2})=t$, $\sin x=\frac{2t}{1+t^2}$  and $\cos x= \frac{1-t^2}{1+t^2}$, then replace $dx$ also $\sin x$ and $\cos x$, and finally I get something like this:
$$
\int \frac{-2\,dt}{bt^2-2at-b}
$$
Now, I may think the next step it's some algebra. How would you proceed?
Comment: take the scale factor of $-2$ out of the integrand, factorise and perform a partial fraction decomposition. warning: it is a very messy process though.
Comment: Yeah, thanks, I thought about it, but went to large. Wondering if there is something faster without use "tricks"
Comment: duplicate of https://math.stackexchange.com/q/377117
Answer: There's a simpler way. Take $\theta$ such that $\cos\theta=\frac a{\sqrt{a^2+b^2}}$ and that $\sin\theta=\frac b{\sqrt{a^2+b^2}}$. Let $r=\sqrt{a^2+b^2}$. Then\begin{align}\int\frac{\mathrm dx}{a\sin x+b\cos x}&=\frac1r\cdot\int\frac{\mathrm dx}{\sin(x+\theta)}\\&=-\frac1r\log\bigl(\cot(x+\theta)+\csc(x+\theta)\bigr).\end{align}Can you take it from here?
Comment: Thanks! Mmhh, is the answer $\frac{1}{r}In|\frac{1-cos(x+\theta)}{sin(x+\theta)}|$? but I think you use a equivalent expression for $\int cscx$
Comment: Yes, that's equal to the function that I got. Note that, for any $\alpha$,$$\left(\csc(\alpha)+\cot(\alpha)\right)\times\left(\csc(\alpha)-\cot(\alpha)\right)=\frac1{\sin^2(\alpha)}-\frac{\cos^2(\alpha)}{\sin^2(\alpha)}=1.$$Therefore,$$\log\left(\csc(\alpha)+\cot(\alpha)\right)=-\log\left(\csc(\alpha)-\cot(\alpha)\right).$$
Answer: $$bt^2-2at-b=b\left[t^2-2\frac abt-1\right]=b\left[\left(t-\frac ab\right)^2-\left(1+\frac{a^2}{b^2}\right)\right]$$ now use substitution to get it in the form:
$$\int\frac{dx}{x^2-1}=\frac 12\ln\left(\frac{x-1}{x+1}\right)+C$$
Answer: If I were doing this myself, I'd prefer José Carlos Santos' method---which among other unadvertised benefits (1) doesn't introduce a problem at odd integer multiples of $\pi$ (see below) and (2) doesn't break the symmetry of the roles of $a$ and $b$.
Here's a conventional way to finish using your approach: Completing the square in the denominator (temporarily assuming $b \neq 0$) gives
$$-b t^2 + 2 a t + b = - b \left[\left(t - \frac{a}{b}\right)^2 - \left(\frac{a^2}{b^2} + 1\right)\right] .$$
So, applying the translation substitution $u = t - \frac{a}{b}$ leaves the standard integral
$$-\frac{2}{b} \int \frac{du}{u^2 - \lambda^2}, \qquad \lambda := \frac{\sqrt{a^2 + b^2}}{b} .$$

The integrand can be decomposed using partial fractions as $$\frac{1}{u^2 - \lambda^2} = \frac{1}{2 \lambda}\left(\frac{1}{u - \lambda} - \frac{1}{u + \lambda}\right)$$ and then immediately integrated.

With some algebraic manipulation the resulting antiderivative $F(\theta)$ can be written using an expression valid even for $b = 0$; to justify that this antiderivative is still valid in that case, we need only verify that $F'(x)$ coincides with the original integrand.
NB that the given substitution $t = \tan \frac{x}{2}$ presupposes that $x$ is not an odd integer multiple of $\pi$, and so the antiderivative we produce by reversing this substitution after integrating is not a priori valid on intervals that contain such a value.
Comment: Thanks! This is a great answer! At the end I get $\frac{-1}{b}ln|\frac{g-\lambda}{g+\lambda}|+c$ right? As Henry pointed as well. I just have to specify the problem of odd integers multiples of $\pi$.
Comment: You're welcome, I'm glad you found it useful. And yes, that's correct, provided you replace $g$ with $u$. Also, you can absorb the negative sign by replacing the argument of $\log$ with its reciprocal. Notice that there's nothing special about the original integrand at odd multiples of $\pi$, at least for generic values of $a, b$, so in that sense the substitution $t = \tan \frac{x}{2}$ isn't ideal for the problem. A better option would be to take $t=\tan\frac{x + \theta}{2}$ for a $\theta$ that aligns the $x$-values where $t$ blows up with the $x$-values where the original integrand blows up,
Comment: ...but this is in spirit what José's answer already achieves by rewriting the original integrand as a multiple of $\csc (x + \theta)$.


Displaying large forms on the iPhone

Question: I'm currently in the process of toying with a few things at the same time: Heroku, Sinatra, HAML/SASS, and of course the glue: Ruby.  I'm loving that, and it all goes well with DataMapper.  However, my current "project to learn by" seems to be pretty data-intensive.  Though it is also something I want to have.
I've been a bit of an amateur thoroughbred handicapper for a while now and I'm compiling a bit of statistics.  Stats which I would love to be able to display on my iphone.
iPhoneUI and iPhone-Universal are great and offer wonderful CSS layout options.
But I'm looking for:
1) Advice on displaying large forms on a small screen such as the iphone.  Do I break it out into sections, "tabs", etc?  I'm a programmer, just not a very good visual designer.  Does anyone have any sample sites I can look at?
Thanks in advance; I hope a few responses can get me through this bit of a "designers block" that I apparently seem to be stuck in.
Answer: Organizing forms into a grouped table view is a common design concept. Most long forms in Apple-created apps seem to use them. As an example, take a look at some of the forms inside of the Settings app (some good examples are the form to add a new mail account, connect to VPN, etc.)

Displaying large forms on the iPhone


I have one page in my WordPress site with a table that needs to be super compact and simple

Question: The theme our site was built with makes the tables look huge and that's fine for almost all of the site but we have one page with an 25-row table that needs to be super compact and simple so it fits in less than one page. Is there a way to tell Wordpress to ignore all themes and table styles for just one section of the site?
Also, this may only be relevant to some answers but the table is built and populated by a JS script which is imported into the page by a plugin (Scripts n Styles).
Answer: Not sure how comfortable you are with programming and such, but in general I would assume that your theme doesn't let you pick and choose where the table styles get loaded, so the only way to do it would be to disable it from loading the stylesheet that styles the table in question OR insert a new stylesheet that has basic table styles that is designed to only affect that one table.
Option 1 - Disable stylesheet:

Is there a way to tell Wordpress to ignore all themes and table styles for just one section of the site?

You can disable certain CSS stylesheets from loading on specific pages, so if by "sections" you mean "pages" then yes. If you have other tables on that same page that need to keep the existing styles, then it gets more complicated.
IF you want to stop a stylesheet from loading on a specific page, you could do something like this:
add_action( 'wp_enqueue_scripts', 'stkxchg301761_remove_css' );
function stkxchg301761_remove_css() {
    if (is_single('SomePageHere')) {
        wp_dequeue_style('StyleHandleHere');
    }
}

This would go in your theme's functions.php file.
Replace 'SomePageHere' with the slug of the page you're trying to remove the CSS sheet from. Replace 'StyleHandleHere' with the handle of the script you're trying to prevent from loading.
If you don't know the handle to the script, you can find it by using
var_dump($GLOABLS['wp_styles']); die;

You can put that^ in the same spot as the first code I provided, replacing the "wp_dequeue_style" line. This will make your site spit out all of the styles that are being loaded on that page. Look for the offending stylesheet and it's handle should be shown right next to it.
Option 2 - Add a new stylesheet
The simpler option would probably be to just load a new stylesheet on top of what's already there and have it only affect that one table. That would require you to make a new simple stylesheet, then load it only on that specific page. The stylesheet would contain styles that target that specific table. You can use the same code I provided at the top, except replace the "wp_dequeue_style" line with
wp_enqueue_style('my-custom-stylesheet', 'PathToStylesheet');

Replace 'PathToStylesheet' with the URL to the new stylesheet on your server.
The stylesheet should then have rules that target your table.
Answer: The other possibility is that you need to add CSS '@media' rules to 'adjust' the CSS for smaller screens. Theme's that are 'responsive' do this.
But setting up a unique class name for your table, then adding CSS for that class name is a quick way to go.  (As @GoTeamScotch said in Option 2 of their answer.)


I have a really old desktop with an intel pentium e2160 and 2 gb ram. Can I run elementary os on it?

Question: Hi everyone having a look at this question.
As you might have read in the title I have really old computer with an intel pentium e2160 at 1.8ghz and 2gb ram.
Can I run elementary OS on it without lag.
Or if can't can you suggest any other OS which should run fine and has good user interface.
Answer: You should be able to run elementary os on 2gb ram and 1.8ghz cpu. But in you might face lag when you open a lot of tabs in browser or trying to multitask in 3 or 4 apps. In any case, if it doesn't work out the way you want the. You can try other lightweight os like: lubuntu, unbuntu mate etc like those or if you want arch-linux then manjaro xfce.
Answer: To tell you the truth, your CPU and RAM are not enough. I also have a computer like you. The CPU performance of this model is so weak that it will run full load for a long time when decompressing a slightly larger compressed file; however, your RAM can only barely run lubuntu. It is inevitable that computers with this configuration will get stuck when running. Therefore, it is recommended that you upgrade the ram to at least 4GB and upgrade the CPU, so that you can run lubuntu, xubuntu and windows 10 x86 more smoothly. You can also choose Windows 8 / 8.1 or LTSC, which is smoother than windows 10. Of course, you can run these systems without upgrading the hardware, but it will be very slow.


Ethereum Code Fork on Github : How to incorporate the majority of Ethereum updates quickly and seamlessly

Question: There are currently 6831 fork on go ethereum on github. Say I have made multiple code changes to go ethereum client for private ethereum purposes, How can I incorporate the majority of Ethereum updates quickly and seamlessly?
Answer: If you merge your code with main ethereum repo, is there any conflict code? If not, then just merge/rebase your code with latest version of main ethereum repo.
I think the best merge strategy is merge your change into the lastest source code of ethereum main repo.


Is there a phonological rule or process that dictates the choice between voiced and unvoiced "th" in the English word "with"?

Question: There are two different pronunciations recorded for the "th" sound in the English word "with" in most dictionaries (Webster, OED). I was wondering if one or the other is preferred in certain phonological contexts (e.g. voiced "th" as in "that" before voiced consonants or vowels).
Comment: @JamesGrossmann They are distinct phonemes, but in the word _with_, they are in more or less free variation.
Comment: An unvoiced sound (particularly an unvoiced stop) following _with_ increases the likelihood of the voiceless variant, whereas a voiced sound (particularly a vowel, I'd say) increases the likelihood of the voiced variant. But neither is absolute in any way, and while I think it would be fairly uncommon to hear 'with people' pronounced with [ð], I'm sure it occurs; 'with it' with [θ] doesn't even strike me as unusual. There's one that I would say is pretty ubiquitous, though: before /ð/, always the voiced variant: 'with this/that/etc.' [wɪð'ðɪs…] (but 'with 'em' possibly ['wɪθəm]).
Comment: Thank you. _"neither is absolute in any way"_. Then it is safe to assume it can be labeled "idiolectal variation", with both variants being equally acceptable and in use, notwithstanding the general tendency to assimilate to the following sound( or feature).
Comment: Yes, absolutely – apart from cases like _with this_ where it would actually sound strange to use [θ], you can use either variant in any situation with no risk of anyone finding it odd. I'm not sure it's even idiolectal: even within a single speaker, you'll find much variation.
Comment: As far as I know, the voiced and unvoiced dental fricatives are distinct English phonemes.  Witness "thy" vs. "thigh," "either" vs. "ether," and "loath" vs. "loathe."
Answer: I generally produce ð in all contexts (even pre-pausal), but I have heard people uttering pre-pausal θ. You could approach the question from an individual phonological perspective, but once you start talking about probabilities, you're really in the realm of socio-phonetics. I don't see any reason to assume that all English speakers have the same representation of the word. As far as I know, there is no general phonological tendency to assimilate voicing of final /θ/ or /ð/ to what follows in dialects of English, though there are always problems detecting vocal fold vibration in fricatives in speech. If there is contextual variation for some speakers, it is more along the lines of phrasal allomorphy of the type "a ~ an" or "ði ~ ðə".
Comment: Was the first or the second ð supposed to be a θ (I'm guessing the second one)?


Integrating the gauge covariant derivative by parts

Question: I was watching a set of lectures on effective field theory and the lecturer said that you can always integrate the covariant derivative by parts due to gauge symmetry. For example, if I understand correctly, we can write:
\begin{equation}
\int {\cal D} \phi \exp \left\{ i \int d ^4 x D _\mu \phi D ^\mu \phi + \, ...\right\}  = \int {\cal D} \phi \exp \left\{ i \int d ^4 x  - \phi D ^2  \phi + \,...\right\}
\end{equation}
where $D_\mu = \partial_\mu + i g T ^a G_{a, \mu} $. This would be obvious if we didn't have the gauge boson contribution but why does integration by parts hold for the covariant derivative?
Comment: It isn't obvious. Did you work it out explicitly? Its not hard to do with a bit of computation. Can you show some work?
Comment: Similar to general relativity, the covariant derivative is constructed such that all the Leibniz rules hold. So why won't you be able to do that?
Comment: @Hunter: Thanks, I didn't know that the Leibniz rules held for the covariant derivative. I was always just shown that it was constructed such that $D_\mu \phi$ would transform covariantly.

Its easy to prove that the product rules holds for $U(1)$, but is it true for non-Abelian covariant derivatives as well?
Comment: @JeffDror yes, I'm pretty sure, although you make me doubt myself now. It is shown that this is true in Sean Caroll's book (which I don't have in front of me right now), and this easily carries over to the covariant derivative in non-Abelian gauge theories. If no one has replied by tomorrow, then I will see if I can find the time to write an answer below.
Answer: Leibniz rule holds for covariant derivatives, both in gauge theories and gravity. Mathematically, a derivation is one for which the Leibniz rule holds. How does it work for non-abelian covariant derivatives. I will give you an example.
Let $\Phi^\dagger \Phi$ be invariant under local non-abelian gauge transformations. Then
$$
\partial_\mu (\Phi^\dagger \Phi) = (D_\mu\Phi)^\dagger \Phi + \Phi^\dagger (D_\mu\Phi) = [D_\mu(\Phi^\dagger)]\ \Phi + \Phi^\dagger (D_\mu\Phi)
$$
The term on the left hand side is the ordinary derivative as the combination is gauge invariant. By construction, it is easy to see that each term on the right hand side is invariant under local gauge transformation. You need to further show that the terms linear in the gauge field cancel. That more or less follows from representation theory. It is also easy to work out the rules for integrating by parts using the above formula. For your Lagrangian, you would consider the ordinary derivative of the scalar,i.e,, $\partial_\mu (\Phi^\dagger D^\mu \Phi)$.
Remarks:

The ordinary derivative satisfies an additional property i.e., $\partial_\mu\partial_\nu\ f(x) = \partial_\nu \partial_\mu f(x)$ for all smooth functions. This is not assumed for all derivations. In fact, the obstruction to commutativity of the derivatives defines the field strength.
$$
[D_\mu,D_\nu]\ \Phi \sim g\ (F_{\mu\nu}^a T_a)\ \Phi\ .
$$
In supersymmetry, one uses a graded version of the Leibniz rule for (covariant) derivatives involving Grassmann coordinates.
Answer: Because $T^{a}$, which is a generator of the symmetry group is a matrix, the following identity is immediate:
$$[T^{a},BC]=[T^{a},B]C+B[T^{a},C]$$
As you may notice, this is just the Leibniz rule.
Now consider $$D_{\mu}(BC)=\partial_{\mu}(BC)+[A,BC]$$
It follows that the covariant derivative $D$ obeys the Leibniz Rule.


How to capture click events on different views in a list item?

Question: I have a list view with an image view and text in a linear layout. I want to perform different operations when user clicks on the Image view and the Text view. I have tried onItemClickListener but it's capturing on the whole linear layout. I tried onClickListener in custom adapter, but were unable to get its position.
How can I resolve this problem?
Answer: set tag for each view you are going to click as its position & get that using gettag
Answer: Firstly make both your textview and the imageview clickable and focusable.
Secondly Inside Your adapter class within getView add events to both textview and imageview.
Answer: Here i m sharing my code.i have three Textviews in each list item and on one of them i put a listener.This code is for reference.Learning from the below code U can put listeners on different list items.Now i hope u can write code as u want.
<code>static class ViewHolder {
    public TextView tv1,tv2,tv3;

        }

@Override
public View getView(final int position, View convertView, ViewGroup parent) {

    View rowView = null;
    final ViewHolder holder = new ViewHolder();
    if (convertView == null) {

        LayoutInflater inflator = context.getLayoutInflater();
        rowView = inflator.inflate(R.layout.attach_pic, null);

        holder.tv1 = (TextView) rowView.findViewById(R.id.defectpic);
        holder.tv2 = (TextView) rowView.findViewById(R.id.no_of_uploded_pics);
        holder.tv3 = (TextView) rowView.findViewById(R.id.camera);

        holder.tv3.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

                Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
                cameraIntent.putExtra(TAG, position);
                context.startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);

            }
        });

        rowView.setTag(holder);
        List itemVal1 = (List)getItem(position);
        String st1 = (String)itemVal1.get(0);
        holder.tv1.setText(st1);

        List itemVal2 = (List)getItem(position);
        String st2 = (String)itemVal2.get(1);
        holder.tv2.setText(st2);

    } else {
        rowView = convertView;
        ((ViewHolder) rowView.getTag()).tv1.setTag(list.get(position));
        ((ViewHolder) rowView.getTag()).tv2.setTag(list.get(position));
        ((ViewHolder) rowView.getTag()).tv3.setTag(list.get(position));
    }

    return rowView;
}
</code>


What is the purpose of a "monitor diode" inside a laser diode case?

Question: I was looking for laser diodes to buy and I noticed many of them have a "monitor diode" included. What is the purpose of a monitor diode? Would not the current (of the laser diode) be a better way to monitor it?
Comment: Laser diodes are highly nonlinear devices driven by positive feedback. Nonlinearity or positive feedback individually make predicting output from input challenging, but here you actually have both, so a lot of the time it's hopeless to predict output from just the input current.
Comment: @user1850479 You should post that as an answer. I think it's far more direct than the current answers.
Comment: It's also good for self-mixing intererometry because then you do not needs optics like beam splitters to produce a beam for the target and a beam to mix with, and redirect both to a photodiode for monitoring https://www.youtube.com/watch?v=MUdro-6u2Zg
Answer: It it normally used as feedback to measure if you are losing light over time due to laser degradation and this in turn can be used as AGC to maintain constant light output.
Just measuring the current or even both Vf and current is not enough due to said degradation. Also, lasers have a knee below which the operate as an LED more or less and above it they start to lase. You won't capture that without the monitor diode being present.
To some degree you can measure coupling/fiber insertion.
Can also be used to create a poor man's laser microphone. YouTube link to Applied Science: youtube.com/watch?v=1MrudVza6mo
Answer:
Would not the current (of the laser diode) be a better way to monitor
it?

No, the monitoring diode is an accurate and fundamental method of ensuring the calibration of many laser diodes. For instance, if you buy a laser diode from a reputable supplier, you can pay a little more and get a precise figure for the light power output based on the photodiode output current. The supplier may typically produce information like: -
output power = 4.70 mW at a PD current of 250 uA when reverse biased at -5 volts
If you buy and use a lot of laser diodes, this information is crucial else, you need to setup your own test rig and calibrate it yourself. Many folk don't want to do that.
Then, the photodiode can be used in a simple closed loop system to ensure that in critical applications, the laser diode light output remains constant across a wide range of operational conditions.
Operating current versus temperature versus light output is too complex and unreliable for accurate control of the laser diode light output. In other words, the photodiode output current is a much more reliable method of determining laser diode output power than any other method.
Answer: Just to make it explicit, their wording is a tiny bit lazy.  Monitor photodiode would be clearer.
How it's integrated depends on the laser package (even big benchtop lasers may have monitor diodes, but they're discrete components). Crucially unlike measuring the input to the laser diode (as you would measuring its current), it measures the output light.
Comment: You are right, but on the web store, the word is Monitor Diode, so I used the same. I never worked with Laser Diodes before, but I know a little about electronics.
Comment: @JulioOtuyama that looks like a typical example of manufacturers using wording that's obvious if you were close enough to the design of the part to know about its internals, perfectly fine for many customers, but overall could be more helpful - a common enough occurrence
Answer: It is worth mentioning that various manufacturers of laser diodes provide various internal configurations of the laser diode and monitor diode.
Also, while this is not the purpose of the monitor diode, a very interesting experiments can be performed using it. https://www.youtube.com/watch?v=MUdro-6u2Zg

Images sourced from Wavelength Electronics application notes
https://www.teamwavelength.com/download/Datasheets/lddpseries.pdf


Homepage is not loading

Question: I have developed my wordpress site locally and now it's live on a host. Everything is working fine, but when I click the Home button on the top menu it goes to localhost/wordpress, not to my exact homepage.. Help me fix this.
Comment: you need to edit your database for references to the old (localhost) site and change them to the live url
Comment: Could you please explain me how to do it.. which data i should change
Comment: Added how I do it as an answer.
Answer: probably is a database migration problem: inside your database table wp_options there are two options, home and siteurl, which in your case must have set as value the "real" homepage in your website.
To complete the migration you should run a search and replace on the whole database, after fixing the options table, to find every url using the old localhost address. Use this plugin to do it.
Comment: Does this plugin handle serialized data?  Looking on their support forum i see several issues people are having...
Answer: You need to go into your new database and change the site url and home url to the new address. I suggest NOT doing this through phpmyadmin or the WP dashboard (using plugins) though as it will cause some problems. Plugins May work, but if wordpress hangs or times out or any number of things you could have a bigger problem.
I recommend is using Search & Replace DB, a free tool by Interconnect, to replace any instances of the host name in the database. It will handle setting the serialized data correctly for you. and it works OUTSIDE of the WordPress system.
First make sure that your wp-config is for the right database.
Go get this tool: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Upload it into your www/ folder. (I usually rename the search and replace folder to SRDB.)
Now navigate to your site with the SRDB at the end on the NEW url. (www.example.com/SRDB) and the top two lines you'll see a search field and a replace field. (if you get a db connection error here, double check the wp-config to ensure that it has the right credentials).
In the search field, place your old site address.
In the replace field, place your new url.
Hit live run.
ONLY do this after ensuring you're on your new url and that SRDB has loaded into your new database.
Remove the SRDB folder when you are done.

Homepage is not loading


Magento 2 - Difference between building a theme from scratch and inheriting from Blank theme

Question: I'm so confused between whether I Should inherit my custom theme from Blank theme or start a new one from scratch.
Please what is the difference?
Answer: Building theme from scratch means no need to inherit parent theme like Blank or Luma.
If you want to use components of Luma/ Blank theme and want to write less CSS or less then you have to inherit parent theme.
Building new theme from scratch means you have to manage all file Email,Print all CSS you have to Write that.
Best theme Development resources.
https://jamersan.com/lets-get-started-theming-magento-2-part-1/
Source: Jamersan.com


Category Header Widget

Question: I hope this is the right category and someone can help point me in the right direction. I created an instance of a widget and have a static block associated to it. I have it placed to appear in the Category header. However, it is placed below the description and i would like to have up more and place it between the title and description of the category. Where or how can I control the exact placement of this widget inside of the category header? Please attachment. Thanks in advance.
Answer: The static block is rendered in the template file catalog/category/view.phtml. If you wish this to appear above the title you will need to copy the file to your theme from app/design/frontend/base/default/ and modify it to more like this:
<?php if($this->isContentMode() || $this->isMixedMode()): ?>
    <?php echo $this->getCmsBlockHtml() ?>
<?php endif ?>

<?php if($_imgUrl): ?>
    <?php echo $_imgHtml ?>
<?php endif; ?>

<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>

        <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>

<?php endif; ?>

<?php if ( ! $this->isContentMode()): ?>
    <?php echo $this->getProductListHtml() ?>
<?php endif; ?>

Comment: I tried something similar to this before and it didn't work. I also tried this suggestion as well with no luck. thank you for replying.

Category Header Widget


How to work out two images's degree of similarity using php

Question: there are two jpg files binary data,how to work out their degree of similarity using php.
if it is possible to get color infomation from binary code.what's more ,the server cant surport gd,it's a delegate server.
Comment: Well, do you have something else, like ImageMagick? If not, you should probably write your own function to decode jpg et al. Also: what would you consider "similar"? Average color?
Comment: no imageMagick either,i want to do something like using picutre search annother picture.
Answer: These previous questions seem to be related:

How can I measure the similarity between two images?
Image fingerprint to compare similarity of many images
What algorithm could be used to identify if images are the "same" or similar, regardless of size?
Duplicate image detection algorithms?
Similar image search software (like TinEye)
Looking for image similarity library that doesn't care about image dimensions


How do I export users and products from a Magento website from inside a module?

Question: I am developing a Marketing(mostly email) extension for Magento, which requires that the users and products be imported into another third-party tool.
How do I export this data from Magento to send it to our tool? What is the correct way to do it?
Right now, I am forcing the Magento store owner to generate consumer key and consumer secret(after giving a bunch of permissions), and then go through the OAuth flow on the third party tool. But it is too tedious a process. I want to simplify it, by the extension taking care of the export/import automatically. How best can it be done?
Answer: You could start by having a look at the Magento API, which gives you a bunch of options to get data out of the box. If you are not happy with these functions, you can extend the api and add more methods by overwriting the Core API with a custom module.
Here are two tutorials on how to. 1, 2.
Another thing you could do is export your data into a csv and have the extenal tool pick it up from there. You could make a CRON job for that.
Comment: Cronjob has the additional step of setting up cron.php/cron.sh, right? In my case, some of the Magento store owners may not have configured the same. Can I setup an export script in the install script of a Magento module?


Cat attacks me then beats up his brother

Question: I was cutting fabric on my worktable and Milo (age 9, neutered male) was sitting on the fabric. I nudged his hind left foot, the only part of him that was in my way. He reared up and slapped my head with his claws out, right-left-right-left. Both he and I were shocked. I said "Milo!" and he jumped down and ran out of the room. The rest of the day he repeatedly attacked his littermate Max (NM), biting his hind leg. Max ended up under the bed shivering. How could I have eased the situation? I've had the pair for almost a year and this has never happened before. Both are strictly indoors.
Comment: Was he napping when you nudged him?
Comment: This question sounds like a news headline: "Cat attacks owner, beats his brother up and robs a pet store at gunpoint."
Comment: I can't speak to attacking his brother, because I only have one cat. However, when I am doing crafts, the cat often sits on my craft and becomes extremely territorial. Even ignoring her and trying to continue as best I can can lead to an attack on me. Picking her up is out of the question. I resorted to the spray bottle. You can shake the bottle, spray past or over your cat, and then finally spray him. Next time he should have learned that the water shaking sound means get down and hopefully you won't need to actually spray him.
Answer: He may be trying to defend himself from you nudging his hand, and left foot. Sometime cats defend themselves when they feel like you were bothering them, it's completely normal for them to act like this, Milo might had evolved with that feature. Also if he's attacking his Littermate, he mighted had learned that from his ancestors. In this case take Max and Milo to the vet.
Comment: This is a behavioral issue, not a medical one.


TLC5940 resets itself when driving certain DC motors

Question: So I had the following setup:

I was just driving a small DC motor with this circuit by either sinking current on pin 0 or 1 on the TLC with a motor voltage of 5 volts and everything was fine. The motor was drawing around 200mA and I thought I could upgrade the motor a bit so I picked one that drew around 350mA at 5V. After I connected the motor and powered the circuit the motor just twitched for a split of a second and then nothing. I changed my sketch and reset the TLC every 5 seconds and it turned out that the motor was just doing this every time the TLC tried to drive it in one direction.
I added ceramic capacitors between VCC and GND on the TLC and the H Bridge and electrolytic ones at the motor supply pin of the H Bridge but that did not help. Then I replaced the H Bridge with a beefier one, the L298 but that did also not help. Now I tried the circuit with a PCA9685 instead of the TLC5940 and it seemed to work now... but I was still wondering why it was not working before. I saw oscillations on my scope right in the moment when the motor tried to start that were driving the logic supply voltage of the circuit to almost 1V both times, when I used the PCA and the TLC, the PCA just seemed to "survive" this voltage drop and just continued working without needing to be reinitialized. Maybe because its minimum supply voltage is lower but I am not sure since I was not using a decouple capacitor on purpose. I understand that the motor draws lots of current when  starting up, but I expected the drop on the motor supply voltage and not on the logic supply, I intentionally used different power supplies, both with an isolation transformer. Only the grounds in the circuit are tied together.
It is not visible in the drawing, but the power and ground rails on either side of the breadboard were connected. Also, I understand that the PCA is push pull and the TLC is open drain, I used the pull ups only for the TLC.
I am just wondering what is happening here or how I can prevent it because I really want to use the TLC over the PCA... I am happy for any solutions/ideas/opinions!
Comment: Did you really build this circuit on a solderless breadboard? Please provide a link to data for the '350mA' motor.
Comment: [Why the L293 is so bad on low voltages](https://electronics.stackexchange.com/questions/108686/l293-l298-and-sn754410-h-bridge-drivers-on-low-voltage-power-supply)
Comment: The L293D has internal clamping diodes. The L298 requires external clamping diodes. See figure 6 of the data sheet https://www.sparkfun.com/datasheets/Robotics/L298_H_Bridge.pdf for how clamping diodes should be added. You didn't say you added diodes, so perhaps you did not. I don't know if that is related to your problem, but it would be a good safety precaution, even if your troubles lie elsewhere.
Comment: @MathKeepsMeBusy I used one of the little driver boards that has the clamping diodes populated on it, I made sure the ICs were used in a similar manner
Comment: @BruceAbbott yes, actually also on a soldered one just to make sure. It was just a motor I had lying around and its draw was 350mA by hooking it up to a 5V dc supply.
Comment: @Andyaka Yes, I read about this. I also ramped the motor supply voltage to 12V but the same result was the outcome
Answer: Be aware of where the current is flowing. If the motor current can flow through the 0V of the logic, then you may get a voltage drop (ground bounce) that may upset the logic.
Plug-in boards are really not good for higher currents.


Modify HDD partitions while using them

Question: In gparted, why can't I modify partitions that are in use, like root, but in Windows I can shrink the root partition while booted into it.
Is there any program I can use to modify a partition while it's in use?
Comment: Yes you can. See https://askubuntu.com/questions/24027/how-can-i-resize-an-ext-root-partition-at-runtime   GParted v0.17  can resize a root that is mounted.
Answer: GParted is pretty conservative about this, but it can be done with other tools; however, there are significant differences depending on the partitioning method (conventional partitions vs. LVM) and the filesystem in use. For instance:

You must distinguish between resizing partitions (which are simple data structures that identify the start and end points of filesystems or other data structures) and filesystems (which are much more complex data structures to help identify files, directories, and associated metadata). GParted presents one user interface for performing both actions, thus masking this important distinction.
When resizing a conventional partition that's used "raw," you need to either resize, or delete and re-create, the partition you want to change. You do this before increasing the size of a filesystem from its end or after shrinking the filesystem if you want to decrease the size of a partition. Because of the way the Linux kernel handles these things, it may be difficult to get the kernel to recognize the changed partition size of a partition with an active filesystem, so you may need to reboot after making a change to the size of a partition.
Moving a partition or resizing it by changing its start point requires re-writing significant amounts of the filesystem it contains. This is because filesystems are defined, in part, by data structures that are located relative to the start of the partition (or other container). GParted handles this more-or-less transparently, but if you want to do it with other tools, you'll need to be very careful to move the filesystem data structures and to get the resized partition to start at exactly the right point. This is a task for experts with nerves of steel; do not attempt such things unless you know what you're doing! Even an expert would do this only after making a backup.
Another data structure type is Logical Volume Manager (LVM), which is an alternative way to identify filesystems. LVM is typically layered atop ordinary partitions -- that is, you designate one or more partitions as physical volumes (PVs) in an LVM volume group (VG), then subdivide that VG into logical volumes (LVs), which are what hold filesystems. Despite the added complexity, LVM makes it easier to resize filesystems because LVs are more like files -- you don't need to be concerned with where they begin or end; you just need to know the LV's name and size.
If you use LVM, logical volumes (LVs) hold filesystems, and so you're normally concerned with resizing LVs, not partitions. Resizing LVs while they're in use is easy, and is done via lvresize; but the filesystems they contain may still need to be resized separately. (Sometimes the --resizefs option to lvresize will help with this task, though.)
If you want to increase the total space used by LVM, you can add a new partition as a PV and then resize LV(s) within the VG. If your LVM setup contains multiple PVs, you can reverse this process (although you may need to explicitly clear out one or more PVs with pvmove followed by vgreduce). If you've got one big PV, you'll need to resize it with pvresize and then adjust the containing partition's size with fdisk, parted, gdisk, or some other tool.
Different partitions support different methods of resizing. For the popular ext4fs (and its predecessors, ext3fs and ext2fs), you can use resize2fs to do this job. This tool supports increasing or decreasing the size of unmounted filesystems; but for mounted filesystems, the size can be increased but not decreased. For other filesystems, you must consult the filesystem's own sizing tools.
GUI tools like system-config-lvm can help with LV resizing when using LVM.

I don't use the Windows tools very often; however, my vague recollection is that, when you resize an in-use Windows partition, its tools require a reboot as part of the operation. If this recollection is correct, then the Linux and Windows tools actually aren't all that different from a low-level point of view; it's just that Windows helps automate the different steps involved, whereas you must explicitly do the different things yourself under Linux. In some cases, such as when increasing the size of an LV, Linux may actually be more flexible than Windows.
The why of it has to do with the way the data structures are created and otherwise manipulated by the kernel; the kernel tends to assume that partitions that are in use won't change in size. That said, I'm not familiar with the internal kernel details, just some of the system calls that partitioning tools can use to tell the kernel to update its partition-table data. There have also been changes to how the kernel handles this from time to time; but such changes require changes to userspace tools that may take a while to propagate. GParted is itself built on numerous other levels (most notably libparted, but also GUI libraries, the X Window System, etc.), so it can be slow to catch up to new features at the kernel level.
There are numerous questions and answers on this site that cover numerous specific resizing scenarios. Covering them all in a single answer would be tedious and impractical.

Modify HDD partitions while using them


how to include Angstrom symbol and Greek letters in gnuplot?

Question: I am using gnuplot and would like to get the symbol for "Angstrom" (Å, ISO encoding 305) and the Greek letter Delta (Δ, Symbol 104) in the plot. How can I combine the two encoding schemes when producing my output eps?
Answer: For readability of your code, why not use UTF8?
set xlabel "{/Symbol D} Δ (Å)"

Gives in PDF terminal :

with encoding to default but UTF8 as system wide locale:
gnuplot> show encoding

nominal character encoding is default
however LC_CTYPE in current locale is fr_FR.UTF-8

Answer: You can see the characters in this example:
set terminal postscript eps color enhanced size 10cm,10cm
set output 'pic.eps'
set encoding iso_8859_1
set xlabel "{/Symbol=30 a}"
set ylabel "{/Symbol=30 b}"
set label "Label {/Symbol \104}{\305} End" at 1.7,2.5 font "Times,30"
set title "TITLE {/Symbol=30 \104}{/Helvetica=30 \305} END"
set key off
plot "-" with lines
1 3
2 2
3 3
end

The syntax for a character is {/fontname=size \code} so for example we have {/Symbol=30 \104} for the delta, and {/Helvetica=30 \305} or just {\305} for Angstrom. Ensure you have set encoding iso_8859_1 or similar to use the ISO Latin-1 encoding.
See Enhanced text mode in the gnuplot guide at gnuplot.info.


Passport issues september 2006 - has 'camera' symbol is it valid?

Question: Hi I have a 'camera' symbol on my passport on the front page. My passport was issued to be in September 2006 and is Valid until May 2017 - does that mean my passport is fine to travel to the USA and meets the e passport/biometric requirements to enter the USA. I have an approved ESTA also.
I fly to the USA next week so am rally worried.
Answer: If your passport has the biometric symbol on the front cover, you should not have a problem using it to enter the US. If you are still concerned and you have or know someone with an NFC equipped Android phone, you can download apps from the Google play store that can read the passport information including your photograph over NFC. e.g. this one, although there are many others.
Conditions of travel under the Visa Waiver Programme can be found here including the description of the e-passport symbol on the front cover.


In WinForms, has anyone seen invoking of one modal dialog from another modal dialog cause the modality to get undone?

Question: The Questions:
Has anyone seen invoking of one modal dialog from another modal dialog cause the modality to get undone?
If you wanted to make a call with ShowDialog so that you get back a result, but without it being modal (other Forms still respond), how would you do it?  (We're not trying to do that... but if there is a way to do that, maybe we're doing that accidentally.)
The Details:
We have implemented our own Print dialog that has buttons that bring up the standard PrintDialog, the standard PageSetupDialog, and the standard PrintPreviewDialog.  And the printing is all done with our own PrintDocument class derived from the standard PrintDocument class.  So, we're trying to follow the standard practices... we just have a few extra settings that we need the user to start with.
We invoke our Print dialog from a menu using ourPrintDialog.ShowDialog(mainWindow).  When it comes up, it is properly modal (all other windows are non-responsive... in particular, that mainWindow).  From that Print dialog, there are buttons to invoke each of the other three dialogs... and all are invoked with ShowDialog(ourPrintDialog), making that first Print dialog as its parent.  In the case of the PrintDialog and the PageSetupDialog, they come up modal (mainWindow and ourPrintDialog and all other windows are non-responsive).  And when we OK or Cancel those, it returns to the first Print dialog (ourPrintDialog) which is still modal (no other windows respond).
However, in the case of the standard PrintPreviewDialog, although we invoke it the same way (ShowDialog with the first dialog as its parent), it comes up not entirely modal.  Our main window becomes responsive again.  So, you can start manipulating the underlying document that the Print dialog is in the process of printing... which of course violates many assumptions.  And when you close the Preview dialog, returning to the original Print dialog, it is also now not in a modal state... the main window is still responding.
We have tried doing this in a plain test app, and it works fine... the modality is not broken when going into the PrintPreviewDialog.  So, it seems to be some specific interaction between the PrintPreviewDialog (since it doesn't happen with the other two) and our app's main window (since it doesn't happen with the test app).  Any suggestions on what that might be?  (And hence my two questions above.)
Thanks in advance for any suggestions!
Comment: Does it take more than 5 seconds for the print preview to be generated?  Then this is normal.  The original windows get replaced by a "ghost window", it shows "Not Responding" in the title bar.  Those windows are not modal and don't otherwise respond to clicks.
Comment: There may be some cases when it takes more than 5 seconds... but I have never seen a "Not Responding" window... and my issue is NOT that there's windows that "don't otherwise respond to clicks"... rather, my issue is that the other windows DO respond to clicks when they shouldn't be because I am in the middle of a ShowDialog so nothing but that dialog should be responding.
Answer: Not sure why it's happening , but you might try running Spy++ on the windows and watch the messages that flow, might give you a clue as to what is happening between the windows, or the properties of the windows in question.


What are the default SXA modules available?

Question: What are the default SXA modules available for CMS user to build website?
Answer: When creating a new site within your tenant, you can (de)select the modules you wish to add to your site. These are the default modules available (SXA 1.9) when adding a new site:

After your site was created you can always add modules which were not selected when the site was created.

Add modules to tenants and sites using context menu script (Add Tenant/Site Module) or bulk module installer. When you create a new SXA tenant or site, the wizard lets you select the modules that you want to include. When you have an existing tenant or site and want to add modules later, you can add modules to a specific tenant or site or use the SXA bulk module installer to install modules for multiple tenants/sites.

Please look at the documenation: https://doc.sitecore.com/developers/sxa/19/sitecore-experience-accelerator/en/add-a-module-to-an-existing-tenant-or-site.html
Answer: In addition, you will not get all the modules in the module tab. Default SXA modules include the not only rendering sections, but JSON site setup, and grid systems as well. SXA modules are stored in the Feature or Foundation folder under the system node -
<code>/sitecore/System/Settings/Foundation/Experience Accelerator/

/sitecore/System/Settings/Feature/Experience Accelerator/
</code>


Parsing " " Characters as Spaces

Question: I'm working on a project for a client where I need to parse data from their legacy HTML pages for more efficient storage. The data appears in this basic format, with multiple key/value pairs on a single line.
 Key1: Value1 Key2: Value2...

I'm able to get 95% of the records using preg_match_all('/\w+:\s+\S+/', $line, $items)
The problem I am having is a minority of the lines contain text like this:
 Key1: Value1 Key2: Value2

In this case, my script shows that Value1 = Value1 Key2:.
I've tried replacing the   strings using both html_entity_decode($line) and str_replace(' ', ' ', $line). With both, I still have   characters in the output, and the string isn't correctly parsed.
The pages I am trying to parse are WordPress pages. Inspecting the wp_post record for the page shows that the   strings are stored in the database. I believe the pages were populated via an export from MS_Access. Earlier in my script, I've passed the parent of $line through $strip_tags().
Is there any reliable way to eliminate/filter/replace this   string?
Comment: str_replace should work. How are you outputting it?
Comment: If I inspect the output of `echo ''.print_r($items, true).''`, Value1 is incorrect, and the ` ` character is present.
Comment: cpilko - There are many vars you are mentioning and it becomes a bit disconnected. Would help if you can update question with a continuous set of lines in its entirety
Answer: I've been beating my head against the wall for days on this one, and finally found the answer. I tested every answer given by others. None work. -1 for everyone!
The   is being stored in the database as a Unicode character string. It only shows as   when rendered in the browser. This removes it.
$line = str_replace("\xC2\xA0", " ", $line);

Parsing " " Characters as Spaces


How and why does the height of water in a glass affect it's resonance? (resonant frequency)

Question: Why does the resonance frequency of a vibrating wine glass changes with the level of water in the wine glass?
Answer: The resonant frequency will be made lower the more water is in the glass, because the glass must vibrate against the water, increasing the effective inertia in the glass.  Resonant frequency always looks like the square root of some kind of restoring force divided by some kind of inertia, so increasing inertia reduces resonant frequency.  Or another way to look at it is, the resonant frequency is inversely proportional to the time it takes a wave to pass down the glass and bounce back up again, and contact with dense water slows down that wave.
Note this is the opposite effect that you get when you blow over the top of a wine bottle-- there the wave is in the air, not the glass, and the resonant frequency is inversely proportional to the time for sound waves in air to propagate down through the air and bounce back up again.  That will be a very obvious effect, increasing the water level raises the resonant frequency in the air dramatically.  But it doesn't sound like that is what you are talking about.
Note that the other answer raises the possibility that the vibration in the glass might actually bounce when it reaches the water level, much like the sound waves in the air, in which case raising the water level would raise the frequency.  So your experiment will tell which of these effects is actually happening, because if the wave has to still go all the way to the bottom of the glass before coming back up, then raising the water level will lower the resonant frequency.
Answer: The parts of the glass that are in contact with the water, cannot oscillate freely, they have to displace the water next to them.
The parts of the glass above the water level can oscillate freely. The eigenfrequency of the glass thus depends on how much of the glass has to oscillate with water and how much without.
Place a long ruler halfway over the edge of a table, then hit it to make it oscillate like in the image below. (click the image to find its source, which is a related article)

Changing how much percent of the ruler is on the table changes the frequency of the oscillation of the free end (which gets longer or shorter).
Your wine glass is similar. The part of the glass that's in contact with the water is similar to the part of the ruler that's on the table.
Answer: What is resonance?
Resonance is a phenomenon in which external vibrations (or forces) causes another system to oscillate at a particular frequency with large amplitude.
In your case, the resonance is caused by the speakers in the air column (the glass acts as an air column).
=> The speakers cause the air in the glass to vibrate at its resonance frequency
=> The air inside the glass is the affected system

Mathematical Derivation

The figure above shows sound waves vibrating inside an air column (glass in your case).
At the base of the air column, the air cannot vibrate; hence, there must be a displacement node at that point. At the top of the air column, the air cannot stay at one position as the air is moving at the top; therefore, the air at the top vibrates with the maximum amplitude.
Let the length of the air column be $L$.
The following formulae will be used in this derivation.
$$v = f\lambda, \space \space f = \frac{v}{\lambda}$$
where $v$ is the speed of sound in air, $f$ is the frequency of the vibrations, $\lambda$ is the wavelength of the vibrations.
Case 1:
The air column contains $\frac{\lambda}{4}$ of the wave.
$$L = \frac{\lambda}{4}, \space \space 4L = \lambda$$
$$f = \frac{v}{4L}$$
Case 2:
The air column contains $\frac{3\lambda}{4}$ of the wave.
$$L = \frac{3\lambda}{4}, \space \space \frac{4}{3}L = \lambda$$
$$f = \frac{3v}{4L}$$
Case 3:
The air column contains $\frac{5\lambda}{4}$ of the wave.
$$L = \frac{5\lambda}{4}, \space \space \frac{4}{5}L = \lambda$$
$$f = \frac{5v}{4L}$$
$$$$
You can observe a pattern. All the possible resonance frequencies can be summarized using the following forumla:
$$f = (2n + 1)\frac{v}{4L}$$

How does the level of water affect the experiment?
As you might have observed in the derivation, the resonance frequencies of the air column depend on the length of the air column. In your case, the base of the water (water height/water level) acts as the lower end of the air column. The air vibrates between the top of the air column and the base of the water height. Therefore, changing the water level effectively changes the air column's height which in turn changes the resonance frequencies.
The vibrating air column's oscillations are transferred to the wine glass. So understanding how the water level affects the frequency of the air in the column is as good as understanding how the water level affects the resonance frequency of the wine glass.


Extracting passwords from recycled machine using Spectre and Meltdown

Question: With Spectre and Meltdown, hackers can extract your password from the CPU cache. If I give someone my computer without the hard drive, can he extract my passwords through the CPU?
Comment: I assume that you mean the password for an encrypted volume. I don't think this is possible. Definitely not possible if you've switched your system off to remove the hard drive. Very unlikely even if you've ripped the drive from the system while it is still running.
Comment: passwords form the browser. here is the explanation i saw : https://www.youtube.com/watch?v=NArwG6yaWJ8
Answer: Since the content of the cache is gone once the system is switched off this kind of attack is only possible if you remove the disk while the system is kept running. In this case the attack should still be possible if it was possible with the disk still connected (i.e. probably not possible with up-to-date systems),
Answer: The way that the spectre / meltdown exploits work is by exploiting a technique used in chips known as 'speculative execution', which is one of three main techniques that vendors use to increase cpu performance. (The other two being multiple branch prediction, and dataflow analysis.) The three together are known as out-of-order execution.
Because modern CPU's are pipelined, they are capable of executing multiple instructions in parallel, which can be seen here: https://upload.wikimedia.org/wikipedia/commons/c/cb/Pipeline%2C_4_stage.svg
So the reason that the spectre / meltdown exploits are capable of running are that the speculative execution is able to access privileged memory that a user-space application cant access. There are no checks for the cache that is being accessed under speculative execution for privileges, it starts to run without the privilege check, and when its time to commit that data or continue with the speculative execution, the check is then done. But that allows for a small window of opportunity to run instructions for the branch prediction so that you can read memory that you shouldn't be able to.
Spectre and meltdown are used more for privilege escalation once someone has physical access to your machine. So to answer your question, yes and no. Someone cannot extract your passwords from an old computer. The passwords are kept in cache during the running of the system, and are 'flushed' at regular intervals, the way that these exploits work is by accessing data stored in memory that they shouldn't be able to access. However they may still be able to extract credentials that have been stored in web browsers.
I simplified the exploit as much as possible to make it easier to understand, but if you want more information on how these attacks work then ill leave the link for the whitepapers below. They are a fascinating read if you have the time.
sources:
https://spectreattack.com/spectre.pdf
https://meltdownattack.com/meltdown.pdf


Recruitment for UX research

Question: I'm would like to recruit executives and design leaders for a study, but my budget will only cover incentives. What are the best recruitment strategies that don't involve paying hefty service fees or yearly subscriptions?
Answer: If you cannot pay an external agency or service to do your recruiting, you will need to do the work yourself. Put out screeners on LinkedIn and Twitter. Find the communities that your target audience would most likely be.
Answer: Like Thomas said, do the recruiting yourself. Fortunately, your target audience is very accessible. You can simply jump on the dozens of design related slack channels and post your screeners there. Design comprises of many professions so make sure to post on the right communities. Additionally, meetup groups are also great for recruiting, just make sure you get permission from the moderators to post for you for credibility. Facebook groups, Reddit subreddits, etc are all valid sources.
Answer: I'd recommend using your personal network in whatever way you can to get some participants. You can also seek out those types of people through incubators and coworking spaces. There's also a nice article with a lot of creative ways to recruit that I've referred to a few times: https://tsharon.medium.com/43-ways-to-find-participants-for-research-ba4ddcc2255b
Good luck!

Recruitment for UX research


How to connect multi battery operated light to AC source

Question: So I bought a few letters light that works with 2X AAA batteries and i am trying to connect them together to one AC source instead of using batteries. I opened one of them and there is nothing but the lights and the power on/off switch. Can I connect all the positives together and all negatives together? if so, how much AC power do I need? is it 3V or the total of the used batteries? I have 14 letters that's mean I need 28 batteries.
Comment: Are the individual lights incandescent bulbs or LEDs? Incandescents run on AC or DC. LEDs _typically_ require current-limited DC, otherwise they change to [DEDs](https://en.wikipedia.org/wiki/Write-only_memory_(joke)). The 12 lamps in your example "A" wouldn't be wired in series, but are they wired in parallel or a series-parallel combination?
Answer: you can connect the letters in parallel to a single 3V supply.
The current requirement is going to add up so I can't guess how many amps you will need.
is there anything written on the lamps? (if they unscrew on the metal part)
You could use a multimeter to measure how much each letter needs (I expect that I uses less than W) and add those up.
Comment: Thank you Jasen, unfortunately there is nothing written on the letters or the box. I will try to look online and see if I can find anything or just use multimeter like you suggested. Thank you again
Comment: if they are filament type lamps they will unscrew and have a rating stamped into the metal part,  if not you'll have to measure or guess from how long batteries last for,
Answer: Interesting question:  Yes, you can connect all the letters in parallel. But be careful here. You're talking about both AC (mains powers) and DC (batteries). Measuring DC current is more difficult than AC.  with AC you can just put a DM with an amp clamp around a wire and whamo samo, you have a current reading.   Measuring DC current is less common, possible, but just less common requiring a specialized meter.
Also, your power supply must convert from mains power to 3 volt DC, preferably with some capacitors to smooth out the supply. your lights might not work right or flicker without a high end power supply.
Comment: @habo.  Yeah, I knew that about the amp clamp, which is why in other posts suggested making up a short "extension cord" with separate wires, but I missed mentioning that here...DOH! Although in my defense, I did say "wire" not "cable".

Thanks for clarifying, I guess I was in a hurry when I first posted!
Comment: We haven't established whether the lights require DC or would function on AC. Aside: Using a clamp-on an AC circuit often involves separating a wire from a cable, i.e. you can't just put a line cord in the clamp. Most DMMs will measure DC current, though the meter needs to be inserted in the circuit under test. My AC/DC current clamp, a vintage ES 695, is "my favorite tool that shouldn't exist". Very handy for diagnosing charging problems in vehicles without disturbing connectors.
Comment: Thank you George for the clarification.


What is the term for vector in same direction but with different length

Question: I'll say $\vec{a}$ and $\vec{b}$ are collinear if they lies in same line, like (1, 2, 3) and (-1, -2, -3).
What should I call two vectors in same direction but with different lengths? like (1, 2, 3) and (2, 4, 6). (Of course they are collinear, but is there any more specific term for them?)
Comment: "codirectional"?
Comment: "Positive scalar multiple" is the best I can think of. Incidentally, "parallel" usually refers to vectors which are a *not-necessarily-positive* scalar multiple of each other. One reason that's a more natural notion is that we're often interested in vector spaces whose field of scalars *isn't linearly ordered* - e.g. vector spaces over $\mathbb{C}$ - so there is no notion of a "positive" scalar.
Answer: You can say (1,2,3) and (2,4,6) are parallel.
As $ \vec{a} = k \vec{b}$

Edit - Difference between parallel and collinear

If two parallel vectors have angle = 0 between them that is both are in same direction but collinear vector lie in same plane they may be parallel or anti parallel that is angle = 180.
Comment: I didn't down vote, but I don't see how it answers the question. OP already has a term they can use for vectors $\vec{a}, \vec{b}$ with $\vec{a} = k \vec{b}$ where $k$ may or may not be negative. I just don't see anything in this answer that refers to positive $k$ only (the OP's objective).
Comment: I wonder why this was downvoted. It is an accurate answer, with the possible ambiguity in the case of $(1,2,3)$ and $(-2,-4,-6)$, which are parallel, but which the OP might not consider "in the same direction."
Comment: Those who down vote please mention the reason so that I can know my mistake.
Answer: The proper term is that one vector is a positive scalar multiple of the other. Or you could say that they give the same normalised vector (which is the vector obtained by dividing them by their own length). In a more informal discussion you could say the vectors point in the same direction.
Comment: I think this answer is a pretty strong indication that there doesn't exist a single term for that relationship between two vectors -- or if there is one, that it's quite localized!


Some features in advanced digitizing tool are not active

Question: I'm working on QGIS 3.2.1 and when I tried to edit a layer using advanced digitizing tool and set the layer in the editing mode, the split features is the only active icon and the rest is not active as in the below screen. How can I change this?
Comment: What coordinate system and data format are you using?
Comment: What happens if you open your kml, what coordinate system is shown? It should be WGS84 (EPSG:4326). Please try to save the kml to a shapefile or geopackage and change the coordinate system (means transform it to) EPSG:32636 within that step. I don't know i this can help with editing fuinctions, but it should help editing in the correct coordinate system and with a more stable data format.
Comment: It works when I inserted the layer as a shapefile. Thanks for your support
Comment: Kml files, I should work on EPSG:32636 but when I set the layer on this CRS, it move the layer to another part of the world. Please note I changed my laptop and I loaded the project once set up Qgis on the new laptop
Answer: Digitizing tools does not work with kml files.
Please save your kml to shapefile:
Save as/Export> Format = ESRI Shapefile
Also, the other tools, such as to change polygons, only work if you have polygons on your layer.
Comment: I worked with it before using the same Kml files. Do you know other way to insert ddmmss coordinates into qgis
Comment: Can't confirm that "Digitizing tools does not work with kml files". I have points inside a kml, and the advanced editing tools are *not* completely grayed out, and i can edit the data... My QGIS-Version is 3.4.10
Comment: Yes, csv works also. Qgis uses GDAL/OGR for data access. So there are multiple possibilities. [See here](https://docs.qgis.org/3.4/en/docs/user_manual/managing_data_source/opening_data.html)
Answer: You need to "activate" first, by clicking the yellow pencil (toggle editing):
Comment: The OP's screenshot shows that the yellow pencil button is selected...
Comment: oh, thanks for the hint, I have "overseen" it.


Sprite Kit Could not create physics body error

Question: Whats my problem:
I get the Could not create physics body error when call the constructor SKPhysicsBody(texture: size:)
I am creating the physics body for my custom SKSpriteNode object in the required init(coder aDecoder: NSCoder) constructor, so I can design my game easily in the scene editor. I need the physics body to be created according to the texture I set to in the scene editor. Here is the code I have so far:
<code>    import Foundation
    import SpriteKit

    class Attachable : SKSpriteNode {
        init(texture: SKTexture, position: CGPoint, size: CGSize ) {
        super.init(texture: texture , color: UIColor.clear, size: size)
        self.position = position

        }
        required init(coder aDecoder: NSCoder) {
            super.init(coder: aDecoder)!
            DispatchQueue.main.asyncAfter(deadline: .now() + 0.03) {

            self.physicsBody = SKPhysicsBody(texture: (self.scene?.view?.texture(from:
            SKSpriteNode(texture: self.texture)))!, size: self.size)

            let joint = SKPhysicsJointFixed.joint(withBodyA: self.physicsBody!, bodyB: (.
            self.parent?.physicsBody)!, anchor: self.parent!.position)
            self.scene!.physicsWorld.add(joint)
            }

        }

      }
</code>
As your can see the call
'texture: (self.scene?.view?.texture(from: SKSpriteNode(texture:self.texture)))!'
is a supposed workaround I saw from another post with this same bug but it isn't working, probably from the latest update with xcode. The deserialization initializer assumes I've chose a texture in the scene editor for the Attachable object. Also Im doing the async thing because the joint needs to be created after one of the bodies is initialized. I will come up with a more elegant solution but thats outside the scope of this question.
Edit: I can set the alpha physicsbody in the scene editor, so thats a work around but I'd prefer to create the body in the class.
Answer: This is a problem that seems to keep reoccurring. It's been discussed on the apple developer forums as well. It was supposed to have been fixed, but seems to have reappeared.