GTK text box number entry

Question: I am trying to create a text box in GTK+3.0 (using C, in Linux) that can be read from as a double, where this double will be plugged into an equation and then returned in a different box.
So my question is: what is the best way to create a text box that can be typed into, and then how do I read it as a double?
I am currently trying to use gtk_entry_new() to initialize and - after a few intermediary steps - *gtk_entry_get_text to read.
My read line currently looks like this:
double y = (double)*gtk_entry_get_text(GTK_ENTRY(input_y));

I keep getting y as a pointer, and the *gtk_entry_get_text(...) is of format const gchar*
I believe the best way is to convert const gchar* into double, but how?
Answer: $ man atof
NAME
   atof - convert a string to a double

SYNOPSIS
   #include <stdlib.h>

   double atof(const char *nptr);

DESCRIPTION
   The atof() function converts the initial portion of the string
   pointed to by nptr to double.  The behavior is the same as

       strtod(nptr, (char **) NULL);

   except that atof() does not detect errors.

RETURN VALUE
   The converted value.

thus:
double y = atof(gtk_entry_get_text(GTK_ENTRY(input_y)));

GTK text box number entry


How show login popup to guest only and redirect logged in users?

Question: I have a menu item "Checkout". When clicked it links to the login popup prompting users to register/login/continue as guest and from there to checkout.
How can I make that same button redirect to the checkout page if a user is already logged in?
Using ELementor and Astra theme
Thanks!
Comment: What have you tried so far?
Comment: Welcome to WPSE. I suggest you [add more of context to your question and explain what you already tried, or at least the strategies you are thinking to use](https://wordpress.stackexchange.com/help/how-to-ask), to improve the odds of a useful answer and to comply to what is expected in the community. I also suggest you take a look at [How do I ask a good question?](wordpress.stackexchange.com/help/how-to-ask), the Code of Conduct and other articles in the help section: wordpress.stackexchange.com/help
Comment: I am new to this, I guess I need to add a php snippet, right? Basically, when clicking the menu item check if the user is logged in if false rediret to login popup if true redirect to checkout.
Answer: Probably somethin like this, but I don't know how to adapt it top my case:
add_action( 'template_redirect', 'dashboard_redirect' );
function dashboard_redirect()
{
if( is_page( home_url( '/min-konto/' ) ) && ! is_user_logged_in() )
{
wp_redirect( home_url( '/dashboard/' ) );
exit();
}
}
Comment: Please update your question - using the edit button - rather than add each update as an answer.
Answer: In a more "vanilla" setting (i.e. without a page builder and not using a modal or popup) you would have two basic approaches:

a) generating a different menu
b) redirecting from the target page

I would not generate a different menu because, in my experience, it seems a little more messy and less performant depending on the server and WordPress settings. I would use option B and I would not use the login in a popup/modal, using a function along the lines of the code you shared, but with a few tweaks:
<code>add_action( 'template_redirect', 'wpse381189_dashboard_redirect' );
function wpse381189_dashboard_redirect() {
    // make sure i) we are not in admin side ii) we are not doing ajax iii) user is logged in.
    if( !is_admin() && !defined( 'DOING_AJAX' )&& is_user_logged_in() ) {
        nocache_headers();
        wp_safe_redirect( home_url( '/dashboard/' ) );
        exit();
    }
}
</code>
If you still want to use a popup/modal, you would need to use a function that returns data telling the frontend the user status (i.e. logged in or logged out) and let the Javascript handle the redirection. But this might be a little bit difficult because you are using a non-core page builder, Elementor, which is off-topic in this community and depending on the template you using, make most of WordPress core hooks unavailable. In this case recommend you take a look at Using Ajax articles on WordPress official documentation and then find in the page builder documentation how to handle Ajax and add your own scripts to it.
Comment: Thanks, I ended up using different menues for logged in users as it makes more sense to me. I used this snippet: // Conditional Nav Menu

function wpc_wp_nav_menu_args( $args = '' ) {
if( is_user_logged_in() ) {
    $args['menu'] = 'logged-in';
} else {
    $args['menu'] = 'logged-out';
}
    return $args;
}
add_filter( 'wp_nav_menu_args', 'wpc_wp_nav_menu_args' );
Comment: Ok, glad I helped anyway. As you are using different menu everywhere, you might see a decrease in caching and increasing in resourcing usage, though.


Is it possible to install a ROM on /recovery instead of /system?

Question: I am not going to do it, but I just wonder whether it is possible to install a ROM to /recovery and TWRP to /system, so one would normally boot into TWRP and only boot into Android when one performs the key combination for recovery mode. Is this possible somehow and would it have any negative side effects?
Comment: Well since recovery partition size is usually 16mb then no it's not possible. Maybe you still can resize the partitions in order to fit a system on it, but question is would it work in practice, however it is possible but probably would be great pain in the ass and it's unnecessary to do so why bother with that.
Comment: It is possible to resize the partitions, but there's a large risk to brick your phone this way if you do it wrong. Let's say, one can manage to repartition the storage correctly and would install a ROM on /recovery instead of /system. However, the question is: Would it work properly?
Comment: Probably not, or if you want to make it work it would require a lot of customisation so it's not worth it. However see answer below maybe I was wrong about a way to do what you wanted to do
Answer: TWRP normally installs to recovery; kernel for the OS normally installs to boot; /system is another thing entirely where the majority of the files of the OS goes.
Doesn't change the conclusion for what you want to achieve though - yes, you can swap boot and recovery so it boots to recovery by default and boots to the OS when choosing "reboot to recovery" or using the key combo. At heart the two booting processes are both simply booting a kernel image. Note that this doesn't touch /system.
Comment: So you mean for a regular phone, one can swap `/boot` and `/recovery` to achieve what you said?
Comment: For what I've read, yes, if you can flash a recovery image to `boot` and boot image to `recovery` then the two will be swapped. Disclaimer: I never tried it on my own devices so take some caution.


Is it possible to find out why a user continuously down voting my questions and answer?

