Obd2 not working, need to rewire

Question: 1996 chevy p30 5.7L
Obd port wasn't working. After I looked under the dash it's apparent someone has cut all the wires and never wires them back in. I guess there was front end damage so I assume they just never wired it back up. I have a pin layout for the port but where do the wires come From? The computer or is there another data source? I wanted to use an Aftermarket obd2 HUD for a tachometer. But it says incompatible. Please help
Comment: You are really going to need a high quality wiring diagram for your vehicle. And that really means the diagram as provided by the manufacturer.

And to do this right you may well have to remove the instrument panel from the vehicle. And thats a huge job, not for the casual home mechanic.

But don't just ask here. Take your vehicle to a mechanic, describe the issue and get a $$ estimate.
Comment: @zipzit and it's a job I would not suggest many mechanics would be good at either, while they may be excellent at their own trade, being a vehicle electrician is not thier forté. And I have worked with many car and commercial vehicle mechanics who happily paid for my skills...
Comment: Does your obd device support J1850 protocol?
Answer: The wires you are looking for would normally be in the loom close by if they cut them off as you say.
So that means looking at the colors of the wires on the port and finding them in the loom.
One possibility that comes to mind is that they replaced the damaged loom because it was burnt and the replacement was from an older car which may mean that the wires just don't exist at that point. Then you will be in need of seaching out the source4 feeds for all the functions. Things like ignition supply will be easy, others not so.

Obd2 not working, need to rewire


Marcato Atlas 150 spaghetti head

Question: I use my Marcato Atlas 150 for fettuccini and occasionally to make lasagna noodles. One side if the fettuccini head has a spaghetti roller. I've used it a only a couple of times because the pasta is so thin it appears to be angel hair or capellini rather than spaghetti. Am I wrong in my assessment?
Comment: Some photos or a link to pictures would be helpful. Can you add them?
Comment: If you feel the pasta is too thin, just buy another roller with a wider pasta shape : http://www.marcato.it/en/shop/marcato-design/accessori-atlas/accessori-atlas
Answer: No, you are not wrong. The roller you describe produces a noodle that is closer to capellini than spaghetti.
Answer: when you roll out the pasta to make the sheets, keep them pretty thick... 3 or 4 out of 6.  then you'll get thicker spaghetti.  if you roll out the sheets very thin, you'll get angel hair of fideo.  but... when they dry, they can be really brittle so cook them while still pliable and of course, only for a minute.

Marcato Atlas 150 spaghetti head


What are the difference between PIC24FJ256GB110 Rev 00004 & Rev 00003

Question: I have a hex file to program a PIC24FJ256GB110 which I do with an ICD3 the revision code it returns from an older board is 00003 from the newer board 00004.  This implies the silicon has changed. The code works in the 00003 board but not the 00004 board, as I am now fault finding the boards could this be a reason?
Comment: I do not understand the phrase `I am now fault finding the boards.` Could you explain what that means ? Will the ICD3 program the new 00004 board ? If so, can you trace the first `__reset` instruction ? For that matter, can you see it in MPLAB ? i.e., what do you see on the screen when you finish programming the device ? Give us these details (and any others you think worthy). This just might be one where I know what to tell you. PeterJ's suggestion to contact Microchip Tech Support is a good one. I have never stumped those guys. They really do help in the weird ones.
Answer: The usual place to find the difference between silicon revisions is the errata sheet. For example the following document seems to cover that device:
PIC24FJ256GB110 Family Silicon Errata and Data Sheet Clarification
It appears 03h was the code for revision A5 and the code 04h indicates revision A6. However unless I've missed something looking through that I can't see any known issues addressed or introduced with A6 that are different to A5.
Presumably though something was changed and it certainly could be your problem. It might be worth asking Microchip what was changed between revisions, I've found them helpful and responsive in the past even if you're a low-volume customer.


Connect to a network share using Android

Question: I am an android developer.
I would like to connect to a network share (on my Windows\Mac\Linux machines).
I am familiar with few apps that achieve that, but I would like to know how to implement it.
I am interested in the code. Any help will be great. Thanks!
Answer: Most likely you probably need Samba or CIFS to access Windows/Linux (don't know about Mac). What about Apache common VFS (http://commons.apache.org/vfs/filesystems.html#CIFS)


A term for mixture used for palatography

Question: When doing palatography, one needs something to paint the tongue with. It is usually a mixture of olive/sunflower oil and powdered charcoal. The question is, what can this substance be called? Is it a colouring, paint or/and dye? What is the most suitable word?
Comment: If you hadn't explained it, I wouldn't even know what palatography was, and I consider myself to have a very large vocabulary. I doubt most people outside the field have even considered what this word would be.
Comment: The best way to learn words specific to a particular field or industry is to ask someone who works in it. So ask a palatographist, or read a website about it.
Comment: @Barmar thanks for the comment. That's true, of course, but I'm interested in what word even a non-specialist would use for such mixture.
Answer: A one  word term for this is perhaps not available. However, there are several  sources of which three are mentioned below that mention the two-word term "coloring agent" (BrE: colouring agent), but  no other.

Wikipedia: It involves painting a coloring agent, such as a dye or a mixture of charcoal and olive oil on the tongue or the roof of a person's mouth and having that person pronounce a specific sound.

Wiktionary:  A technique used to identify which parts of the mouth are used when making a certain sound, by painting a colouring agent on the tongue or roof of a subject's mouth and photographing those areas after the subject has pronounced the sound.

University of Sheffield: Palatography involves using a colouring agent (such as dye) on a speaker's tongue or the roof of their mouth to identify which part of the mouth is used when producing different sounds. This method has been extensively used at UCLA.
Comment: @Aer Two of the sources I quote say "such as a dye", which means that "dye" is not the most general term. Moreover, the mixture of olive oil and charcoil, as mentioned in the first reference, would not be a dye, while it still is a coloring agent.
Comment: A [dye](https://en.wikipedia.org/wiki/Dye) is a specific type of colouring chemical that chemically bonds with the substrate. If it doesn't do that, it's not a dye.
Comment: Thank you! The latter example uses the word *dye*; maybe that's a good choice.
Answer: "Coloring" and "dyes" implies you are applying the substance specifically to color the surface.
"Painting" might be better because it describes the action (like stroking with a brush).
Possibly, "coating" may be the better word choice.
Answer: I would call it "a special non-toxic paint" (harmless if swallowed).
It was looking for what to call a mixture of oil plus pigment that gets "painted" onto the person's tongue and palate. Dye is permanent or semi-permanent as it penetrates fibers. Colo(u)rings change the color of a substance when mixed into the substance. Paint is a coating. So paint is an accurate name for it, and to make clear that it's not off-the-shelf house-paint, I called it "non-toxic".
Comment: I know the question wasn't asking what paint means. Where are you getting the idea that that is what I thought?  It was looking for what to call a mixture of oil plus pigment that gets "painted" onto the person's tongue and palate.  **Dye** is permanent or semi-permanent as it penetrates fibers.  **Colo(u)rings** change the color of a substance when mixed into the substance.  **paint** is a coating. So **paint** is an accurate name for it, and to make clear that it's not off-the-shelf house-paint, I called it "non-toxic". You haven't indicated a context for you question. Who needs to be told?
Comment: @Joachim  You're wrong about what OP wants. To quote a comment left by OP above: " I'm interested in what word even a non-specialist would use for such mixture." And have you ever read standard dicitionary definitions of "paint".(as distinct from some scientific definition)? They are usually extremely basic requiring no "explanation": a "colored substance" that is  "spread over a surface".  So that is why I called it "paint". And even the palatography sites use the verb "paint". So of all answers I've ever given on SE, this one requires the least "explanation".
Comment: That's not what the OP is after: they want to know what the type of mixture is. If you think it is paint, please explain why.
Comment: I wasn't asking what 'paint' means, but why you think that was the best out of the given options, which would benefit your answer. And maybe "type of mixture" was not the right way to phrase it, but my point was that "non-toxic" was not a logical answer to what I assumed the question was, hence my remark.
Comment: I never thought you thought it did. And that comment is kind of what I was after with my first comment: a clarification, a reasoning. So, perfect.


automatic add the product's Set Product as New from Date

Question: My aim is to create the product's New From and New To date fields to be filled automatically, We do not have to fill those dates. So basically i want the New From Date should be the same when product is being edited/added and In the field New to date, i want to automatically assign the date after 3 month's date.
Answer: you need to create an observer for the event catalog_product_save_before that can look like this:
public function setNewDates($observer)
{
    $dateModel = Mage::getSingleton('core/date');
    $product = $observer->getProduct();
    $product->setNewsFromDate($dateModel->gmtDate());
    $product->setNewsToDate($dateModel->gmtDate(null, mktime(0,0,0, date('m') + 3, date('d'), date('Y') )));
    return $this;
}

Comment: Thanks Marius, It worked for me. I have used this event 'catalog_product_prepare_save' .


Converting Reverse Polish Notation

Question: Is there any way to interpret Reverse Polish Notation into "normal" mathematical notation when using either C++ or C#? I work for an engineering firm, so they use RPN occasionally and we need a way to convert it. Any suggestions?
Answer: Yes. Think of how a RPN calculator works. Now, instead of calculating the value, instead you add the operation to the tree. So, for example, 2 3 4 + *, when you get to the +, then rather than putting 7 on the stack, you put (+ 3 4) on the stack. And similarly when you get to the * (your stack will look like 2 (+ 3 4) * at that stage), it becomes (* 2 (+ 3 4)).
This is prefix notation, which you then have to convert to infix. Traverse the tree left-to-right, depth first. For each "inner level", if the precedence of the operator is lower, you will have to place the operation in brackets. Here, then, you will say, 2 * (3 + 4), because the + has lower precedence than *.
Hope this helps!
Edit: There's a subtlety (apart from not considering unary operations in the above): I assumed left-associative operators. For right-associative (e.g., **), then you get different results for 2 3 4 ** ** ⇒ (** 2 (** 3 4)) versus 2 3 ** 4 ** ⇒ (** (** 2 3) 4).
When reconstructing infix from the tree, both cases show that the precedence doesn't require bracketing, but in reality the latter case needs to be bracketed ((2 ** 3) ** 4). So, for right-associative operators, the left-hand branch needs to be higher-precedence (instead of higher-or-equal) to avoid bracketing.
Also, further thoughts are that you need brackets for the right-hand branch of - and / operators too.
Answer: The Shunting Yard Algorithm is used to convert Infix (i.e. algebraic) to RPN. This is the opposite of what you want.
Can you give me an example of your RPN input? I am a veteran HP calculator user/programmer. I presume you have a stack containing all the inputs & operators. I would guess that you need to reconstruct the expression tree and then traverse the tree to generate the infix form.
Comment: Yes, creating an expression tree is exactly the way to go. :-) The way I had was to convert to prefix first, but maybe there are direct-to-infix methods available.
Answer: C# doesn't have built-in support for parsing Reverse Polish Notation (RPN).You'll need to write your own parser, or find one online.
There are dozens of tutorials for converting postfix form (RPN) to infix (Algebraic Equation). Take a look at this, maybe you'll find it useful and you can try to 'reverse engineer' it to convert postfix expressions to infix form, keeping in mind that there can be multiple infix notations for a given postfix one. There are very few useful examples that actually discuss converting postfix to infix. Here's a 2-part entry that I found very useful. It also has some pseudo code:

PostFix to Infix: converting RPN to algebraic expressions
Postfix to infix, part 2: adding the parentheses
Comment: The link talks about how to convert infix to postfix, not the other way around....
Comment: I have updated my answer. While I couldn't find an exact solution, I have added references that should help in formulating one.
Answer: If you can read ruby, you'll find some good solutions to this here
Answer: One approach is to take the example from the second chapter of the dragon book which explains how to write a parser to convert from infix to postfix notation, and reverse it.
Answer: If you have some source text (string/s) that you're looking to convert from RPN (postfix notation) to "normal notation" (infix), this is certainly possible (and likely not too difficult).
RPN was designed for stack-based machines, as the way the operation was represented ("2 + 3" -> "2 3 +") fit how it was actually executed on the hardware (push "2" onto stack, push "3" onto stack, pop top two arguments off stack and add them, push back onto stack).
Basically, you want to create a syntax tree out of your RPN by making the 2 expressions you want to operate on "leaf nodes" and the operation itself, which comes afterward, the "parent node".  This will probably be done by recursively looking at your input string (you'll probably want to make sure that subexpressions are correctly parenthesized for extra clarity, if they aren't already).
Once you have that syntax tree, you can output prefix, infix, or postfix notation simply by doing a pre-order, post-order, or in-order traversal of that tree (again, parenthesizing your output for clarity if desired).
Some more info can be found here.
Answer: I just wrote a version in Java, it's here and one in Objective-C, over here.
Possible algorithm: Given you have a stack with the input in rpn as the user would enter it, e.g. 8, 9, *. You iterate over the array from first to last and you always remove the current element. This element you evaluate. If it is an operand, you add it on a result stack. When it is an operator you pop the result stack twice (for binary operations) for the operands and write the result string on the result stack.
With the example input of "8, 9, +, 2, *" you get these values on the resultstack  (square brackets to indicate single elements):
step 1: [8]
step 2: [8], [9]
step 3: [(8 + 9)]
step 4: [(8 + 9)], [2]
step 5: [(8 + 9) * 2]
When the input stack is empty, you are finished and the resultStack's only element is your result. (Note however that the input could contain multiple entries or such that don't make sense, like a leading operation: "+ 2 3 /".)
The implementations in the links deliberately don't use any selfmade types for e.g. operators or operands nor does it apply e.g. composite pattern. It's just clean and simple so it can be easily understood and ported to any other language.
Porting it to C# is straight forward.

