Simple Radio Transmitter Range

Question: I am currently looking to design a single frequency radio transmitter. The transmitter needs to have a maximum range of about 120 feet. Would a design similar to the one included be able to transmit that far? Additionally, is there a method to estimating the range of a transmitter prior to building?
Comment: @gil that really isn't an argument. The internet is full of badly copied and dysfunctional circuits. And this circuit is called "FM transmitter", but it doesn't frequency modulate at all; it's just a bad implementation of an oscillator with an unspecified antenna.
Comment: I mean. You can even see that the website this schematic is from just style it somewhere else, and slapped a logo on it, even hiding crucial info. The owner of the website didn't care - most likely, they simply even didn't understand what they were copying.
Comment: I expect it will work, I found several transmitters with the same circuit on the web and they all profess to work. I will take a SWAG; and say it will go 120 feet but can you receive it, that depends on the probacation factors involved, antennas, receivers etc.
Comment: On top of what mmmm said, the battery is upside down too.
Answer: Radio waves travel infinitely far; therefore a transmitter doesn't have a "range". A full transmission system, including both the transmitter and receiver, can have a range, because the transmit power, with all the loss the transmission has, which scales quadratically with distance, must be higher than the receiver's sensitivity.
If you want to estimate the range of such a system, you hence need to know the sensitivity of the received and the power your transmitter outputs.

The transmitter needs to have a maximum range of about 120 feet.

Operating this circuit is illegal, basically everywhere: it's not stable or precise enough to guarantee you stay in a band where you don't need a license, and it's potentially more powerful than you're allowed to be without a license, too. This circuit simply is just a source of interference to multiple bands and should never be connected to an antenna!
That being said, your circuit is also not a good transmitter, in many ways. You won't be very happy with this. This literally just makes a tone, and not a stable or clean one. Detecting this at your receiver will be error-prone, just because your signal isn't possible to tell apart from e.g. noise that power supplies or fridges cause.
I'd recommend looking either into proper RF integrated circuitry - for example, there's many microcontrollers and microcontroller boards that simply implement a reliable, legal, easy to use transmission system in an ISM band - or into first building a clean crystal or SAW based oscillator, which you can then modulate to transport information (like "I'm transmitter number 1 and on, and not just noise that you pick up").

Simple Radio Transmitter Range


Partition a simple undirected graph with degree of every vertex at most 4 into two graphs with degree of every vertex at most 2

Question: Suppose $G = (V, E)$ is a simple undirected graph (with no self-loop) such that the degree of every
vertex is at most $4$.
How to prove that it is possible to partition the edges $E$ into two sets $E_1$ and $E_2$ such that in
each of the graphs $G_1 = (V, E_1)$ and $G_2 = (V, E_2)$, the degree of every vertex is at most $2$?
Comment: For future questions, you should include what you've attempted so far.
Answer: We have $G$ with $\Delta(G) \le 4$. Show that

There is some finite $4$-regular graph $R$ such that $G \subseteq R$.

The above statement generalizes nicely for any $\Delta(G)$. Then, we can apply Petersen's $2$-factor Theorem:

If a graph $G$ is $2k$-regular, then it has a $2$-factor. Consequently, $E(G)$ decomposes into $k$ many $2$-factors.

A $2$-factor is a $2$-regular spanning subgraph. There's a proof in the link, but you can also look at this MSE question to find an argument that generalizes nicely.
From these two, we can find a $4$-regular graph containing our graph, use the $2$-factor Theorem, and then delete vertices as required to obtain $G_1 = (V_1,E_1)$ and $G_2 = (V_2,E_2)$ as desired.
This is probably the way to think about it, but I wouldn't be surprised if there is another way using edge colorings. For example, the result follows immediately for Class $1$ graphs, but Class $2$ graphs may require a bit more thinking (See Edge Coloring.)


Kerberos Errors

Question: Need help with the below error. I haven't been able to find much that has helped.
<code>Event Source: Security-Kerberos
Event ID: 4
    Qualifiers: 16384
Version: 0
Level: 2
Task: 0
Opcode: 0
Keywords: 0x80000000000000
</code>

The Kerberos client received a KRB_AP_ERR_MODIFIED error from the
  server D@@@@@$. The target name used was DOMAIN\DS@@@@@$. This
  indicates that the target server failed to decrypt the ticket provided
  by the client. This can occur when the target server principal name
  (SPN) is registered on an account other than the account the target
  service is using. Please ensure that the target SPN is registered on,
  and only registered on, the account used by the server. This error can
  also happen when the target service is using a different password for
  the target service account than what the Kerberos Key Distribution
  Center (KDC) has for the target service account. Please ensure that
  the service on the server and the KDC are both updated to use the
  current password. If the server name is not fully qualified, and the
  target domain (My.FQDN.ORG) is different from the client domain
  (My.FQDN.ORG), check if there are identically named server accounts in
  these two domains, or use the fully-qualified name to identify the
  server.

A little background. We have been experiencing random issues with our DCs. Typically after a few months one of them will no longer allow us to login. If we turn off Kerberos on that DC we can log back in, but that is causing all sorts of other issues. Typically we just blow it out and create another DC which last for a couple of months, however, I need to get to the bottom of the problem. Along with the kerberos error we are seeing group policy errors and AD replication errors, but my guess is that they are caused by an authentication problem. If anyone could point me in the right direction it would be appreciated.
Answer: Take a look here: https://support.microsoft.com/en-us/kb/558115
Further, possibly the client ticket cache is corrupt and sending a poorly formed response.
Identify the client and server and try taking some tcpdumps. Walk through the full set of steps in Kerberos and see what step is broken.

Kerberos Errors


How do you analyse the fundamental frequency of a PCM or WAV sample?

Question: I have a sample held in a buffer from DirectX. It's a sample of a note played and captured from an instrument. How do I analyse the frequency of the sample (like a guitar tuner does)? I believe FFTs are involved, but I have no pointers to HOWTOs.
Answer: The FFT can help you figure out where the frequency is, but it can't tell you exactly what the frequency is.  Each point in the FFT is a "bin" of frequencies, so if there's a peak in your FFT, all you know is that the frequency you want is somewhere within that bin, or range of frequencies.
If you want it really accurate, you need a long FFT with a high resolution and lots of bins (= lots of memory and lots of computation).  You can also guess the true peak from a low-resolution FFT using quadratic interpolation on the log-scaled spectrum, which works surprisingly well.
If computational cost is most important, you can try to get the signal into a form in which you can count zero crossings, and then the more you count, the more accurate your measurement.
None of these will work if the fundamental is missing, though.  :)
I've outlined a few different algorithms here, and the interpolated FFT is usually the most accurate (though this only works when the fundamental is the strongest harmonic - otherwise you need to be smarter about finding it), with zero-crossings a close second (though this only works for waveforms with one crossing per cycle).  Neither of these conditions is typical.
Keep in mind that the partials above the fundamental frequency are not perfect harmonics in many instruments, like piano or guitar.  Each partial is actually a little bit out of tune, or inharmonic.  So the higher-frequency peaks in the FFT will not be exactly on the integer multiples of the fundamental, and the wave shape will change slightly from one cycle to the next, which throws off autocorrelation.
To get a really accurate frequency reading, I'd say to use the autocorrelation to guess the fundamental, then find the true peak using quadratic interpolation.  (You can do the autocorrelation in the frequency domain to save CPU cycles.)  There are a lot of gotchas, and the right method to use really depends on your application.
Comment: As well as missing fundamentals, there is also the issue of sympathetic resonance to deal with on signals from stringed instruments. Particularly in the instrument tuning scenario for guitars, the strings not being tuned at any given time are open and if close to tuned pitch have coincident partials with the played string.
Comment: The link for the outline of the algorithms is broken. Would you happen to have them on another place? Thanks in advance!
Comment: @RafaelB Thanks I fixed it https://gist.github.com/endolith/255291
Answer: There are also other algorithms that are time-based, not frequency based.
Autocorrelation is a relatively simple algorithm for pitch detection.
Reference: http://cnx.org/content/m11714/latest/
I have written c# implementations of autocorrelation and other algorithms that are readable. Check out http://code.google.com/p/yaalp/.
http://code.google.com/p/yaalp/source/browse/#svn/trunk/csaudio/WaveAudio/WaveAudio
Lists the files, and PitchDetection.cs is the one you want.
(The project is GPL; so understand the terms if you use the code).
Comment: Whoa, what? I disagree. A frequency-domain solution is absolutely not a terrible solution, at all. Harmonic product spectrum or cepstral methods are easy to implement and reasonably robust.  Autocorrelation is not *generally* considered the RIGHT solution by any means; it is one of several valid solutions. True, though: zero crossing is not a reliable indicator of pitch.
Comment: I want to vote this answer up several times. FFTs are a terrible solution to this problem; it's like driving a tank to the grocery store. Sure, it's cool, but it's really not the best way. Autocorrelation is generally considered THE RIGHT solution to this problem; viz Autotune/Melodyne/Singstar/you name it. Zero crossing based solutions are ONLY APPLICABLE when you have SPECIFIC knowledge of the hermonic behaviour. Autocorrelation can be implemented very efficiently too.
Comment: Autocorrelation is usually more computationally intensive than FFTs.  We often use FFTs to do autocorrelations, in fact, because it's faster.  Using naive autocorrelation when you could do it with FFTs is like driving a tank through the wall of the grocery store instead of using the front door.
Answer: Guitar tuners don't use FFT's or DFT's. Usually they just count zero crossings. You might not get the fundamental frequency because some waveforms have more zero crossings than others but you can usually get a multiple of the fundamental frequency that way. That's enough to get the note although you might be one or more octaves off.
Low pass filtering before counting zero crossings can usually get rid of the excess zero crossings. Tuning the low pass filter requires some knowlegde of the range of frequency you want to detect though
Comment: I doubt they just count zero crossings.  There are many zero crossings per cycle in a typical guitar waveform.  http://www.flickr.com/photos/56868697@N00/4180888094/  They probably do a simple autocorrelation.
Comment: More zero crossings doesn't really matter for a simple tuner. Remember  that a tuner doesnt need the exact frequency of the fundamental. It needs to know the note. By counting more zero crossings per cycle it might lock on to a higher octave but a Cb will still be a Cb and two cents too high will still be two cents too high. Autocorrelation is great for more advanced processing but it's overkill for a tuner.
Answer: FFTs (Fast-Fourier Transforms) would indeed be involved.  FFTs allow you to approximate any analog signal with a sum of simple sine waves of fixed frequencies and varying amplitudes.  What you'll essentially be doing is taking a sample and decomposing it into amplitude->frequency pairs, and then taking the frequency that corresponds to the highest amplitude.
Hopefully another SO reader can fill the gaps I'm leaving between the theory and the code!
Comment: This approach has serious accuracy problems, especially in the music context. As endolith points out, FFT gives you intensity within a range of frequencies; the range is larger the smaller (and faster) the FFT window size. Even worse, the overall range is 0 to 44100 Hz (for redbook audio), while a typical musical note is almost always well below 1000Hz, so most of the resolution you have is wasted on the higher frequency bands.
Answer: A little more specifically:
If you start with the raw PCM in an input array, what you basically have is a graph of wave amplitude vs time.Doing a FFT will transform that to a frequency histogram for frequencies from 0 to 1/2 the input sampling rate.  The value of each entry in the result array will be the 'strength' of the corresponding sub-frequency.
So to find the root frequency given an input array of size N sampled at S samples/second:
<code>FFT(N, input, output);
max = max_i = 0;
for(i=0;i<N;i++)
  if (output[i]>max) max_i = i;