Question: Is it possible to ask a user why  intentionally he has been downvoting my answer without any reasons. Yesterday the same user not only downvoted my answer without any reason, but also he downvoted 3 questions within 2 to 3 mins without any reason. I never downvote any answer unless it is spam or rude and abusive. Can we ask him why is he doing that
Comment: How do you know it's the same user? You can't usually see who is downvoting.  If you have a suspicion I can look into it.
Comment: @JonathanReez and Ali - I've just gone through what is available to us as mods. If the system detects a systemic downvoting (or upvoting) pattern between two users, it shows it to us.  Currently there's nothing untoward that it's highlighted, sorry :/  We also can't look at individual posts and see who up/downvoted (that I'm aware ofi).
Comment: @MarkMayo OK thanks, that's mean down voting coincidentally occurred at the same time  and could be from different users. Also like mts answered we are not loosing anything here, also we are not gaining nothing here either besides reps. So chapter is closed and thanks for responding :)
Comment: @AliAwan it's still possible it came from the same user, just not enough times to appear on the radar :/  If it happens again, feel free to flag a mod and we can check the logs again for any flagged activity.
Comment: @MarkMayo these were the 3 questions downvoted within 3 mins. I believe this must be the same user who downvoted along with yesterday answer , all these occured at the same time
Comment: http://travel.stackexchange.com/questions/72225/highway-motorway-speed-limit-for-non-eu-tourist-in-germany   2, http://travel.stackexchange.com/questions/74521/how-to-purchase-japan-train-tickets-online-and-also-japan-scenic-itinerary    3, http://travel.stackexchange.com/questions/81885/what-to-write-in-visa-application-form-and-what-documents-to-submit-as-an-unregi
Comment: @pnuts I agree with with those 2 answers just pointed I received -1 three to four times, because those user were not agreed with my answers. Again I am not complaining about them, it looks reasonably suspicious if you have been down voted in 3 questions simultaneously in abrupt manner.  OK lets forget about it , if a user is happy with this manner let me do whatever he wants like mts answered, I am not loosing any thing here. I just use this site for fun because I love traveling and found this better than lonely planet and TripAdvisor.
Comment: @MarkMayo can mods see who downvoted a post?
Answer: There is (almost) no way for you to know which user downvoted you, and even less to ask them about it.
Downvoting is there for a reason (when you hover over the downvote button on an answer it says "this answer is not useful" and similar for questions) and some of us are happy upvoters, some of us rarely vote and some of us are infamous for voting down much more than up.
It would be nice of said user to provide a comment explaining why they did downvote but they have no obligation to whatsoever.
Your questions seem well-received and useful to me and I would not worry to much about it, you are not loosing anything here, even though I can relate that it is frustrating.
Let me on the other hand voice my own experience from both points of view.

I have experienced serial downvotes or revenge downvotes (and have a suspicion on who from, but more on that below). Not much to do about it, be a good human and keep going. Sometimes you can leave a comment asking for an explanation for the downvote, which often gets good response.
I have in the past been upset with some users (for their lack of research, continuously providing bad answers or suspected trolling from my POV) and thus downvoted some of their contributions, and let me point this out, not serially, i.e. all of their stuff, but only where a downvote was warranted IMHO, checked on a case-by-case basis for each post.

The last is important because serial downvoting is frowned upon by the site and there are measures in place to prevent and auto-correct it.
Related reading:
I've just been downvoted. How should I react?
Why do you cast downvotes on answers?
Comment: This. It should be stressed that if the system detects serial voting, it will reverse it. Happened to my chemistry account yesterday: I logged in to find all but one of my questions (many of them months or years old) upvoted exactly once. I called the vote reversal was going to happen and sure thing, it did.
Answer:
Is it possible to find out why a user continuously down voting my questions and answer?

Only what the user in question tells you, whether or not true. And you can't be sure who to ask since, other for one's own votes given or a hacked account, in general, only SE developers have access to exactly who voted on which post.
You mention downvoting my answer without any reasons which I take to mean without any reasons given. Each user only has one vote per question or answer so multiple downvotes on any one answer come from different users and hence are indication that there is something quite evident lacking in the answer.
Three questions from the same user downvoted within 2 to 3 mins is a sign that all three might well be from the one user. Though it still could be nothing but coincidence, given the number of users. However, if in the context of some differences of opinion with another user and downvotes on high scoring answers around the same time I would agree more likely sheer vindictiveness.
There is though one way to create a pattern on three downvotes to questions in rapid succession that I have admitted to in a Comment. That is where an A is so egregiously incorrect, misleading or dangerous I have looked to see whether the person posting it was responsible for similar pollution of the site. If they really should not have been allowed out of their mental institution, rather than a mere aberration,  I may warn others with two or three (not more) downvotes in rapid succession. Naturally I consider this legitimate and not 'serial voting'.
I am not suggesting this is what happened to you – I have never had cause for such a pattern on TSE nor seen any signs that anyone else has voted in such a way for that reason on TSE, nor had any cause to do so.
However, you also mention I never downvote any answer unless it is spam or rude and abusive. I would point out that downvotes are shown to be for "This answer is not useful". There is I think no further 'official' guidance anywhere other than:

the post contains wrong information, is poorly researched, or fails to communicate information

The quote is from Why is voting important? and here by 'official' I am excluding blogs and meta posts, where voting has been discussed at length.
It may not be very nice to downvote the attempt by someone who, in good faith, has stirred themselves to try to help the person who asked, but it is also not as considerate as it might be to other users of the site if everybody is too squeamish to cast a downvote on an answer. There are some As on this site that are "not useful" and somebody needs to spare one of their votes to indicate to others that that is the case. And given the Community, 'somebody' means as much you and anyone else.
Votes are intended to be an indication of quality, and 0 for example does not differentiate 'barely acceptable' or 'too recent to have been seen by users with voting privileges' from 'bad'.
It is not a universal view, but I consider duplicate As are 'not helpful', even where both or more are intelligible and possibly expressed in slightly different words. Where there is a substantial time difference in the posting and the more recent posting offers no relevant addition of substance I may well downvote. If I am looking for a solution I don't want to waste my time reading many versions of the same answer and I appreciate users giving me indication of those that are mere repetition. And in addition, the 'gaming' aspect of the system, that contributes to its effectiveness, is challenged by plagiarism, even when disguised.
The "fun" part of I just use this site for fun is as intended (I think it was Joel himself who said so, though I can't now find where). I hope you can accept that even three downvotes in as many minutes from the one user is fun (though on a regular basis would not be). IF the one user, it is a child throwing a tantrum – when not your child, as long as your exposure is limited, is that not fun? When I see an obviously well-cared for child (not mine) going blue in the face, streaming tears and banging his fists on the floor because he has to eat lunch before he has sweets I don't spank the child (it's not mine anyway) but I do smile. I can't help doing so. There is just a touch of absurdity in making such a big issue out of something so trivial.
Answer: What a shame.
I remember reading on the main META site that the software will take note if someone votes on a question/answer that was immediately preceded by a view of the victim's profile page. And if there's a run of these, the software will reverse the votes.
When you get right down to it, it makes sense that people look at questions on the 'questions' page and and then vote off the answers they see.  But when somebody is flipping back and forth from the person's profile page to their answers, it means they are looking for stuff that the victim wrote.
I don't know the details of what happens when the software detects a trigger threshold, I assume that the vengeance voter gets a bad mark in the database. And when bad marks reach a trigger threshold, something else bad happens to that person and something good happens to the victim.
All well and good, but if the vengeance voter stays beneath the detection threshold then nothing will happen unless you do something first. So you could write to the SO headquarters and ask them if somebody has been voting off your profile page. And if so can they do something about it.
I have no knowledge at all if writing to them works or not. I would guess that with all the wackos out there that they get an ungodly intake of emails.  Maybe they will do something, or maybe not. But getting it off your chest may be valuable in its own right.
Comment: I can agree with 'something bad' happening to 'that person' — something like a temporary ban of some sort most likely. However, I don't think 'something good' will happen 'to the victim' — unless you explicitly count the serial voting to be reverted.


What type of edible mushrooms can I easily inoculate in logs and grow in USDA zone 4a for full sun?

Question: I'm currently building a home fungal/crop garden, and am wondering what types of mushrooms can inoculate fresh cut oak logs with that will grow in full sun next to tall grass on one side, and a wood chip bed on the other side. It will be cooking at about 160 all winter long (2'-3' X 20' X 100' so mycelium will be "running").
Comment: You really need to give the dimensions of the oak branches. If they're logs you might be waiting a few decades for them to fruit.
Answer: I have no experience with growing mushrooms at all, but in the past I have seen my father growing shiitake on logs in his garden. Shiitake can be grown on live oak (Quercus virginiana) in USDA zones 3 to 9 (see here for more info).
Comment: full sun would be 90-100% sun
Comment: Maybe this previous [post](https://gardening.stackexchange.com/questions/4455/what-edible-mushrooms-can-be-grown-in-full-sun) will help.
Comment: any other ones in full sun?
Comment: I don't know if it was edible, but I saw some kind of mushroom (a cluster of them of good size) growing in extremely dry bare soil that had received no water for months, as far as I'm aware (no rain), which soil was in full, strong sun. I didn't know that was possible, but yeah, some fungi can do it!


Why does the SGU Destiny gate vent?

Question: In Destiny, the Stargate vents and flashes when it closes. I don't think I've seen this happen to any other gates. Are there any reasons why this is the case?
Comment: Writers: "How can we make the Destiny gate different?". "Venting?". "Venting is cool, let's go with that"
Comment: It's especially odd given that the gates on the planets that the Destiny crew visit don't vent.
Comment: I was thinking the same thing. I know that these gates are "old" compared to the ones from SG-1, but in that case, ALL of them should have the same "flaw" or need to vent.
Comment: Didn't Orlin's one-shot gate do the same thing? Not really a fully functional gate but it stands to reason his jury-rigged contraption was closer in operation to Destiny's gate than to anything else.
Answer: According to the Stargate Wiki, the CO2 vents (that's what vents after the gate closes) appears to be superfluous.
That said, my own theory is that the venting is shown only on the Destiny because the Destiny is already pretty far along on it's path, and I would assume the seed ships would be programmed to discover newer and better ways to build gates, and eventually they possibly found a way to not need CO2 discharge, where the Destiny's gate didn't get the upgrades.
Comment: It might have something to do with it being on a ship as well...
Comment: yeah, that too.
Comment: Agreeing with @PearsonArtPhoto.  The _Destiny_ gate is in a closed system with extremely little ability to dissipate heat (an enclosed room in a spacecraft), and has to be able to connect to any and all seeded gates _and_ viable for high-energy transfers over extreme distances (9th chevron connections); this is furthermore compounded by any other heat buildup in the system, such as, e.g., leftover heat from the standard refueling stardive.  Venting CO2 ensures that anyone or anything that arrives won't be fried if the room or gate is running especially hot.
Answer: I'm going to go from DKuntz information, and stretch this a bit further.
So, let's start with the facts.

The Stargate on Destiny is older than any known stargate, at least, in that part of the universe.
The Stargate on Destiny is the only known operating one on a ship, at least in that part of the universe.
It's common practice for ships to have higher concentration of oxygen than normal. This enables a few cool tricks, including easier space walking, lower overall weight of gas, etc. See this link.
The gas coming from the gate is Carbon Dioxide, per the Stargate Wiki.
We know that the gates are much more flimsy than the Milky Way gates. A shot produced a hole in one episode.
We know that the stargates deal with lots of energy.
While most of the gates aren't of huge importance at any one point in time, Destiny's must be more important, because it's where the Ancients wanted to land.

So, putting all of that together, we can assume the following.

Closing a wormhole must involve large amount of energy, of a type that could potentially produce a spark.
In order to minimize any affect, it seems likely that CO2 is forced near the gate, to keep any fire from occurring at this sensitive time.
This CO2 spray also helps to improve the longevity of the stargate somehow, and isn't required if the stargate isn't going to be used for a long period of time.
It could also be that the stargate is full of pure CO2 during the active wormhole, and that it's vented out after the wormhole closes, for the same reasons as above.
Comment: @Keen: The one on Destiny dates to its launch, one can reasonably assume. The ones on the seeding ship are manufactured (See SGU 2.03 "Awakening").
Comment: For #1, do we know that to be true?  The seeding ships dumped their gates on planets centuries prior, so shouldn't those gates be older than the one on Destiny?
Comment: Based on all of the series, closing a wormhole doesn't take any extra energy, it's just that the gate no longer pushes energy to the wormhole, closing the connection. Making your first assumption outright wrong. (sorry, just need to point that out). Additionally, because your first assumption is wrong, none of your following assumptions can be correct.
Comment: And by no longer pushing energy, I mean that the gate just stops drawing power (which is why it's always confusing at the SGC as to why a gate stays open longer than it should have and why it's still drawing energy). We know that this limit is based either on when the Gate somehow detects when everyone intending to come through makes their way through and closes, or after 38 minutes elapses.
Comment: Inductance (which is impossible to avoid, even with superconductors) trys to keep current moving. It is like inertia. When you suddenly stop drawing power, the inductance keeps the current flowing if there is nothing on the other end, it causes voltages to het higher and higher until it breaks through. So when dealing with large amounts of power you can't just turn it off, you need to reroute it somewhere while the field decays. The co2 is likely part of this mechanism.
Answer: The planet gates are designed to only be used a few times, but the Destiny gate is designed to be used time and again, perhaps it improves the longevity of the gate to cool off the capacitors afterwards?  Also, Destiny's gate is the only gate in the network that can dial an extragalactic connection, requiring way more power, my guess is that, similar to how the Icarus gate sparked from the power levels being at maximum, the older Destiny design gets really hot when powered up by a 9 chevron address, and so it was designed to vent whenever it dials, regardless...  Also, I'm not sure it it vents just co2, there must be more to it, unless it's just extremely hot, because when the Lucian Alliance boarded, one member got caught in the blast after the gate closed, and either got injured or killed...

Why does the SGU Destiny gate vent?


Can you disable the standby mode on a Macbook Air 2010 model?

Question: It seems that the Macbook Air 2010 model has some issues waking from its standby mode which it goes into after an hour of on-battery sleep.  I'm looking for a way to disable this standby behavior.  I'm sure there's a plist file somewhere that will turn it off but I can't find it for the life of me.  Anyone have any ideas/hints?
Answer: Caffeine will not stop the computer from sleeping when the lid is closed (this comes form experience, I use it daily), for this you will want InsomniaX http://roaringapps.com/app:1281
Naturally, if you still want it to sleep when the lid is closed, then Caffenine would be the better solution as detailed in the other answer.
Answer: You could just run Caffeine.

Caffeine is a tiny program that puts an icon in the right side of your
  menu bar. Click it to prevent your Mac from automatically going to
  sleep, dimming the screen or starting screen savers. Click it again to
  go back. Right-click the icon to show the menu.
Answer: To disable standby / "deep sleep", run the following command in Terminal:
<code>sudo pmset -a standby 0
</code>
See this question for more information.


What is "elementHandle.contentFrame()" in PlayWright?

Question: I just solved a problem using "elementHandle.contentFrame()", but not really know what's going on behind it. So, I was trying to select a DOM element and click on it. But I realized that I couldn't just simply do it like this when the element is wrapped inside a frame:
{
    await page.click('<element>');
}

So, I applied this method ("elementHandle.contentFrame()") and it works!
{
    const handle = await page.$('frame');
    const contentFrame = await handle.contentFrame();

    await contentFrame.click('<selector>');
}

Can someone explain to me the concept behind it?
Thanks!
Answer: You don't have to use contentFrame, page.frame('frame-name') can give you a frame instance as well.
Basically you can think iframe is a page inside another page, so that you have to first find that frame if you want select the element inside a iframe
Comment: Right, or use `page.frameLocator`.
Answer: The handle you have in the handle variable represents iframe element inside the page. With that variable, you can read or manipulate that element in the same way you can do with any other DOM element on that page. But you can't access the HTML content that iframe rendered.
That's why, if you want to interact with the content inside that frame you need to get the frame using contentFrame.


How can I invest in Ethiopia?

Question: I, US citizen living in US, believe investing in the Ethiopian economy is a good investment because XYZ. How can I do this? I have found many African ETFs with exposures to either specific regions or individual countries, but, perhaps because Ethiopia does not yet have a stock exchange, none of these ETFs are geared toward Ethiopia. With no stock exchange and no ETFs, am I stuck? Is there no accessible way for me to invest broadly in its economy? Do I simply have to wait until the stock exchange is set up so that Ethiopian companies can be publicly listed and, therefore, put into an ETF? Want to make sure I'm not missing something.
Answer: People investing in frontier countries, as from developed countries, often invest in limited partnerships, found at their home country investment banks, that fund and engage in particular endeavors in the frontier countries. However, the developed countries only allow accredited investors to invest in that way. A group of investors could form their own partnership that doesn't offer participation to other investors.
Now Ethiopia has a new law that allows its citizens, that live in foreign countries, to invest in commercial banks and in investment banks or to participate in funding projects of those banks.
And so overall, the way to invest in the frontier country is to form a company in that country that has a registered-agent office in the country. Then the company should be able to invest in banks or invest in funding projects of the banks.
However, it appears that neither Atlas Mara Limited or Equity Group Holdings have any position in Ethiopia and if they don't then I wonder if any foreign company or foreign partnership is allowed to invest in the banks.
Comment: Particular projects can be found. For instance, investment in a mining company that has a license in Ethiopia would be possible. Investment in Chinese companies that have construction or manufacturing projects in Ethiopia would be possible.
Comment: This means that I, a retail investor without the ability to 'form a company' in Ethiopia, have no accessible way of investing in its economy until an ETF is created? Is that right?
Comment: Consumer banking in Africa is mostly by mobile phone: https://www.theafricareport.com/22250/vodafone-we-have-a-keen-interest-in-ethiopia-vivek-badrinath/
Comment: Investment funds issued by private equity companies are generally for accredited investors only: https://cepheuscapital.com/
Answer: You could consider 'investing' more directly by participating in the local Ethiopian economy in whatever way makes sense for you. This could include buying reputable fair-trade products sourced from Ethiopia where money actual ends up in the hands of locals there, (coffee is a main export), or spending your tourist dollars there.
If you want to see a financial return from this social 'investment', you could also seek out art being produced there, if you are sufficiently diversified generally that you want to expand your investment portfolio into art.

How can I invest in Ethiopia?


Tools to measure statistics of a connection

Question: I set up a SDN using Mininet and Pox, now I need to measure statistics on certain links, such as packet loss. I was suggested to use Wireshark. I thought of filtering the arriving packets with tcp.analysis.packet_loss (don't know if it does work for this purpose) but this way I need a client-server tool to generate some TCP traffic to capture, not random TCP, but at least with progressive sequence number (so I can track packet loss). iperf is not good for me because I need a tool that doesn't generate "congestion" of a link. Other methods for measuring statics are ok. Can you help me, please?
Comment: I could run an Apache server on one side, and then use wget on the other host to download a file. Wget runs over HTTP, that uses TCP, so it's good for monitoring packet-loss. The only problem is that i need to set a limit on bandwidth usage.
Comment: wget --limit-rate=20k http://....   woudl limit it to 20k/sec
Answer: You can almost certainly do this with python 2 & scapy.

Scapy is a packet capture, analysis, manipulation and generation tool.
Free, gratis & open source
Cross platform including OS-X, Windows & Linux
Easily send a set of packets with an incrementing field
Analysis of the results, including graphical results, within the tool
Scapy can have its own routing table rather than using the system one
You can save your tests as scripts so as be able to retest later
Lots of examples and a demo
Comment: I think scapy does the job, but i was looking for something simple that I don't need to program myself, otherwise I would go for Python and socket programming. I think it's not dead simple to initiate a TCP connection (3-way handshake) and than write a client-server app that waits for ACKs, ecc.
Comment: With scapy it should be almost a one liner
Comment: Can you post an example, please?


Accessibility into android7 there are news?

Question: I'm blind and I tried Android 5.0 and it seemed not very good using talkback.
Does someone know if there are many differences with the new version?
Comment: Did you turn on deplore by touch also?  https://support.google.com/accessibility/android/answer/6006598?hl=en
Comment: @James Jenkins  : If you are talking about exploring the screen by touch ... yes I did it!
Comment: We are using android 4.3 with talk back and explore by touch without much difficulty.  Takes some getting used to, biggest [issue has been the speed dial](http://android.stackexchange.com/questions/171754/how-to-disable-speed-dial) also you might be interested in this proproposed site [Disabilities Lifehack](http://area51.stackexchange.com/proposals/107537/disabilities-lifehack) the proposal lives on Area51 which is running an old version of StackExchange software, when the proposal launches it will be more friendly.
Answer: You should think of "Talkback" as its own app, like any other app in Android. So the version of the Talkback-app usually has not much to do with the Android version. You can have a new version of Android, but an old version of Talkback and vice versa.
Most of the time the Talkback-version in a newer Android is also newer, but you could manually upgrade Talkback.
Some manufacturers like Samsung or Huawai implement their own "TTS - Text to speech engine", which basically is the Talkback-App. For example: The way the TTS reads numbers or weekdays might be quite wrong, the focus-frame might be blue instead of Googles green frame, etc.
From my experience the not-Google TTS-engines are worse than the one from Google, but in the Talkback-Settings you can always switch to the standard Google TTS.
But to answer your question about Android 5 and 7: Sadly I could not find any change logs that exactly describe what has changed. The best link is this: https://nfb.org/blog/vonb-blog/android-60-and-talkback-45-accessibility-improvements
From my experience I can say that the accessibility usually improves from version to version, especially on WebViews and how things are put into context ("5:00" could be read as "5 - pause - zero zero" or as "5 o'clock"). So if you can use a newer version of Android / Talkback, you will benefit from it.


How to insert 2 SIM cards on Ulefone Armor 9?

Question: I have the Ulefone Armor 9. It states it has a Hybrid Dual SIM (Nano-SIM, dual stand-by). In the settings, it seems it says there are 2 slots for SIM cards. But for the life of me, I cannot figure out how to put in 2 SIM cards.
Opening the slot seems there's only a place for 1.

Has anyone seen this before? How is it supposed to work?
Answer: A hybrid dual SIM slot is a technology that offers both features of a SIM card and a MicroSD card.
The hybrid dual SIM slot also means the OEM provided just two spaces instead of the traditional three slots for dual SIM cards and a MicroSD card. In other words, either two SIM cards are used or one SIM card slot is sacrificed to serve the role of a MicroSD slot.
Simply put, you have two options:

Dual SIM (one micro/nano SIM + one micro/nano SIM)
One micro/nano SIM + MicroSD card
Comment: ah ok, thanks! How do I open the right hand side to put in the sim/sd?
Answer: To open the second slot, push the pin-like end of the tool that's supplied with the phone (or a needle or other small pin) into the tiny hole at the end of the secondary cover.


WordPress Editor not getting youtube video preview

Question: When I am creating a post from the admin panel and using a youtube link in the Editor, the editor automatically fetching the video from youtube and displaying right away in the editor.

But When i am using custom code to display the editor in the frontend and putting the youtube URL its not getting the preview of the video.

Is there any specific parameter to pass to the editor for YouTube videos !!
Here is my current code,
<code>$settings = array( 'media_buttons' => false, 'editor_height' => '140px');
$editor_id = 'video_content';
wp_editor( '', $editor_id, $settings );
</code>
Any idea how to accomplish this !!
Answer: Had this same issue, but figured it out once I dug around in WordPress a bit. What you need to do to make this work in a frontend tinyMCE editor is make sure you enqueue this JS file:
<code>add_action( 'wp_enqueue_scripts', function() {
    wp_enqueue_script( 'mce-view' );
} );
</code>
Once that is in place your youtube, twitter, etc links will automatically embed in the editor for you to preview.
Hope this saves someone a bunch time! :-)
Answer: Perhaps obvious- you've put the URL in the "visual" tab of the editor. Check the "Text" tab and ensure that this isn't wrapping your URL with paragaraph tags and therefore outputting the URL as text. For simplicity, I would turn the "Video Content" meta box into a regular text field.
Hope that helps!


DataGrid columns color, font

Question: I need to set a column's background color, font size, etc. in a DataGrid. I have read a lot but can't find a working solution. The column color and font should be set for each column as the table is loading from a database based on the table.
Is it possible to set these properties for individual cells in the DataGrid's LoadingRow event.
Answer: You can do this in the RowDataBound event.

DataGrid columns color, font


Can I disable others from receiving notifications every single time I post on FB?

Question: Annoying family member has "Get Notifications" set on my profile.  Is there a way to stop them from receiving notifications every time I post?  Not talking about things not showing in news feed, or on the activity sidebar, just so they aren't immediately notified every time I post something.
Answer: No this is not possible without limiting their ability to see the posts. You can only hide the posts from them, but as they have access to the posts, there is no way for you to prevent them to personalize the way they get their content on Facebook.
Answer: You can set the friend onto your 'restricted' list (via your friends list) and this will only allow them to see public posts.
Answer: You can choose friend by friend who you share with.  If you want to share with everyone but your family that would be a pain to go through.  On the privacy option you have World, Friends of Friends, Friends, and Specific People.


Travel to the USA from India with passport validity of less than 6 months?

Question: Can I travel to the USA from India with a passport validity of less than 6 months? I have an Indian passport with a validity 10 days short of 6 months, traveling with an Air India flight. Will there be any issue?
Comment: Hi Sujata! Can you confirm if you were able to travel on Air India with less than 6 months passport to US?
Answer:
Can I Travel to USA from India with passport validity of less than 6 months?

Yes,
The normal rule is that you need 6 months worth of validity to enter the US, but it doesn't apply to the members of the 6 month club, which are listed in 9 FAM 403.9-3(B)(2) § f

Citizens of the countries listed below are exempt from the six-
month rule and need only have a passport valid for their intended period of stay

As of September 7th, 2023 :

Andorra
Angola
Antigua and Barbuda

Antilles
Argentina
Armenia

Aruba
Australia
Austria

Bahamas, The
Barbados
Belgium

Belize
Bermuda
Bolivia

Bosnia-Herzegovina
Brazil
Bulgaria*

Burma
Canada
Chile

Colombia
Costa Rica
Cote D'Ivoire

Croatia*
Cyprus
Czech Republic

Denmark
Dominica (DOMN)
Dominican Republic

Egypt
El Salvador
Estonia

Ethiopia
Federated States of Micronesia
Fiji

Finland
France
Gabon

Georgia
Germany
Greece

Grenada
Guatemala
Guinea

Guyana
Haiti
Holy See (Vatican City)

Hong Kong
Hungary
Iceland

India
Indonesia
Ireland

Israel
Italy
Jamaica

Japan
Kosovo*
Latvia

Lebanon
Libya
Liechtenstein

Lithuania
Luxembourg
Macau

North Macedonia
Madagascar
Malaysia

Maldives
Malta
Mauritania

Mauritius
Mexico
Monaco

Mongolia
Montenegro
Mozambique

Nepal
Netherlands
New Zealand

Nicaragua
Nigeria (NRA)
Norway

Pakistan
Palau
Panama

Papua New Guinea (PNG)
Paraguay*
Peru

Philippines
Poland
Portugal

Qatar
Romania
Russia

San Marino
Saudi Arabia*
Serbia

Seychelles
Singapore**
Slovakia

Slovenia
South Africa
South Korea

Spain
Sri Lanka
St. Kitts and Nevis

St. Lucia
St. Vincent and The Grenadines
Suriname

Sweden
Switzerland
Taiwan

Thailand
Trinidad and Tobago
Tunisia

Turkey
Tuvalu
Ukraine

United Arab Emirates
United Kingdom
Uruguay*

Uzbekistan
Venezuela
Zimbabwe

India being present in that list,  you can enter the US
Comment: As the other answer notes, someone with a passport expiring in less than six months will not be admitted past the expiration date of the passport.  For example, a traveler with a B-2 visa is normally admitted for six months.  Someone arriving with a six-month-club passport that expires in two weeks will be admitted for two weeks.  (Similarly, those with passports from other countries are admitted until six months before their passport expires. So a traveler arriving with a non-six-month-club passport that expires in seven months' time will be admitted for one month.)
Answer: I was able to travel and come back with 4 months' validity on my Indian passport and 5 months' validity on my US visa on Air India from Delhi to New York for a 10-day visit without any issue.
I am sharing because I was stuck in this loop of approaching embassies and airline office with no clear answer. Though, for peace of mind it's suggested that you renew your Indian passport, even on urgent (tatkal) quota.
Comment: It's worth noting that the visa validity does not limit the allowed duration of stay.  You can arrive on the visa's expiration date and be admitted for six months.  The passport validity, however, _does_ affect the duration of stay; if you look at the admission stamp (if you have one) it should show an "until" date that is either the same as the passport's expiration date or earlier.
Answer: A nonimmigrant is inadmissible under 8 USC 1182(a)(7)(B)(i)(I) unless they have a passport valid until 6 months after the end of their period of admission. What this means in practice is that for people with passports from countries not on the "6-month club", their passport must be valid for at least 6 months at the time of entry, and the admit-until date on their I-94 will be no later than 6 months before their passport expires. For people with passports from countries on the 6-month club, their passport must be valid for any length at the time of entry, and the admit-until date on their I-94 will be no later than their passport expiration date.
Since you are using an Indian passport, and India is in the 6-month club, you can enter the US with a passport of less than 6 months of validity left. However, note that if you are entering on a status with a fixed date on your I-94, you will be admitted on your I-94 to no later than your passport expiration date. If you wish to stay longer than that, either 1) an extension of stay must be applied for (the exact process depends on your status), or 2) you would have to leave and re-enter the US on a new passport (you would not need to get a new visa on the new passport, since a valid US visa in an expired passport can be used in combination with a valid passport from the same country).
This is as far as the US government is concerned. It is possible that the airline and/or originating country may have stricter requirements for passport validity.


Can I obtain a valid CGContext for drawing with just a @synthesize UIView dropped into a view controller view

Question: Thank you in advance for any help, I am building a multipage iPad app,and each page has specialized calculations, they all work great, but i would like to make the user experience better with some simple line drawings that represent the calculations, I am comfortable with the drawing once i get a valid CGcontext working, and this is where my problem is. I already have a webview on each page and now I want to have a UIView pop open with my drawing when the user presses the calculate button, My UIview is called drawingView and it will pop open like I want but from what i have read all drawing needs to be done within the DrawRect method in order to use the correct context. I think some of my problem is the syntax for getting the context.
Thanks for any help
Norman
Answer: Ok, I had to do what I wanted the old fashioned way, but it just seems like you should be able to get the current context of a UIView from wherever I want. By calling the view and getting it's current context. But when I do ,I get errors about not getting the current context. So, I have to make my app differently using traditional UIViews classes and bringing them into my page.


How to differentiate diastereotopic protons by NMR in flexible groups?

Question: In (1R,2S)-2-(hydroxymethyl)cyclohexan-1-ol shown below, Ha and Hb are diastereotopic (they will have different chemical shifts), but because of fast rotation, NOESY should show that both couple with Hc, right? How to differentiate diastereotopic protons by NMR in flexible groups?
Comment: Hmm... I am wondering if the rotation really will be that fast. I guess there will be some preferred position of the hydroxyl group. If you would then perform low-temperature NMR you could maybe be able to freeze the molecule in that preferred conformation. The only way I could imagine you would be able to differentiate between $\mathsf{H_a}$ and $\mathsf{H_b}$ though would be to perform *ab initio* calculations and compare these to the experimental chemical shifts. Why are you interested in that anyway?
Answer: I don't think you can distinguish which is which in a freely rotatable group like the one you drew. They will be different, both signals will split up as dd (potentially ddd, if coupling to the hydroxy proton is observed). There will be significant roofing. Careful analysis of the spectrum should reveal two different shifts coupling to each other but very close.
Rotation around the $\ce{C-C}$ axis should be rapid on the NMR timescale resulting in the couplings $^3J_{\ce{HaHc}}$ and $^3J_{\ce{HbHc}}$ averaging out to one common value and the signal of $\ce{Hc}$ having a dddt-type pattern (three doublets to the neighbouring ring protons, a triplet to the side-chain protons).
All NMR methods I know to determine relative stereochemistry (e.g. NOESY, Murata, …) rely on rotation being slow on the NMR timescale.
Potentially cooling your sample down to very low temperatures ($-50~\mathrm{^\circ C}$ or less) could inhibit the rotation and allow for intermittent resolution of the protons. However, that should also produce a more distinct chemical shift difference, so it may actually not help.
Comment: In the frozen-in state, shouldn't the coupling constants to Hc give a good idea which is which (Karplus equation)?
Comment: @Karl Yes, imho. However, I'm not sure if the chemical shifts in frozen state can be mapped back to those of the non-frozen state. (I never did low-temp NMR, so … ^^')
Comment: Right. The average chemical shifts in the freely rotating hydroxymethyl group might easily reverse the peak order in the spectrum.
Answer: There are a number of methods that have proven successful in a number of cases, but no universally applicable method exists. Some thoughts to throw into the mix, to add to Jan's answer.
The greater the rate of rotation, or conformational exchange, the more difficult to implement a method. That is, if no preferred conformation exists, it becomes very difficult. The methods developed by Murata (J. Org. Chem., 1999, 64 (3), pp 866–876 DOI: 10.1021/jo981810k) make use of the 2 and 3 bond couplings to carbon, as well as the 3J H-H coupling. A very good reference that covers much of the recent work is by Bifulco, G. et al. (Chem. Rev. 2007, 107, 3744-3779 DOI: 10.1021/cr030733c).
For complicated natural product systems, often the difficulty is accurately determining the H-C coupling constants, and a lot of work is being done in this area of NMR methodology.  The review by Parella et al (Prog in Nucl Magn Res Spec 73 (2013) 17–55 DOI:10.1016/j.pnmrs.2013.07.001) provides some good insights here, and the very recent review by Tormena (Prog in Nucl Magn Res Spec 96 (2016) 73-88 DOI:10.1016/j.pnmrs.2016.04.001) discusses some complementary methods of analysis using modelling and theoretical calculations.
Freely rotating chains of course exist as a staggered average of rotational conformers. Sometimes, even in acyclic systems, specific conformers are preferred, and the coupling constants reflect this. However, in fast rotating systems, the couplings average across the lifetimes of all conformers - if you are seeing 3JH-H coupling of about 7 Hz, you have a very fast averaging system, with no strongly preferred conformation. If you have couplings that are more toward 3-4 (gauche) or 10-12 (anti), then it is likely that a preferred conformation exists. As Jan suggests, cooling can help, but even simply changing solvent can have benefits. Going to a non-polar solvent will promote intramolecular H-bonding, which can help stabilise a preferred conformer. Even going to a higher magnetic field can help favour the one population.


Electron flow in a wire

Question: How do electrons that constitute a current flow move in a wire? Some say it's like a wheel.If you give it a push,every part of the wheel moves instantly. Is that what happens to electrons?Do they start moving everywhere in the wire when the circuit is closed? Why? Or is it because electrons bump into each other and the energy travels at the speed of light?
Comment: It's not quite instantaneous, but the change in the electric field in the wire once it's connected (which is what drives the electron motion) will propagate at the speed of light.
Comment: possible duplicate of [Is electricity instantaneous?](http://physics.stackexchange.com/q/335/)
Answer: Under the influence of an applied electric field, electrons in conductors actually do not move very fast, in regards to their bulk flow velocity.  For instance, in copper the bulk drift speed of electrons is less than a millimeter per second.  However, each electron (specifically, the conduction electrons) has an effective speed of over one million meters per second.  The effective speed is a random speed and it turns out to only depend upon the material (e.g., for copper it is ~1.6$\times$10$^{6}$ m/s), neither the temperature nor the applied electric field.  The random speed and drift speeds are important for determining the mean free path (~4$\times$10$^{-8}$ m or ~40 nm in copper) and collision rate (~4$\times$10$^{13}$ collisions per second in copper) for conduction electrons.
The short answer is yes, the conduction electrons hit each other (which causes the transfer of information) and while their net drift speed is very low, the rate of communication through the conductor is slightly below the speed of light.
Comment: Voltage is the work done to move a charge from one point to another. They hardly move however.So what is voltage?And resistance? Does it mean that a wire with more resistance make electrons bump slower?Sorry I'm lost.
Comment: @SmCcK voltage is kind of like gravitational potential energy.  If you apply a voltage difference between two points, a charged particle in that region will accelerate.  Resistance (or resistivity) in a material is kind of like friction, in a sense.  In a superconductor, for instance, current can flow indefinitely without loss.
Comment: @SmCcK in short, the collision rate I referred to is dependent upon the electron drift speed whereas their mean free path is dependent upon the random speed of the electrons and the collision rate.  You can also think of it this way:  $\mathbf{j}$ = $n_{e}$e$V_{drift}$ ~ $\sigma$ $\mathbf{E}$.  So yes, the resistivity of a material affects the drift rate and mean free path of electrons.
Answer: As soon as you complete the circuit an electric field travels though the wire.

$$E=\frac{V}{x}=\frac{F}{Q}$$
The electric field travels at the speed of light so for wires in use are too small that the electric field will take noticeable time to travel through the wire. As the electric field is constant around the wire and is (almost) instantly there in whole of the wire every electron experiences the same force:
$$F=\frac{Ve}{x}$$
Where $e$ is charge on one electron.
Every electron experiences the same force due to electric field not because neighboring electrons bump into them.
Answer: If the circuit is closed, one after the other electrons start to move in the chain between the source and the sink approx. with the speed of light. This is because the electrons always feel each over and the signal about the start moves approx. with c.
The same happens in a water pipe too. Try it. Of course you can't measure how fast the signal "open wider the  stopcock" come to the end of your pipe.
More excited it is if the pipe was heated by the sun and, if you open stopcock, the water flows "instantaneously", but the cooler water comes with delay.
Of course take in attention the other answers about the zig-zag-trajectory of the electrons.

Electron flow in a wire


new variable types: interface vs contract

Question: Suppose a contract C inherits an interface I. What is the difference between I c; and C c;?
For instance, in both cases C c = new C() and I c = new C()it seems c points to a newly deployed instance of C, no? (I'm looking here.)
Answer: Consider this:
contract C {
  // tonnes of code, lots of bytecode
}

interface I {
  // function signatures only ... small footprint
}

contract Dapp {

  C c; // Dapp must inherit C, i.e. Dapp size grows by size(C).
  I c; // Dapp must inherit I, i.e. Dapp size grows by size(I), which is smaller.
}

Since I and C are both elsewhere, they are instantiated with an address. Consequently, the internal workings of C are unreachable code inside Dapp because it's calling something else. The interface will suffice for that purpose. It just describes how to format the message, for this Type, and what to expect in response.
Unnecessarily large code leads to unnecessarily costly deployments. It doesn't take too much of that to hit the maximum bytecode size allowed by the protocol, so always use an interface if an interface will suffice.
As style suggestion, to ensure I is always a replica of C's interface, consider:
contract C is I {

That effectively sets up a commitment to implement all of the functions, exactly as defined in I. That plus the override keyword which C's functions must have if they are implementations the functions described in the interface enable the compilerto catch divergence between I and C in the development process, which is what we should want. It's a compiled-time sanity check that has no bearing on the final size of C.
In terms of a practical example, one could contract Token is ERC20 and inherit all the code from another implementation but if one was planning to build it from the ground up, then contract is IERC20 would at least ensure that there has been an attempt to implement the minimum required functions and there are no missing or extra parameters.
Hope it helps.
Answer: There is no difference.
All information about types in Solidity is used only during compilation and doesn't present in a resulting bytecode. Both C c and I c will be an addresses of a deployed C contract but specifying a type allows a compiler to check that functions your are calling in the contract do exist there.
Accordingly the only difference you can notice is that you receive compilation error if you try to call a function of a contract C that in not inherited from I on a variable of type I despite the function in fact exists (assuming the variable with type I is pointing to an instance of the contract C).
pragma solidity ^0.8.24;

import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";

interface I {
    function inheritedFunction() external pure;
}

contract C is I {
    function inheritedFunction() external pure override {}
    function notInheritedFunction() external pure {}
}

contract Example {
    function foo() external {
        C c = new C();
        I i = new C();

        c.inheritedFunction(); // Works
        c.notInheritedFunction(); // Works

        i.inheritedFunction(); // Works
        i.notInheritedFunction(); // Compilation error

        IERC20(address(c)).totalSupply(); // Runtime error
    }
}


Installing a dimmer switch

Question: I'm replacing a regular light switch with a new dimmer switch. When I pulled out the switch, there was a red and black wire that were slotted into the top of the switch, and then a thicker black wire slotted into the bottom.  And the grounding wire.  The new dimmer switch has a green and white wire - I know the green wire is the grounding wire but don't know which of the black and red wire from the outlet is the neutral and which is hot.  Also, on the side of the dimmer switch are spots for Load and Line. So I have 3 wires to connect to the white (neutral) wire, the Load and the Line on the dimmer...
Comment: Black and red aren't going to be neutral. There are no neutrals with a conventional switch. One likely comes in from the source and one goes out to another branch of the circuit. Please post photos so we can be sure what we're telling you.
Comment: Are you installing a smart switch/dimmer? They would have a neutral, white wire.
Comment: Could you define what you mean by slotted , I ask because if backstabbed a larger wire size should not fit backstabs.
Comment: Can you post photos of the inside of the box please?
Comment: Will the dimmer a light fixture or an outlet?
Comment: Is this a 3-way switch? That is, are the lights controlled by two or more switches where any can turn the lights on and off?
Answer: You need to use a voltage tester while the circuit is on to identify which is the load and which is the line. The line comes from the circuit break to the switch. As long as you have power, that will be hot. The load is from the switch to the light/outlet/etc. That will only be hot when the switch is in the on state.
Neutral is its own wire. Generally white, and will be in the back of the junction box capped (unused). You connect the smart/dimmer white wire to this wire.

Installing a dimmer switch


Is there any information we can extract from the residual

Question: The residual in estimation is the difference between the measurement and the previous estimate. My question is when I plot this quantity, what is ,if any, information I can extract or infer from this quantity? No beneficial information I can see from the figure. Any suggestions?
Answer: If your estimate is based on a linear time invariant model then you could use the following measures for the quality of your estimate: cross-correlation between the estimate and residual, and the autocorrelation of the residual. Namely the cross-correlation should be close to zero at all time, otherwise there would still be some residual dynamics that could be modeled. The autocorrelation should be close to zero at all time except at zero, where it should be close to one. If this is the case then this would mean that the residual would be white noise, which can't be predicted/modeled.
Answer: Your residual tells you if your model ,is a good fit to the data. It should meet the orthogonality criteria as described in @fiboranic's answer if your model is linear and noise is Gaussian.
In Kalman Filter Tracking, the Interacting Multiple Model Technique (IMM) the residuals are the innovations sequence and they are tested as the filters run.
In Statistics, most packages like SAS will test an ANOVA set of residuals for Normality (Gaussian. ality) and independence for goodness of fit.  The same is true for Linear Regression.
Even in some nonlinear problems, like an EKF, the innovations are nearly as diagnostic as for the KF.


Current in a strip - Scalar or vector

Question: In certain books like David Griffiths electrodynamics , he treats current as a vector in some places. Moreover certain problems like current in a strip are often dealt with by taking current components. I am having a difficult time understanding this.
After going through books and dealing with problems,i think that when current flows in a wire, of negligible dimensions, it is bound to flow along a line, so we treat it as scalar. But when we talk about current in a strip or in a volume, we can take components of current.Is it so?
Comment: Yes, indeed I think so.
Answer: The reason that you typically think of it as a scalar, is because we confine the current to travelling along one path ( the wire ). This is clearly a special case. Why? Because we have a wire that predefines the path of the electricity for us. For more general situations, we don't assume a particular path, and this lets us apply vector analysis to the situation. This is because charges can generally flow in arbitrary directions. Intuitive notions of flow should tell you that we can think of flow mathematically as something passing through something as time passes. In symbols $$ I = \frac{dQ}{dt} $$ This says that current is the charge, $Q$, passing through some surface area over some time. This surface area is what encodes the information for a path and where we can turn from a scalar definition to a vector definition: $$ I = \int\vec{J} \cdot d\vec{A} $$ This is just another definition of charge flow, but for arbitrary paths. The aforementioned surface area, is the cross sectional area of the path the charge takes, $d\vec{A}$, and $\vec{J}$ is what is termed the current density, ie the amount of charge per cross sectional area. This is in units of $\frac{C}{m^n}$, where $n$ is the number of spatial dimensions we want to take.
Answer: Flow is a good word. Current in a sheet is described as flow, which is the same as a field and that means in general, partial DEQs. When constrained to a wire current is like water in a pipe. You don't worry about a vector field unless you get into turbulence or some other complication. The rate alone (scalar) is good enough for a lot of problems.
Griffith's book is good. You might notice that he chooses his questions very carefully. If you don't get rattled, you can do every problem in the book without putting pencil to paper.
Comment: Sir, that means in such cases it would be better just to talk in terms of current density vector. And can you suggest any other book or links that would help through topics like these?
Comment: If you are doing an E&M course, "Div Grad Curl and All That" by Schey can't hurt. Get a used 3rd edition. The 4th is expensive and uses non-physics conventions for spherical coordinates. 3rd is OK. Also Stanford has Leonard Susskind's E&M lectures online. He uses a mature sort of high level view of things in his lectures that you might find enlightening. Check other free lecture series from MIT, etc.

Current in a strip - Scalar or vector


Linux group permission not applying correctly with hard link

Question: I have a log file located at /var/log/snort/alerts. I want to grant one of my users access to read this file, however, I don't want to grant that user access to the directory /var/log/snort.
My solution was to create a group read_snort_alerts, add the user to the group, then make the file owned by that group. Then I was going to make a hard link somewhere that granted the user direct read access to the file.
But I'm still getting permission denied.
Here is the file permissions on the original file /var/log/snort/alerts. Anyone in the owning group has read access.
<code>$ ls -l | grep alert
-rw-r----- 2 snort read_snort_alerts  6067 Oct 9 20:40 alert
</code>
Here is the hard link
<code>$ ls -l | grep /tmp/hardlink
-rw-r----- 2 snort read_snort_alerts  6067 Oct 9 20:40 hardlink
</code>
The user is named john, and belongs to the correct group.
<code>$ groups john
john : john sudo read_snort_alerts
</code>
Then as John I cannot read the file.
<code>$ less /tmp/hardlink
hardlink: Permission denied
</code>
Here are the permissions on the directory of the folder that contains the original file.
<code>$ ls -ld /var/log/snort
drwx-s--- 2 snort adm 4096 Oct 9 21:19 /var/log/snort
</code>
Any ideas?
Answer: I found the answer here.
https://stackoverflow.com/questions/1167006/linux-permission-group
I needed to log out and log back in again in order for the new group to take effect.


Ubuntu Flash Drive Will Not Boot

Question: I created a bootable flash drive using Windows 7, Pendrivelinux, and ubuntu-12.04.2-desktop-i386. I tried booting from it after changing boot option in bios to USB. System shows no errors but boots in windows 7. I went to Disk Managment and the drive does not show up as bootable. Pendrivelinux completed showing no errors. What am I doing wrong?
Answer: Use the tool named Universal usb from pendrive linux .com it works for me............

Ubuntu Flash Drive Will Not Boot


creating new VM in azure that uses existing vhd

Question: Is it possible to create a new VM (Azure RM) that uses an existing vhd disk (where everything is already set up) that is already on a storage account? In the new portal, I can't find any option for doing that. But can it be done by editing a template or by using PowerShell? Can anyone point me to any docs about this?
Answer: You can deploy an existing Vhd from both PowerShell and ARM Templates.
There are two methods of using an existing image. You can either directly attach that disk or you can use that disk as an image source.
If you look at the Create a Virtual Machine from a User Image template on Github. There is both a template and a PowerShell script.
Both of those are currently configured to make a copy of the Vhd and use that. If you want to directly attach your Vhd you would need to change this line (currently line 168) in the template
"createOption": "FromImage",

to
"createOption": "Attach",

You would do the same for the createoption of Add-AzureVMDataDisk
Answer: Yes you can create a Resource Manager VM from a VHD. It is possible through aRMT template. in Github there is a reference template, please edit and deploy that.
Thanks!
Sabha Mahadevan


In the first book of "His Dark Materials", why didn't Lyra ask the alethiometer what the Gobblers were doing?

Question: I'm reading THE GOLDEN COMPASS by Phillip Pullman. Lyra, John Faa, Farder Coram, and just about everyone else wonders what the Gobblers are doing with the children they've been stealing, but they never ask the alethiometer. Why is that?
Answer: This is quite early in the story.  Lyra has not long had the alethiometer and is still trying to work out how to use it.  Remember that it came to her with no instructions on its use.
From a storytelling point of view, it is convenient for her not to know yet what the Gobblers are up to.  However, it makes sense in-universe that her inexperience means she can't yet formulate that sort of query or understand the answer.  It may not yet occur to her that such a question can be asked.
There are a number of points in the books where Lyra is described as sitting studying the alethiometer, trying to make sense of it.  All this is learning.
As you read further, particularly in the second book The Subtle Knife Lyra's ability to ask and understand the alethiometer grows.
Comment: Probably also worth noting that characters in stories - just like in real life - don't always make full use of the resources that they have, or make smart decisions with them. Key example: Harry not using Sirius' mirror in Order of the Phoenix.


Java equivalent to .NET's ColorBlend

Question: What is the closest equivalent of .NET's ColorBlend /InterpolationColors  in Java?
Update:
See my own solution below. Also, I needed this for my Android App.
Answer: Nearest seems to be java.awt.GradientPaint
Answer: I think I got the answer. I was actually looking this for Android for drawing a linear gradient line with multiple colors at various stops. Turns out Android's LinearGradient's constructor takes parameters for both colors and positions. To imitate .net's ColorBlend I'll just create a ColorBlend class with setter/getters for positions and colors.
Answer: For Java SE:
http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/ext/awt/LinearGradientPaint.html
(Sun has sponsored this Apache project. It is also part of their JavaFX product line.)

Java equivalent to .NET's ColorBlend


Kali Linux boots from USB, black screen after boot option

Question: Trying to figure out what's going on with my laptop. As you can see in the picture below, Kali Linux boots, but upon selecting live system boot or "start installer" I'm presented with a black box in the foreground. I booted the Kali Linux USB from my desktop and it worked just fine. My graphics drivers are up to date on the laptop. Spent about two hours trying to figure this out for my class work. Any help greatly appreciated, thank you.
Obeyed Kali Linux USB ISO, obeyed dual boot installation. Issue arises at Dual boot launch.
Bios options attempted:

Safeboot On/Off,
Virtual hardware On/Off,
Graphics mode Switchable/Discrete

Machine specs:

Lenovo Yoga 720,
Windows 10 64bit,
16gb RAM,
i7-7700HQ
nvidia 1050
Answer: The problem was I did not enable legacy boot. After I enabled legacy boot everything is fine.


How would one show that a nonabelian field strength tensor transforms in a certain way under a local gauge transformation?

Question: How would one show that the nonabelian ${F_{\mu\nu}}$ field strength tensor transforms as $${F_{\mu\nu}\to F_{\mu\nu}^{\prime}=UF_{\mu\nu}U^{-1}}$$ under a local gauge transformation? Rather than going through this in a very manual manner (i.e., gauge transform ${A_{\mu}\to A_{nu}^{\prime}}$ and use the explicit expression for ${F_{\mu\nu}}$), it was suggested to me to show first that $${D_{\mu}\to D_{\mu}^{\prime}=UD_{\mu}U^{-1}}$$ and then gauge transform the commutator relation ${\left[D_{\mu},D_{\nu}\right]}$ for ${F_{\mu\nu}}$: $${\left[D_{\mu},D_{\nu}\right]\psi\left(x\right)=gF_{\mu\nu}\psi\left(x\right)}.$$
Answer: The field strength tensor is proportional to the commutator of the covariant derivatives:
$$F_{\mu\nu}\propto[D_\mu,D_\nu]=D_\mu D_\nu-D_\nu D_\mu.$$
Transforming this expression according to $D_{\mu}\to D_{\mu}^{\prime}=UD_{\mu}U^{-1}$ gives
$$UD_{\mu}U^{-1}UD_{\nu}U^{-1}-UD_{\nu}U^{-1}UD_{\mu}U^{-1}=UD_\mu D_\nu U^{-1}-UD_\nu D_\mu U^{-1}=U[D_\mu,D_\nu]U^{-1},$$
where we have used $UU^{-1}=1$. Due to the proportionality of the field strength to the commutator, the desired transformation property
$${F_{\mu\nu}\to F_{\mu\nu}^{\prime}=UF_{\mu\nu}U^{-1}}$$
is evident.
The transformation property of the covariant derivative follows from both the transformation of the partial derivative and the gauge field itself.
Answer:
This question is often asked typically because it is ambiguous from the notation how far the differential symbols act, cf. e.g. this Phys.SE post.

The short answer is that the set of operators $T$ that transform via a similarity transformation $T\mapsto UTU^{-1}$ form a subalgebra, i.e. the set is closed under

addition,
scalar multiplication, and
operator composition.

Since the commutator $[S,T]:=ST -TS$ is built from such elementary operations, the result follows.


GotoMeeting Webinar prospects are not syncing to Pardot

Question: I have created 14 days free trail account for GoToMeeting Webinar.
Added connector in Salesforce Pardot successfully.
Scheduled Webinar on GoToWebinar it got sync with Pardot Calendar.
But when I registered for GoToWebinar and expecting Prospect to sync in Pardot it was not there.
Not sure where to look for this sync issue.
Please help
Answer: It took bit longer for first time sync.
And after couple of hours I could see the prospect with proper score there in Pardot.


Pinch Zoom/Multitouch functionality on Android GridView

Question: I am looking for an optimized way of implementing Pinch Zoom feature on my GirdView containing images. Why optimized? Because playing with Bitmaps any day gifts me with Out of Memory exception. Till date I have implemented the handling of Multitouch on screen by using          switch (event.getAction() & MotionEvent.ACTION_MASK)
in my onTouch event and getting to the case of "MotionEvent.ACTION_MOVE".
Further I have been rebuilding the grid by calling the Adapter again and again on every case of pinch zoom in or out but one or the other moment I get out of memory exception.
Also I have tracked the intensity of pinch by taking the difference of coordinates between the old touch point and new touch point (using the trigonometry formulae: [(x2-x1)^2 +(y2-y2)^2]^1/2 ).
To summarize I am looking for help/suggestions on two points:
1) The way I have been tracking the intensity of Pinch Zoom in/out, is this a correct way?
2) What will be an optimized way of rebuilding the grid after the detection of pinch zoom in/out.
Thanks.
Answer: Extend the grid view and make your own class, make a custom grid view and set the gesturelistener in that gridview and it will work out(if u need it in version > android 2.1) , i think...!!!!!!


Hellcarver Demon and Second Sunrise

Question: When Hellcarver Demon's ability triggers and I sac all my permanents and discard my hand then cast Second Sunrise do I have to keep track of the discarded cards? because second sunrise say s return to play all artifact, creature, enchantment and land cards that were put into the graveyard from play this turn. Since my hand was discarded I don't think it satisfies the second sunrise condition. I think I just answered my own question but I'll ask anyway to make sure I'm right.
Comment: As a general rule, gatherer has the most up to date wording on a card, and the text there should be looked at when you are unsure about the wording on your printed copy of the card.
Answer: That's correct, the cards in your hand were not "in play", which is the old name for the battlefield. The current official text of Second Sunrise follows the modern wording:

Each player returns to the battlefield all artifact, creature, enchantment, and land cards in his or her graveyard that were put there from the battlefield this turn.

The cards from your hand were not put into the graveyard from the battlefield.

Hellcarver Demon and Second Sunrise


What does this multimeter tempco spec mean?

Question: This is the accuracy spec for an Agilent 34401A 6-1/2 digit multimeter.  What exactly does the "temperature coefficient" mean here? Does it mean that the reading will not change by more than 0.0005% (5 ppm) over the whole temperature range 0 to 18C? Or does it mean 5 ppm/C? And why are there two separate temperature ranges 0-18 and 28-55?  (I understand that it gives % of reading plus % of range.)
Comment: Accuracy at 23+/-5C includes any temperature error already. Outside that, add the temperature error (calculated per answers) to the base accuracy figure.
Comment: Got it. Very confusing to me at first sight because they missed the /C, and because there *is* a tempco between 18 and 28C, but its contribution to the accuracy is already included in the other specs.
Answer: No, "coefficient" means factor by which temperature change is multiplied.
I.E., using the 100,000 mV range at full scale (0.1V), a change from 0°C to 18°C. a 18°C rise, could change reading by as much as 18 x 0.0005% = 0.009% (ignoring the additional error allowance of 0.0005) x 200,000 mV [% reading + % range] = 0.0018 V. (Hoepfully, I've kept track of the decimal place... verification is left to the student ;-)
Answer: If you look at the manual for the 34401A multimeter, you will find that the specification you quoted in your question is missing some information.  In the manual, the same specs appear except that in the last column the term "temperature coefficient" is directly followed by "/°C" which indicates that the numbers are to be taken as per °C. This makes sense since the number applies over a range of 0-18C (span of 18 deg) and a range of 28-56C (a span of 28 deg). A drift of 5ppm per degree C is a lot more reasonable than a drift of 5ppm over a span of 28 deg (equivalent to a drift of only 0.18ppm per deg).
Comment: That's helpful. The clip I posted is from the Agilent data sheet. It clarifies things to know there is a "/C" in the manual. This still does not explain the temperature ranges, but I found a similar spec in a Fluke publication that is more clear. I think we are supposed to understand that there is *no* additional error related to temperature between 18 and 28 C. Then we add 5 ppm/C of reading and 1 ppm/C of range for every degree C above 28 C or every degree C below 18 C. There is no spec below 0 C or above 55 C.
Comment: There is no additional error for temperatures between 18 and 28C because they are covered in the 90 day and 1 year columns.. Temperatures below 0C and above 55C are out of the multimeters operating temperature limits.


How do I change the consensus algorithm for a network that i forked from github?

Question: can i change the consensus algorithm for a network that has forked from github? is there any link to understand how can make changes to consensus
Comment: Can you clarify which client you're using? Geth? Parity? A different one?
Answer: Yes, if you have forked then you are free to change the consensus code.
The consensus part is mostly in the consensus/ directory of the https://github.com/ethereum/go-ethereum repository.
I don't know of any guide to make modifications to geth source. Since the code is always changing it is likely that such guide will be obsolete almost immediately.


Difference between member and method

Question: I am searching for a difference between member and method.....
Comment: To steal from my geometry teacher: "All methods are members.  Not all members are methods."
Answer: A "class member" is basically anything that can be contained within a class object. A "method"  is a particular type of member, described by MSDN as such:

Methods define the actions that a class can perform.

See C#'s documentation on class members for a good explanation.
Answer: Member is a generic term that encompasses the following: Constructors, Methods, Properties, Fields, and Events.
A method is a function that is associated with an instance of a class or a static class.
Answer: A member is just about everything that you can declare inside a class, a method is one possible member type.
Thomas
Answer: I'm not sure what you meen but a member of a class could be an propertie, a method, a public variable, a static method, another class, ..
Answer: A method is something you call to perform an action and maybe return some data.  The easiest way I'd say to identify a method is of course it has brackets at the end ...(..)
A member holds some sort of data, could be a value or reference type.

Difference between member and method


Stock loans: Question about "Put" also defined as "Insurance Policy"

Question: I have a question related to stock loans industry. The so called "Put" is insurance which protects the downside. Lets say the lender had decided, before receiving the stocks to the brokerage account as collateral for the loan, that Loan To Value (LTV) is 60%. This defines how much equity does the borrower get out of his or her stock. But what I don't understand is the following: There is no way for the borrower to loss more than WHAT? More than 60% (so more than LTV) or more than 40% (remaining to full value 100%)? I'm asking what does the borrower have full protection when it comes to maximum potential loss. No way for borrower to loss more than the given equity (LTV) OR no way to loss more than the rest (40% in my example)? Thank you in advance!
Comment: Not following your terminology nor is it clear what your question about put protection is.  Are you asking about margin borrowing from a broker and the possible losses that may ensue?
Comment: Yes but I'm having problems in understanding what is maximum that the borrower can loss: is that maximum equal to the equity received as a form of loan from the lender? Or is the maximum that can borrower loss the difference between 100% and LTV (equity)? Or something else?
Comment: The reason I'm asking this is: More research I do on that, more info I get that the answer I'm looking for may be that borrower cannot loss more than LTV % is but to me it doesn't make sense. Borrower won't return the actual loan but will only pay it so why would he loss the amount of loan (% ltv).
Answer: In the US, the Reg T long margin requirement is 50% and the Margin Maintenance Requirement is 25% (MMR) though brokers can require more.
If your security is marginable and fully paid for, you can borrow an equal amount  of its value to buy more stock.  If you do so, your equity drops to  50%.  If the stock goes bankrupt, the entire proceeds are gone and you owe the brokerage firm the dollar amount of the loan.
As the price drops, the amount of your equity drops, reducing the amount of margin. Your broker monitors this and will sell out your position if the MMR level is breached.  This occurs when the security loses 1/3 of its value and which is 2/3 of your margin deposit.  However, this isn't guaranteed in real life because if share price collapses and  gaps through the MMR, you could end up losing more.
For example, you put up $5k and at 50% margin, you buy $10k worth of stock.  The  MMR level is 4/3 times the debit balance or $6,666.67.  At that point you would have $1,666.67 of equity and  on a $5,000  loan, margin would be 25%.
And yes, one could buy a long put to limit the potential loss of a margined security.
A more complex and riskier scenario is using your fully paid marginable long stock to fund the establishment of a short position in another security.  Because shorting has open ended upside loss, your potential loss could be significantly more.


Linux Server | Tomcat 7.0 Exceptions

Question: I am facing these exceptions regularly, everytime I have to restart the server. The Exceptions are:
exception:1-> com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet success
fully received from the server was 61,316,033 milliseconds ago.  The last packet
sent successfully to the server was 61,316,034 milliseconds ago. is longer than
the server configured value of 'wait_timeout'. You should consider either expir
ing and/or testing connection validity before use in your application, increasin
g the server configured values for client timeouts, or using the Connector/J con
nection property 'autoReconnect=true' to avoid this problem.
exception:2->Exception in thread "ajp-bio-8009-exec-106" java.lang.OutOfMemoryError: PermGen
space
exception:3->Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
The server specifications are: 1 GB RAM| 1000 GB Bandwidth
Please also give me tips on how to manage the RAM amongst the various applications on the server and how to self kill the process which are not in working now. According to my research what I believe is processes are not getting killed and the memory once allocated to them is not refreshed back and get aligned for that process till the server reboots. So please help me with this.

I will be really grateful!

Thanks & Regards
Romel Jain
Answer: for the permgen space error, maybe cloud you add some jvm options (or CATALINA_OPTS) like this :
-XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled

XX:MaxPermSize : permanent space size
XX:+CMSClassUnloadingEnabled: allow the jvm to unload unused class definitions

i was talking about this error in an old french post here

Linux Server | Tomcat 7.0 Exceptions


Questions about "minecraft" game optimisation

Question: I'm currently trying to do a basic "minecraft style" game. I know how difficult it is to create a game like this, that's why I juste want to do the base of a game like this. I did a class which creates one block face, another one which handles the creation of the whole block (All the faces), and a Chunk class which stores and renders all blocks.
My chunks are 16x1x16 sized (Just 1 layer of blocks). I did a first optimisation step : I removed all faces that aren't visibles (If two blocks are sided, I don't add the two sided faces). And another optimisation with the frustrum.
One chunk rendered Removing invisble faces

With one chunk rendered, framerates are good, but above 4-5 chunks rendered, framerates are becoming low. I don't know how to optimise more. I heard about VertexBuffers and IndexBuffers, but I don't know how to add them, because I have a lots of Blocks, in a lots of chunks. And maybe, in the future, how manage that if I want to destroy/place blocks ?
So my question is : How I can optimise the game ?
Thank you !
(Excuse my english, i'm a French guy eheh)
Comment: We have lots of previous Q&A about optimization strategies for this type of problem. Try searching "minecraft" or "voxel" to find them.
Answer:
The biggest difference is using VertexBuffers/IndexBuffers. You'll want to draw each chunk as a single Buffer. If you want to destroy-place blocks, you just re-calculate the VertexBuffer and setData with new data.
You'll want taller chunks. The optimization where you remove all the internal faces works a lot better when you have more internal faces. With 1-block-tall chunks, you're always rendering the internal top faces, which you don't need.
Depending on how your shader works, you should be able to merge individual 1x1 squares on the surface into larger rectangles. This blog post shows some comparisons on how the mesh size gets reduced by this optimization.

Questions about “minecraft” game optimisation


How can I get additional data for each order item, based on order id?

Question: How can I get additional data for each order item, based on order id? I need to get additional data for each order when order is made. I already implemented the observer, it works fine. I hooked observer to the sales_order_place_after event, it seems that at this moment, the additional data is not yet saved into the database, so maybe it is not available to this event? When is additionalData for an order item created, and where can I catch it, while the order is being made, ie. what is the soonest (earliest) moment I can catch this data and how?
Answer: You can use this code to get orders items in observer: Magento 2
<code>$orderId = '';
$order = $this->_objectManager->create('Magento\Sales\Model\Order')->load($orderId);
$orderItems = $order->getAllItems();
    foreach( $orderItems as $item ):
         $productId = $item->getProductId();
        /* Here we can get additional data */
    endforeach;
} </code>
Magento 1.8: You can get order data by:
<code> $orderdata = Mage::getModel('sales/order')->load($orderId);
</code>


How is biochar production as a CDR method different from crop residue burning?

Question: How is biochar production as a CDR method, which is good, different from crop residue burning, which is bad? Does it have something to do with oxygen availability?
Comment: A brief overview (it's old, though, but seemed relevant to me still): Saran Paul Sohi & Simon Shackley 2009, 'Biochar: carbon sequestration potential'
Answer: Deliberate biochar production differs from open burning in two important ways.

The first is oxygen availability as you said.  Limiting the amount of oxygen means far more of the biomass ends up as solid carbon rather than CO2.
The second is particulate pollution.  Burning biomass always produces particulates, but open burning is worse than burning in a controlled manner (in an incinerator, power station, or even wood-burning stove).  This leads to severe effects on air quality, up to and including smog for huge distances downwind of the source.  Compared to incinerating, biochar production causes still less particulate pollution if done properly.  Field methods (similar to the charcoal-burning of old) may still release a lot.
Answer: Let's compare biochar production from wood with burning wood:

1000 tonnes of biochar sequester 3000 tonnes of CO2 and the production of said biochar creates 5000 MWh of energy as heat, requiring 10625 solid cubic meters of wood
10625 solid cubic meters of wood would produce 21356 MWh of energy as heat if directly burned, but if wood is burned, it retains approximately zero of the carbon dioxide, but the carbon dioxide can be captured in gaseous form and stored if you happen to have a depleted gas field within pipeline reach

So it's a matter of whether you want more energy or carbon capture in solid material. In some cases, it may be you can capture the carbon dioxide from wood burning, transport it via pipelines and store it in a depleted gas field. Also a benefit of energy is that there are still areas that are cold in winter and heat is being produced by combusting coal. Wood burning can offset coal burning.
However, capture, transport and storage of gaseous carbon dioxide is expensive, so in most cases, if wood is burned, the carbon dioxide is released to the atmosphere. Also the cases where wood burning offsets coal burning are getting rarer and rarer every year, and in 5 years we most likely are in the situation that no area in developed nations is heated by coal, but rather heat is being produced using heat pumps utilizing renewable or nuclear electricity (and large-scale heat storage is used if the electricity is intermittent renewable to provide heat during sun-free and wind-free hours). Therefore, I would argue that today the most useful choice is to capture as much carbon dioxide as solid material as we can. Thus, this would favor biochar production. You still get some energy as heat from it, but much less than if wood was directly burned.


Is it possible to make the raspberry pi add to current cpu of ubuntu laptop

Question: I know its possible to make a "supercomputer" with multiple Raspberry Pis, but is it possible to make the Raspberry Pi add to the current ram/cpu of a laptop running ubuntu or another os like OS X, or Windows?
Answer: Considering that a modern laptop is likely to have significantly more CPU and RAM than a RPi, I have to wonder if the effort is worthwhile? Not to say that it might not be possible to cobble something together, but it's probably not worth the effort. Most clusters use identical or at least similar hardware.
Answer: No, it is not possible to build a supercomputer with Raspberry Pis (some people have made clusters as an exercise in making clusters).
No, a Raspberry Pi will add no meaningful processing power to a recent lap top.


how to get the unique id of a dynamic element in selenium webdriver

Question: How can I get the unique id of the element in selenium webdriver.
For example email id creation:
Each time the system creates a unique id for the email id.
How can we use that specific id in selenium webdriver for testing when it is constantly changing ?
Comment: What problem are you trying to solve? what is email id? is it id attribute of some element? "Each time its creating" who is that "it"? "and we cannot create a new one with already existing name" what do you mean by "create"? Why are you trying to create something with already existing name?. Please answer all these question. Yet I'm voting to close this one as "unclear what you're asking"
Comment: Is this same like- https://sqa.stackexchange.com/questions/18342/how-to-handle-dynamic-changing-ids-in-xpath/18358#18358
Answer: When the element ID is dynamic and uniquely generated each time - usually a database ID or the link - your options are:

work with designers to have a fixed css ID on the element or a surrounding element
use surrounding code elements, ID's and classes to identify the element without using the ID


what is a pseudohalogen/pseudohalide?

Question: What do you mean by a pseudohalogen/pseudohalide and how do you tell whether a molecule/ion is a pseudohalogen/pseudohalide ?
Comment: see the wiki http://en.wikipedia.org/wiki/Pseudohalogen
Answer: Pseudohalides are "fake halides."   Their chemistry bears some resemblance to true halides ($\ce{F-}$, $\ce{Cl-}$, $\ce{Br-}$, $\ce{I-}$).
Examples of pseudohalides include $\ce{CN-}$ and $\ce{N3-}$. These are generally weak Lewis bases that bear a formal negative 1 charge.
In my opinion, it is rather subjective as to what can be labeled as a pseudohalide. In general, it is in the eye of the beholder, and for a certain set of chemical circumstances.
In short, there is no "dividing line" for being a pseudohalide. If we assume that halides undergo certain (characteristic) types of chemistry, and the species X in question also generally does those same types of chemistry with a similar mechanism, then you may be able to label X a "pseudohalide."
(Note that within the true halides themselves, they can have very different characteristics, and so there is a bit of a moving target for what constitutes a pseudohalide.)
Comment: Yes, it is probably a misnomer in the context of coordination chemistry, that you cited here. But, it may have certain aspects of acid/base chemistry that look like halogens.  BTW, I think it's kind of a silly concept: pseudohalides.  It's just asking for a fight as to whether group X is enough like any/all/some halides in all reactivities/spectroscopies to be called "pseudohalide."  Truth is, X is a halide or it is not.
Comment: But **F-**,**Cl-** tend to make low-spin complexes and **CN-** ion tends to make a high-spin complex. Now considering this difference isn't 'pseudohalogen' a misnomer ?
Answer: A pseudohalogen is an anion with similar properties to a halogen, but that isn't a halogen. The true halogens are of course the group one column to the left of the noble gases; fluorine, chlorine, bromine, iodine, and astatine, as well as the theoretical ununseptium.
The pseudohalogens are generally -1 compound anions with stable structure (typically featuring multiple bonds) that form compounds with similar reaction behaviors and properties as halides, and can be used as general substitutes in reactions with similar mechanisms. These properties include being weak bases by themselves that form strong acids when protonated, forming neutral salts in combination with metals, and oxidizing electropositive elements. Common pseudohalogens include cyanide/isocyanide, cyanate/isocyanate, azide, their sulfur analogs such as thiocyanate, and complexes such as tetracarbonyls.
However, pseudohalogens are not always identical. Take for instance sodium chloride, and the pseudohalogen analog sodium azide. While the former is relatively harmless table salt, consumed in tens of grams every day, the latter is so generally toxic to life that biochem labs use it as a reference poison (and to make sure whatever nasties they've been growing in vitro for an experiment are good and dead before disposing of the medium). Similarly, while the human body needs a decent dose of chlorine anion as an electrolyte, and smaller amounts of iodine and even bromine are essential trace elements, most of the pseudohalogens are quite toxic, including cyanide, azide and carbonyl complexes. Thiocyanates and isothiocyanates are essential functional groups and anions in human biochemistry, so not overtly toxic like azide, but - First Lesson in Toxicology - too much of anything is bad.
Comment: Can one say that the diatomic interhalogen compounds ,eg. ClF are pseudohaogen compounds ?
Comment: I would say not, first because interhalogens are typically not ions (they end up sharing their lone electron forming an electrically neutral compound) and because this structure typically isn't preserved in any reaction; the two halogens would much rather oxidize *anything* else than each other. However, there are halides of pseudohalogens, such as chlorine and fluorine azides. While similarly reactive, the stable pseudohalogen group is typically preserved in an exchange or oxidation.

what is a pseudohalogen/pseudohalide?


How Do I Calculate the Velocity of the Flow That Is Sucked Into Two Parallel Walls by a Fast Moving Flow?

Question: I'm trying to solve a problem where I calculate the velocity of the setup bellow. Basically I have two very long(basically infinite for calculation purposes) plates, and I have one central jet of gas that is moving very quickly(I'm currently simulating the velocity and mass flow rate of the gas). However, I'm trying to calculate the amount of gas, and the velocity that will be sucked in as a result of the fast moving flow. I know the distance between the two plates, as well as the distance between the source of the fast moving flow and the top two plates but I'm unable to calculate the velocity of the sucked in gas at the top of the two plates. Could someone help me solve this issue? Thank you
Answer: What you want is the mass flow rate out the top of the device, not "velocities sucked in."   The velocity of the entrained air is irrelevant.
That said, this is a very complex problem.  A few of the variables:

pressure of air entering the jet
Nozzle configuration and size
all relevant dimensions
wall materials

Once you have all that you can go and search for the general solution of mass flow rate at a distance from the nozzle.  Then you would adjust based on the walls.  I'm sure all this has been modeled so the work is finding a model you trust.  I would consider this graduate-level fluids work.
Comment: Doesn't answer the question, and you didn't mention the most important factors that govern the result. If they say they want the velocity sucked in, let's assume that's what they want.
Comment: @PhilSweet, let's assume instead that "velocity being sucked in" isn't a thing.