Converting Reverse Polish Notation


Patching a property of a used class

Question: I'm trying to patch two properties from a class but the mocking is returning a MagicMock instead the expected return value (String).
Client class:
class ClientApi:
    def create_path(self):
        return f"client_api_{self.time_now}T{self.date_now}.json"

    @property
    def date_now(self):
        return datetime.now().strftime("%Y-%m-%d")

    @property
    def time_now(self):
        return datetime.now().strftime("%H:%M:%S")

Test Class
class TestClientApi:

    @pytest.fixture
    def setup_class(self):
        yield ClientApi()

    def test_create_path(self, setup_class):
        with patch("client_api.ClientApi.date_now") as mock_date_now, \
                patch(client_api.ClientApi.time_now") as mock_time_now:

            mock_date_now.return_value = "2023-11-28"
            mock_time_now.return_value = "00:00:00"
            expected_path = "client_api_2023-11-28T00:00:00.json"
            assert expected_path = setup_class.create_path()

The create_path method is returning "<MagicMock name='time_now' id='1687227445600'>T<MagicMock name='date_now' id='1687227461936'>.json" and I would like to understand why.
I would like to ask as well if anyone know how can I compress the two patches in one and if it will work, for example:
def test_create_path(self, setup_class):
    with patch("client_api.ClientApi") as mock_client_api:

        mock_client_api.return_value.date_now.return_value = "2023-11-28"
        mock_client_api.return_value.time_now.return_value = "00:00:00"

Or any similar way, but it's not mocking it and just sending the current timestamp.
Thank you in advance
Answer: When you make an instance method a property it becomes a descriptor instance and is no longer a callable, so you cannot patch the descriptor instance with a mock object and still expect it to behave like a descriptor and automatically call its underlying getter function for you.
Since a property behaves like an instance attribute, you can simply use patch.multiple instead to replace the two properties with the mock values you want:
with patch.multiple(ClientApi, date_now="2023-11-28", time_now="00:00:00"):
    expected_path = "client_api_2023-11-28T00:00:00.json"
    assert expected_path = setup_class.create_path()

Comment: It worked, thank you. Always good to learn new things.
Additionally you can also use the decorator

 @patch.multiple(ClientApi,
                    date_now="2023-01-01",
                    time_now="00:00:00")

Patching a property of a used class


Missing capital G in 'got a question about the site itself?' banner

Question:
The 'got a question about the site itself?' banner should have the G in got be capital.
Answer: Bug or not, this is something that I agree should be changed. It's been reported on Meta Stack Exchange, which is considered the "global" meta, in the form of a feature request. The request also has some other objective improvements to the wording/format, so I'd say rallying behind it is our best path forward to getting a change for this field.
A community manager, V2Blast, commented:

I suspect this banner message basically hasn't been changed in ages, so the formatting hasn't been updated to be in line with the Stacks guidelines yet.

Which says to me that this simply needs to triaged by the dev team.
Answer: It's more of a grammatical error than a "bug".
If we care about grammar, instead of "Got a question about the site?" I think it would be better to say "Do you have a question about the site?".
I agree with you, starting sentences without capital letters does not look very professional in the eyes of some viewers, including you and me.
Comment: Being that a professional site should have basic grammar on the major displayed things, I would call it a bug, albeit perhaps one that wont be fixed


shortest path optimization for multiple edge attributes

Question: Say I have a network. The edges each have two attributes: age and height. How might I run a shortest path algorithm that optimizes on both age and height? And could I weight it so that it optimizes 0.7 on age and 0.3 on height, or vice versa?
Answer: Let $A_{ij}$ and $H_{ij}$ denote the age and height attributes of an edge from node $i$ to node $j$. Suppose we want to weight age and height by some fractions $\alpha$ and $\beta$, respectively. Then, we can construct the combined edge lengths $D$, where the length of an edge from node $i$ to node $j$ is $D_{ij} = \alpha A_{ij} + \beta H_{ij}$. This means the length of any given path when measured using the combined edge lengths is $\alpha$ times the path length when measured using age, plus $\beta$ times the path length when measured using height.
Using the combined edge lengths $D$, the shortest path between any two nodes (and its length) can be computed as usual. For example, using Dijkstra's algorithm.
Comment: it doesn't matter that they are different units? yrs and meters
Comment: Yes, this will affect the solution. But, how to deal with it is problem dependent. For example, you'd have to choose $\alpha$ and $\beta$ appropriately, and/or normalize age/height so that they have common units (e.g. standard deviations) or are unit-less (e.g. fraction of the max).


Wifi audio extender

Question: I need to replace an old airport express which I use purely to get audio from my computer over to where my stereo system is. It also acts as a wifi extender. Other than airport, what other modem/router/accesspoint hardware can I consider?
Comment: I don't know of any non-Apple routers with airplay capabilities - at least none that are as easy to use. I'd get an old express or extreme on eBay. They're pretty cheap (<$30).
Comment: I found this one: https://www.amazon.com/gp/product/B00KGGHYWK/ref=ox_sc_act_title_1?ie=UTF8&psc=1∣=A4UCFL9LU89NR Does anyone know anything about it?
Comment: It says it's airplay compatible, so after set up you should be able to find it where your express used to be
Answer: I found this product which I think satisfies my requirements: D-Link DCH-M225 Wi-Fi Audio Extender. I will let you know once I get it!

Wifi audio extender


Meaning of "ball off "?

Question:
How do you get a good job without a college degree??
Claim unemployment, ballin off the state bro.
Comment: I generally disregard any sentences containing the words *bro* or *ballin*.
Comment: Why is that?  ''
Comment: IMO, both words just sound plain stupid. They probably aren't even words.
Answer: In this context, ballin used in the slang sense.  From UrbanDictionary:

1.) To play basketball.
  2.) Living in affluence/wealth.