root = S/2.0 * max_i/N ;
</code>
Comment: I like the concise simplicity but suspect a problem with the for loop. The output would surely not be the same size as the input
Comment: It exactly the same size.  Doing an FFT is a tradeoff - you can have fine frequency resolution (many output bins) only by analyzing a large time span. If restrict the analysis to a very precise time (small input sample size) you get low resolution in the frequency domain.
Answer: Retrieval of fundamental frequencies in a PCM audio signal is a difficult task, and there would be a lot to talk about it...
Anyway, usually time-based method are not suitable for polyphonic signals, because a complex wave given by the sum of different harmonic components due to multiple fundamental frequencies has a zero-crossing rate which depends only from the lowest frequency component...
Also in the frequency domain the FFT is not the most suitable method, since frequency spacing between notes follow an exponential scale, not linear. This means that a constant frequency resolution, used in the FFT method, may be insufficient to resolve lower frequency notes if the size of the analysis window in the time domain is not large enough.
A more suitable method would be a constant-Q transform, which is DFT applied after a process of low-pass filtering and decimation by 2 (i.e. halving each step the sampling frequency) of the signal, in order to obtain different subbands with different frequency resolution. In this way the calculation of DFT is optimized. The trouble is that also time resolution is variable, and increases for the lower subbands...
Finally, if we are trying to estimate the fundamental frequency of a single note, FFT/DFT methods are ok. Things change for a polyphonic context, in which partials of different sounds overlap and sum/cancel their amplitude depending from their phase difference, and so a single spectral peak could belong to different harmonic contents (belonging to different notes). Correlation in this case don't give good results...
Answer: Apply a DFT and then derive the fundamental frequency from the results.  Googling around for DFT information will give you the information you need -- I'd link you to some, but they differ greatly in expectations of math knowledge.
Good luck.


ios6 mapkit not showing current location in a blue dot

Question: I am using the raywanderliech tutorial for reference. It worked perfectly in a test project.Now in my actual project i have a View controller with many buttons and at the bottom left side, i have a mapkit. It is about the size of 3*3 rubik's cube. What i am trying to say is its small, not full screen/half screen. So i am trying out the example from the test project in this.But it is not showing me the location. It shows the world map. Not my location.
<code>-(void)viewWillAppear:(BOOL)animated
{
CLLocationCoordinate2D zoomLocation;
zoomLocation.latitude = 39.281516;
zoomLocation.longitude = -76.580806;

MKCoordinateRegion viewRegion  = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5 *METERS_PER_MILE, 0.5*METERS_PER_MILE);

[_mapView setRegion:viewRegion animated:YES];
}
</code>
I changed the latitude and longitude to my current coordinates.I used a website to get my current coordinates.I am attaching a link here.The last pic in this link is the output i am ending up with. Can someone please tell me what i am doing wrong. If more info is needed please let me know..Thanks..Here is the link
https://www.dropbox.com/sh/q9t3k1b01pbu1uq/rzI_2k_GlN
Comment: Can someone care to tell me why the -1?
Answer: You are missing
<code>_mapView.showsUserLocation = YES;</code>
in the above code. You should read that tutorial once again.


Is a physical lapel pin awarded for FAA Safety Wings?

Question: I have recently got my PPL, and started the FAA Safety Wings program. After completion of each phase, are we awarded a physical lapel pin?
Answer: Yes, the FAA currently offers a lapel pin at the completion of each phase of the WINGS program.
This "reward" is not automatically awarded or delivered, the WINGS participant must request it. Upon completion of each of a phase, for example Basic, Advanced, or Master, the FAA Safety Team will include the following notice:

If you have not already done so, I encourage you to go to your My WINGS page at FAASafety.gov and claim your Team Member Reward -- a beautiful set of wings for your lapel.

The pins are sponsored and distributed by AVEMCO, in partnership with the FAA.
The pins are available in at least three finishes: bronze, silver, and gold, and a special sea-plane version is apparently available.

Source: own work
Comment: Beautiful!!! I just made the request and waiting for my lapel pin.... Thanks for the information.


Plugins not showing in Multisite dashboard