The writer is using the word in the second sense, to mean living well.  "Ballin off smth." refers to the source of the money that allows the speaker to be 'ballin'.  In the particular context you've given, the speaker is using the term somewhat sardonically/sarcastically, as clearly no one living of unemployment benefits will be living in great affluence or wealth.
In my understanding, the term follows from the lifestyles of basketball players; to spend extravagantly at nightclubs or buy lavish cars is the epitome of 'ballin'.  It reached the popular consciousness via Jim Jones.
NOTE: I'm being a little facetious in giving this such serious treatment.  This phrase is about as far from standard English as could be and is totally inappropriate for any serious use if you're not a rapper.
Comment: I am surprised this answer hasn't drawn comment from the pro-AAVE brigade who regard 'Rapper English' as as valid as the Dickensian kind ;-)
Answer: I think "ballin" is from "bailing" - so it's having money handed out to you - as in "banking bail-out".
It's from the usage of scooping water out of a sinking boat.
Comment: As unfortunate as it is for standard english, 'ballin' is not 'bail in', but rather just ['ballin'](http://www.urbandictionary.com/define.php?term=ballin), so I'm forced to down vote this as incorrect.
Comment: I'll second that. Also c.f 'bailin' which is a truncation of 'bailing out' comes more probably from the legal concept of bail i.e. monies paid as security left with the authorities which then allows those accused of crimes their liberty until their trial.

Meaning of “ball off ”?


Fluid in beaker on inclined plane

Question: On an inclined plane there is a beaker filled with fluid, what will be the shape of fluid as the beaker accelerates down?
What I think is that the beaker accelerates with $g \sin\theta$ acceleration down the incline and so does the fluid molecules of surface, so fluid molecules experience a net real force down the incline of $mg\sin\theta$, and $mg\cos \theta$ perpendicular to the inclined plane due to $mg$ component, so the net force is $mg$ down only, and fluid should take a horizontal shape (perpendicular to net force) but as I have seen answer isn't this, the solution takes into consideration a pseudo force.I don't get where my method is wrong, isn't fluid perpendicular to real force?
Comment: Hi. Please try and use Latex for rendering formulas/math. For simple formulas include them between $ signs. Also, draw an FBD to see the light in this simple problem.
Comment: Ok, I am new here so didn't knew latex worked here also. I have added the diagram of what I expect can u check pls
Answer: It's a confusing question, but the net force on the fluid must be down the plane, otherwise the fluid would  accelerate straight downwards through the plane.
There is also the normal reaction force from the bottom of the beaker of value $mg\cos\theta$, so the resultant force on the fluid is the $mg\sin\theta$ component going down the plane.
Comment: Why won't a water molecule at surface have acc. Perpendicular to plane, can't it go in, like ir that the molecules keep on going in the fluid and below molecules come up etc, also idt fluid molecules apply normal on one another
Comment: @ Math-Wiz, the ones beneath can't go anywhere so there is a pressure throughout the liquid that keeps even the higher ones from accelerating straight down, sorry not sure what all the abbreviations mean!
Comment: Still no clear, if one could explain it better, describe what's this extra force between molecules it would be better, idk why taking a psuedo force of mgsinø and real force mg works and not this
Comment: @ Math-Wiz it's a similar force to when the beaker is on a table, the molecules don't move down through the bottom of the beaker, the downward force of gravity is balanced by the reaction force from the bottom of the beaker.  Got to stop now, all the best with it.
Comment: I still don't get it, fluid molecules can exert normal forces ? When we do the pseudo force solution then
also we don't take normal, but still the answer comes. If someone can clarify it better it would be nice
Comment: It would help in your FBD is to show the liquid's meniscus is inckined.

Fluid in beaker on inclined plane


What is use of R41 (base to emitter) resistor in Transistor Relay Circuit?

Question: I am controlling relay from arduino, using the following circuit.

I want to understand what is use of R41 (base to emitter resistor)?
Is it required for base termination?
How is its value calculated?
Comment: The +24V_GND must be the ground as the relay is a 24V one? MMBT2222 has a 40V Vbe breakdown voltage so it couldn't be a 48V relay.
Answer: It prevents leakage through the optoisolator from partially turning on the transistor.
Find the maximum leakage of the opto (typically it will occur at the maximum junction temperature ever expected) and calculate the resistor to drop no more than something like 0.4V. Then go back and make sure that it's not hogging too much base current under worst-case (low) CTE etc.
That particular opto has 1uA typical leakage at Tj=100'C, so you might want to allow for 3-10uA worst-case.
I can't read the values there very well, but typically R3 and R41 about the same value works, and if that is actually 115K, it looks way too high to reliably drive a relay, especially considering the relatively poor guaranteed gain of the MMBT2222.
Answer: The collector-emitter dark current for the EL3H7 opto is given as 100 nA maximum and this won't be sufficient to activate the BJT and turn on the relay but you can never rule out leakage currents across the opto from the driven side having small effects so it's probably a good idea to have this resistor just to act as a weak pull-down.
So, as a weak pull-down a value from 10 kohm to 100 kohm won't hurt too much and might just save a bit of head-scratching should the relay trigger falsely if the resistor isn't there.
Answer: It improves the noise margin of Q1. There are some relay modules without this resistor and many complaints about random false triggering like here.
It's value is not critical, low enough to have a better noise margin but high enough to leave Q1 a good base current.
The base current can be approximated as the difference between current through R3 and current through R41 considering Q1 Vbe ~= 0.8V
Ir3 ~= Vcc/R3 = 24V/115kohm = 0.2 mA
To estimate the minimum base current required we use the coil/collector current which is less than 17mA for a G5LE relay and Q1 amplification factor that is 50 worst case for MMBT2222, so the minimum base current should be 17mA/50 = 0.34mA
Now we cam see that whoever designed this took a Q1 amplification of 17mA/0.2mA = 85 which is not safe.
Just for exemplification let's take a 150 minimum Q1 current amplification. That leads to a 17mA/150 = 0.11mA minimum Q1 base current. The difference of 0.089mA up to 0.2 mA can go through R41.
With a 0.8V Vbe the result is R41 >= 0.8V/0.089mA = 8.9kohm
Update to show an example with a maximum value of R41.
If there is a leakage current from opto output , Iopto, this will translate in a permanent current through Q1 which can damage Q1 or maintain the ON state of the relay that requires much less current than the nominal current.
Worst case Q1 I collector is Iopto * maximum amplification factor of Q1
For 100nA leaqkage current and max beta = 300 Ic will be 30uA
For this relay the "must release" current is specified at 10% , 1.7mA , much higher than the 30uA above.
The power disipated on Q1 due the leakage current is 30uA*24V = 0.72mW, also in Q1 parameters.
To make sure Q1 is closed we need a voltage less than 0.5V on the base. With a 100nA current that leads to 0.5V/100nA = 5Gohm maximum value.
Obviously here we won't go that high for R41, it was just a theoretical example.


Nearest line feature from point using ArcGIS for Desktop?

Question: In the image given below, solid lines are showing as road elements and points are showing as data collected for those road segments. I want to update road element id to the points shapefile. "Near" tool of ArcMap has almost solved this problem except for the points lying in red region (marked in the image) which is obvious as per the algorithm of this tool. In this red region, "Near" tool updates the id of BE road element but I want to update the id of AB and BC road elements respectively because those points belong to AB and BC road elements.
Comment: I think this problem is not a weakness for near tool, I recommend create copy of line feature and delete EF line in new feature(copied version) and then calculate distance again with Near tool.
Comment: Yes to add to what @Predator X is saying, it sounds like you would want to run the near tool on every individual line feature and for each point keep the closest feature from every run.
Answer: I agree with PredatorX that this is a bit of a weakness in the tool; if you have access to SQL Server 2008 or higher though you could just make a spatial query that would do exactly that. The example below should give you an idea and it will work with SQL Server Express which is free.

select PointID,
(select top 1 ID from [roads]
where points.geometry.STDistance([roads].[Geometry])<= 100
order by points.geometry.STDistance([roads].[Geometry])) as [RoadID]
from points

The first line is just asking for the point ID. Lines 2 through 4 run the spatial expression (STDistance) that asks for the ID from the roads (line 2) that are within 100m or less (line 3 - my data sets are usually in UTM).
There are some other things you can add to bring in more information or as an example, draw lines from the points to the line in question so that you can visually see the relationship etc. Since this is just a sql query, it will auto-update as well which is nice in case someone starts moving your roads / dots or add more to one or the other. Including the <=100 is an important key though for performance. Otherwise things will be evaluated across the whole set many to many which may take some time depending on the size of your data sets.
Comment: It isn't a weakness of the Near tool, and I believe that's what @PredatorX was saying. Rather, the behavior the question-asker is explaining arises from having all the lines, including BE, in the search space, in which case BE is of course nearer to those points than anything in AC.
Answer: I tried the following steps and it worked out. Say road shapefile and point data on road as road.shp and route.shp.

Convert Road Polyline shapefile to Point Shapefile containing all points at vertices with Feature Vertices To Points (Data Management) tool, say this point shapefile as road_point.shp.
Transfer Road id to from road_point.shp to route.shp with Near (Analysis) tool.
Using UpdateCursor, update road id in all intermediate route points.

P.S. - Thanks for all the suggestions.


Relation between foreign and primary key?

Question: For example:
Table 1:
user_ID -
username -
first_name -
email -

Table 2:
message_ID -
user_ID -
message_title -
message_body -

As you can see I have user_ID as primary key in table 1, and as foreign key in the second table.
If I enter 2 rows into the first table, eg.
1, undergz, sarah, firstname.lastname@example.com
2, michel21, michaele, email@example.com

And now, michaele enters the message, and I now I add this to table 2:
1, 2, hello, hello everybody,

I added this entry in the table 2 considering first table, I added user_ID number the same as in the table 1.
I did this from $_SESSION['user_ID'] variable, when I entered the second query. So it was like
INSERT INTO table_2 VALUES (NULL, {$_SESSION['user_id']}, '$title','$message')

My question is, is this the right way to do this? We define foreign key in table so we enter data STRICTLY according to primary key, it must be the same for all values?
Comment: "As you can see I have user_ID as primary key in table 1, and as foreign key in the second table" -- I can see there are attributes of the same name in both tables but this does not prove the existence of a `FOREIGN KEY` constraint. Have you created a `FOREIGN KEY` constraint? You need to tell us, we can't see your SQL DDL.
Comment: no I didn't create FOREIGN KEY explicitly. Do I need to? If I just link all tables with data in order I enter it, is that enough?
Comment: Short answer: yes, you need to.
Answer: The question you should ask yourself is:
Can a row in the table 2 exist without a corresponding row in the table 1?
If the answer to your question is "no", then you need the FOREIGN KEY (a.k.a. referential integrity) constraint from table 2 ("child") to table 1 ("parent"). You can think of it as having a "pointer" from one row to another, where the DBMS itself guarantees you can never have a "dangling" pointer.
The "parent" set of columns in the FOREIGN KEY must always be the key, be it primary or alternate (a.k.a. UNIQUE). The "child" can be any column or combination of columns, whether they are part of a key or not. You can think of that as the parent's key columns being propagated to the child, and depending on where the propagated columns end up, you can have the following 2 kinds of relationships:
1) "Identifying" Relationship
The parent key becomes a part of the child key (so parent "helps" identify the child):
 or
This models either 1:N or 1:1 relationship.
2) "Non-Identifying" Relationship
The parent key does not become the part of the child's key:

This models 1:N relationship, but requires message_ID to be unique on its own (instead of in combination with user_ID).
Answer:
You can create a FOREIGN KEY constraint as part of the table
definition when you create a table. If a table already exists, you can
add a FOREIGN KEY constraint, provided that the FOREIGN KEY constraint
is linked to an existing PRIMARY KEY constraints or UNIQUE constraint
in another, or the same, table. A table can contain multiple FOREIGN
KEY constraints.
If a FOREIGN KEY constraint already exists, you can modify or delete
it. For example, you may want the FOREIGN KEY constraint of the table
to reference other columns. However, you cannot change the length of a
column that is defined with a FOREIGN KEY constraint.

So, you can only had values in table2 with a user_ID that is already present in table1.

Regarding your question(s):

My question is, is this the right way to do this?

It seems that yes.

We define foreign key in table so we enter data STRICTLY according to primary key

Correct

it must be the same for all values?

It depends, it must be a value that already exists in table1. In your case, for each login (user), the value should be from that user. But if you login with another, the value should be the id from that user.
Comment: A foreign key isn't a "field", it's a constraint on one or more columns of a table to make their values refer to existing values in another table. It doesn't have to refer to a primary key in the other table (it can be `unique`).
Comment: I agree, the thing I needed to check is that entering all values in foreign key is on all developer, the database doesn't make difference between foreign key and primary key. If I skip to enter foreign key, it will remain NULL value, and won't be automatically field right?
Comment: Yes, you have to put the value. In the insertion the database doesn't assign it automatically.


r.series command in QGIS - timeseries

Question: I am using r.series command in qgis. The command is performing correctly, but when I import input raster files, it creates a list in a random order. Sometimes the order of input rasters is essential to the outcome. Is there a way to control the list of input rasters?
the order of raster is random
Answer: the best way is to use vrt (virtual raster format). The initial command line is gdalbuildvrt, which is also available directly in QGIS using

Raster-> Miscellaneous-> Build Virtual Raster (Catalog)

r.series command in QGIS - timeseries


Selling my house for what is owed to keep from foreclosure but it's worth more. Who gets the extra money?

Question: I am selling my house to a friend (for what I owe on the mortgage) which is $107k because I am behind on my payments and don't want to go through foreclosure, but it's worth $155k who gets the extra money?
Comment: Basically that extra worth will become the buyer's built-in equity. No one gets actual money but should he choose to flip it and sell it quickly, he can benefit from the equity available on it technically.
Comment: Isn't there a concept called either arm's length transaction or willing-buyer-willing-seller that is used to describe the "fair" value of a home?
Comment: you may get better answers if you describe the situation a bit better. Will you continue living in the house? Is you friend taking over the mortgage or do you pay it back with the 107k? Do you have any agreements regarding you paying rent, if you will keep living there? How did you came by the "worth" of 155k? Could you sell it to someone other? Right now this reads as if you just gifted your friend 48K in equity. I don´t know if that´s what you intendet?
Comment: You are very welcome.
Answer: There's no objective definition of what your house is worth between sales.  If you sell it for $107K, then that's the current functional definition of its worth.  There is not "extra" money to be had because you sold it for less than it was worth.  If the buyer is able to flip it for more, then the value of the house effectively went up and he will pocket the difference when he sells it.
EDIT
This turned out to be unexpectedly controversial, so let me be more precise in my answer.  I think this is important because it seems like many people misunderstand equity and how it figures (or doesn't) into the value of their home, which then leads to significant confusion and errors in what's many people's largest single investment.
At any given time there are several possible ways to put a dollar value on your home.  A non-exclusive list that includes:

The value used by your local authorities to assess property tax
The value appraised as part of a sale (if any - if the buyer is paying cash and doesn't need insurance you could potentially have a sale without this appraisal)
The appraised value you got when you bought the house
The last sale of a "comparable" house in your neighborhood
Whatever you happen to believe yourself
At the time of a sale, what the buyer and seller agree for the transaction

Some of these obviously are more "official" than others. It would not be strange for these different values to vary by quite a bit at any given time. (This is what I meant in my original answer when I said there's "no objective definition of what your house is worth between sales.")
The interesting thing - and what I meant in my original answer when I wrote "current functional definition of its worth" - is that none of these factor directly into the transaction that the OP described of selling his house except for the last.  Using the numbers from the OP's example, that means the $107K.  Wherever the OP got the number $155K (either from one of the options on my list above or somewhere else), it won't be directly part of the sale between him and his friend.
(For completeness, with a nod to Eric's comments on my original answer, some of these numbers may indirectly influence the sale.  For example, the buyer typically won't be able to get a mortgage for a value greater than the appraised value of the house, and so that might influence what he's willing and able to bid.  There may also be tax consequences if the price is artificially low, like, say, a gift.  As further expounded below, however, that's not directly relevant to answering the OP's stated question.)
Now, the OP seemed to believe that there is an "extra" $48K in cash up for grabs in this scenario.  That comes from the $155K value that the OP claims his house has and the $107K price of the actual proposed sale.  This is a complete misconception.  When the buyer and seller sit down at closing and the title agent sums up who owes and who receives cash in this transaction, the $155K "theoretical" value will not enter into the calculation and therefore no one will pocket it.
Subsequently, however, after the buyer takes possession, he may sell it.  If it's true that he "got a deal" on the transaction at $107K, then he maybe able to flip it and turn a profit.  But if that happens, it will be in a completely separate, subsequent transaction. Even if you look to this hypothetical second sale, however, the $155K doesn't really figure.  The new owner will have to find his own buyer, and they will have to agree on a price.  That might happen to be $155K, but there's no real reason to believe that it will or it won't.
Comment: @Eric Those things are true but not relevant to the question that the OP asked.  He asked "who gets the extra money?" and the answer to that is definitely "no one" because there is no "extra" money.  Even in an extreme case like the $1 sale, still no one gets the extra money, although I agree about your comment as regards taxes. The "extra money" gets pocketed at a subsequent sale.  In the OP's case, there's nothing to say that the price isn't a fair market price, even if some buyer may consider it a "deal." People in inliquid positions may sell for less; that's part of the market price.
Comment: I think you can only stretch this so far.  If you buy a house for $1, then no one would believe it to truly be worth $1.  You would pay property taxes at a higher value.  You would insure it at a higher value, etc.  The sale transaction may also have tax consequences since it is not a fair market price.
Comment: I take issue with your statement of "If you sell it for $107K, then that's the current functional definition of it's worth".  I agree with the rest.
Comment: @Eric I expanded my answer to address your concern and incorporate dialog on JoeTaxpayer's answer below. I have a feeling we all agreed on what the right answer should be and that it's a matter of wording. I was perhaps too terse in my answer?
Comment: It gets my +1 now.
Comment: Because this is not an [arm's length transaction](http://www.investopedia.com/terms/a/armslength.asp), you can't say that this $107k number reflects an accurate value for the house, even if it is the sale price.
Answer: What if there were no mortgage, and you gave the friend the house? They are getting the house' value. In your case the discount from market value is their instant profit.
We often think of our house in terms of the equity we have, plus the mortgage. Equity therefore is what's left after the mortgage is paid off, if you sell the house. In your question, you are, in effect, "giving all equity to your friend.
Where else would you imagine it goes?
Comment: The $155K value has no basis. I can say my house is worth $10M, but that doesn't make it so unless someone offers me $10M for it. I do have several possible "values" for my house - last appraisal, assessed value for property tax, price that I paid, last sale in my neighborhood.  Those all vary widely.  In any case, his question is about money.  You either think someone is going to end up with $48k cash in the bank on this transaction or you don't. You are talking about equity (at best) not money. They are not the same.
Comment: The OP asked about "money" and even in this scenario there is no "extra money" to be had.  If the friend in your hypothetical sells the house after getting the gift, *then* they get money and turn a profit.  As Eric just noted on my answer, there could be tax consequences to something *artificially* below market value, but the OP's scenario is not that. The OP is apparently selling at the best deal that he can get under his current circumstances. That's a sale at market value, even if it ultimately turns out to be a "deal" for the buyer.
Comment: Your last 2 sentences, agreed, 100%. There is no $48K, there may be some value, but it really can't be known with high accuracy until a second sale. Are we in agreement now?
Comment: How are you reading this as "best deal"? He's behind in the mortgage but far from underwater. Why are you ignoring his statement of $155k value?
Comment: Definitely closer after the full string of comments, especially the last one. I feel like this is an important distinction though - The OP seemed unclear on the concepts of equity, market value, and the mechanics of the sale. Your original answer (as I read it) also mixes these things. Could have just been because you gave a short answer. (I did too and just expanded mine based on this exchange with you and comments by Eric on my original answer.)  Hopefully in net we have something useful to others out of all of this!


How were Cryptographic nonces used in the Yahoo! data breach?

Question: How does an attacker use Cryptographic nonces to generate access cookies through a script on a server? As what happened to Yahoo! servers.
Comment: It seems that your question is specific to how Yahoo was using nonce. You need to be more specific about what happened to Yahoo and what's your question.
Comment: Yep, definitely change the title to include Yahoo! and the specific attack. Adding a reference in the body to the attack would also be very beneficial.
Comment: @MaartenBodewes Thanks, changed the title.
Comment: What makes you think cryptographic nonces are related to this data breach? Do you have a source for us?
Comment: @AndrolGenhald https://www.csoonline.com/article/3180762/inside-the-russian-hack-of-yahoo-how-they-did-it.html
Please read through this once. I was just trying to understand how the breach happened.
Answer: I wonder if this was a not a mistake in the article.  They call the stolen cryptographic values "nonces," but a nonce is intended to be used only once and I would not expect them to be stored in an account database because, depending on their use, the value would change many times during an authenticated session.
If I had to guess, what they call a nonce is actually a salted hash generated from their password and the script on the Yahoo server was allowing them to authenticate using the hash instead of checking the provided password against the stored hash.
Edit:
After reading this, the "nonce" changes only after changing the password which to me indicates it is either their salted+hashed password or else some type of unique identifier for their account cryptographically generated based on their password and maybe other fields, but I suppose it could be based on other information entirely.
It is hard for me to guess what the script used to mint the cookies intended purpose was.  It could be that it is part of their regular authentication process.  It was available from the internet and so may have been called by the browser during authentication making it easier to find by the attackers.  Maybe the browser called one authentication function to validate the username/pass and was returned the "nonce" which it used to call the function in question to generate the session token.  Whatever it's intended purpose, in this case it allowed the attackers to bypass the traditional authentication process that salts+hashes the client provided input to compare to what is stored in the table, instead allowing the "nonce" value to generate a session token with the authorization granted to the account.  The whole point in storing passwords in a salted+hash form is to prevent someone who successfully stole the account database from being able to use the credentials without a lot of extra work.  With the referenced script on a server this step was basically eliminated and the results were not much different than if the passwords were stored in cleartext.
Comment: It sounds to me like the "nonce" is actually a per-user key used to MAC a predictable value, and the session cookie is value+MAC. Why they're calling it a nonce though is beyond me. Regardless, it's an unusual way of authenticating sessions.
Comment: That makes sense.  Sorry for all of the extra edits, I realized i was only focusing on the "nonce" and not the rest of the question.
Comment: @Tony Thanks for the link you shared, gave some more info regarding the entire breach. I think the fact that they called it a 'nonce' is the most confusing part about this whole thing.


Rails fixtures seem to be adding extra unexpected data

Question: all. I've got a dynamic fixture CSV file that's generating predictable data for a table in order for my unit tests to do their thing. It's working as expected and filling the table with the data, but when I check the table after the tests run, I'm seeing a number of additional rows of "blank" data (all zeros, etc). Those aren't being created by the fixture, and the unit tests are read-only, just doing selects, so I can't blame the code. There doesn't seem to be any logging done during the fixtures setup, so I can't see when the "blank" data is being inserted. Anyone ever run across this before, or have any ideas of how to log or otherwise see what the fixture setup is doing in order to trace down the source of the blank data?
Answer: You could turn on ActiveRecord logging (put ActiveRecord::Base.logger = Logger.new(STDOUT) in your test/test_helper.rb file).
Or, instead of using fixtures (which have gone the way of the dodo for most Rails developers) you could use something more reliable like Factories (thoughtbot's factory_girl) or seed_fu (if you have specific data that must be loaded).
Answer: I discovered what the problem was, although not the precise way to prevent it. I was placing ERB into the fixture CSV file, which was working fine, but due to the way it was being parsed and processed, it was causing blank lines to be placed into the resulting CSV output. Fixtures doesn't seem to handle that very well, and as a result it was inserting blank rows into the table. I couldn't prevent the blank lines from being placed into the output CSV because for whatever reason, the <% rubycode -%> doesn't work -- having the closing dash caused ERB parsing errors. Not sure why.
In any case, the eventual workaround was to switch to YML instead of CSV. It tolerates the white space just fine, and no blank rows are being inserted into the table anymore.
As an aside, factory___girl seems potentially interesting, but the YML is now doing just fine so it may be overkill. There's not a huge benefit to using seed_fu I think. In this current case I'm testing reporting code so the data is very specific and needs to be structured in a certain way in order to verify output data for the reports.
Comment: ERB _inside_ the CSV file?  Wow.


Garlic and Onion in Hindu Text

Question: So I know usually speaking Garlic and Onion are considered impure. However, from these news articles: https://timesofindia.indiatimes.com/us?back=1 and https://lovingfoods.medium.com/why-onion-and-garlic-is-not-vegetarian-loving-foods-23af0fcf1898#:~:text=Not%20only%20this%20some%20people,and%20garlic%20have%20medicinal%20properties. state that Aryuvedic scripture acknowledge their medical benefits and just shouldn't be eaten in excess like say tomato. I couldn't find any scriptural references however, can you?
Answer: Ayurveda texts like sushruta samhita and charaka samhita do have chapters detailing out medicinal value of every animal and plant including onion and garlic but these are chapters for an ayurvedic doctor to prepare medicines or prescribe a medical diet to patient for specific illness. These are not verses dealing with regular food.
The list of foods which are wholesome or can be consumed regularly are mentioned in other chapters and these foods do not include onion and garlic and are consistent with foods listed in smritis :

charaka samhita sutrasthana ch 5 :
12.Shashtika rice, shali rice, green gram, rock-salt, emblic myrobalan barley, rain water, milk, ghee, flesh of jangala animals and
honey may be habitually taken.
charaka samhita sutrasthana ch 27 :
3-(1). The experts hold that the articles of food and drink which are of a pleasing color, smell, taste and touch, taken
systematically, constitute the Life of all living beings known also as
creatures. This view is the result of practical observation.
charaka samhita sutrasthana ch 25 lists ginger among roots (not onion/garlic) :
38. The most beneficial among food articles are thus:
Red rice is the best among all cereal crops having bristles, green gram among pulses,
rain water among various types of drinking water,
rock salt among salts,
jiwanti among pot herbs,
antelope among meat of animals,
common quail among meat of birds,
the iguana among meat of burrowing animals,
rohita among fishes,
cow ghee among ghee, cow milk among milk,
tila  oil among fats of vegetable sources,
lard (wild hog's fat) among the fats of marshy animals,
fat of chuluki among fish fat,
fat of pakahamsa (white swan) among fats of aquatic birds,
the fat of wild hen among fats of gallinaceous types of birds,
the fat of goat among fats of branch-eating animals,
ginger among rhizomes and roots,
grapes among fruits,
and sugar among the products of sugarcane.
In this manner, various natural food articles have been identified to be the most
wholesome in their class.
Comment: Cool very nice!
Comment: What about the verses prepared by a doctor can you please answer the question?
Comment: I am not able to find anything in your first link. The conclusion in the 2nd link i.e. "eat onion and garlic but as medicine. not as food." is close to what is mentioned in texts like susruta, charaka,etc. Difference between food and medicine is that food is eaten every day full plate whereas medicine is taken only when a person falls sick that too only a spoon quantity under medical supervision
Comment: Yes, but the verses for medication, please. I won't be eating it or anything like that just interested.
Comment: charaka samhita chikitsa sthana 5.95 talks about garlic milk for curing some disorders - "This milk will quickly cure Vata Gulma, misperistalsis, sciatica, irregular fever, abscess, cardiac disorders, abscess and edema. Thus has been described 'The Garlic Milk'."

Garlic and Onion in Hindu Text


Code to Graph XYZ coordinates

Question: I need to graph XYZ coordinates in a 3D cube that I can rotate. Im look for code that will basically take a 3d array of 1s and 0s and build a cube. Coloring of the points would also be nice. The program that creates the point is in C/C++ so I would prefer something that would play nicely will that but Im not picky. Im alright aware that Mathematica can do this , but Im looking for something that can be "live" updated so I can watch the progress
Thanks in advance
Answer: One obvious possibility would be something like Direct3D (for Windows, X-box and Windows Phone 7) or OpenGL (for pretty much anything that can do 3D except X-box or Windows Phone 7).
There are quite a few libraries and sample code for things like this.
If you're working on Unix/Linux, you may or may not have OpenGL installed. If you don't, you might want to check into Mesa3D.
Comment: +1 for OpenGL. Much easier to get something basic going with it
Answer: I would go with Jerry's suggestion of using OpenGL. There are some good tutorials out there too - have a look at the nehe series which have examples for doing precisely what you're after.
Answer: Refer this tutorial link : http://www.directxtutorial.com/
This will help you to implement three dimensional cube.
Comment: It is paywalled

Code to Graph XYZ coordinates


importance of cDNA sequencing of a specific gene in different plants

Question: i want to know what if i made a sequence of cDNA of a specific gene in different plants - what is the important from the sequence and can if found difference between plants , and can i use this sequence to determine cis regulating element
Answer: No, cDNAs are copies of spliced mRNAs, and typically contain a 5'-UTR (untranslated region), an open reading frame, or ORF, and a 3'-UTR.
The cis-regulatory information might be revealed by sequencing the genomic DNA upstream of the gene(s).  That is where one usually finds the promoter (although there are some rare exceptions, particularly for genes transcribed by RNA polymerase III).
Comment: ok , thanks alot however, how can i obtain the sequence of promoter of a specific gene with a simple method ( only primer and PCR)
Answer: The importance of sequencing
Sequence comparison is important because biologists tend to use prior knowledge to make inferences about the function of unknown entities.
Determing flanking sequences
You can use Genome Walking to isolate flanking regions of known sequences. It's a simple repetitive method. The amount of repeats will depend on how far you want to go upstream or downstream of your gene of interest.
Answer: One point is cDNA sequence encoding a specific protei, you will find differences in the coding sequence bewtween plants of different species and, within the same species, difference when you compare the genotypes
for promoter analysis you must use the genomic DNA, at leasst 1 kb upstream the ATG, or more (may be there are introns)


How to acknowledge lecture notes?

Question: How can a lecture note be acknowledged in another lecture note? In other words, is it sufficient to express appreciation or does it have to be added as a reference?
Comment: @FedericoPoloni, I don't assume anything. I suggest the OP needs to consider the possibility.
Comment: @BryanKrause Not in my view. Fair-use doctrine only applies if OP is copying text verbatim, or paraphrasizing it with minor changes (and only in some countries), if I understand correctly. Following the same general approach as another set of notes does not give copyright problems, no matter how extensive the usage is. This is no question of limiting usage, in my mind.
Comment: Assuming the original was subject to copyright, have you sought permission or otherwise limited your use using fair-use principles? Limiting distribution can be a plus. Re-publishing has caveats.
Comment: @Buffy Why do you assume there is copyright infringement here? If OP is merely following the same approach as the other set of notes, without copying or paraphrasing directly their content, I think they are in the clear legally. And, in any case, normally we acknowledge previous literature to give credit where it is due and follow good scholarly ethics, not to follow copyright law. The two concepts are different.
Comment: @Buffy Then I suggest to use a sentence like "have you made sure you don't need to seek permission", not "have you sought permission". With your wording you give the impression that this is always a requirement, while in practice it rarely is.
Comment: @FedericoPoloni Isn't that covered by "...or otherwise limited your use"?
Answer: Lecture notes are normally not some one's original research. It is taken from already printed material. Expressing appreciation is sufficient.
Comment: Lecture notes might, however, have creative elements and be subject to copyright. For example, some contain insights beyond known facts. It can be more subtle than this suggests.

How to acknowledge lecture notes?


How to change version string of the kernel?

Question: I'm very new to Linux and very new to building/compiling my own kernel. For starters, I'm just trying to figure out how to change the version string of my kernel. For instance, when I do uname -a, it prints out "Linux localhost.localdomain 3.11.10-100.fc18.i686". I'd like to customize that, but I'm not sure what file to edit. I know it must be some file in my kernel directory, but I've been going through them with no luck. Any help would be great!
Answer: At the top of the top-level Makefile, there are four lines
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 7
EXTRAVERSION =

The values are different for different kernel versions, of course. These are used to construct the version string, so changing them before building the kernel changes the version string of the kernel you build.
Additionally, there's a configuration option CONFIG_LOCALVERSION, to be found under General Setup -> Local version - append to kernel release in make menuconfig that is appended to this.
Comment: The Fedora guys compiled their kernel with `EXTRAVERSION` set to `100.fc18.i686`. Changing the makefile in a kernel source tree will not affect the version string of the running kernel, it will affect the version string of the kernel you build from those sources.
Comment: Or they might have used `CONFIG_LOCALVERSION`, to be found in `make menuconfig` under General Setup -> Local version.
Comment: Alright, it compiled but yet the name still returns the running kernel, not the one I'm building. Why is that?
Comment: Alright I found that file. For some reason though, what uname -a shows is different than what the makefile shows. Also, is EXTRAVERSION what I would want appended onto the end ?
Comment: alright I see. Yeah I didn't build the custom kernel yet, I figured if I was in the source tree and did uname -a it would base it off of that. I just changed the EXTRAVERSION in the kernel source tree. Compiling it now, will update when it's finished. Thanks!


S-I, S-II, S-IV; what happened to III?

Question: Stages of the Apollo stack (at least the configuration that landed humans on the Moon) are identified as S-IC, S-II, and S-IVB for the first, second, and third stages. There's no S-III. Why the gap in numbering? Was Saturn going to  be a four-stage rocket at some point in its development?
Comment: C'mon, they were clearly using a `2^x` sequence. Waiting for Saturn 65536
Comment: Years ago while studying for PhD qualifiers I made the mistake of sitting deep in the library next to the bound copies of the Journal of Spaceflight (or something like that). I happened to randomly pluck a tome and found an article laying out the (then current) plans for the Saturn program, up through the Saturn VII (yes, 7), with expected launch capabilities and time frames. Fascinating at the time. But, plans change in engineering as things are developed.
Answer: The planned scope of the Saturn launcher program varied quite a bit before the launchers were finally developed, as you can read here. The basic idea was to progressively develop a larger and larger rocket, re-using upper stage designs while enlarging the lower stages. The exact parameters of the design were altered repeatedly during early development, so the overall picture is complicated and confusing.
Five basic stages would be developed, S-I to S-V, with S-V being a modification of the Centaur stage, using 2 RL10 engines. These stages would be used in different 3- and 4-stage configurations. The S-III stage would have used 2 J-2 engines and S-IV would have 4 RL10s.
The idea was that the line would begin with a three-stager using a modestly sized S-I stage and the S-IV and S-V stages (eventually this became the two-stage Saturn I with a 6-engine S-IV stage) and the first stage would be progressively upgraded with more of the intermediate stages used. (S-V never happened; Wernher von Braun was never a fan of the Centaur, possibly because it was primarily developed for the Air Force, while von Braun's fortunes were tied to the Army until his transfer to NASA in 1960.)
However, the Kennedy challenge to land on the moon before the end of the 1960s accelerated the development of the program, and development of the S-III was skipped because the larger S-II stage was going to be needed sooner.
Answer: The S-III stage did exist, but only on paper. It was proposed for some Saturn-C configurations.
There was the original Saturn C-2 variant with the stages S-I, S-III, S-IV and even a S-V.
The original Saturn C-3 would have been a combination of S-I, S-II and S-III, as well with S-IV and S-V on top, which would have made it a five-stage rocket.
But in further development the S-III and the S-V have been dropped, leaving only S-I, S-II and S-IV.
Answer: The other answers are okay as far as they go but I prefer something less conventional.
There was an S-III stage and it was in fact the most flown Saturn stage. But for obscure reasons it was designated S-IVB instead of S-III and the vehicle on which it was first flown was designated Saturn C-IB (later Saturn IB) instead of Saturn C-2.
Comment: Do you have any references so that readers can check your assertions for themselves?  I, for one, would like to hear the "obscure reasons", otherwise this answer boils down to "because, reasons".
Comment: I wasn't the down voter. Don;t make assumptions.
Comment: @jimDavis, I think your question is good, and maybe OrganicMarble should have behaved more friendly, but he has right that giving references significantly improves the acceptance of your posts.
Comment: @OrganicMarble How to hook a new user better? Down votes should not be allowed on new users.+1. Is the answer incorrect?

S-I, S-II, S-IV; what happened to III?


Can Bangladeshi Lawyer practice in UK?

Question: If somebody has no Nationality card of UK, is he able to practice in UK court, although he has completed BPTC courses?
Answer: Practising as a barrister in England and Wales requires more than completing academic courses, as Wikipedia will tell you; passing yourself off as a barrister on the basis of a Canadian qualification and a few courses will probably land you in prison. It is not a requirement that you hold British nationality; foreign lawyers can and do represent clients - once they have qualified in England as well.
(As asked, your question could also cover Scotland and Northern Ireland, and indeed qualifying as a solicitor (in which case you probably will not practise in court). However, if you are not clear on all the differences, you will not be allowed to practise anyway.)
Comment: @NaserUddinMiazi successful completion of the BPTC is not sufficient for *anyone* to practice in a court, regardless of nationality.
Comment: if somebody (Bangladeshi) just completed BPTC from UK,  will he allowed to practice UK court?
Comment: Unless you clarify what you are actually asking, neither I nor anybody else can add anything.
Comment: please give me a list of requirements,  those need to be a lawyer in UK for a foreigner..
Answer: Firstly, you must have a practising certificate to be able to practice reserved legal services (exercising rights of audience, probate activities, conducting litigation etc).
Anyone supplying such services without a practising certificate is committing a crime under the Legal Services Act 2007.
Note that providing legal advice is not a reserved legal service.
Now to answer the main question:
There are two types of lawyers in the UK, Solicitors, and Barristers.
A foreign lawyer may qualify as one or the other, but each type of lawyer has its own foreign qualification scheme. I will only speak for barristers.
A foreign lawyer may qualify as a barrister in the UK through the Qualified Foreign Lawyers Scheme
In the relevant guidance, for a person who is not a european lawyer, the requirements are:

4.5   A Qualified Foreign Lawyer may apply to the BSB for exemption from the Academic, Vocational and/or Professional Components of training.
  If the Qualified Foreign Lawyer has for a period of at least three
  years regularly exercised rights of audience in courts which
  administer law substantially similar to the common law of England and
  Wales, the BSB will grant exemption from the Academic and Vocational
  Components, and, if it thinks fit, from part, or all, of the
  Professional Component of training. Exemptions will usually be granted
  conditional on passing some or all sections of the Bar Transfer Test.
  For the purpose of 4.5 above, courts in the following jurisdictions
  are deemed to administer law substantially similar to the common law
  of England and Wales:
Anguilla               Antigua & Barbuda           Australia                    Bahamas
  Bangladesh                     Barbados                    Belize                      Bermuda                     Botswana
                     British Virgin Islands              Canada                  Cayman Islands                  Dominica                     Ghana                      Grenada                     Guyana                      Hong Kong
  India
  Isle of Man                Israel                          Jamaica         Malawi  Malaysia  Montserrat
  Namibia  New Zealand  Nigeria  Northern Ireland Pakistan  Papua New
  Guinea  Scotland Singapore  South Africa  Sri Lanka  St Kitts & Nevis
  St Lucia  St Vincent & the Grenadines Sri Lanka  Trinidad & Tobago
  Turks & Caicos
  United States of America  Zambia  Zimbabwe
Other Qualified Foreign Lawyers may be granted exemptions from the
  Academic, Vocational and/or Professional Components of training. Any
  exemptions granted would normally be subject to passing some, or all,
  of the Bar Transfer Test.

So it appears that a Bangladeshi lawyer can practice in the UK if they follow the necessary application procedure and prove to the UK Bar that they are an appropriately qualified foreign lawyer.
NOTE: It doesn't matter if you've completed the BPTC. That would only make you an unregistered barrister, and part of the BPTC Ethics course is knowing that unregistered barristers are not allowed to provide reserved legal services.

Can Bangladeshi Lawyer practice in UK?


What is going on in this degree 8 number field that fails to be a quaternion extension of $\mathbb{Q}$?

Question: This is a soft but very mathematically hands-on question. Hopefully it will be interesting to more than just me. Thanks in advance for your help in thinking clearly about what follows.
I have been trying to build a quaternion extension of $\mathbb{Q}$. I have been pursuing an overly optimistic method, which has not quite been working, and I just learned from this MO question that it's impossible for it to work. I would like your help in thinking about the way it is failing; more precisely, the extent to which it is/is not working. I have obtained a family of degree 8 number fields that are not quaternion extensions, and are not even normal, but due to the construction there is (perhaps??) something quaternion-ish about them. I guess my question is really: what is the relationship of $Q_8$ to the galois group of their normal closure?
Let $L=\mathbb{Q}(\alpha)$ be a $Q_8$-extension of $\mathbb{Q}$. $L$ has a unique biquadratic subfield $K=\mathbb{Q}(\theta,\psi)$ where $\theta^2,\psi^2\in\mathbb{Q}$, and thus quadratic subfields $\mathbb{Q}(\theta),\mathbb{Q}(\psi),\mathbb{Q}(\theta\psi)$ fixed by $\mathbf{i},\mathbf{j},\mathbf{k}$ respectively. From the MO question linked above I learned that $\theta^2,\psi^2>0$, but before I knew that, I reasoned as follows:
$\mathbf{i}$ must fix $\theta$ and reverse the sign of $\psi$, and have order $4$ cyclic action on $\alpha$. $\alpha$ can be taken to be the square root of an element of $K$; then we must have $\mathbf{i}^2(\alpha)=-\alpha$. So, optimistically, suppose $\mathbf{i}(\alpha)= \psi/\alpha$. Then $\mathbf{i}^2(\alpha)=-\psi/(\psi/\alpha)=-\alpha$; this is promising! Suppose likewise that $\mathbf{j}(\alpha)=\theta/\alpha$. Then $\mathbf{k}(\alpha)=\mathbf{ij}(\alpha)=\theta/(\psi/\alpha)=(\theta/\psi)\alpha$, and
$$\mathbf{k}^2(\alpha) = \left(\frac{-\theta}{-\psi}\right)\left(\frac{\theta}{\psi}\right)\alpha=-\alpha$$
Thus $\theta^2,\psi^2$ are equal magnitude and opposite sign. This tells us, a propos of the linked MO question, that this optimistic construction cannot actually work. However, bear with me:
If all of this were actually working, we would have $\theta/\psi = i$ (up to sign), and thus the conjugates of $\alpha$ would be
$$\pm \alpha, \pm i\alpha, \pm \psi/\alpha, \pm i\psi/\alpha$$
A straightforward calculation shows that any polynomial of the form
$$f_{\psi^2}(x) = x^8 - 2r x^4 + \psi^4$$
with $r,\psi^2\in\mathbb{Q}$ has these as roots. If we choose $r,\psi^2$ so that $f$ is irreducible, then $\mathbb{Q}[x]/(f)$ is a field of degree 8 over $\mathbb{Q}$, so even if it is not the originally-desired quaternion extension of $\mathbb{Q}$, it is something with a kind of promising-looking bunch of roots.
So, consider $L=\mathbb{Q}[x]/(f)$ and let $\alpha$ be the residue of $x$ in this field.  If it were really the desired extension, it would contain $i, \psi$. We can force it to contain either one of these because we have control over the discriminant of $\alpha^4$ since we can control $r,\psi^2$. For example, choosing them so that $r^2+1=\psi^4$, e.g. $r=4/3, \psi^2=5/3$, we get
$$\left(\alpha^4-r\right)^2 = (2r\alpha^4-\psi^4) -2r\alpha^4 + r^2 = r^2-\psi^4= -1$$
so that $L\supset \mathbb{Q}(i)$; in fact, $\mathbb{Q}(\alpha^4)=\mathbb{Q}(i)$ because it contains it and is degree $2$.
Before I realized that $L$ couldn't possibly be my desired quaternion extension, I was hoping I could put a further fullfillable constraint on $r,\psi^2$ to force it to contain $\psi$; this was of course in vain. However, the search did lead me to realize that
$$\left[\alpha^2((\psi^2-2r)+\alpha^4)\right]^2=\alpha^4\left(-4r(\psi^2-r)+2(\psi^2-r)\alpha^4\right)$$
$$=2(\psi^2-r)\left(-2r\alpha^4+\alpha^8\right)=2(r-\psi^2)\psi^4$$
Thus (because $\psi^4$ is a rational square) $L$, in fact $\mathbb{Q}(\alpha^2)$, contains a square root of $2(r-\psi^2)$. I found this square root by searching for elements of $L$ that were invariant under the substitution $\alpha\mapsto i\psi/\alpha$, which I wanted to correspond to $\mathbf{j}$. I was hoping for $\psi$ but instead I got a different rational square root!
At any rate, we conclude that $\mathbb{Q}(\alpha^2)\subset L$ contains both $i$ and $\sqrt{2(r-\psi^2)}$. (For example with $r=4/3, \psi^2=5/3$, it contains $\sqrt{-2/3}$, thus $\mathbb{Q}(\sqrt{6})$.) Thus (under the condition $r^2+1=\phi^4$), $\mathbb{Q}(\alpha^2)$ is generically a biquadratic extension of $\mathbb{Q}$, and thus normal.
On the other hand, $L$ is not normal, because it can't contain $\psi$ unless it is generated over $\mathbb{Q}$ by $i$, $\psi$, and $\sqrt{2(r-\psi^2)}$, and this is not plausible. On the other hand, $f$ splits in $L(\psi)$, so $L$'s normal closure is a quadratic extension of it. $L$ ought to have one conjugate $L'=\mathbb{Q}(\psi/\alpha)$ corresponding to the fact that $\alpha$ and $\psi/\alpha$ are both roots of $f$ and all other roots of $f$ are obtained from these by multiplying by $i$, which $L$ and thus any conjugate contains.
So, we've obained a normal degree 16 extension $L(\psi)$ of $\mathbb{Q}$. I guess my question amounts to, what's the relationship between its Galois group and $Q_8$?
(It seems to me that, at least, $Q_8$ should be a subgroup, with $\mathbf{i}$ sending $\psi\mapsto -\psi$, $\alpha\mapsto \psi/\alpha$, and $\mathbf{j}$ fixing $\psi$ and sending $\alpha\mapsto i\psi/\alpha$. Is this right?)
Answer: I figured it out.
First of all, we can think of $\alpha$ as $\sqrt{\sqrt{p}+\sqrt{q}}$, with $p,q$ rationals such that $-4pq=1$. Then $r=p+q$, $\psi = \sqrt{p-q}$.  Also, $i=2\sqrt{pq}$, and $\sqrt{2(r-\psi^2)}=2\sqrt{q}$, explaining why $i,\sqrt{2(r-\psi^2)}$ are in $\mathbb{Q}(\alpha^2)$.
This makes it clear that, in general, $\psi\notin L$.
Then, $f$'s splitting field is $L(\psi)$; an automorphism of this field is determined by its action on $\alpha,\psi$. Defining $\mathbf{i},\mathbf{j}$ as in the question, and setting $\mathbf{k}=\mathbf{ij}$, we find that $\mathbf{k}$ sends $\alpha\mapsto i\alpha$ and $\psi\mapsto -\psi$. Let $\mathbf{-1}$ denote the automorphism that fixes $\psi$ and sends $\alpha\mapsto -\alpha$; it commutes with the others. Then $\mathbf{i},\mathbf{j},\mathbf{k}$ satisfy the famous $\mathbf{i}^2=\mathbf{j}^2=\mathbf{k}^2=\mathbf{ijk}=\mathbf{-1}$. Thus $G=\operatorname{Gal}(L(\psi)/\mathbb{Q})$ does contain $Q_8$ as a subgroup.
I was secretly hoping that $G$ would also have $Q_8$ as a quotient, so I could still pull a quaternion extension of $\mathbb{Q}$ out of all this, but alas, this is not to be. $G$ is generated over $Q_8$ by a central element $\mathbf{l}$, that, tragically, has order 4. (For a moment, I though it might have order $2$ and thus imply that $G=Q_8\times C_2$. Alas...) We can find $\mathbf{l}$ as follows:
Let $\sigma$ be the automorphism of $L(\psi)$ that sends $\psi\mapsto -\psi$ and fixes $\alpha$, i.e. the nontrivial automorphism of $L(\psi)$ over $L$. It is clear that $\sigma$ generates $G$ over $Q_8$ because $Q_8$ is index $2$ and $\sigma\notin Q_8$.
Now $L(\psi)$ has $\mathbb{Q}(\sqrt{p},\sqrt{q},\psi)$ as a subfield. Restriction to this subfield gives us a surjective homomorphism $G\rightarrow \operatorname{Gal}(\mathbb{Q}(\sqrt{p},\sqrt{q},\psi))$; thus we have an exact sequence
$$1\rightarrow C_2\rightarrow G\rightarrow C_2\times C_2\times C_2\rightarrow 1$$
A normal subgroup of order $2$ is automatically central, thus $G$ is a central extension of $C_2\times C_2\times C_2$ by $C_2$. It was pointed out to me by Fedor Bogomolov that whenever $A,B$ are abelian groups and $G$ is a central extension of $A$ by $B$, the commutator $[\cdot,\cdot]$ induces a $\mathbb{Z}$-bilinear form on $A$ with values in $B$. (This is awesome! This must be a standard fact, right? Where would one normally learn this?) This is because commutators $[x,y]$ in $G$ are necessarily in $B$ because they are knocked out by homomorphing to $A$ since it is abelian, and furthermore they are not affected by changing $x,y$ by central elements (in particular, by elements of $B\subset Z(G)$), thus $[\cdot,\cdot]$ is still unambiguous when it is seen as accepting values from $A$ rather than $G$.
In the present case, $A=C_2\times C_2\times C_2$ is an $\mathbb{F}_2$ vector space and $B=C_2=\mathbb{F}_2$, so we can see the commutator as a skew form on $\mathbb{F}_2^3$!
Any skew form on an odd-dimensional space has a nontrivial null space. The preimage in $G$ of this nullspace is the center of $G$. This gives us a way of finding a central element of $G$ that generates it over $Q_8$.
Let $\bar{\mathbf{i}},\bar{\mathbf{k}},\bar{\sigma}$ be the images of $\mathbf{i},\mathbf{k},\sigma$ in $C_2\times C_2\times C_2$. $\mathbf{i}$ reverses $\psi$ and $\sqrt{q}$ while fixing $\sqrt{p}$; $\mathbf{k}$ reverses all three; while $\sigma$ just reverses $\psi$. Thus $\bar{\mathbf{i}},\bar{\mathbf{k}},\bar{\sigma}$ are a basis of $C_2\times C_2 \times C_2$. Since $\mathbf{k},\sigma$ commute while $\mathbf{i}$ doesn't commute with either, the matrix of the commutator form with respect to this basis is
$$\begin{pmatrix}0&1&1\\1&0&0\\1&0&0\end{pmatrix}$$
and, by inspection, the nullspace is spanned by $\begin{pmatrix}0&1&1\end{pmatrix}^T$. It follows that $\mathbf{k}\sigma$, the automorphism of $L(\psi)$ that fixes $\psi$ and sends $\alpha\mapsto i\alpha$, is in the center of $G$! Let $\mathbf{l}=\mathbf{k}\sigma$.
Then $G=Q_8\cup\mathbf{l}Q_8$, $\mathbf{l}^2=\mathbf{-1}$, and $\mathbf{l}$ commutes with everything. This is enough information to calculate in $G$.
Answer: About building a quaternion extension of Q (or more generally of any number field) : the problem can be solved completely and explicitly starting from a biquadratic field, using techniques of embedding problem. Actually, given a field K containing a primitive p-th root of unity (where p is any prime), the more general problem of embedding a Galois extension L/K of type (p, p) into a non abelian Galois extension M/L/K of degree $p^3$ of any possible type can be solved via Kummer theory and cohomology. Allow me to refer to R. Massy & T. Nguyen Quang Do , J. reine angew. Math., 291 (1977), 149-161. Beware : the last result there (thm. 15) contains an error by omission, which is repaired in R. Massy, J. of Algebra, 109 (1987), 508-535, thm. 3 B .


Would a G-SYNC monitor prevent performance issues for underpowered GPUs?

Question: I have an entry-level gaming laptop with an NVIDIA GeForce GPU and I like to cap the few games that I play on it to 60 fps. Would an expensive gaming monitor that can handle refresh rates well beyond 60 Hz be (1) a waste of money and (2) problematic? I've read that using an overpowered monitor on a relatively underpowered GPU may cause performance issues. However, can't I just buy a G-SYNC capable monitor and have the NVIDIA GPU bring the monitor's refresh rate down to 60 Hz when I play games?
Answer: I think you've misunderstood what people mean.
The refresh rate of your monitor has no impact on gaming performance. It only decides how often your monitor can show a new frame every second.
What can impact performance is monitor resolution. However you can always choose to render a game at a lower resolution and let it upscale. Or use Nvidia DLSS if availible.
You also do not need a G-sync capable monitor for this, especially considering that with a G-sync monitor the monitor refresh rate is dynamically ajusted to the framerate of your game. Basically already dynamically doing what you are asking. If you then limit the maximum refresh rate. you're only denying yourself extra visible frames if they are availible.
However if you really wish to reduce the refresh rate of your monitor for other reasons you can do this by right clicking on the desktop and selecting display, then scroll down and click 'advanced display settings' there is a drop down to edit the refresh rate.
Comment: If I plugged a 4K monitor into this computer but rendered games at 1920x1080, would it perform as well as if I were using a 1080p monitor?
Comment: Yes, depending on the upscaling though it might look a little bit blurry but  there are some fixes for that.
To get 1080p looks and a bit less blur you can enable something called integer upscaling. That way it can just use four monitor pixels for each normal pixel, instead of upscaling and interpolating. This can look better depending on the game.  Another thing you can do to get better looks is use the Nvidia filters called Nvidia Freestyle. I believe the default hotkey is alt+z there you can add sharpening filters to get the most out of a 4k monitor. and of course use dlss if available.


Ways for beginner programmer to practice with C++

Question: So i just finished my first semester of college. In my intro to programming class we made a bunch of super interesting (sarcasm) console applications. Any suggestions on ways other than just messing around with console applications for a beginner C++ student to improve?
Answer: Depends on what you mean by console apps, but there is nothing wrong with console applications to learn C++. It all depends on how complex they are.
You could try writing a gui app with something like QT, but then you'll spend most of the time learning the framework.
You could write a game in something like OpenGL, SDL etc.
The problem with C++ is that it is a huge step from simple stuff to something useful.
Comment: Qt is amazingly accessible.  Just follow the tutorials and very soon you'll be writing your own small (but real) applications.
Comment: @Javier: Qt is accessible, but somewhat un-C++. Because Qt is object oriented with hacks to provide kind of introspection while modern C++ is more about functional and generic programming.
Answer: Console applications are the best ways to learn C++. And rather than learning advanced C++, better learn the data structures first. Once you learn list, tress, graph etc. then you will have much more option in console applications.
Comment: Second this.  Speaking from experience, jumping straight into GUI programming gives a *very superficial* understanding of C++.  Despite all its high-level abstractions, C++ is built on top of very low level abstractions and hence it's critical to know these basic building blocks in order to understand how the abstractions work and, more importantly, *when these abstractions leak* (as they *will* inevitably do so given its unsafe nature).
Answer: Know the feeling. I was frustrated at the same thing. Console applications aren't very interesting what with all that string reversing and linked lists, but at the same time there is no way I can argue with the other responses given.
To answer your question, pick a topic your interested in. Seeing as I learned C/C++ I headed in the direction of learning GTK+ and SDL. GTK+ should give you a good start on GUI and SDL on 2D graphics (this could lead onto opengl later on). I also recommend you going over beej's guide to networking (its a free online ebook), this should give you a start on networking.
Answer: Find an open source project you find interesting, and contribute.  We love new contributors, and more experienced coders will be reviewing your patches and providing feedback. :)
Comment: +1. And don't forget the fact that you get to read other people's code, which is good way to learn new idioms and important skill in itself.
Answer: Console applications may seem boring but they are essential to the development of the programmers ability to think of solutions. The basics of programming are always overlooked these days with the shiny stuff. I still use console applications a lot to test out ideas before building the high-level stuff on them. Once you have become good at the low-level stuff, you become a programmer with better understanding and flexibility and also have good programming habits.
Try challenging problems each time. I would recommend you Cracking the Coding Interview by Gayle Laakmann to get challenging questions and insights. You are at the best time in your career to start building up on these fundamentals and polishing them up into being a great programmer some day. Good luck.


accelerometer interference

Question: I had a PCB containing a micro usb and a 3 axes accelerometer LIS3DH. I put the PCB at fixed position and the value of Z vary between --77at -83. but when I touch the usb cable with my hand or with a material stuff and without changing the PCB position, I receive big glitches of the values of z (up to 700 on Z value).
is that really my hand which cause this fluctuation (knowing that if I dont touch the usb, the value would stay stable (-77 -83for hours)
Answer: You may well have induced-electrical-noise issues.
Test:

Place the PCB and cable on a flat surface and

Weight the cable with a cup or similar non conductor near the PCB.
This allows you to move the cable slightly when you touch it without moving the PCB.
Now touch the cable on the non-PCB side of the weight.

If you get similar results it's probably electrical noise.
If so, you need to examine the circuitry where the USB cable interfaces to see if it may be allowing induced signal to interfere with the accelerometer signal.
Comment: methinks you mean electrical noise/interference. In accelerometers there is also mechanical noise.
Comment: @placeholder Yes, I meant electrical noise. My clamp on the cable procedure above was aimed at eliminating (or much reducing) mechanical coupling from cable to sensor so that electrical coupling effects can be checked. Olin deals with mechanicaal coupling.
Comment: @placeholder Anyone following my suggestions (physically or thought-experimentally) and then not understanding the implications of the outcome (of which there are two main probable ones) is unlikely to benefit from any amount of clarification.
Comment: @placeholder Tidied formatting. Added a few words. I wot that anyone straining at enough gnats to render " ... without moving the PCB ...may be allowing induced signal to interfere with the accelerometer ..." as relating to mechanical "signal" affects on the PCB probably should be asking the question on a mechanical site and ignoring the fact that electronics exist.
Comment: Ummm ..  that comment was a hint that perhaps you should clarify your write up.
Answer: The accelerometer has a digital interface.  It's fairly unlikely that you are looking at electrical noise or interference, and you're looking at accelerations that the device is experiencing.  You should make an effort to put some numbers in real units on your Y-axis to figure out how large the accelerations are.
Answer: Always begin your troubleshooting tasks by measuring/monitoring the power supplies. I recommend you use an oscilloscope to monitor the power supply voltage at the accelerometer IC's power pin to see what happens to the voltage when you touch the USB cable. (n.b. You cannot use a multimeter for this test; you must use an oscilloscope.)
Using the oscilloscope, look for an obvious voltage spike on the power bus at the moment you touch the USB cable. If touching the USB cable induces obvious electrical noise on the power supply bus (see also electrostatic induction), then you need to remedy this problem before continuing.
If an obvious voltage spike DOES NOT appear on the power bus when you touch the USB cable, then as others have already suggested, it seems likely you are inadvertently moving the accelerometer IC as you touch USB cable, and the IC is detecting this motion.
And in addition to what @RussellMcMahon suggested, I would orient the accelerometer IC so that one of its three axes (e.g., its Z-axis) is perpendicular to your tabletop, and lightly press the IC (or circuit board) onto the tabletop so that it cannot move perpendicular to the tabletop—e.g., place something onto the IC/circuit board to hold it down (don't press on it with your finger). Now touch the USB cable. If touching the USB cable causes the IC to move, one would expect that the strongest acceleration values would be observed in the two axes that are parallel to the tabletop (e.g., the X-axis and Y-axis directions), and the weakest acceleration values would be observed on the axis perpendicular to the tabletop (e.g., the Z-axis).
Answer: The LIS3DH accelerometer has a built-in thermometer.  While the accelerometer may be sensitive to both mechanical and electrical noise, the themrmometer is probably sensitive only to electrically-induced noise.  If you monitor the output of the thermometer, you might be able to determine whether your original noise is of mechanical or electrical origin.
Comment: Interesting, but doesn't answer the question.
Answer: It seems like the accelerometer is picking up small accelerations caused by your hand or this "material stuff" moving it.
A more remote possibility is that there is a bad connection, like a bad solder joint, on the board, and the small motions are making it open and close intermittently.
Try the board in different orthogonal gravity-aligned orientations.  If only one axis responds as you describe, then perhaps something is wrong with that axis.
Comment: Hy Olin, I dont think I create accelerations, I ust have touch the usb cable with an unplugged usb male to see the glitches
Comment: olso I noticed that, when there is a glitch, if affected the 3 axes x,y,z simultaneously

accelerometer interference


Which of the following statements about gravitational waves are true?

Question: a) The emission of gravitational waves from merging black holes is predicted by Einstein's general theory of relativity.
b) The first direct detection of gravitational waves, announced in 2016, came from the LIGO observatory.
c) Two orbiting neutron stars or black holes will gradually spiral toward each other as a result of energy being carried away by gravitational waves.
d) The emission of gravitational waves from merging black holes is predicted by Newton's universal law of gravitation.
e) Although gravitational waves are an important theoretical prediction, we do not yet have any observational evidence that they  exist.
f) Scientists seek to detect gravitational waves by using powerful gamma-ray telescopes.
I personally think e is false because LIGO detected the gravitational wave already. For others, I think they are alright. But I am not sure if I missed anything. Could someone give any suggestion?
Comment: I'm voting to close this question as off-topic because  it is someone's homework.
Comment: Before you post questions like this, you should see what information you can find on your own.  Pretty much all you need to know to answer this question can be found on the Wikipedia page for gravitational waves.
Comment: Is this a "homework problem"?
Answer: a) This is true.  Gravitational waves have been predicted by General Relativity since 1916.
b) This is true.  In February 2016, LIGO announced that they had detected gravitational waves resulting from a merger of two black holes.
c) This is true.  Two objects orbiting around each other will slowly lose energy due to the production of gravitational waves, causing them to fall inwards towards each other.
d) This is false.  Newton's laws assume that all interactions happen instantaneously.  Gravitational waves and signals from gravity travel at the speed of light.
e) This is false because (b) is true.
f) This is false.  There are two different ways to detect gravitational waves.  The first is by using an interferometer, like LIGO, the Laser Interferometer Gravitational-Wave Observatory.  By using a very large interferometer, scientists can detect minute changes in the length of the arms, due to the passage of a gravitational wave.  The second way is by using a Weber bar, a large, solid antenna sensitive to changes in strain due to its resonant frequency.  This second method has not yielded any results yet.
Comment: @SirCumference my bad