Question: I have been trying to upload more plugins and even though the files are all located in content/plugins directory, nothing is showing up in the dashboard.
Even the default plugins are not showing. Does anyone know why this may be?
Answer: Have you enabled Plugins for network sites, via the Network Admin?
Also, MU (must-use) or network-activated Plugins won't show in the site dashboard, IIRC.
Answer: You have likely Network Activated all of your plugins. If there are options for the plugins, these will appear in the Child site admin sidebar navigation. Plugins that have not been Network Activated will appear in the Child site admin under Plugins, with the option to activate them on a site-by-site basis.
Answer: I've had this happen on a multisite before and what I ended up doing was programmatically deactivating/reactivating the plugin again using activate_plugin and deactivate_plugins. And it seemed to show up in my case. The plugin that wasn't showing up in my case was Post Type Switcher, a Network Plugin.
<code>//deactivate/reactivate the plugin on theme switch
function post_type_switcher_activator(){

    //reference the plugin's main php file
    deactivate_plugins( array( 'post-type-switcher/post-type-switcher.php' ) );
    activate_plugin( 'post-type-switcher/post-type-switcher.php', NULL , false);
}
add_action('switch_theme', 'post_type_switcher_activator');
</code>
Not sure if those other two args to activate plugin are needed.  I did the activating/deactivating based on theme switching (so that it wouldn't happen every time). So to see if this works, just switch out to another theme and switch back, and then see if the plugin shows up in your list.  Post Type Switcher did for me.


Help with making pavlova bases

Question: I constantly am having problems with the removal of baking paper used to line baking tray when making Pavlova bases. I have tried oiling the tray and then dusting the baking paper with cornflour to make it easier to remove the baking paper  from the cooked Pavlova base, but it always sticks and tends to destroy the base. Any suggestions?
Comment: Could you post your recipe and technique.
Answer: Pan release spray (such as PAM in the US) can help hold the paper in place (to aid your piping) and prevent the finished meringue from sticking to the paper once cooled. I've used this technique in both professional kitchens and in my own kitchen at home.
Spray a light coating on the pan, then lay down the paper.
If necessary, spread the coating evenly with your fingers or a towel (for some reasons, the consumer/home versions of these products often emit more of a "blast" compared to the finer "mist" of the professional ones).
Then repeat the process on the top side of the paper.
Answer: Maybe you could use edible paper. That would probably be the easiest and quickest way to solve this issue. You can even make it yourself:
https://makezine.com/projects/make-edible-paper-3-easy-steps/
Answer: We've always used teflon sheet for pavlova. It peels off the cool pavlova very well. It's reusable and useful for many other things too, and goes through the dishwasher (though it's slightly awkward in there).  Just cut it to the size of your baking tray with scissors.
Answer: Are you sure you use waxed side of paper and dry base long enough? I know it may be stupid but my girlfriend always mix the sides and her dough always stick to paper.
When making base from 4 large whites I preheat oven to 120C. The I bake the base for 30 minutes AND dry for at least 3 hours in 90-100C.
My mother used to draw circle with her nail in the paper where base should end. She said it help to separate base from paper but I think it was need because of the poor paper quality (she was using white sheets when I use much thicker brown paper from roll).

Help with making pavlova bases


When there are multiple circuits in a junction box do all grounds get connected

Question: If I have a junction box where there are splices from several circuits, do I connect all ground wires from all circuits together in one bundle or do I do that for each circuit within the junction box?
Answer: Only one answer...  YES, all the bare grounds go together!!
Answer: I don't think this OP got the right answer, at least under code in the US.  It's my understanding that of different circuits should not be connected together.
Comment: As I understand it NEC2014 allows for retrofitting a ground and that ground can go to any place that has one, even (as I understand it) if it's on a difference _circuit_ breaker. So, if you're covered by 2014, then yes, this is actually OK, at least for retrofits - I don't know about new installs.
Answer: You connect all the grounds together with a ground crimp connector.  A wire nut is not sufficient to meet code.
And then if the box is metal, you connect the crimped bundle to the box.  Leave one of the ground wires longer than the others, sticking through the crimp connector, and attach that one to the box.
Comment: Ordinary wire nuts are acceptable for joining ground conductors: NEC 250.8(A) "Equipment grounding conductors... shall be connected by one of the following means: (1) Listed pressure connectors..."
Comment: I think the wire nuts vs crimp connector depends on your local inspector. In my case (Ohio) he said either is fine.


Why don't the magnetic dipole moments in a neutron cancel out?

Question: This may be a silly question. I thought magnetic dipoles were dependent on electric charge, so why in a neutron do the dipole moments not just cancel each other out?
Comment: Are you talking about magnetic or electric dipole moments? Because the latter has not been observed in neutrons...
Comment: I meant magnetic dipole moment, (will edit), but even that is caused by moving charge right?, or spin?
Answer: The magnetic moment of the neutron is not due to circulating charge. Instead it is due to the combined magnetic moments of the partons inside it.
The inside of a hadron is a ferociously complicated place, but let's take the simple model of a hadron as made up of three quarks. The quarks have a magnetic moment due to their spin. This magnetic moment is an intrinsic property of the quarks and not due to rotation in any classical sense.
So the problem is to find the lowest energy state configuration of the three dipoles in a neutron, and this turns out to be non-zero. If fact it's approximately:
$$  \mu_n = \tfrac{4}{3} \mu_d − \tfrac{1}{3} \mu_u $$
where $\mu_d$ and $\mu_u$ are the intrinsic magnetic moments of the down and up quarks respectively.
Answer: I am presenting this classical description for simplistic understanding of the process.
In general (not for elementary particles) the Magnetic dipole moment is generated by a current loop. If you consider a current loop with current $I$ then the charge exiting from loop is same as charge entering into loop and hence there is no net charge on the loop.
If the area of the loop is $A$ then magnetic dipole moment
$\mu=IA$
Hence you can understand that requirement of excess charge is not necessary for the magnetic dipole moment (even classically).
The relative strength of the magnetic force to the electric force is very small
$F_{mag} = \frac{1}{c}F_{elect}$
If excess charge would be the necessary requirement then magnetic force would not be detected on the first place. This is just my humble opinion.
Regards,


Was Yoda wrong about the limits of telekinesis?

Question: In Empire Strikes Back, Yoda tells Luke that an object's size doesn't matter and that the difficulty of levitating an X-Wing was only in his mind. If the upper limits of telekinesis are determined by belief, what's to stop a Jedi/Sith from pulling a moon out of orbit, moving an entire solar system, or splitting an atom with the Force?
Comment: To be fair, Starkiller *did* pull a star destroyer out of the sky in The Force Unleashed.
Comment: It's possible that the size may not actually matter but the amount of concentration necessary to makes one's self _ believe_ that the size does not matter is in fact the limiting factor. Luke might be inspired to believe that he can move an x-wing--but a moon? That would require some truly phenomenal paradigm reevaluation.
Comment: By the same reasoning, because Luke's XWing has wires, and landing gear, Yoda could not lift it from the swamp.
Comment: Was there any restriction about what the object was; did some (e.g. living things) have more or less pliancy?
Comment: a star system consists of many individual items that would all have to be moved together, so if telekinesis is limited to a single object it won't work for one. Splitting an atom is not equivalent to moving an object, but to tearing it apart. Who knows, maybe it can be done, just because it's not demonstrated doesn't mean it's impossible. But remember splitting one atom won't do anything except maybe cause a mutation that over decades might possibly lead to another lifeform or a form of cancer.
Comment: It's not just about imagination. It is also about willpower.
Comment: I know it's controversial but, every time someone tells you "size does not matter", they're lying to you...
Answer: Yes and No. Yoda may have been being metaphorical in his explanation of size not mattering. He was doing that zen master thing where the master asks or promotes an idea which makes the student think differently about whatever they are discussing. (What is the sound of one hand clapping...)
Size may matter less than one might believe but mass is surely a factor in moving something with Force Telekinesis. All things being equal, Force telekinesis likely has both mass limits and size limitations which vary from Jedi to Jedi. Even all of the greatest Force Telekinesis feats ever performed none have ever tried to move a natural body as large as a moon.
However, there are several examples of Jedi using Force Telekinesis to do amazing feats including pulling starships from the sky, and pushing entire fleets out of starsystems. Without an understanding of the physics of Force Telekinesis, it is impossible for anyone who wants to use physics to understand the physical limits.
Wookieepedia lists several examples of Force Telekinesis, canon and non-canon.

Among the most skilled users of telekinesis were the Zeison Sha. Neither Jedi nor Sith, their skilled use of telekinetic force use was developed over decades of simply surviving their planet's harsh environment, surpassing even some of the most powerful of Jedi in their skills. Their weapon of choice was a discblade, a circular bladed weapon that was thrown and manipulated with the Force and could be recalled. It required great skill in telekinesis to be wielded effectively.
The finest display of telekinesis ever, Jedi Dorsk 81, utilizing the channeled Force powers of all available Jedi of Luke Skywalker's Jedi Praxeum, used telekinesis to push seventeen Imperial I-class Star Destroyers out of the Yavin system. The massive amount of Force energy claimed the Jedi's life.
Perhaps, the most powerful of telekinetics were Galen Marek and Revan. Galen Marek was able to pull up the Imperial Star Destroyer, to himself. Revan broke away a considerable piece of Star Forge and crushed more then a hundred droids and Sith acolytes, by it.

Galen Marek was able to pull up the Imperial Star Destroyer, to himself. How much do those things weigh, anyway?
Comment: For the record, Naga Sadow also pushed two stars together.
Comment: That makes absolutely NO SENSE. Given the mass of stars, it is impossible to believe anything like that could be done without rewriting the fabric of the UNIVERSE itself.
Comment: So you're saying Naga Sadow was a jerk when he was drinking.
Comment: I don't disagree, but it happened in Tales of the Jedi. He nudged two small stars towards each other and made them collide. True story.


Can't place a second bounty after grace period.

Question: I posted a question on Christmas and placed a bounty on it. I'm planning to re-bounty the question for 100 points today, but the system isn't letting me do that. Also, it is saying "award this bounty to the best eligible answer as soon as possible" when there is no answer. Is the website supposed to work this way? If so, why?
Comment: That is odd... The bounty banner is visible to me and it says, "Answers to this question are eligible for a +50 reputation bounty. Bounty grace period has ended." Sounds contradictory... Maybe wait for up to 24 hours and see if you're able to set a bounty after that.
Comment: I started the second bounty, but it appears that the first bounty expired $68$ minutes late.
Comment: I'm actually happy that this bug occurred because now the meta post would draw attention to the question that I was planning to bounty for extra attention.
Answer: Regarding the site saying to award the bounty as soon as possible, even though there's currently no non-deleted answer, I suspect that's because there might still be a new answer that's posted before the bounty expires. In particular, it's a reminder for you to check for, and be aware of, any last minute answer that you might consider appropriate to award the bounty to.
Note that since your original bounty was not manually awarded, it would only expire when the next check for auto-awarding runs after the grace period ends. The network Meta's Time before bounty awarded automatically post has animuson's answer which states:

The check for bounties runs once an hour. Just looking at data here, all automatic awards seem to take between 1 and 2 hours from when the bounty ended to occur. I honestly don't know why there's always an extra hour delay; there must be an explicit check that is an hour off somewhere (as in the script that checks eligibility for auto-award seems to be looking for questions that have had the bounty an hour longer than when the grace period actually runs out).

Thus, the $68$ minutes in your comment of

I started the second bounty, but it appears that the first bounty expired 68 minutes late.

is consistent with the $1$ to $2$ hours timeframe mentioned in animuson's answer. This likely means the problem, that was there in $2017$, of at least an extra hour delay hasn't yet been fixed. Considering how relatively minor this issue is, I'm not surprised it hasn't yet been checked into and taken care of.
Comment: There was a last-minute answer, but it was completely stupid.


Linear Algebra Tetrahedron Centroid 3/4 Down Segment Proof

Question: Here is the question:

Show that the centroid of the four vertices of a tetrahedron (a solid with four vertices joined by six lines that bound the tetrahedron's four triangular faces) is the intersection of the following seven lines:
a) It is $3/4$ of the way from the vertex of the tetrahedron along the line segment joining the vertex to the centroid of the opposite face.

Basically what it means is if there is a line segment starting from one of the tetrahedron's points to the centroid of the point's opposite triangle face, the centroid would be placed 75% into the length of the line (if line segment is $4$ units long, centroid would be at $3$ units).
I spent the day thinking about it so it's not that there's no work, but the work doesn't feel very close to the answer at all.  I apologize for that.  Here it is:
Properties of a tetrahedron:

Equilateral triangles compose the 3D shape.  Faces = same shape

Due to symmetry, a height line intersects the centroid of the house triangle (basically tetrahedron $PQRS$ with $G$ as the centroid of its base triangle, $PG$ would equal to its height, $A$ being the top vertex)

Base of the vertical triangle composed of $P,\, G$ and another vertex is equal to $1/2$ the length of the median of the base triangle.

Height and base of the vertical triangle are not equal because the vertical triangle is isosceles whereas the base triangle is equilateral (although they are both related to bisectors)

Now that's over with, onto the solutions.
$3/4$ down $PG$ is the centroid, and also the midpoint of the midpoint.  i.e. the midpoint, $x$, of $PG$ is $\frac{1}{2}(P + G)$, the midpoint of $x$ and $G$, call it $u$, is $\frac{1}{2}\left(\frac{1}{2}(P + G) + G\right) = \frac14 P + \frac34 G$. Remember, $u$ is the location of the supposed centroid.
$3/4$ down the line between $Q$ to the centroid of the face of its opposite triangle, you measure it the same way and get $v = \frac14 Q + \frac34 a$.
Now that I've got the location of the midpoint of the midpoint, I think I will need to prove that it is a centroid by proving that the two dots are equal.
I did manage to prove vectors $QA = PG$, but that process is so tiring and I'm not sure if two equal vectors have any meaning for my solution, so I'm refraining from posting the entire proof until needed.
It's late and I'm dead tired.  Please someone help me a little.
Thank you.
Comment: Hmm the topic must be bad...even I can feel it.
Comment: It's a good topic, and you've done well! It just is indeed late :)
Answer: Let $O$ be the tetrahedron centroid and $G$ be the centroid of face $QRS$, opposite to $P$. Then:
$$
G={Q+R+S\over 3},\quad O={P+Q+R+S\over 4},
$$
so that:
$$
P-O=P-{P+Q+R+S\over 4}={3\over4}P-{Q+R+S\over 4}=
{3\over4}P-{3\over4}{Q+R+S\over 3}={3\over4}(P-G).
$$


Send input to all screen windows

Question: Is there a command in screen to replicate a command to every window? I'd like to send something such as 'reboot' to every window at once. Is this possible?
I've seen talk about the 'at' command via screen, but I don't know if this is correct or not, or I can't get it to work.
Answer: Yes, the at command is what you want. If you're using the default settings, then C-a : gets you to command mode, at which point you can enter at # stuff reboot. See this guide or the at and stuff descriptions in the CUSTOMIZATION section of the screen(1) man page for more details.
Answer: If you are already using screen, then it is probably worthwhile to solve your problem with the tool you are already using and is something that is commonly packaged for linux distributions.
If you want to consider a different approach, you could try ClusterSSH, which allows you to connect to multiple SSH sessions simultaneously and issue commands to all sessions from one control window.

Send input to all screen windows


Can I assess proportional hazard assumption by Schoenfeld's method in the time-dependent Cox model with restricted cubic spline?

Question: I am considering a survival time analysis with death as the outcome. I first performed a time-dependent Cox regression with BMI as the independent variable (linear model). The likelihood ratio test confirmed a significant improvement from the null model. Proportional hazard assumption was evaluated using Schoenfeld's method, and significant deviations were confirmed. Therefore, a time-dependent Cox regression was performed again with BMI as a restricted cubic spline (df=3) in the model (spline model). The likelihood ratio test confirmed a significant improvement compared to the linear model. I evaluated this spline model with Schoenfeld and found no significant deviations. I am not sure if I can assess proportional hazard assumption by Schoenfeld's method in the time-dependent Cox model with restricted cubic spline. From this result, is it safe to say that there is no significant deviation of proportional hazard assumption in the spline model? I would be grateful if you could enlighten me.
Comment: I've only seen examples of using the Schoenfeld residual PH assessment in models without time-dependent covariates.
Answer: With at most a single event possible per individual, the counting-process data form used to fit a Cox model with time-varying covariates "is just a mechanism, a trick almost, that allows the program to select the correct $x$ values for [an individual] at a given time" (Therneau and Grambsch, page 70). All that matters for such a Cox model is the set of covariate values in place among members of the risk set at each event time.
With that in mind, there's nothing wrong with using scaled Schoenfeld residuals to evaluate proportional hazards (PH) in your situation. Your identification of a violation of PH in your initial model with time-varying covariates led to a more realistic nonlinear functional form for association of the BMI covariate with outcome. That's good.
You do, however, need to be very careful in considering whether all that matters is the set of covariate values in place among members of the risk set at each event time. Death is more likely to be a function of risk factors integrated over time, rather than an instantaneous covariate value.
You also need to evaluate the direction of causality in such a model. For example, a cancer patient with cachexia might be developing progressively lower BMI until death. How much sense does it make to use BMI as a predictor of death in that case?
Such assumptions are probably more important than the PH assumption.
Comment: I understand that using scaled Schoenfeld residuals to evaluate proportional hazard (PH) is not a problem in my situation.
Thank you for your further detailed advice. It is very helpful.


How can I calculate remaining battery life time with arduino

Question: I want to display a 3.7V battery's remaining life time on LCD screen using arduino. Like a laptop does. 1h 23m remaining or others. Do I need any kind of module to measure the thing? Can anyone tell the method please?
Answer: you may use ADC(analogRead) to measure Li-Ion Cell voltage. unlike Ni-Cd or Ni-Mh batteries, a Li-Ion Cell Voltage is a good measure for battery status. the discharge cycle of an usual Li-Ion cell Starts at 4.2v(full charged, better avoid that!) which quickly comes down to 3.7v. it remains about 3.7 volts most of the cycle and at the end, comes down again to about 2v which battery protector circuit cuts battery off circuit.
but if the Arduino itself is powered from li-ion battery, it can't measure the battery voltage as the ADC Reference is the current varying cell voltage itself. in this case you need to set VREF of Arduino to a lower internal constant reference(1.1v):
https://www.arduino.cc/reference/en/language/functions/analog-io/analogreference/
and implement a voltage divider

simulate this circuit – Schematic created using CircuitLab
now you can measure cell voltage compared to a fixed reference. a full battery of 4.2 will be read in ADC as about 1000 (4.2* (1/1+3.3) * 1024). 3.7 should be read about 880 and 2.2v (if the Arduino is still ON!) will be read 500 in ADC unit.
Comment: Note that the discharge curve of a lithium battery isn't linear. So you'd have to do some additional math to convert the battery voltage to a percentage-of-charge. Also, don't discharge a battery to as low as 2.2V, as that will degrade the battery.
Comment: but sir this is the method for getting the battery voltage I guess... I need to print the remaining time of the battery life...
Comment: @Shojib the cell voltage for "Lithium" cells is a good representation of the battery status.(unlike NiMH) many applications like mobile phones use this method of calculation.


Making sprite bounce in an angle in box2d

Question: In the game I'm trying to make, I have a ball sprite which bounces thanks to box2d. Here's how my current code looks:
<code>-(id)init
{
    ball = [CCSprite spriteWithFile:@"ball.png"];
    ball.position = ccp(150, winSize.height * 0.78);
    [self addChild:ball];
    ball.tag = 2;

b2BodyDef ballBodyDef;
ballBodyDef.type = b2_dynamicBody;
ballBodyDef.position.Set(150/PTM_RATIO, 450/PTM_RATIO);
ballBodyDef.userData = ball;
_body = _world->CreateBody(&ballBodyDef);

b2CircleShape circle;
circle.m_radius = 26.0/PTM_RATIO;

b2FixtureDef ballShapeDef;
ballShapeDef.shape = &circle;
ballShapeDef.density = 0.5f;
ballShapeDef.friction = 1.0f;
ballShapeDef.restitution = 1.0f;
_ballFixture = _body->CreateFixture(&ballShapeDef);

b2Vec2 force = b2Vec2(160, 375);
_body->ApplyLinearImpulse(force, ballBodyDef.position);}

- (void)update:(ccTime) dt {
if(_isPaused == FALSE)
{
    _world->Step(dt, 10, 10);
    for(b2Body *b = _world->GetBodyList(); b; b=b->GetNext()) {
        if (b->GetUserData() != NULL) {
            CCSprite *sprite = (CCSprite *)b->GetUserData();
            if(sprite.tag == 2)
            {
                sprite.position = ccp(b->GetPosition().x * PTM_RATIO,
                              b->GetPosition().y * PTM_RATIO);
                sprite.rotation = -1 * CC_RADIANS_TO_DEGREES(b->GetAngle());
            }
        }
    }}
</code>
Bouncing itself works fine, my problem is there are instances wherein the ball would bounce on a straight line so to speak, either vertically or horizontally continuously which I am trying to avoid. So my question is, how can I make my ball sprite bounce at an angle instead of a straight line so it wouldn't get stuck bouncing infinitely in the same direction?
Answer: You could apply a tiny force or gravity change to the body or the world, "randomly" or at equal intervals.


ADB can detect devices but it can't detect device in recovery move

Question: I am using mac.
I am trying to install twrp on my Galaxy Note 8.0 GT-Nn5120, via adb. ADB can detect the device when in normal mode but when i boot into recovery mode, it can't detect the device.. What do I do
Comment: Are you using the stock recovery? It's possible that you have to use another recovery such as TWRP to use ADB in recovery. From my experience you need to install the recovery using ODIN.
Comment: I'm using stock recovery, I want to flash TWRP but I'm using mac so I can't use odin, how can I do this?
Answer: You can't ADB in recovery mode, not with a stock recovery. You can only ADB Sideload which is used to flash zip packages (updates, gapps, etc). To install TWRP, you need to flash it in Download mode.

Download TRWP or here
Boot in Download mode (Hold volume down then briefly press the power button. Press Volume up to confirm).
Download and unzip Odin then launch it.
Click on PDA or AP button and select TWRP file you downloaded previously (Should be in .tar format. If in zip, unzip it)
Click on Start button
When you see PASS, disconnect the phone and power on (Hold volume up this time: you should boot in TWRP recovery )
Comment: As a side note, a stock recovery doesn't allow sideloading flashable zips that are signed by anyone other than the manufacturer.
Comment: how do i use odin if I am on mac?
Comment: On Mac you'll need Heimdall. It's the Mac equivalent of Odin (Windows). @L.Tommy
Comment: lol can't install heimdall because "not compatible with this version of OS". I give up, i'll just settle for nova launcher and icon packs
Comment: Oh, sorry to hear that


How do on kill sigils work together?

Question: I have a Superior Sigil of Life (gain a charge of +10 healing everytime you kill a foe (max 25)) in my main hand and a Major Sigil of Restoration (gain health on killing a foe) in my offhand.
I assumed they should perfectly work together as the off hand sigil isn't stacking, yet they don't. I don't gain health on kill unless I change my main hand.
I am now confused as to how 'on kill' sigils work together as the wiki only mentions that you can only have 1 stack active. Is it normal that they don't work together or a bug?
Answer: On-kill sigils have stacks of up to 25 (you'll see a buff that stacks up to 25) which reset when you die. You should get hp when you kill an enemy, as well, as there is no reason for these two particular sigils to not work together as they don't share the same internal cooldown (ICD).
Comment: That's what I thought but I don't get hp, hence my question..
Comment: According to [the wiki](https://wiki.guildwars2.com/wiki/Sigil_of_Restoration) it might not work if you don't get XP from the kill?
Comment: I've read that too so I made sure to check I got xp from the kill.

How do on kill sigils work together?


Story by two people, but written by one... whose names go on cover?

Question: My friend and I conceived of a story, a world, and set of characters. We started an LLC partnership so that this IP is split evenly. We then decided person B would write a book based on the story we talked about. Would both our names go on the cover of the book, and then inside the book we detail that Person B wrote it, or would only the author go on front, and inside we say "Story by 'A' and 'B'" and then "Written By 'B " under that?
Answer: That's up to you. Think about what authorship means and discuss the consequences.
James Patterson, who has written many novels on his own, now only outlines the stories and lets other people write them. Yet he is named as the main author on the book covers. That is probably for marketing reasons, but it also means that he is perceived as the author of the book by the readers. They are his fans, and not fans of the actual writers. Also, Patterson alone owns the copyright (as indicated in the edition notices).
Writers Daniel James Abraham and Ty Franck publish under the joint pseudonym James S. A. Corey. No one knows how many ideas each of them has contributed or how many words each of them has written.
Other, usually celebrity "authors" have their books ghostwritten by someone who isn't mentioned anywhere in the book.
All these and many more options are open to you. Who actually wrote the book is largely irrelevant. What I would recommend is that the two of you

decide how you want to present authorship to readers and media, that is, whose name is going to be the author brand name and will receive the accolades, and
negotiate and sign a written contract both regarding copyright and royalties.

You might want to consult a lawyer if you think your book might become a bestseller and get turned into a movie or media franchise, that is, when lots of money and far reaching decisions might be involved.
Answer: In screenplays, there is a protocol for this.
They divide the task into "Story" and "Screenplay". The story is the development of the plot and the characters.
The "screenplay" is the actual writing of scenes and dialogue, specifying some special effects, etc.
Now, in a screenplay, the word "and" and the symbol "&" mean different things.
"And" indicates independent work. If the attribution reads "Story by Andy and Bill and Charlie", then in that order, Andy originated the story, later and without Andy, Bill worked on the story, and then later and without Andy or Bill, Charlie did the final work on the story.
On the other hand, "&" means they worked together. So "Story by Andy and Bill & Charlie", then Andy originated the story, and later without Andy, Bill & Charlie worked together to revise Andy's story.
Same rules for the Screenplay.
The exception in Hollywood is that if a work is done for hire, paid by a studio, then the studio gets credit for that work, not the writer they hired.
In print and novels, some authors do the same; devise stories and characters, and then hire writers they supervise and edit to produce the book. Depending on the contract, they may or may not give the ghost writer credit; many very good ghost writers are willing to take a big paycheck and maybe a share of royalties and give up attribution.
A similar thing happens in both comedy and song-writing; for many stars, their jokes or their songs, music and lyrics, are ghost-written, purchased and perhaps modified by the performing artist to fit their style.
In your case, the proper attribution would be "Story by Guy1 & Guy2, Screenplay by Guy2."
For a novel, you'd probably list "Story by Guy1 and Guy2" on the cover, and inside, "Story by Guy1 and Guy2, written by Guy1".
Personally, I think the story is the part that requires the most imagination and deserves the most credit. Writing is certainly a valuable skill and a critical contribution, nothing happens without a written work.
So this may just be my personal preference. I do both, and figuring out how to portray a scene isn't easy, but I feel the most creative and inspired when I am inventing the story. That's where I feel like most of the value in the story lies.
Congratulations on finishing a work, by the way, and don't alienate your writing partner by trying to hog most of the credit.


Where goes signal sent to process which called system?

Question: Given a very simple ruby script:
child = fork do
  system 'sleep 10000'
end

5.times do
  sleep 1
  puts "send kill to #{child}"
  Process.kill("QUIT", child)
end

QUIT signal is just lost. Where does it go? Something with default handler which just ignores it?
How to send signal to all processes created by that fork? Is it possible to do that without searching for all child processes?
Answer: The problem is that the system call creates yet another child process running the given command in a subshell, so there are actually three processes running in your example.  Additionally, the Ruby Kernel#system command is implemented via the standard C function system(3), which calls fork and exec to create the new process and (on most systems) ignores SIGINT and SIGQUIT, and blocks SIGCHLD.
If you simply call sleep(10000) instead of system("sleep 10000") then things should work as you expect.  You can also trap SIGQUIT in the child to handle it gracefully:
child = fork do
  Signal.trap("QUIT") { puts "CHILD: ok, quitting time!"; exit }
  sleep(10000)
end

If you really need to use a "system" call from the child process then you might be better off using an explicit fork/exec pair (instead of the implicit ones in the system call), so that you can perform your own signal handling in the third forked child.
Answer: I think that you are sending signal to fork process corectly. I think that the problem is with the system command. System command creates new fork and waits until it ends and I think that this waiting is blocking your quit signal. If you run your example as test.rb you'll see three processes:

test.rb
test.rb
sleep 10000

If you send signal "TERM" or "KILL" instead of "QUIT" the second test.rb will die but sleep 10000 will continue!


VPN , clients connect but no network

Question: I have a Server Essentials 2012 server that has anywhere access enabled for VPN access, and web access. this has worked fine for a year with no problems that the occasional tickle would't fix. About 1 week ago I added a 2012 r2 standard to the domain as a hyper-v host. with the intention of transitioning services to VM on this host and retiring the essentials server. that went fine, no problems. I added a vm on this host and installed the RDS role to work on transferring an access database we serve to offsite employee's. This didn't work as planned due to licensing issues, but no other problems i could find. This morning I get an email from a remote employee saying they could not connect to the vpn with error 812. the connection was prevented by a policy configured on your RAS/VPN server. After a "repair anywhere access" from the dashboard, he could connect, but cant connect to any host on the lan. He cant ping any server by IP, FQDN, Computer Name, nothing. I have now established that no client can "see" the network or ping any host, even though they are connected to the VPN. I don't know if Adding a Terminal server to the domain hosed the VPN, or what. I checked DNS and everthing looks as expected. I have made no changes to the Essentials server. This is a major problem and I need Help!
Comment: Can you give routes
Answer: I had a similar issue... What I had to do was tell the connection to not use the remote gateway to connect through internet. On the XP machine (works on Vista and 7 also) go to the properties of the VPN connection. Click on the Networking tab and double click Internet Protocol Version 4 (TCP/IPv4). Click Advanced and uncheck the box for "Use default gateway on remote network." This will route all of your local traffic through whatever network you're locally connected to, and any remote traffic through the VPN connection. This also assumes that you're not trying to route your internet traffic through the VPN. Also I would like to suggest you to try some other VPN services providers. Currently I am collecting all information about VPN from https://anonymweb.co.uk/. Here you can read different types of articles. I will be back after completing this.

VPN , clients connect but no network


How to do Islamic Conquest in This Postmodern Era

Question: God has approved the Muslims to do Conquest not for worldly gain but to make the area that is not submit to the Authority of God become submissive to His Authority. Imagine if the conquest of Europe and US is successful, there will be much much less drug industry, obscene movies/music industry, less white supremacist, and most importantly the world economic system will not be backed by riba anymore, and certainly other wisdoms as well. So what is the practical steps to do the Conquest in this era (preparations, rules, etc)?
Comment: @Hassanal Shah - As per Islam, defending Muslims currently being oppressed takes priority over initiating new conquests.. otherwise you will be biting off more than you can chew. So first Muslims need to unite and deal with those issues first.
Comment: This doesn't look like a subjective question. Please check our [help] to learn what is on-topic and what we regard as a constructive question.
Answer: Conquest can be done but first we need an Islamic State (Khilafah). It is that simple. And we need to understand what conquest really means... The concept of Conquest in Islam is quite different from Western one... The West view conquest as overbearing dominance, whereas Islam sees it as removing the physical obstacles preventing the spread of Islam to other lands. Hence, we see that British and American dominance did not bring good to the world, but Islam's did.
Comment: Ok we need to create Khilafah
Comment: alhamdulilah this the correct answer and an excellent one.
Comment: Khilafah is not created, my brother rather established but I assume that is what you mean. Indeed, we need to establish Khilafah because all classical islamic scholars have agreed unanimously on its obligation. Read scholars views and statements https://www.islamiqate.com/3694/how-did-the-classical-scholars-define-the-term-khilafah


What does the number of orbitals in a subshell represent?

Question: s subshell has 1 orbital and p subshell has 3 orbitals. Does that mean that there is a high probability that the electron is in the p subshell? As orbital are the space where there is a high probability of finding electrons.
Answer: Short answer
Number of orbitals does not have direct relation to either probability of  electrons occupying them, either the space they are describing.
The related probabibility is to be understood as:
IF the electron is in the quantum state, belonging to the particular orbital, THEN the wave function of the orbital describes spatial distribution of the electron  occurence probability, what is geometrically illustrated by the orbital 3D shape.
Longer answer
There are 3 meanings of the term orbital:

A complex wave function $\Psi$ being a particular solution of the quantum wave equation
A quantum state of an electron, following 1., described by particular quantum numbers $n$, $l$ and $m$, representing discrete values of electron energy, orbital angular momentum and one of component of angular momentum, respectively.
3D shape, following 1. and 2., representing statistical  probability of the electron presence at given point by$\Psi^2$, determined by the conventional value by residual external probability and by the isoprobability surface.

If there is 1 orbital 2s and 3 orbitals 2p, it means,
for  $n=2$  and $l=0$, there is 1 value $m=0$.
But for $n=2$  and $l=1$,
there are 3 values $m=-1,0,+1$
Electrons are fermions with half integer 4th spin quantum number $m_s$, and every electron in the atom must have unique set of quantum numbers.
Therefore there can be 2 electrons in the orbital 2s, having $n=2$, $l=0$.
But there can be up to 6 electrons in 3 2p orbitals, having $n=2$, $l=1$.
Comment: Good answer, but I have a feeling this explanation is not suitable for OP's level.
Comment: You are right, I sometime let the topic to lead myself too far.


Compatibility of CORBA implementations

Question: As far as I know there were problems with incompatible CORBA implementations in the past resulting from different interpretations of the specification. How is the situation today? Can I expect two different implementations to interact without problems?
Answer: I worked with corba stuff for the last 8 years. Its a standard (ASAM ODS OO API) and uses Corba to implement the API between server and clients.
We din't find incompatibilities till a long time. (java, jorb, mico, omniorb / C++ / Java)
When we started there were mainly problems with the nameservices (different port, ...) but we didn't figure out any real incompatibility till then.
I think the difference between the different orb implementations may be the features that are represented by the implementation.
What is still there is that speed of the different implementations differ.
Comment: Hi Totonga, I would like to ask you a few question about ASAM, if you've got a bit of time for me, that would be nice. Don't hesitate to join the [ASAM room](http://chat.stackoverflow.com/rooms/81001/asam)
Answer: At the time I was testing Sun's (now Oracle's) CORBA implementation (Java SE 1.4.0) compatibility with my own, I have discovered that Sun's CORBA it is not properly switching from big to little endian (CORBA must be capable of processing both big and little endian messages, determining the byte order from the header). C-based implementation that send the first message using little endian default would have not been able to talk.
The issue has been reported as bug 4119129 and seems fixed now. I am posting because maybe somebody has tried at that time and remembers that it did not work with.
At that time, this was one of the reasons to use JacORB instead.

Compatibility of CORBA implementations


In UC Browser I am unable to download after display lock

Question: i am using Latest Microsoft Lumia 640 XL for last 2 months . I am unable to download in UC after Display Lock.  Why?
Comment: Do you mean "unable to download whilst screen is locked", or "unable to download after the screen is unlocked"
Answer: You can choose option "Background Download" when options comes when a list appears and you press download in UC Browser. In case of choosing "Regular Download" this problem occurs.
Hope you got your answer!
Answer: You may try UC Browser PC version.
its downloading function is more stable than phone.
also it can download Facebook videos.
here's the link to the official website: http://pc.ucweb.com/?from=ghx0005


How to lay out Gerber files for rigid-flex PCBs

Question: I want to move to rigid-flex PCB design for our product, to eliminate need for the FFC cables we currently use.
I have found vendors providing this service but I cannot find any information on how to lay out Gerber files.
My application had 3 rigid boards.  The "mother" board has 4 layers, with 2 x 2 layer "daughter" boards, and single-layer interconnects which should be flexible.
Is there a standard for how to define this sort of design, i.e. which areas are rigid, and which are flexy?
Comment: I would ask the vendor you talked about - if they want the business they'll be only too pleased to assist.
Comment: You don't lay out gerber files; gerber files are an output file format from a PCB tool.
Comment: Ok, thats a semantic point.  I need to generate gerber files which define the flexible/rigid areas.  By layout, I mean what information should I put in these typically for a rigid-flexy design?  Presumably I need to define extra dimension gerbers to show the outline of the separate rigid and flexible areas?
Comment: Talk to the PCB vendor. Ask them how they like teh sections delineated. When you're ready to go, have them look at the Gerbers and an overall drawing describing what you want and ask them if they need further calrification.
Comment: I did ask, but being a Chinese fab house I can't call anyone, and so far they haven't been forthcoming on messages.  I was hoping there was a standard, but seems not..
Answer: Rigid-flex boards are still so outrageously expensive that vendors should be able to work with you to get a mutually acceptable solution.
Last time I did one, I used Altium which has specific features for rigid-flex but I think you could do it simply by laying out a multilayer board with internal (typically) layers designated as FPC. You could demarcate the rigid and flex areas on a mechanical layer just as you would define an outline. Of course the stackup has to be described fully, and any mechanical features such as stiffeners, so either a mechanical layer with a lot of text or a mechanical drawing. I used a proper mechanical drawing with tolerances, showing all the details. The stackup in my case had a core of a polyimide circuit with coverlays in the flex area and FR4 layers on either side in the rigid sections, but there are various possibilities depending on your vendor and budget.
Comment: Thank you.  I had asked a generic question (Chinese fab house) and didnt really get anywhere with them yet.  I think I'll do as you say, lay it out using mechanical layers to define extra information then once its in for them to look at I can itterate on design info.  Thank you!


Wiring single pole switch

Question: I have an outside switch to control a light in the garage. The white wires are connected in the box and there is one black and one red wire. How do I connect them to a single pole switch.
Answer: If this is the way you found it and you're sure there used to be a switch there, connect the black wire and the red wire to the two screw terminals on a single pole toggle switch.
If you're not sure, then remove the wire nut from the white wire and test for 120 Volts between the black wire and the white wires with a multi meter. Also check for voltage between the red wire and the white (there should be none). Trace the red wire to the garage light to verify it's for the light.
Turn the breaker on only when checking for voltages and leave it off when doing any work or mounting the switch into the box.

Wiring single pole switch


Is consent necessary for sexual relations with a concubine?

Question: Is consent before sex needed in sexual slavery and does the sex slave woman have to give her consent in the case of her master wants to marry her?
Comment: Salam and welcome to IslamSE the Q&A site about Islam. To learn more about our site and model consider taking the [tour] and checking our [help]. A master can't marry his slave in Islam. He needs to free her first. As for having intercourse her consent is not necessary needed however there are some rules to take care of. See [Are Muslim men allowed to have sex slaves?](https://islam.stackexchange.com/questions/649/are-muslim-men-allowed-to-take-sex-slaves).
Answer: It can be ethically desirable to seek the slave's approval but her consent is not legally required.
The Quran gives a parable of a slave as follows:

عبدا مملوكا لا يقدر على شيء
a slave owned (by someone), who has no power over anything
— Quran 16:75

This implies that a slave does not have any agency. Slaves are enslaved without their consent. They are bought and sold without their consent. They are made to perform labor without their consent. Their earnings are taken by their owners without their consent. Hence their consent is not of consequence in any matter - and there is no reason to assume that sexual intercourse is any different.
Sexual intercourse is a way in which a master gains a lawful benefit from his slave - hence it is analogous to other means of obtaining benefit like sale or labor. Consent is not required in those means so it also does not matter here.
Verses like 4:3,  4:24, 23:6, 33:50 give a categorical permission to have sexual relations with concubines, there is no other verses or hadith which imposes the condition of consent - hence it can be deduced that consent is irrelevant.
Scholars have noted that it is obligatory on a concubine to submit to her master:

ويجب على المملوكة أن تمكن سيدها من نفسها للاستمتاع، ويحرم عليها الامتناع من ذلك لأنه منع حق
It is wajib on a female slave to provide herself to her master for sexual intimacy and it is haram for her to stop him from it - because it is his right
— Mawsoo'ah al-Fiqhiyyah

An act being obligatory (and refraining from it being haram) means that the person does not have a choice to refrain from it. Lack of choice means that her consent is not relevant.
A master can punish a slave for her refusal to have intimacy:

وكذلك الأمة ليس لها أن تمتنع من تلبية رغبة سيدها إلا من عذر ، فإن فعلت كانت عاصية ، وله أن يؤدبها بما يراه مناسباً وأذن الشرع به
It is not permissible for a concubine to deny intimacy to her master without a valid excuse, if she does this then she is disobedient sinner. And it will be permissible for her master to discipline her in a way which he think appropriate and is permissible in shariah
— islamqa

فإذا امتنعت الزوجة أو ملك اليمين عن المعاشرة بلا عذر شرعي، فحينئذ يجوز للزوج أو السيد إجبارها على ذلك
If a concubine prevents her master from having intimacy without a valid excuse then it is permitted for her master to force her to do it
— islamweb

A master has sexual relations with her concubine without requiring 'marriage'. Indeed he can not himself 'marry' his concubine, unless he frees her first. However he can give his female slave in marriage to someone else. In this case he does not need to obtain her permission - because giving her in marriage serves an interest (keeping her chaste) and also has personal benefits for the master (such as receiving dowry).

وللسيد أن يجبر الأمة على التزويج بمن شاء السيد، واستثنى الحنابلة أن يكون الزوج معيبا بعيب يرد به في النكاح فلا يجبرها عليه
A master can force his slave to marry whomever he wishes, however the Hanbalis have made an exception when the groom has a defect
— Mawsoo'ah al-Fiqhiyyah
Comment: See my first line. It is the master's right so he can obviously forgive it out of kindness, indeed showing kindness is recommended and there are numerous ahadith on that and the verse  [4:36](https://quran.com/4/36?translations=20) also says that. What I am answering is the legal aspect, i.e. her consent is not essential.
Comment: The master receives mahr?
Comment: There is difference on this among the Malikis, but yes according to the majority it goes to the owner.
Comment: Always seemed to me using 16:75 as evidence was way too much of a stretch.
Comment: Isn't there room for magnanimity? None of this implies that the concubine is to be treated with injustice and cruelty right?
Answer: Good question, not getting consent and doing it against their wills can cause significant harm to their mental well being, in Islam you must treat slaves in good way not like that.
You Can't even Slap slave, Let Alone Raping Them
You are not allowed to inflict physical harm on slave, let alone raping them

I came to Ibn 'Umar as he had granted  freedom to a stave. He (the narrator  further) said: He took hold of a wood or  something like it from the earth and said:(freedom of a slave) has not the reward evert equal to it, but the fact that I heard Allah's Messenger (way peace be upon him) say: He who slaps his slave or beats him, the expiation for it is that he should set him free.

Source : https://sunnah.com/muslim:1657a
That being said, you can verbally order them around but if they resist it you can't use physical aggression to force them into it and later Rape them, it's similar to the hadith about angels cursing a wide who reject sex but the husband can't force himself on her if she refuses, the punishment is between her and God not her husband physically forcing her, same thing for here, raping them is contradicting several ahadiths and verses severely and goes against how it's commanded of Muslims to treat them well.
Answer:
And [also prohibited to you are all] married women except those your
right hands possess. [This is] the decree of Allah upon you. And
lawful to you are [all others] beyond these, [provided] that you seek
them [in marriage] with [gifts from] your property, desiring chastity,
not unlawful sexual intercourse. So for whatever you enjoy [of
marriage] from them, give them their due compensation as an
obligation. And there is no blame upon you for what you mutually agree
to beyond the obligation. Indeed, Allah is ever Knowing and Wise. Quran 4:24

So the main point is the gift(mahr) is accepted by the woman in presence of 2 witness before any sexual relation can take place. If the gift is not acceptable to the girl, no sexual relation can take place and what happens is rape and it is punishable in Islam.
Main point to note is the above verse is continuation of verse where the women who are forbidden is listed. So it includes captive woman also who can be married.


Trying to find file location of Mac Mail Smartboxes so that I can run automatic email archiver

Question: I'm currently working on a MacBook late 2008 with OS X Yosemite 10.10.3.
I use Mac Mail for my email.
I have created smart mailboxes to collect together emails that relate to a project number.
When the project is complete I want to be able to archive the emails into PDFs and store them on Dropbox.
I have purchased Email Archiver for the purpose.
Email Archiver needs the source folder destination and I can't find the smartbox location. I have looked in Library/Mail/V2/MailData and can see the SmartMailBoxes.plist but I can't see folders relating to specific smartmailboxes.
Anyone got any suggestions about how I can achieve this?
Is what I want to do possible?
Answer: The smart mailboxes aren't real mailboxes—they're just filters stored in Mail preferences. You can't find the location of the smart mailbox because it's not actually stored separately on disk.
Answer: el capitan = SyncedSmartMailboxes.plist


What is the meaning and application of ren'youkei?

Question: My knowledge about ren'youkei is limited to "tabe is the ren'youkei of taberu". I would like to know what the meaning of ren'youkei is, what linguistic idea lies behind this term and for what it is actually used in everyday usage.
Answer: The 連用形{れんようけい} ("continuative form") is one of the various 活用形{かつようけい} ("inflected forms") for 用言{ようげん} ("inflectable words") in Japanese.
The way I like to explain this is somewhat non-standard, but I think more coherent than how it is usually explained. I will connect this explanation back to the standard way at the end.

I think there are two things worth discussing:

The -I Form
The Continuative Form

The -I Form
The -I form is stem-I: the stem of an inflectable word plus the -I morpheme.
-I definition:

Vowel-stem verb: ∅
Consonant-stem verb: i
i-adjective: ∅

Examples:

Consonant-stem verb 思う: omow-I -> omo(w)-i -> 思い
Consonant-stem verb 行く: ik-I -> ik-i -> 行き
i-adjective 熱い: atsu-I -> atsu-∅ -> 熱
Vowel-stem verb 食べる: tabe-I -> tabe-∅ -> 食べ

The -I form feels a lot like a noun.
Uses:

The continuative form

See later for examples.

-sou and -sugi-

熱そう
行きそう
熱すぎる
食べすぎる

Compounding

早起き

Stand-alone nouns (I can only think of verbs here)

思い
考え
感じ

The Continuative Form
The continuative form (a.k.a., 連用形) is stem-I-CONT: the stem of an inflectable word, plus the -I morpheme, plus the -CONT morpheme.
-CONT definition:

Verbs: ∅
i-adjectives: ku

Examples:

Consonant-stem verb 思う: omow-I-CONT -> omo(w)-i-∅ -> 思い
Consonant-stem verb 行く: ik-I-CONT -> ik-i-∅ -> 行き
i-adjective 熱い: atsu-I-CONT -> atsu-∅-ku -> 熱く
Vowel-stem verb 食べる: tabe-I-CONT -> tabe-∅-∅ -> 食べ

Uses:

Adjuncts:

間違いなく怒っている。
優しく抱きしめる。
君のことを思い、彼を許した。

Conjunction (this form is known as the 中止形):

外へ行き、マスコミに話す。
空は青く、地面は茶色。

-te:

熱くて
食べて
思って (omo(w)-i-te after euphonic changes, namely 促音便)

Various auxiliaries, e.g.:

-mas-: 行きます
-tutu-: 直りつつ

While this is hardly complete, maybe it helps give an idea of what the 連用形 is. The way this stuff is usually taught, I think the -i form is often conflated with the 連用形, because the surface form is the same for verbs, but I think it makes more sense to split it out like this.
Comment: So, you're pretty much categorizing adjective stems under "i-form"? Interesting. Also, there are a couple of standalone nouns (doubling as adverbs) that come from 連用形 of i-adj, like 多く, 近く, 遠く, and 早く
Comment: What does "surface form" mean? And do verbs that have a su ending have a shi added to their stem form via continuative form?
Comment: @Toyu_Frey "Surface form" is in contrast to "underlying form". The underlying form is stuff like ik-PLAIN, where the surface form is iku. When you presupose morphemes that have null surface forms (like I do in this post) it's very easy to have a surface form which has an ambiguous parsing into underlying representations.
Comment: Also, your second question isn't precise enough to give a short answer without reexplaining some of the concepts in this post. Try again? (If you'd like.)
Answer: Japanese has two main categories for standalone terms: 用言{ようげん} and 体言{たいげん}.

用言 inflect: this category includes verbs, -i adjectives, and -na adjectives.
体言 don't inflect, and this category includes nouns, pronouns, and numbers.

These two terms form the basis of the terms for two different conjugations: the 連用形{れんようけい} and the 連体形{れんたいけい}.

連用形 literally breaks down as 連 "goes with / attaches to" + 用 short for 用言 + 形 "form" -- this is the form of the word (conjugation) that attaches to other words that also conjugates.
So when combining verbs into a compound verb, you use the 連用形.  Or when using an adjective (a part of speech that inflects) to modify another adjective or a verb (which also inflects), you use the 連用形.
Since this form (and the meaning of the underlying term) continues into the following inflected term, this is often glossed in English as the "continuative form".
連体形 literally breaks down as 連 "goes with / attaches to" + 体 short for 体言 + 形 "form" -- this is the form of the word (conjugation) that attaches to other words that don't conjugate.
So when modifying a noun or other non-inflected term with a verb or adjective, you use the 連体形.
Since this form is used to describe an attribute of the following uninflected term, this is often glossed in English as the "attributive form".

Notably, the 連用形 for verbs is sometimes used as a noun: for instance, 替{か}わり is the 連用形 for 替{か}わる, and it is also a noun meaning "replacement, alternative".
Also, the 連体形 and the 終止形{しゅうしけい} (literally "terminal form", the form to use when an inflected word is at the end of a sentence) used to be distinct, but these have become the same thing in modern Japanese (except for -na adjectives -- these use な for the 連体形 and だ for the 終止形).
For more about Japanese conjugation forms, see the Wikipedia article on Japanese grammar, particularly the bit on Conjugable words.
For more about older Japanese where these two forms were still distinct, see the Wikipedia articles on Classical Japanese language and Early Middle Japanese.
Comment: I like your answer in paritucar for mentioning 体言 and 用言 but I think there is a little typo: 蓮 (as in 蓮根) instead of 連 sometimes.
Comment: あら、変換ミス!すぐ修正します。


Which algorithm has been used in photoshop for RGB to CMYK convertion for an image?

Question: I have been facing a problem during conversion in RGB image to CMYK image. I know that the color gamut of these color space are not same. I would like to request you ,could you able to provide the basis algorithm of RGB to CMYK color space, so that I would able understand the conversion process, which will really helpful for my work.
Thanking you.
With Regards
I.Das
Comment: You would need to ask Adobe about their algorithm.. and it's just my guess, but I would imagine they consider that proprietary and not open to the public.
Comment: What do you mean by an algorithm? Are you a programmer? Are you making an application to emulate the mode conversion? Are you a graphic designer? Are you neither and you are simply converting color modes? The question as it means reverse engeneering of Adobe's mode conversion algorithm.
Answer: I assume that you already know RGB numbers control how much red, green and blue light are produced in a pixel of RGB screen. I also assume that you know CMYK numbers control how much cyan, magenta, yellow and black inks are inserted onto paper to make it colored or darker or both. I assume you expect a couple of formulas to convert RGB --> CMYK or reversed. Just two clear and exact formulas with no blahblah.
Unfortunately the blahblah starts now, because there's no unique conversion method. Every RGB display has its own color space (=the collection of produceable colors) and every CMYK print process has its own. You must know the used RGB version and the used CMYK version before any really useful conversion is possible between RGB numbers and CMYK numbers.
You can argue that Photoshop asks nothing, but changes the colors in a second when one changes the used color mode from RGB to CMYK or vice versa. Used versions are hidden to the color settings which define "color management". You find there numerous RGB  and CMYK profiles, which actually are complex pieces of computer software and define which is the connection between RGB or CMYK numbers and exact produced (=measured) colors. Photoshop actually even has one color mode which presents measured colors. It's Lab.
To make this all a little more confusing Photoshop can take into the account 4 color profiles in the same time. They are

one for the camera which took the photo
one for the space where your current photoshop job lives
one for your becoming print process
one for how your monitor displays colors

The last one is actually in the computer operating system. You must calibrate your monitor if you want to have it right. The first one comes as written into the photo file.
You can easily find quick and dirty conversion formulas such as https://www.rapidtables.com/convert/color/rgb-to-cmyk.html and https://www.rapidtables.com/convert/color/cmyk-to-rgb.html
They do not at all take into the account the used devices. They have a reasonable principle to select as high percentage of black ink K as possible to remove redundant C, M and Y inks and they surely show white paper with no ink at all when R=G=B=255. But for any realistic print preparation those formulas are poor. They assume a CMYK system which can produce exactly the same colors as your RGB screen and make a linear transformation between them (=linear after inserting as much K as possible).
In reality the used conversion must be highly non-linear for decent results. That non-linearity is written into color profiles.
When you understand all this, you may also understand why Adobe collects $millions despite the existence of GIMP. The latter knows nothing of CMYK printing altough it allows you to set colors with CMYK numbers.
ADD in May 2022: GIMP 2.10 understands CMYK print profiles, it can show the CMYK printing result and can show a warning if something is unprintable (=out of gamut) in CMYK. This all is availabe in the real time when one edits his RGB image in GIMP. The actual conversion to CMYK must still be done outside GIMP, for ex. in Krita, if one wants to use Freeware.
Answer: I am not sure you understand the question. I will try more than answering it, to explain what must be understood about color modes.

RGB and CMYK are not really color spaces, they are color modes. But I will not dive into it too deep.
The conversion from RGB to CMYK should be made ONLY if you need it, which making a totally imaginary loose guess is a tiny fraction of the times people think they should. Imagine there are 100 color printers in peoples offices, homes, etc. They all most likely do NOT need, and should not use CMYK.
2.1 You only need it if you are using some specific specialized printing service, normally for mass production, like offset sheeted lithography, or in some really limited cases some specific commercial digital services... (Which I have almost never encountered)
The RGB to CMYK in these particular cases (see 2.1) is not to cause problems... it is to solve them. The conversion is not meant to "Lose colors", it is meant to "simulate them when printed on a limited (printed) medium"
This "simulation" is made accordingly to some stuff called color profile, which is a series of parameters (matrixes and functions) to control the conversion which renders two things...
4.1 The amount of ink each plate (CMY&K) should have... according to a set of rules, for example, maximum accepted ink on the paper (or medium) TAC (Total area of Coverage), Dot gain, type of paper, absorption of ink, brand of ink (or the intended specification), transparency of it, etc.
4.2 How to simulate this on your application so you have an idea how it will look when printed.
As these conversions imply a squishy-squashy of the shape of the "color solid" there are different sub-methods to do it, depending on what do you want to preserve more. Colorimetric, relative colorimetric, relative something stuff vs some other colorimetric something stuff.
The conversion also can imply jumping into a 3rd color mode, Lab for example.
But you also can make some other conversions, like swapping RGB to CMY channels, changing the number of inks involved, and a big etcetera.

Sayed that... No. I do not know how the "algorithm" works None of the previous is the algorithm... (the algorithm uses these parameters) But I do not need it. I only need to understand when to use what. :o)
Answer: You need to implement a  color management system. Photoshop does not  really do the color conversion it  asks a CMS to do it for Photoshop. The system allows you to choose which CMS to use. You can  use Adobes CMS, apples CMS, microsofts CMS etc...
You should also defer the job  to a CMS engine. Why? Well because you will need to implement color profile to color profile conversion. This is quite much work since you need to write a tool that can undstand and execute different versions of ICC profile standards. Since each ICC profile is sort of a mini programming language, or at least a complex format, so this task is time consuming.
We simply can not give a formula. Because there is no formula. There is a system that allows you to describe the system you have and
letting the system combine 2 of these formulas for a transform. You need the entire system.
Use your operating  systems CMS, or use something like tiny CMS.


'$L$ almost' is regular

Question: Given a regular language $L$, I have to prove that '$L$ almost' is regular where '$L$ almost' is all the words which differ from the words of $L$ by one char.
for example, if $L = \{aab,aaa\}$, so $bab$ belongs to '$L$ almost' because it differs from $aab$ only by the first letter.
I have found this problem's solution and I simply can not understand the transition function.
If someone can explain it or maybe suggest a different one, that would be fantastic.
The most difficult part is the part of $t$,$t'$ so if you can be explicit when it comes to this part I would appreciate that.
Explanation of the picture (it's in Hebrew):
$L$ is regular so there is a DFA $M$ which defines it. They are creating an NFA based on the DFA by making two copies of the DFA, and moving from one to the other.
Any help understanding the transition function will do.
Thank a lot in advance!
Solution
Comment: See this [question](https://math.stackexchange.com/questions/1544749/proving-that-l-textalmost-is-a-regular-language).
Answer: If $L$ is regular, then consider a DFA on $L$. Make two copies of it $D_1$ and $D_2$ and consider the DFA $D_1\cup D_2$ letting the start state of $D_1$ be the start state of $D_1\cup D_2$. Let $a_{(D_1)}$ and $b_{(D_1)}$ be states in $D_1$ and let $a_{(D_2)}$ and $b_{(D_2)}$ be the corresponding states in $D_2$. For all $a_{(D_1)}$,$b_{(D_1)}$,$a_{(D_2)}$ and $b_{(D_2)}$, if $\sigma\in \Sigma$ and $a_{(D_1)}$ transitions to $b_{(D_1)}$ on $\sigma$ in $D_1$, then we will add the transition $a_{(D_1)}$ to $b_{(D_2)}$ on any character except $\sigma$ (i.e. $\Sigma - \sigma$) to $D_1\cup D_2$. Remove the accept states from $D_1$ in $D_1\cup D_2$. This NFA accepts exactly "$L$ almost".
The idea is that for any word in $L$, we want to make one "error" (the one letter off from the word in $L$). In our NFA, if a word is in $L$, then it will transition entirely within $D_1$ in $D_1\cup D_2$. However, an "error" will then transition to the corresponding next state in $D_2$. This means that a word is in a state of $D_2$ in $D_1\cup D_2$ only if it has an "error". We want to accept only the words that have one "error", so we remove the accept states from $D_1$ (since a word will only end in $D_1$ if it is in $L$).

'$L$ almost' is regular


Copy the last Emacs message into the current buffer

Question: Is there a function I could use to quickly copy the message in the echo area (if any) into my working buffer? Should I define the shortcut for that function with define-key or global-set-key or some other way?
Comment: So what you want then isn't the minibuffer contents. The minibuffer is where you type stuff, e.g. a file name when opening a file with `C-x C-f`. Messages from Emacs also appear in the [echo area](http://www.gnu.org/software/emacs/manual/html_node/emacs/Echo-Area.html#Echo-Area) but they're called messages.
Comment: Are you sure the minibuffer is what you want to copy? Which buffers to you want to act on exactly: from the minibuffer associated with the current window to the current buffer?
Comment: @Gilles correct; my use case is that I want to do a `C-c+z` (which I've bound to `show-file-name`) and then copy that content (i.e. the current file name) to my current buffer. Or that I can type in the buffer an expression like (/ 30.0 7.0), hit `C-x C-e` and copy the result to my buffer without having to copy the digits with the mouse.
Comment: @Gilles I guess you're right. I was confused because of it being the same spot. Thanks for updating the question.
Answer: The function current-message returns the message that is currently displayed in the echo area, if any. You can insert it with (insert (current-message)). However, anything that causes something else to occupy the echo area will cause current-message to return nil.
Messages from Emacs are archived in the *Messages* buffer. It would be more useful to grab the last line from there. This isn't perfectly reliable since it's possible to have a multi-line message, but that's rare: the message function is meant for short messages that fit in one line.
The following function inserts the last message (more precisely, the last line from the *Messages* buffer. With a prefix argument, it returns older messages: 1 for the latest message, 2 for the next-to-last one, etc. The argument 0 inserts (current-message) if any.
(defun last-message (&optional num)
  (or num (setq num 1))
  (if (= num 0)
      (current-message)
    (save-excursion
      (set-buffer "*Messages*")
      (save-excursion
    (forward-line (- 1 num))
    (backward-char)
    (let ((end (point)))
      (forward-line 0)
      (buffer-substring-no-properties (point) end))))))
(defun insert-last-message (&optional num)
  (interactive "*p")
  (insert (last-message num)))

Bind it to a key in the normal way. For example, if you want the command available on C-c m at all times:
(global-set-key "\C-cm" 'insert-last-message)

There may be easier ways than invoking two custom commands to insert the file name, see the Emacs wiki.
To insert the output from evaluating a Lisp snippet with C-x C-e, pass a prefix argument: C-u C-x C-e.
Comment: Good but would be nice if it handled multi-line messages.
Comment: I multi-line messages would be great, but I think that it would be even cooler to be able to cycle among the previous messages!
Comment: You could also change the function to push the last few lines of the messages buffer to a list and present it with completing-read (optionally, only do the completing-read when prefixed with a universal argument).


fail2ban with iptables-persistent

Question: I've been running fail2ban for a bit, and recently installed iptables-persistent and am using it with ipset for a blacklist (there's one particular IP that is always hammering away at this machine).  The ipset/iptables persistency was a bit of work on Ubuntu, but that part seems to be working.  My issue is now the following:
When I reboot the machine, my (relevant portion) iptables looks like this:
Chain INPUT (policy ACCEPT 682 packets, 84744 bytes)
 pkts bytes target     prot opt in     out     source               destination
  347 23254 f2b-sshd   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0            match-set blacklist src
  347 23254 f2b-sshd   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22

Chain f2b-sshd (2 references)
 pkts bytes target     prot opt in     out     source               destination
  694 46508 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

With this, I noticed also that netfilter-persistent.service was marked as "loaded failed failed" by systemctl even though it clearly loaded the rules files.  I tried editing my fail2ban service to load AFTER netfilter-persistent, and now netfilter-persistent is marked as "loaded active exited"...but the rules are still duplicated (apparently f2b creates the rules regardless of whether they already exist)
Manually editing this file each time I run iptables-save to delete the f2b entries is probably an acceptable option (particularly given that the consequences aren't all the grave if I forget to do so), but I'm wondering if there's a better option?
Answer: One solution has already occurred to me, but it's...a little hackish imo.  Create the following file and run it.  It relies on the f2b entries--and no others--all having "f2b" in them, and this script being run rather than iptables-save directly...
~/bin£ cat saveFilteredIptables.sh
#!/usr/bin/zsh
sudo iptables-save | perl -ne 'print if !/f2b/'
~/bin£

fail2ban with iptables-persistent


in pokemon black and white 2, which button takes me to the main menu?

Question: Im using an emulator and I need to delete my save, but I can't get to the main menu. All of the buttons I've pressed haven't done anything.
Answer: What you are asking for is typically called "Soft Resetting" and for DS games this is typically achieved by holding down the L and R shoulder buttons as well as Start and Select (for 3ds games it's Start or Select). This will return you to the startup screen.
Once at the startup screen (where the game display's the legendary and tells you to press start), there is a separate button combination to start the process of deleting your save; press Up, Select, and B at the same time, and then follow the onscreen dialogue, as it will ask you a number of questions to confirm if you want to erase the save, and a 'wrong' answer will abort the deletion process.

Alternatively, most emulators will have some sort of menu option that will manually reset the ROM, after which you can perform the in-game method to delete your save. Or you could close the emulator, and open up the folder where your ROMs (or sometimes, the 'BATTERY' folder in your emulator's folder) and delete the *.sav file for your ROM.


How do I create a wood texture?

Question: How do I texture wood so it looks like rough bark? I would like to imitate this texture:
Comment: In google find: 1. Blender UV Mapping. 2. Blender Principled BSDF. 3. Free Bark Textures. 4. Blender Displacement Modifier. For the first two and the last one any tutorial from youtube will be good. For the third one maybe you will need to dig a bit to find one with Base/Diffuse/Albedo, Roughness, Normal and Height map. That's it. Any of them steps are also pretty easy to find here on BSE. Even thread with Blender Resources.
Comment: There are a few textures in the image. What have you tried?
Answer: As LukeD mentioned, you could make your way with what he pointed out. Depending on your skill level, you may succeed or be completely discouraged.
There's a full tutorial from Andrew Price (blender guru) teaching the whole work flow of the steps mentioned in the later comment.
https://www.blenderguru.com/tutorials/how-to-create-realistic-bread
Yep, it's not for a rough bark but the work flow should help you taking care of some details and difficulties you may encounter during the process.
Replace all the words "Bread" with "Wood" and you'll be good to go!
I guess I saw some wood textures that may help you out on textures.com, it's free for low res.
Good luck!
Comment: This is just a link answer. You didn't do anything else than posting link to a tutorial. This should be posted as a comment.
Comment: Then how can I post a comment for now? Other than my own posts?
You basically blaming me of being unable to shake your hand while they are tied behind my back.

I didn't do anything but trying to help the best I could.  Have a wonderful day.

How do I create a wood texture?


Rank of adjacency matrix of twin-free bipartite graph and maximum matching

Question: Setup
The rank of the adjacency matrix $A$ of a bipartite graph is not directly linked to the size of the maximum matching, as shown in the following graphs;
$$
\begin{pmatrix}
0 & 0 & 1 & 1\\
0 & 0 & 1 & 1\\
1 & 1 & 0 & 0\\
1 & 1 & 0 & 0\\
\end{pmatrix}
\text{ and }
\begin{pmatrix}
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1\\
1 & 0 & 0 & 0\\
0 & 1 & 0 & 0\\
\end{pmatrix}
$$
both have a perfect matching, but the rank of the first adjacency matrix is 2 while the second has a rank of 4.
Rank $2n$ $\rightarrow$ matching of $n$
If the adjacency matrix has a rank of $2n$, we can show that a matching of size $n$ must exists as the maximum rank of the Edmonds matrix is at least $n$, and the maximum rank of the Edmonds matrix is equal to the size of the maximum matching. However, the converse does not hold, as shown in the first example.
Matching of $n$ $\rightarrow$ Rank of $2n$ for twin-free graphs
I wonder if the converse holds for bipartite graphs that are twin-free, meaning that no two nodes in the same part of the graph are connected to the sames nodes in the other parts.
In terms of the adjacency matrix, this implies that there are no duplicate lines or columns.
We can also assume that there is no node that is not connected (no all 0 line or column), and that there is no node that is connected to every node in the other part (no all 1 line or column in the upper right or lower left blocks).
Question
I have not been able to find a way to approach the problem, and have not found reference to this problem in the litterature. Any hint on how to try to prove that it holds or keyword recommendation (I might not know the correct vocabulary to search for this) would be appreciated.
And obviously any counterexample is welcome.
Answer: Cycles of length $4n$ with $n\ge2$ have perfect matching, no twins, but have rank $4n-2$.