If I have jRuby on Rails installed can I use only Ruby?

Question: What I mean by this is if I install jRuby on Rails, can I use only the ruby language to build my application?  I wanted to install my rails application with jRuby in case I wanted to use Java in the future, though I don't need it now.  Or do I not understand?  Is jRuby ruby that has access to java libraries?
Answer: yes, jruby is ruby (your ruby scripts need no modification to run under jruby). in addition, it has full access to java libraries - check out the wiki for how easy it is to integrate a java class or library into your ruby code.
Comment: Read how easy it is... and then don't do it.  If your goal is to maintain the ability to switch between Ruby and JRuby you should avoid using C extensions in Ruby and java libraries in JRuby.
Answer: The others have answered your direct question. I just want to say that I've been using jruby full time at work for the past 6 months and it's great. Deploying a rails app with the glassfish gem is very easy and jruby performs better than MRI ruby 1.8.x.
I've seen no real downside after 6 months other than the fact that we can't use gems that have pieces written in C. However, we've taken a C library and created a gem using FFI and it wasn't too much trouble.
It's also really easy to speed up your app by writing a few key pieces in java (which is easier t work with than C).


How to get back the standard application in Notification Center in Mac OS X?

Question: I have configured No application in the center of notifications. no weather, no stock, no calendar, no calculator. How to return back to the standard application?
Answer: Clicking the 'Edit' button at the bottom of the 'Today' panel in Notification Center will show the widgets which have been disabled. Clicking the green plus circle icon beside any of them will re-activate it. When all the widgets you want are active, just click 'Done' button on the bottom-left.
As far as I know the following is a list of the standard widgets supplied with OS X Yosemite

Today
Tomorrow
Weather
Reminders
Calculator
Social
World Clock
Calendar
Stocks