How to make shortcode to hide selection of text from post or page?

Question: is there any shortcode or a plugin that will add new quicktag, like this example:
[hidemytext]some hidden text[/hidemytext]
and any text inside those tag is hidden from the post or from the page.
Thanks and regards
Answer: Simple answer:
add_shortcode( 'hidemytext', '__return_false' );

But shortcodes should never be used like that. Imagine what happens when the plugin or theme with that shortcode is turned off: everyone can see the content now. This is not very user friendly.
So switch the logic: show nothing or the bare shortcode tag by default, show the content only if the shortcode handler is active. Store the hidden content in a simple metabox:

To do that, add a metabox with an editor and show its content per shortcode:
add_shortcode( 'extra',  't5_extra_content' );
add_action( 'add_meta_boxes_post', 't5_register_extra_metabox' );
add_action( 'save_post', 't5_save_shortcode_box', 10, 2);

function t5_extra_content( $attributes, $content = '' )
{
    $args = shortcode_atts( array ( 'cap' => 'edit_posts' ), $attributes );

    if ( current_user_can( $args['cap'] ) )
        return wpautop(
            get_post_meta( get_the_ID(), '_t5_extra_box', TRUE )
            . $content
        );
}

function t5_register_extra_metabox()
{
    add_meta_box(
        't5_extra',
        'Extra',
        't5_extra_metabox_callback',
        NULL, // screen
        'normal',
        'default'
    );
}
function t5_extra_metabox_callback( $post )
{
    $nonce = wp_create_nonce( __FILE__ );
    echo "<input type='hidden' name='t5_extra_box_nonce' value='$nonce' />";
    $content = get_post_meta($post->ID, '_t5_extra_box', TRUE );
    wp_editor(
        $content,
        '_t5_extra_box',
        array (
            'textarea_rows' => 10,
            'media_buttons' => FALSE,
            'teeny'         => TRUE,
            'tinymce'       => TRUE
        )
    );
}
function t5_save_shortcode_box( $post_id )
{
    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE
        or ! isset ( $_POST['post_type'] )
        or 'post' !== $_POST['post_type']
        or ! current_user_can( 'edit_post', $post_id )
        or ! wp_verify_nonce( $_POST[ 't5_extra_box_nonce' ], __FILE__ )
    )
    {
        return;
    }

    if ( isset ( $_POST['_t5_extra_box'] ) )
        update_post_meta( $post_id, '_t5_extra_box', $_POST['_t5_extra_box'] );
    else
        delete_post_meta( $post_id, '_t5_extra_box' );
}

Comment: Very true, the deactivation of plugins poses issues but this solution also poses some issues in some circumstances. Consider the fact that the post content isn't where other plugins would expect to find it. SEO plugins are the best example. I've yet to see an SEO plugin that allows us to tell it that a specific meta key holds content that should be parsed with the post content.
Comment: If a budget exists. A custom plugin should always be considered. My opinion is that all commercial sites should have their own custom plugin that handles some of the simple but key functionality. The OP requires something that is very basic and would cost very little to implement. The advantage is not relying on a third-party plugin to hide content and maintain a members only system.
Answer: You really should be able to work this out from the examples in the Codex.
function hide_text( $atts,$content) {
  return ''; // returns nothing
  // or
  return ''; // returns an html commented version of your text
}
add_shortcode( 'hidemytext', 'hide_text' );

Comment: This would answer, "How to display content using a shortcode if the visitor is allowed to view the content" but this does not hide post content entered in the WYSIWYG editor or Gutenberg blocks which is what I believe the OP has requested.
Answer: You could set up a filter hook and filter all post content. The hooked function would return a default "Not Permitted" type content or if the visitor has permission, the function would return the actual post content.
I'm about to implement something in TwitchPress that might use this approach but take it a step further. I might detect a specific block (basically detect the blocks tags/html) and hide all content after that block. This allows some flexibility when authoring posts.
The approach with a block isn't much different from your own idea. The block just makes it all drag and drop instead of typing [hide] or something similar. Whichever approach, the post content requires filtering. I'm concerned about the extra processing as opposed to restricting the entire post and redirecting none permitted users to a standard "Not Permitted" page which done when WordPress is initializing.
So there are many approaches. Performance and flexibility will be different with each. I think I'll implement them all in TwitchPress.


Flash with Chromium or Google Chrome broken on Ubuntu 19.04

Question: I tried loading Adobe Flash player in Chromium on Ubuntu 19.04 (Lubuntu in this case) using various answers on AskUbuntu.com. I get to the point where the Allow Flash popup happens. But when I click to allow it, it says "Right-click to run Adobe Flash Player". When I rightclick and choose Run this Plugin, nothing happens. I've tried to apply fixes using the Pepperflash technique, as well as the Adobe Flashplugin technique.
Answer: Update 2019-05-29:
This is now fixed for Chromium via chromium-browser 74.0.3729.169-0ubuntu0.19.04.1.
(Not yet for Google Chrome, though.)

Yep, it's a known bug. Someone posted the Chromium fix for Ubuntu 19.04 finally.
First, let's get a clean slate:
sudo apt-get --purge remove chromium-browser
sudo apt-get --purge remove adobe-flashplugin

Do the following to find a list of all the pepper stuff and then get rid of it with apt-get --purge remove ___package-name___
sudo apt-cache search pepper | grep -i pepper | grep -i flash

Now, visit here with Firefox (since you don't have Chromium):
https://launchpad.net/ubuntu/+source/chromium-browser/74.0.3729.131-0ubuntu1
Look for Builds. Find one that fits your architecture. Mine for instance was AMD64. I clicked that. Now, from this list, you need to download two binary packages:
chromium-codecs-ffmpeg 74.0.3729.131-0ubuntu1
chromium-browser 74.0.3729.131-0ubuntu1

(Note when you click those links above on that web page, it will take you to a page that says "Downloadable files" and will have your deb file to download.)
Once both deb files are downloaded, use the dpkg command to install, starting with the ffmpeg file first:
sudo dpkg -i chromium-codecs-ffmpeg*
sudo dpkg -i chromium-browser*

Now go into your GUI-based Apt Package Manager and look for Software Sources. Click the Other Software tab. You'll see 2 items called Canonical Partners -- click the one that is not the Source Code version and click OK or Close to enable it.
Next, at command line, do:
sudo apt-get update
sudo apt-get install adobe-flashplugin

Now launch Chromium. When viewing a Flash component your first time on a given domain, Chromium will act kind of dumb and tell you that you need to install Flash. Click the link to install Flash. It won't actually install Flash. Instead, a security prompt will appear to ask if you want to enable Flash. Do so. The page will load your Flash component. You can go to this page to test if you have Flash installed. Note if you see a puzzle piece, click it, choose Enable Flash, and you should see flash content like an ad plus a "Version Information" box appear. That means you have flash enabled.
Here's something else to note. Adobe's newer flash test page is broken when viewed from Linux Chromium. It provides the wrong answer. Instead, use the older flash test page, click the puzzle piece, enable Flash, and you'll see Flash content appear if you have done these steps properly.
Comment: You're right. I cant find it either. It was very late when I posted this. I'll revise my post to remove the disclaimer.
Comment: Thanks for explaining this! However, I don't understand what you mean by "experimental". The fix has been uploaded to the development version of Ubuntu and it will soon reach 19.04, 18.10, 18.04 and 16.04 too.
Comment: I'm just repeating that the word experimental is what is listed on the launchpad.net website for this release. I figured mods would be upset if I didn't post a disclaimer about that.
Comment: I can't find it. Can you be more specific? Asking because while disclaimers generally are good, disclaimers which are not motivated only confuse users.
Answer: Want to add a few things as a supplement to Volomike's answer.
The issue is affecting both Chromium and Google Chrome. There is an upstream commit which fixes it, and that commit has been included as a patch when building Chromium for Ubuntu eoan. It will soon be added to the Chromium build for Ubuntu 19.04 too. In the meantime, Volomike's solution works.
It will take a while before the commit gets included in Google Chrome.
The issue is related to the update of glibc from version 2.28 to 2.29, which happened in Ubuntu 19.04. Consequently Flash works as usual in previous Ubuntu releases with both Chromium and Google Chrome.
Firefox is not affected by the issue at all.
Answer: I had this same problem and launching chromium with the --no-sandbox switch worked for me. Do not do this permanently as it is unsafe. For a long list of other useful switches see: https://peter.sh/experiments/chromium-command-line-switches/
A safer method might be using the switch --ppapi-flash-path ⊗   Use the PPAPI (Pepper) Flash found at the given path. ↪ However I didn't try this.


Cannot automatically insert bibliography in Texworks

Question: I've just installed MacTeX and used TeXworks. However, every time a want to insert a new BibTeX record, I have to manually execute BibTeX command in a terminal and then run Typeset in TeXworks, otherwise I will receive 'citation undefined' warning and a citation is displayed as '[?]'. I want to ask for a way to manually execution all required commands for inserting bib just by clicking on Typeset in TeXworks.
Answer: When using TeXworks with MacTeX, there's no need to run BibTeX from a Terminal prompt.
After running pdfLaTeX once from inside TeXworks -- presumably by clicking on the black arrow inside the green circle, right? -- you need to click on the drop-down menu to the immediate right of the "Typeset" button and select BibTeX from the options that present themselves. After running BibTeX once, run pdfLaTeX twice more.
Comment: Thanks, your solution work for me. But, is there another way which doesn't involve with pressing them same button many times, i.e. I'm looking for a way to just push a button once, if there is any exists?
Comment: @LongThai - In a normal editing session, it's usually not necessary to run `BibTeX` very often; in such situations, there's no need to keep switching back and forth between running pdfLaTeX and BibTeX. However, if that's not the way you normally work, I suggest to you take a look at the [arara](http://www.ctan.org/pkg/arara) package and its many capabilities. You'll also need to add `arara` as an option to the dropdown menu. `arara` can be configured extremely flexibly.


How does Memstore in HBase update records?

Question: Does HBase perform update-in-place in its Memstore. Let's say if there are multiple versions of values for the same rowkey, will HBase memstore delete old value and replace it with new value?
Answer: No, it will not delete & replace existing record. It will append new keyvalues (record data) to memstore.
First reason: it might be configured to keep more than one version of a cell (column) value. But even if there are more more versions of a cell in memstore than it is configured to keep, it will still append the record instead of overriding it (or removing the oldest).
However, note that in more recent version of HBase (0.92+) there's an optimization of memstore flushing process: it may skip (don't write to HFiles) those versions of the cell which are too old (i.e. should not be included  given the max number of versions to keep). More on this here: HBASE-4241.
Though it seem like "overriding" the existing values in Memstore (at least from the external point of view), but it is not exactly doing that. This optimization happens only upon memstore flush and hence doesn't affect the memstore size: when new values are written, they always appended. I.e. this optimization will not cause flushing to happen more rarely.
There's an ongoing work related for optimizations here, so watch for the next releases.
And yes, as Richard mentioned, you can learn more about configuring HBase Memstore here.
Comment: that is great explanation! btw, which part of habse source code are maintaining memstore, as you mentioned? pls point that out if possible.
Comment: I guess what you are looking for is org.apache.hadoop.hbase.regionserver.MemStore
Answer: The memstore holds the updates just like the HFile will but it will only write to disk according to the configuration of the table (e.g. if you have set the table to only hold one version of a row only the latest will be written to disk).
There's a good explanation of how the  memstore works here


How to estimate the printing time of a 3D printer from an STL file?

Question: My local library has a 3D printer (Lulzbot Mini) for patrons to use. The prints are limited to 4 hours and if I go after work I really only have two hours before the Library closes. The software at the Library will give an estimated time, but I would like to be able to estimate the time before I get there.
Currently I have been creating my designs in TinkerCad and then I export the STL file. From the STL file I can find online estimators that will tell me how much material but nothing that says how long it will take to print.
Is there a way of calculating the estimated printing time from a STL file for a given printer?
Comment: It probably makes sense for you to do the slicing on your own computer ahead-of-time and bring gcode instead of a STL -- that way you can adjust the settings to get within your time-and-material budget on your own time.
Answer: There is no way to estimate the print time of an STL file directly.
The print time is based on the number of instructions in the g-code file plus the time it takes to move the effector (the hot end) around the build area. The only way to compute that is to know what settings their slicer is using and then slice your stl the way they will; and this is assuming that you have the same slicer software. If you manage to do that, then the slicer software will give you an estimate.
Here is what you would need to do:

Get access to the same slicing software, and obtain a copy of
the profile that they use to slice with. The nozzle diameter, feed
rate, layer height, and infill settings will affect the print time.
Import your stl into the sofware and "slice it" There will usually be a large button that is used to generate the g-code. There are quite a few slicers that will output the print time into the text of the g-code. They may also show the print time on the UI during slicing.

alternatively: Email the stl to the staff at the library, and them to generate an estimate for you. They might just do it.
However, that estimate could be incorrect. It will depend on the printer itself. As an example: the time it takes to heat the bed and the hot end is never included in the time estimate the slicer gives.
Comment: The time it takes to heat the bed and hot end, though, is tiny compared to the time it takes to print an object; it's so small that it can be ignored. Surely the library will keep its doors open for sixty extra seconds if your print runs long.
Answer: It is already established that is is possible to calculate the estimated print duration by this anwer.
The most accurate estimation is obtained with specific settings for the printer. So if you have access to the printer, your most accurate estimation would be using the software from the manufacturer or correctly setup third party software. Going to the library twice might work out as you have one day to tweak the print to get it done in 4 hours, the other day to print the file generated the day earlier. Note that there are also community solutions (cheaper than commercial printer services) available where you select the most nearby printer and let somebody else print it for you.
As an alternative (to try at home), if you navigate to the LulzBot website you can find a specific release for the LulzBot printers e.g. download here and use their released profiles (from this location) to slice your print using the material to print the object in. Note that these slicing parameter files are for the TAZ, the slicing parameters can be applied to the mini. Note that this will cause an inaccuracy for the print time, but will serve as a good start.
From their website you can read that:

How to Download and Use Print Profiles
To get printing right away, the default LulzBot TAZ print profiles listed below can be imported into Cura LulzBot Edition for ready-to-print settings. To download and save the configuration file, right click and select Save As.
In order to use the print profiles below you will need to switch to the Full Settings view (Expert > Switch to full settings). After downloading, import the Cura print profile by selecting, in Cura, File > Open Profile. Navigate and select the pre-set Cura print profile file of choice.
Comment: Cura LE comes with profiles for *all* Lulzbot's printers, including the Mini; there's no need to separately install them when using Lulzbot's edition of the software.
Comment: @CharlesDuffy Thanks for the information! Will update later. I'll install when I get to a computer again.


How to figure out total count and details currently logged in users in multi-sever scenario

Question: I am using Express +mongoose +Mongo angular for my web application
I want to know how can i figured out list of all logged in users(specially when we have more then one sever), I need to know when user is idle, active, last active etc
Bu knowing list of logged in user, one user can share stuff with other user.
or maybe I can user Redis(i am very new to this)
Answer: To get list of logged in user, we can push user info in mongo, as soon as user login,
Later use redis for quicker access to user list.
if you are using JWT token for authentication , please use Jwt-redis-session
for session this below article will be helpful.
https://codeforgeek.com/2015/07/using-redis-to-handle-session-in-node-js/
To update other users in realtime , there below module will be helful.
socket.io-adapter
socket.io-redis


how to define a function which returns a multiset

Question: Given graph $G(V,E)$, how can I formally define function $f\prime$ which takes a node $v \in V$ and returns a multiset?
Comment: A multiset can be defined as a set of couples of the form $(x, n) \in X \times \mathbb{N}$, where $X$ is your base set, and $n$ the multiplicity.  A multiset is just a subset of all possible couples, so the return value is a member of the powerset of $X \times \mathbb{N}$.  So formally you can write $f : V \rightarrow P(X \times \mathbb{N})$ (where $P(S)$ denotes the powerset of $S$).
Answer: A multiset is a function $\nu$ defined on some ground set $X$ with values in ${\mathbb N}_{\geq0}$. Such a function assigns each element $x\in X$ its "multiplicity" $\nu(x)$.
When you have a function $f$ that assigns to each node $v\in V$ a multiset $\nu$ on some ground set $X$ I'd suggest to denote the multiset corresponding to the node $v$ by $\nu_v\>$. In this way $\nu_v(x)$ denotes the multiplicity of $x$ foreseen by $f$ for the given node $v$.


color picker in custom webpart properties

Question: I want to have custom color picker in web part properties to let users select colors for headings. Any idea how to achieve this.
Comment: The controls on web part properties are limited, you can only create simple controls like textbox, dropdowns, checkbox and buttons (I don't know if I miss another one)...   So, I think you can make a simple color picker with dropdown controls... let me know if you need assistance on how to create these controls, but I would need to know the SP version and VS version.
Comment: Any one has any idea ??
Comment: Thanks for reply. What you suggest is to have simple color names in drop-down and then get color from its hex code through script ..right.! But I want to let users select proper color from color picker.! that will be more easy for us to choose colors more precisely.
Comment: Please let me know if you have any idea for this case. greatly appreciated. I'll let you know my questions if I need in this case if we decide to move along with usual controls like drop-downs and all. thanks a lot.!
Answer: You can try to replicate a simple color picker with a dropdown control setting the corresponding background color foreach item. This way you can get the following:

Maybe this could be a good solution for your requirement.
Useful information:
How to create a custom web part editor:
http://msdn.microsoft.com/en-us/library/office/hh228018(v=office.14).aspx
How to build a Color DropDownList control
http://www.codeproject.com/Articles/19356/Multi-color-DropDownList-using-C
Comment: oh..that's great.it will help me out for sure.I appreciate. thank you very much


How can I book the interrail passholder Eurostar fare?

Question: I don't see an option for it online. I'm in Sweden. Do I need to wait until I get to Paris to make a reservation?
Answer: There's a lot of handy info on the Seat61.com InterRail Pass page about this. Interestingly, much of it isn't positive about the InterRail discounted tickets...
A couple of key bits to pull out (but you'll really want to go and read the whole thing!)

Eurostar isn't covered ....  The best and cheapest option is usually to forget your pass and buy a regular cheap Eurostar ticket well in advance at www.eurostar.com.  These start from just £39 one way or £69 return .....
In theory, Eurostar offers a 'special' fare for InterRail passholders, £57 one way, £100 return, with changes to travel plans allowed, but as you can see, this is actually more expensive than the cheapest regular fare if you book a month or two in advance and commit to a specific date and train ......
but be warned, the number of passholder tickets is controlled by a quota and people have turned up at the station on a Sunday to be told there are no passholder places available on any Eurostar departure until Wednesday, and if they wanted to travel immediately they'd have to pay the full-price regular fare, a whopping £170 for immediate departure ......
Alternatively, take a ferry to mainland Europe:  If you prefer to travel by ferry rather than Eurostar, or if you find all the cheap Eurostar fares sold out, there are several cheap ferry options.
Top tip:  South Eastern Trains offer a £33.90 day trip ticket from London to Calais covering both train and ferry, which is cheaper even for a one-way trip than a £34 train ticket to Dover and a £30 ferry ticket on to Calais

So, assuming you don't just end up buying a normal cheap Eurostar ticket, and you don't decide on using the return half of a London-Calais day return by ferry
If you did want to book, then the InterRail website says that you can't book pass holder fares online. Instead, your options are to book by phone on +44 (0) 1233 617 575 (and I believe pay a fiver booking fee), or buy the ticket at a Eurostar terminal and hope that there are still some passholder fares left (otherwise it's going to get expensive!)
Comment: The ferry takes far too long. I guess you pay for convenience.
Comment: The normal price Eurostar tickets for the dates I want are alreaady at over £130, so yeah it makes sense for me to buy the passholder rate. Thanks for the no. I'll give them a call
Comment: I called them and booked, and it was like.. £2 cheaper than the regular fare. What a bargain. I guess I do get a free change included in it, but since my travel plans are pretty set it is worthless to me. Going to the UK with an Interrail pass is almost not even worth it.
Comment: You probably would have been better off on the ferry! Or book earlier next time...
Comment: I would also suggest to book directly in a Swedish station. When  I used an Interrail pass, I booked a train abroad in my own country without any problem. I guess it depends on the countries, but it's worth trying. And the Eurostar pricing is closer to flight pricing than train pricing in my opinion.
Answer: Quite a few things have now changed since the original answer was written in 2011 so to update for 2022.
Interrail reservations are available online through https://www.b-europe.com/EN/Booking/Pass#TravelWish - if you are traveling with a mobile pass you'll need to generate a pass cover number using for Eurail or for Interrail passes.
You can also get reservations through the Interrail reservation service: https://www.interrail.eu/en/book-reservations#/
They can also be purchased in person at any of railway stations served by Eurostar. Or from SBB railway station ticket offices in Switzerland. This is detailed at: https://www.interrail.eu/en/plan-your-trip/tips-and-tricks/trains-europe/high-speed-trains/eurostar
Reservations in standard class cost €30 except for journeys to/from the Netherlands which cost €35. Some of the above channels do add an extra booking fee on. There is a limited quota of interrail reservations available so it is possible for them to sell out even though there are still full priced standard tickets on sale.
Comment: tip: consider journeys other than the most obvious ones. I travelled to Marseille from greater manchester on an interrail and was unable to get any reservations from London to Paris, but I *was* able to get reservations from London to Lille and Lille to Marseille.
Answer: In addition to the previous answers:
general booking information on interrail/eurail is found at https://www.interrail.eu/en/book-reservations#/
they offer some special products (1 adult, economy), at the time of writing. The cheapest are

4 days within 1 month, 246€
Travel in 2 or more countries, 335€

If you prefer to travel 1st class, above products are a quite more expensive (add about an extra 33%)

4 days within 1 month, 328€
Travel in 2 or more countries, 446€

add to those rates the Seat Reservation fee, which you mandatory need to book on high-speed/night trains.


Can't connect to network using windows 8

Question: I have small local network with no access to internet. I was using PCs with win 7 OS and everything worked fine. But when I wanted to add PC with win 8 OS this PC can't see any other on the network. All other PCs are set to public network with ip 10.0.0.xxx. I did the same with win 8 PC, turned on network discovery, turned off password protection, allowed remote assistance even turned off firewall to PC but I still cannot see any other computer although it shows that is connected.
Comment: What happens if you try pinging each of the Windows 7 computers?  (open a command prompt, and type `ping [ip address]` for example `ping 10.0.0.5`.  Try pinging them all then report back with your results.
Comment: When I tried to ping it it gave Reply from 169.254.79.65: destination host unreachable. It sows 4 packages sent, 4 received, 0 lost. I have checked and this Ip its showing is set as autoconfigured ipv4 address. It also has subnet mask 255.255.0.0 while ipv4 address that I have configured is set to 10.0.0.123 and 255.255.255.0
Answer: It sounds as though your Windows 8 machine does not have an IP address configured.  169.254.x.x is a special range of IP addresses used when an interface is set to auto-configure but no DHCP server was found on the network.  Given you have no internet router, I'm guessing you have no DHCP server on the network, and you mentioned that your other computers are set to 10.0.0.x - this must mean they are configured with static IP addresses. Check the IP address config on your Windows 8 machine, and set a static IP address on the same subnet as your other computers (i.e. anything between 10.0.0.1 and 10.0.0.254, but make sure you don't an IP address already in use by one of the Windows 7 computers).  Use the command-line ipconfig /a to view the IP settings on each computer (especially the Windows 8 one).
Comment: I have set static ip address. Now when I checked using ipconfig it shows me that autoconfigured ipv4 address is preferred address and the one I have set up (10.0.0.xxx) is duplicate. Is there any way to remove autoconfigured ipv4?
Comment: The first thing you should try, is setting a different static IP address.  When you configure your IP address, Windows checks to ensure that IP address is not already in use on the local network.  It sounds like you've configured the same IP address on another machine, and I think Windows copes with this by "falling back" to autoconfigure.


Random Explanatory / Independent Variables

Question: Are explanatory variables in regression always considered non-stochastic? If the explanatory variables are random or stochastic will the regression be still valid? What are the implications on the coefficients or issues with hypothesis testing one would face ?
Answer: It depends on the context. In classical regression analysis, explanatory variables are measured variables, and hence deterministic (the randomness in the dependent variables thus stems from the randomness of the error term, which can be thought of as measurement error). In econometric regression analysis or linear structural causal models, explanatory variables are to-be-measured variables, and hence stochastic.
If the explanatory variables are stochastic, you can still compute the OLS estimator, the OLS estimator is random, and its distribution is determined by the joint distribution of the dependent variable together with the explanatory variables. Thus, in hypothesis testing, one must consider this joint distribution when deriving standard errors. In the classical case one only has to consider the distribution of the error term.


What should I do if my university accepted too many first year grad students and now not everyone can find a pi/permanent lab?

Question: The university accepted way too many students and now about 25% of the cohort is having to do additional rotations because it seems like the school does not have enough PIs or mentors to take on everyone. How can I warn new and incoming/applying students about the dangers/mismanagement of the program?
Comment: Well, it seems unlikely they will accept many students next time around. It also seems unlikely that they _planned_ to do this. The yield (percent accepting an offer of admissions) can vary year-to-year, sometimes dramatically, through no fault of the students or the department. So they will deal with it and they seem to be doing so. This is not "mismanagement". Would you prefer that they turned away admitted students once the program was "full" back in the spring?
Comment: in what position are you? A professor? A PhD student? What you CAN do heavily depends on the channels and means you have access to
Comment: im a 1st year graduate student - All the TA positions are filled and there is a waitlist. I would like to show the administration how other universities have handled this - such as UCSD releasing more funds to support the students who cannot join labs due to financial constraints, but that type of information is usually in house and hard to find.
Answer: Strange question. Why should you do anything?
Your department likely went on historical return rates on positions offered vs accepted and ended up with WAY more than anticipated. Sometimes these things happen. The other end of it is unprecedentedly low acceptance of offers which greatly understaffs the department for TA and research needs. Also not good.
Why would it matter for next application cycle? One would assume the department will look at the number of positions available, taking into account the large cohort from the prior cycle, adjust for their past acceptance rate and act accordingly.


Getting ORA-01031: insufficient privileges while querying a table instead of ORA-00942: table or view does not exist

Question: When I'm querying a table in schema C from schema A, I'm getting ORA-01031: insufficient privileges and when I'm querying the same table from schema B, I'm getting ORA-00942: table or view does not exist. On the table neither of the schemas are having any privileges. Why am I getting different error messages in this case?
Comment: Which schema does the table actually exist in; are there any synonyms for the table (private in any schema, or public); and are privileges on the table granted to a role which either schema has granted? Just looking for privileges granted directly to the schema (user) doesn't tell the whole story.
Comment: The table exists in a third schema C. There are no synonyms for that table. Select access is granted to a role but neither A nor B are granted that role.
Comment: OK, so look at the differences in the roles and privileges granted to A and B. It looks like A will have visibility of the data dictionary (`select any dictionary` perhaps), so it can see that the table exists; but still doesn't have `select` privileges on it?
Comment: In schema A when I run `SELECT * FROM SYS.ALL_OBJECTS T WHERE T.OBJECT_NAME = `, its not returning anything.
Answer: You may get ORA-01031: insufficient privileges instead of ORA-00942: table or view does not exist when you have at least one privilege on the table, but not the necessary privilege.
Create schemas
SQL> create user schemaA identified by schemaA;

User created.

SQL> create user schemaB identified by schemaB;

User created.

SQL> create user test_user identified by test_user;

User created.

SQL> grant connect to test_user;

Grant succeeded.

Create objects and privileges
It is unusual, but possible, to grant a schema a privilege like DELETE without granting SELECT.
SQL> create table schemaA.table1(a number);

Table created.

SQL> create table schemaB.table2(a number);

Table created.

SQL> grant delete on schemaB.table2 to test_user;

Grant succeeded.

Connect as TEST_USER and try to query the tables
This shows that having some privilege on the table changes the error message.
SQL> select * from schemaA.table1;
select * from schemaA.table1
                      *
ERROR at line 1:
ORA-00942: table or view does not exist

SQL> select * from schemaB.table2;
select * from schemaB.table2
                      *
ERROR at line 1:
ORA-01031: insufficient privileges

SQL>

Comment: @Ak777 You can certainly grant these privileges through roles. Unfortunately, you must loop through all the objects in a schema and grant the privileges individually. I usually do this with a PL/SQL script. But the hard part is remembering to always run that script whenever new objects are created. There's no single schema-level grant command until Oracle version 23c.
Comment: My user is already added in ORA_DBA
Comment: What if I have a role (RoleA) that has select table privileges, and i grant that role SELECT option to SchemaA.table1. And then i set the same role to test_user. Can test_user not query that schemaA.table1? or how do we provision such for a table or at the Schema level that all tables under this shema can be SELECTable?
Comment: Thanks for your response. great to know that its there although at a more recent. Higher versions only. we are currently using 19c and mostly at some point in time, would move/upgrade.
Answer: for ORA-01031: insufficient privileges. Some of the more common causes are:

You tried to change an Oracle username or password without having the appropriate privileges.
You tried to perform an UPDATE to a table, but you only have SELECT access to the table.
You tried to start up an Oracle database using CONNECT INTERNAL.
You tried to install an Oracle database without having the appropriate privileges to the operating-system.

The option(s) to resolve this Oracle error are:

You can have the Oracle DBA grant you the appropriate privileges that you are missing.
You can have the Oracle DBA execute the operation for you.
If you are having trouble starting up Oracle, you may need to add the Oracle user to the dba group.

For ORA-00942: table or view does not exist. You tried to execute a SQL statement that references a table or view that either does not exist, that you do not have access to, or that belongs to another schema and you didn't reference the table by the schema name.
If this error occurred because the table or view does not exist, you will need to create the table or view.
You can check to see if the table exists in Oracle by executing the following SQL statement:
select *
from all_objects
where object_type in ('TABLE','VIEW')
and object_name = 'OBJECT_NAME';

For example, if you are looking for a suppliers table, you would execute:
select *
from all_objects
where object_type in ('TABLE','VIEW')
and object_name = 'SUPPLIERS';

OPTION #2
If this error occurred because you do not have access to the table or view, you will need to have the owner of the table/view, or a DBA grant you the appropriate privileges to this object.
OPTION #3
If this error occurred because the table/view belongs to another schema and you didn't reference the table by the schema name, you will need to rewrite your SQL to include the schema name.
For example, you may have executed the following SQL statement:
select *
from suppliers;

But the suppliers table is not owned by you, but rather, it is owned by a schema called app, you could fix your SQL as follows:
select *
from app.suppliers;

If you do not know what schema the suppliers table/view belongs to, you can execute the following SQL to find out:
select owner
from all_objects
where object_type in ('TABLE','VIEW')
and object_name = 'SUPPLIERS';

This will return the schema name who owns the suppliers table.
Answer: ORA-01031: insufficient privileges happens when the object exists in the schema but do not have any access to that object.
ORA-00942: table or view does not exist happens when the object does not exist in the current schema. If the object exists in another schema, you need to access it using .. Still you can get insufficient privileges error if the owner has not given access to the calling schema.
Answer: try to execute this on sql command line:
connect/ as sysdba;
create user b identified by "password";
grant all privileges to b;

and go create a new connection in SQL Developer;
do the same for schema 'c';
and grant privileges for schema 'a' too:
connect/ as sysdba;
grant all privileges to a;

this method fixed the problem for me.
Answer: In SQL Developer: Everything was working fine and I had all the permissions to login and there was no password change and I could click the table and see the data tab.
But when I run query (simple select statement) it was showing "ORA-01031: insufficient privileges" message.
The solution is simply disconnect the connection and reconnect.
Note: only doing Reconnect did not work for me.
SQL Developer Disconnect Snapshot
Answer: ORA-01031: insufficient privileges
Solution: Go to Your System User.
then Write This Code:
SQL> grant dba to UserName; //Put This username which user show this error message.
Grant succeeded.


What is Wrapped Bitcoin WBTC?

Question: I have read on twitter that WBTC has solved bitcoin scaling issues. Is it true? I want to know more about WBTC
Answer: Disclaimer: I worked at BitGo when WBTC was kicked off, but I didn't work on the WBTC project.
Wrapped Bitcoin (WBTC) is an ERC20 token fully backed by bitcoins held in BitGo's custody. BitGo mints new WBTC when bitcoins are deposited into custody and WBTC is burned when bitcoins are withdrawn from custody. WBTC is a means to get an IOU for hard money into the ETH ecosystem.
As a "scaling solution", it fits somewhere between a sidechain and payments between two user accounts on a custodial service:

There is no "BTC on ETH", all bitcoins are held by BitGo (or other custodian if another gets added). WBTC is a promissory note for the assets held by BitGo.
Payments using WBTC do not interact with the Bitcoin blockchain, they happen on the ETH network
WBTC can be freely sent and received on ETH
The WBTC token cannot be trustlessly redeemed for bitcoin, entering and exiting WBTC requires actions by BitGo

As ETH is still figuring out its monetary policy, the ETH ecosystem lacks a hard money. WBTC is frequently used to represent Bitcoin's value in the ETH ecosystem. Under the assumption that WBTC is a faithful representation of Bitcoin balances and since WBTC payments do not consume Bitcoin on-chain resources, one could consider them a scaling technique. Representing WBTC as "the scaling solution" for Bitcoin is a silly misrepresentation.
Answer:
WBTC does not scale Bitcoin
Bitcoin has its own on-chain and off-chain scaling solutions
You can read more it here: https://bitcoin.stackexchange.com/a/100177/
WBTC refers to Wrapped Bitcoin (WBTC) and is an ERC20 token on other Chain which has nothing to do with Bitcoin or scaling Bitcoin.
Bitgo is a custodian for WBTC: https://blog.bitgo.com/wrapped-btc-launches-with-bitgo-custody-and-full-proof-of-assets-c7fbf21e4a66
You can lock bitcoin in multisig and issue any tokens on other chains to do fancy things which has tradeoffs and trust assumptions. This token will never be same as bitcoin and do not consider it as decentralized or censorship resistant or anything that solves bitcoin scaling issues.
Last thing which non-technical users may find difficult to understand when they read "BTC on XYZ"

All BTC are on Bitcoin blockchain. Yes they are used in different projects and some of them issue their own tokens as well.

What is Wrapped Bitcoin WBTC?


Designing an FIR filter with Gain = 1 on TI DSP processor

Question: I'm trying to design an FIR filter with gain = 1 on DSP processor that does not support floating representation. I'm using MATLAB to design the filter and then transport the taps into my code. The problem is that MATLAB returns floating point coefficients that are not compatible with my requirements.
of course I tried multiplying the coefficients by $2^{15}$ but that would result in a massive gain to the filter and may saturate my signal and cause an overflow.
I would appreciate some help and insights if I'm missing something.
Thanks!
Comment: Are you confident you understand fixed-point processing?
Comment: @Jazzmaniac Ahm yes I think so.
Comment: As far as I know TI has at least two, and as many as four, different flavors of fixed-point DSP cores.  Please *edit your question* to say which processor you're using.
Answer: If I understand correctly, you are doing a 16 bit fixed-point FIR filter with coefficients equal to 1.
If all other coefficients are smaller than 1, the solution will be very simple. Since multiplying a number by 1 is equal to itself, just omit the step of multiplying by 1 and add it directly to the accumulator. For example, say you have an FIR filter [b0, b1, b2],  The filtering process is given by the following difference equation
y[n] = x[n] * b0 + x[n-1] * b1 + x[n-2] * b2;

For fixed-point version, assuming that b0 = 1, b1 and b2 are smaller than 1, the Q15 coefficients would be B1 = round(b1 * 2^15), B2 = round(b2 * 2^15), we don't need to calculate B0 in Q15 format.
acc = (int)x[n] << 15;   // accumulator is in Q31
acc += (int)x[n-1] * B1;
acc += (int)x[n-2] * B2;
y[n] = (short)(acc >> 15);

If any of the other coefficients are greater than 1, instead of multiplying by $2^{15}$, you should use a smaller power of two. In this way you sacrifice the quantize resolution but avoid numeric overflow. After the filtering process, a post shift on the output is required. For example, say the FIR filter is [b0, b1, b2] = [1.0, 1.5, 0.8], then you have Q14 coefficients [B0, B1, B2] = round([b0, b1, b2] * 2^14), and the filtering process is given by
acc = (int)x[n] * B0;
acc += (int)x[n-1] * B1;
acc += (int)x[n-2] * B2;
y[n] = (short)(acc >> 14); // post shift by 14 bits since coefficients are Q14

Comment: Thanks for the answer.  I have two follow-up questions, what do you mean by add directly to the accumulator? Are you familiar with the Q15 TI representation?
Comment: @Euler see my edits


Connecting a second monitor blanks both displays

Question: On my windows 8.1 computer, when I connect a second monitor the first monitor goes blank (loses signal) and won't come back even if I unplug the second monitor.
I can plug either monitor into the primary video port and it will work, but the second video port doesn't appear to work at all.
Graphics card is an AMD Radeon HD 7900 series
Monitors are both Asus VGA monitors.
Answer: I've seen cases where plugging in a new monitor shifts the primary monitor. That could be what is going on.
This is reset by going to the Control Panel > Appearance and Personalization >  Personalization > Display Settings > Monitor tab

"I can plug either monitor into the primary video port and it will work"

Did you try ⊞ Win + P to either extend or duplicate the monitor output?


Simplest "battery low" indicator for a 3.7 volt lithium ion battery

Question: I just need a single LED to light up when the voltage drops below a threshold like say 3.3 volt ( sharpness is not that important ). I know basic electronics like transistors,logic gates etc. On searching a bit, I think a comparator is what I need (all about which I know is that it gives a logic signal based on which input voltage is higher).
Can I use just the comparator for the 3.4 volt LED and achieve what I need, from the link given below ?
http://www.instructables.com/id/Li-Ion-battery-level-indicator/
Comment: Just a suggestion. I would use a circuit that indicated (with a small LED) when the battery voltage was "good", and disconnect the battery when the battery voltage is "low". Otherwise, your low battery indicator is going to drain your battery when it is already low, possibly causing permanent damage to the battery, and possibly making recharging of the battery dangerous.
Answer:
Simplest "battery low" indicator for a 3.7 volt lithium ion battery?

I don't think you can get simpler than this circuit...

Here is the datasheet for the chip shown, although there are lots of under-voltage sensing chips available from numerous vendors...
https://www.microsemi.com/document-portal/doc_view/11145-sg3546-datasheet
Note that the battery must obviously have enough voltage left in it to light the LED to see anything so pick an LED with a low forward drop (red is a good choice).
Comment: At the moment SG3546 is unavailable to buy :( No similar ICs available.
Comment: @KarlSimmons There are many similar chips available, for example https://www.digikey.com/en/products/detail/rohm-semiconductor/BD48K33G-TL/3693298. You can search for things like "voltage supervisor" and "voltage reset controller"
Answer: A regulator is a good, simple idea; especially if you already have a regulated voltage (buck converter or similar) present. If that is the case, you can use this as the threshold voltage and simply scale down the battery voltage accordingly.
If not, you need to build a small circuit that produces a voltage independent of the battery voltage: The easiest solution is to utilize a zener diode in reverse bias (and a current limiting resistor.)

simulate this circuit – Schematic created using CircuitLab
Make sure to calculate the values for your specific design. There are also different types of comparator outputs, perhaps you need to drive the LED differently.
You can determine the value of the voltage divider by considering that the voltage at the negative input needs to be the same as the threshold voltage (at the positive input). If I understood you correctly, you want the LED to turn on for battery voltages lower than 3.3V (V_th); that means you calculate
$$ \frac{V_{threshold} * R3}{R2 + R3} = V_{@inverting} $$ where you arbitrarily choose R3 to have some resonable resistance (based on how much current it would draw) and your arbitrarily chosen \$ V_{th} \$ of 3.3V.
Consider using two comparators so you can have two thresholds; if you use single package with two comparators this hardly takes up more space.
Comment: Keep in mind that this circuit will always be draining the battery though R2+R3. This could impact battery life even with very large resistors here. I've actually seen a product that would drain the attached battery within 6 months even if you never turned it on because of a voltage divider used to low battery detect.
Comment: The battery has 4.2 Volts when fully charged. I need the threshold to be 3.3 Volts and so I would use a 3.3 volt zener diode. Since the negative input should also get the 3.3 volt, I would use R2 and R3 such that R3/R2=33/9. But as the potential across the battery drops over time (R2 and R3 being unchanged), the potential at the negative input will not be equal to that at the positive input (3.3 v) and hence wouldn't the LED light up for any significant drop in the battery's potential much before it reaches 3.3 volts ?
Comment: @user20962 You have to do the same line of reasoning but with the voltage that you want as *threshold* for switching the LED on, *not* the maximum voltage if the battery. The consequence is of course that the LED is off for any larger voltage and on for any smaller voltage.  V_th * R3 / (R2+R3) = V_ref
Comment: @caconyrn I am not sure I completely understand. Please help me out a bit here. For what voltage of the battery should the voltage at the negative input of the op amp be equal to that at the positive input?
Comment: @user2062 I edited my anwer with an example, I hope that will help.
Comment: @caconyrn That really helped me understand. Thank you very much.


What's the relationship between assembly language and machine language?

Question: Are assembly language and machine language (for the same underlying system) really the same? Are there any differences between these two concepts?
Comment: As far as a concept goes assembly language is all about labor saving.  From the ideal one to one instruction to mnemonics to additional non-instruction parts of the language.  Also related to the word concept, the machine language is defined by the logic and assumed to not be changeable (there are exceptions lets ignore those for now) where assembly language is defined by the assembler, and you can have as many (incompatible) assembly languages as folks care to write for one machine language.  You as the user get to pick the one you prefer.  This is not limited to x86 BTW.
Answer: Assembly language is a convenience mechanism over the machine language. With assembly language you use mnemonic sequences instead of numeric operation codes and can use symbolic labels instead of manually calculating offsets. It also protects you from really dumb errors - like typing a malformed processor instruction.
Otherwise the assembly language is the equivalent of the machine language. Sometimes you will have an old assembler that will not support mnemonics for some instructions of the newer processors - then you can still insert operation codes directly into the program.
Comment: Assembly language is more than just an equivalent, it very often includes additional labor saving devices other than just making the instructions easier to read/write for humans.  Labels, directives, sometimes a macro language, etc are all part of the assembly language it is most often not limited to the ideal one to one machine to/from mnemonics.
Answer: Machine language is the "Bit encoding" of a CPU's opcodes.
Assembly langauge is the "Symbolic encoding" of a CPU's opcodes.
So for Example Symbolically:
<code>loop:  dec R1    # Decrement register R1
       bnq loop  # Branch if not equal to zero to
                 # address "loop"
</code>
Becomes Bit encoding:
<code># Mythical CPU Machine code 4 bits operation,
#                           4 bit "option"
       0x41      # 4 is a "dec" and represents r1;
       0x7E      # 7 is bnq and E means PC -2;
</code>
Generally it's a one to one relationship, however some assembly languages will ocationally have extra assembly instructions that map to either multiple machine code instructions or reuse another opcode.  Such as using machine code "xor R1,R1" as a "clr R1" or something very similar.
In addition assembly languages will tend to support "macro programming" which in the 80's when assembly was used extensively gave the source code a more "high level" appearance.  I've personally written assembly macros that looked like "plot x,y" and "Hex Val" to simplify common operations.
For example:
<code># Mythically CPU Macro
.macro spinSleep x,y
            ld #x,y
localLoop:  dec y
            brq localLoop
.endmacro
# Macro invocation
            spinSleep 100,R1
# Macro expantion
            ld #100,R1
localLoopM: dec R1
            brq localLoopM   # localLoopM is "Mangled" for localization.
</code>
Answer: I found a really good explanation, thought to post it here, so that others could read it:

Machine language is the actual bits
  used to control the processor in the
  computer, usually viewed as a sequence
  of hexadecimal numbers (typically
  bytes). The processor reads these bits
  in from program memory, and the bits
  represent "instructions" as to what to
  do next.  Thus machine language
  provides a way of entering
  instructions into a computer (whether
  through switches, punched tape, or a
  binary file).
Assembly language is a more human
  readable view of machine language.
  Instead of representing the machine
  language as numbers, the instructions
  and registers are given names
  (typically abbreviated words, or
  mnemonics, eg ld means "load"). Unlike
  a high level language, assembler is
  very close to the machine language.
  The main abstractions (apart from the
  mnemonics) are the use of labels
  instead of fixed memory addresses, and
  comments.
An assembly language program (ie a
  text file) is translated to machine
  language by an assembler. A
  disassembler performs the reverse
  function (although the comments and
  the names of labels will have been
  discarded in the assembler process).

Source : What is difference between machine language and assembly language?
Answer: In Assembly, instructions are easier-to-understand representations of CPU instructions.
But the assembler also makes, for example, addressing easier:

In machine language you have to know the distance (in address space) between where you are and where you want to jump to
In Assembly language you call one address "iWantToJumpHere" and then you can say "jump iWantToJumpHere"

This makes assembly much easier to maintain, especially when the distance between the addresses changes.
Answer: machine language is what the chip understands
Assembly is what you understand
Every assembly instruction has a machine language equivalent.  x86 has a few single-byte instructions, but they're variable length and can be up to 15 bytes long (including optional prefixes)
<code> machine code bytes |   x86 assembly language
8D B0 00 36 65 C4    lea    esi, [eax - 1000000000]
BB 00 FC FF FF       mov    ebx, -1024
43                   inc    ebx
41                   inc    eax
3B CA                cmp    ecx,edx
C3                   ret

C5 F5 72 D2 01       vpsrld ymm1,ymm2,0x1        ; AVX2
C5 F5 D4 6D 88       vpaddq ymm5,ymm1,YMMWORD PTR [ebp-0x78]
C5 CD D4 AD 68 ff ff ff vpaddq ymm5,ymm6,YMMWORD PTR [ebp-0x98]
</code>
Answer: Assemble level language is the first conscious step towards making the programming simple by allowing the programmers to write mnemonics instead of binary code(machine code).
Answer: Assembly language is first converted to machine language by the assembler. which is stored in memory (RAM) processor/cup fetch it and store in from memory to register and follow the instruction set one after one.
Comment: Correct up to the point where you say an instruction is stored in a register.  This is *not* necessarily the case; CISC machines like x86 or VAX have variable-length instructions and can't usefully use the bits of an instruction as internal control signals the way an in-order non-superscalar MIPS can.  [x86 registers: MBR/MDR and instruction registers](https://stackoverflow.com/q/51522368).  Even out-of-order CPUs give the illusion of running instructions one after another, though, so that's a useful description.  Except for VLIW architectures with explicit parallelism!
Answer: Machine Language
Machine language consists of ones and zeros. so it's so hard to understand by looking at it. so if we want to modify the code , it will be a huge problem. Machine languages is also a programming language(1st Gen).our computer CPU can directly execute that machine code without any assembler.
Assembly Language
assembly language consists of syntax , number , and letter. it's easy to modify existing code. so our machine cannot understand that program. so machine using an assembler to convert that assembly language code into machine code.
Answer: Assembly Language is the symbolic encode of opcode (operation code) that is understand by humans and only use to instruct computer processor (hardware operation) and robot (robotic operation) to perform specific tasks. This is an understandable language to human. This language is only use to instruct hardware operation and definitely not use to create software programme. A assembler is use to convert this symbolic encode part of opcode (operation code) into machine language. Operation Code (Opcode) is a part of machine language.
Comment: It is not clear what this answer is intended to convey.


MySQL - Order of Table Load From Backup

Question: I need to load a database backup from some months ago.There are 29 tables backed up as individual.sql files. Is the order I load them important? For instance the ClientSupplementary table has a FK into the Client Table so that if the Client is deleted the Supplementary data is as well. So does the Client have to be loaded before their Supplementary information?
Answer: Usually yes, when foreign keys are involved, you have to create them in the right order.
When you are sure, however, that your data is consistent, you can do it like this:
mysql> USE your_schema;
mysql> SET FOREIGN_KEY_CHECKS=0;
mysql> SOURCE /path/to/your/dump/file1.sql
mysql> SOURCE /path/to/your/dump/file2.sql
mysql> # ...
mysql> SET FOREIGN_KEY_CHECKS=1;

Or on the command line:
shell> mysql -uuser your_schema -e "SET GLOBAL FOREIGN_KEY_CHECKS=0;"
shell> cat file1.sql file2.sql | mysql -uuser your_schema
shell> mysql -uuser your_schema -e "SET GLOBAL FOREIGN_KEY_CHECKS=1;"

Comment: I find that it is preferable to load the data in the  correct order to eliminate surprises later on! Loading bad data that subsequently fails is worse than failing straight away - check out what Ken Thomson has to say on [failing early and loudly](http://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html)!
Comment: Absolutely. I should have emphasized that more.
Comment: No excuse now for not updating the schema,PK and FK, and relationship documentation. I had it all up to-date but someone amended the DB but not the documentation!

MySQL - Order of Table Load From Backup


Should we allow simple questions?

Question: Not all questions are made equal. Some require expert knowledge, some can be sufficiently answered by a dictionary. Should we allow the second kind, and if we don't, where do we draw the line?
Comment: I think "simple" questions will more often than expected still be good questions, but "trivial" questions will never be good for the site.
Answer: I think the line is research effort.
If the OP provides evidence of it, then any question is fine, even the simplest ones. I also agree with Vladimir.
Answer: I think simple how-to-translate questions should be allowed if they there's some context provided that does not allow to use translation from dictionary or topic-starter explained why he can't use dictionary, e.g.
Bad:

How to translate "A" to Russian

OK:

How to translate A to Russian in the phrase "Blabla A blabla"

OK:

How to translate A to Russian? I checked the dictionary and there's А and Б options which one is more appropriate in my case (case explanation followed)
Comment: That seems like a good policy to me for translation questions, but it's not like we're going to be dealing with translation questions exclusively.

Should we allow simple questions?


What's the difference between cyclotron radiation and synchrotron radiation?

Question: What's the difference between cyclotron radiation and synchrotron radiation? The title says it. If there is a difference between a cyclotron and a synchrotron beyond the particles being accelerated in bunches, please clarify. Is bremsstrahlung a distinct mechanism from the above? Is there a gravitational equivalent, such as a relativistic particle moving just beyond an event horizon (or whatever the equivalent is since Stephen Hawking said something about black holes, the details of which I have no knowledge, maybe they were grey this whole time)?
Comment: I'll have to find my class notes, but I seem to recall that cyclotron was non-relativistic, and synchrotron was relativistic.  The more relativistic, the more coherence in the output beam (more "laser like"), this effect is also increased by "wigglers" I believe they were called...
Answer: Cyclotron radiation is the radiation emitted by a non-relativistic charge when it is accelerated by magnetic field. Synchrotron is similar for a relativistic charge with relativistic beaming and characteristic frequency approximately $\gamma^2$ times the cyclotron frequency. Bremsstrahlung is the radiation emitted when a charge is accelerated as it approaches a different charged object, often a nucleus. In all three cases, we use Larmor's formula for the power emitted.
A relativistic particle experiences a force similar to the Lorentz force but of relativistic origin, the one that causes the Lense-Thirring effect, which is stronger near a massive object. Your description about a particle near the event horizon indicates that you're probably referring to Hawking radiation, which is due to quantum effects.
Answer: I couldn't add the comment, but this is an excellent introduction to cyclotron and cyclotron radiation for future readers (along with explanations of relativistic beaming and other associated effects): https://www.youtube.com/watch?v=FnYNjKabmxU&feature=youtu.be
To reiterate what's been already posted: synchrotron emission is simply cyclotron radiation in the relativistic limit and thus there are additional considerations that need to be taken into account such as Doppler shifting.


"realise" vs "recognise" usage

Question: "In this article you realise/recognise Esperanto, the constructed language basic to the Latin, (which) has been invented by L. L. Zamenhof."
Can I say it like this?
Comment: was invented. Not has been invented. recognize=acknowledge, admit. But we're not supposed to do editing, really.
Comment: oh, yes. Thaks for your help.
Answer: Hmm, what are you trying to say?
To realize (American spelling, realise is British spelling) something is to become aware of a fact or idea. You might say, "I realized that Bob had entered the room" or "If you read this book you will realize that math is not as hard as you thought."
"Realize" can also mean to make something real. Like, "After years of hard work, the new product was realized." i.e. it went from being an idea to being a real product.
Neither of those definitions seems to make sense in this context. You can't "realize Esperanto". You might realize something about Esperanto, like, "I realized that Esperanto is very systematic." Perhaps you could say that the inventor of Esperanto realized it in the send of my second definition, but a student cannot realize it in that sense. It's already been realized.
To "recognize" is to identify or perceive something. Like, "I recognized Bob's face", that is, I saw a face and I knew that it was Bob. Or, "I recognized the difficulty of the problem." I saw the problem and I understood that it would be difficult. To say that someone "recognizes Esperanto" would mean that he sees something written or hears someone speaking and he knows that the language is Esperanto. Like, "I heard the man say, 'sic transit gloria mundi', and I recognized that that was Latin."
If your intent is to say that the article will enable students to know that something said or written is Esperanto, than this word would be appropriate. If you mean that the student will be able to understand Esperanto, that goes beyond "recognize". You'd want to say something more like "know" or "understand".
I'm not sure what you're trying to say by "basic to the Latin". If someone says "A is basic to B", what they usually mean is that A is an essential part of B. Like, "words are basic to language". But Esperanto is not basic to Latin. Latin existed millennia before Esperanto. I don't know a lot about Esperanto. Perhaps you mean that it is based on Latin?
Finally, the construction of your sentence creates the ambiguity that it is not clear whether you mean that Mr Zamenhof invented Esperanto, or Latin. Okay, I think most readers would guess that you mean he invented Esperanto, but in other sentences this could be more confusing.
Comment: Thank you. So, example "Let me introduce the Esperanto - the constructed language, which was invented by L. L. Zamenhof. The Esperanto alphabet is based on Latin" is more correct?
Comment: Yes, much better. You should say "Let me introduce Esperanto ...", not "the Esperanto". Proper nouns do not normally get an article. And maybe you should ay "a constructed" instead of "the constructed". Esperanto is not the only constructed language. (There's Volapuk, for example, probably others.)

"realise" vs "recognise" usage


Only Chrome can access the Internet

Question: Very curious problem - only Chrome can access the Internet, but literally everything else cannot. Confirmed this in Activity Monitor's Network tab (it shows 0 bytes sent/received for literally every process other than Chrome). Mail, Software Update, Safari, App Store, all can't connect. At first I suspected it was a botched uninstall of Little Snitch or K9 internet filter, but now I'm suspecting something deeper in the system. Cleared DNS cache and other items using Onyx. Still no luck. Thanks in advance.
Comment: Sounds like a DNS issue. Can you verify Chrome is using the same DNS as everything else?
Answer: Are you able to get access out using command line programs? For example, can you ping google.com or perhaps ping 220.127.116.11? Ping will communicate using the ICMP protocol. So knowing whether or not requests on ICMP can communicate out may help to solve this mystery.
As far as whether or not you can communicate on TCP, you should try curl google.com and/or curl 126.96.36.199. Whichever works. The google.com one should produce some short HTML code, in which you can see "301 Moved". The 22.214.171.124 one should produce a lot of code. This is what Google's standard search page is. If neither work, something's perhaps blocking any TCP request not made by Google Chrome. Which is really strange. If one, the other, or both work however, we may be looking at more of a blacklisting situation. Hard to tell though. If it fails though, tell me what it says when it fails. It may be a standard "couldn't connect to host" or it may be something more helpful.
One more thing you can do is check Activity Monitor for any possible processes leftover from Little Snitch or K9. Only Little Snitch can block programs, I'm guessing though because from a quick glance at K9's site, they didn't say anything about blocking programs. So you really want to look for anything that might be associated with Little Snitch.
That's all I can think of for now. Let me know the results and hopefully I can help you more.
Comment: Aha! Thanks for the ideas! Curl and Ping to IP address worked, domain name could not resolve. Turned out the culprit was mDNSResponder (not being loaded it seems). Thanks for the ideas!
Comment: I have had this exact same thing happen on a 10.6.x machine also with Chrome being the only thing to get out on the internet and the same ping results. The only way I found getting it working apart from a reboot was to unplug the ethernet cable for a few seconds and  plug it back in. Thanks for the heads up on mDNSResponder we knew it looked like something to do with DNS but could not pin point it. Still its is odd that Chrome could get out?

Only Chrome can access the Internet


find my iphone got lost trying to find it but i think i had find my iphone turned off in my icloud

Question: how to find my iphone 4's problem is my i cloud is on but find my iphone is turned off. iv'e been trying everthing i could think of. Need some help from the people out there that no what to do
Comment: Can you please reword your question so that others can understand what you're trying to ask? We can help you better that way.
Answer: If you did not turn on Find My iPhone on the phone before it was lost, then I'm afraid that you can't find it using Find My iPhone.
You can't turn it on remotely, as this would be a huge privacy issue.
It's a bit like having an insurance policy - you take the hit up front (by buying the insurance, or by turning on Find My iPhone), and it pays off later (by providing coverage, or telling you where your phone is). If you don't do it up front, then you lose.
Sorry, but I don't think it's possible.
Your best bet would be to contact law enforcement (in the case the phone was stolen), and see if there is anything they can do. If the phone was simply lost, then I am pretty sure there is nothing you can do about it, other than send it messages and hope that someone finds it and responds to the messages.


delete wildcard throughout subdirectories, Mac OS

Question: I would like to delete wildcard throughout all subdirectories under the directory where I run the command.
Comment: This is not clear. It looks like you are using the word "wildcard" to describe something else. Edit the question to make it clearer. Avoid technical words.
Answer: find . -name '*.unwanted' ! -type d -delete

Would delete the files whose name matches the *.unwanted wildcard (except those of type directory¹) in the current directory and sub-directories below. If you remove the ! -type d, it would also remove directory files, but only if they're not empty.
Note that it also removes hidden files and files in hidden directories.
-delete is a BSD extension (so would work in macOS) also found in a few other find implementations including GNU find but is not standard (replace with -exec rm -f {} + if your find doesn't support it).
As the default interactive shell in macOS is now zsh, at the shell prompt, you should also be able to do the same with:
rm -f -- **/*.unwanted(D^/)   # same as find above, D for dot (hidden) files
rm -f -- **/*.unwanted(^/)    # skip hidden files and dirs
rm -f -- **/*.unwanted(-^/)   # consider the type of file after symlink resolution
rm -f -- ***/*.unwanted(^/)   # follow symlinks when traversing the
                              # directory tree (same as find -L)

You may however run into a argument list too long error if there's a large number of files, which could be worked around with zargs or by making the rm command builtin with zmodload zsh/files.
Both find predicates and zsh glob qualifiers (the part in (...)) can further refine which files you want to delete. Some examples:

-type f / (.): regular files only (in place of ! -type d / (^/))
-mtime -7 / (m-7): not older than 7 days
-size +1000000c / (L+1000000): bigger than 1MB.
-exec cmd {} \; / (e['cmd $REPLY']), files for which cmd returns true.
etc. See the man/info documentation of find/zsh for details (info zsh qualifiers).

¹ It would however remove symbolic links, whether they point to files of type directory or not


Is it possible to express a cycloid in polar coordinates

Question: The parametric equations for a cycloid of radius 1 centered at the pole are
$$
x(t) = t - \pi - \sin t \\
y(t) = \pm (1- \cos t)
$$
where the plus sign is a cycloid above the x-axis and the minus sign a cycloid below the x-axis. Is it possible to convert these equations into  polar coordinates so that the cycloid is expressed as a angle dependent radius $r(\theta)$ ? I tried to convert them to polar coordinates by using
$$
r = \sqrt{x(t)^2 + y(t)^2} \\
\tan \theta = \frac{y(t)}{x(t)}
$$
But I don't understand how I can eliminate the parameter $t$ so that I get a function $r(\theta)$ in the end.
Comment: I don't think it's possible. Why are you trying to do so? Are you perchance trying to find the area under one arch of a cycloid?
Comment: You may not be able to make a cycloid, but you can make something similar: https://en.wikipedia.org/wiki/Epicycloid
Comment: You can use $t=cos^{-1} (r \sin \theta \pm 1)$
Comment: @N74: That is not giving the curve in polar coordinates (i.e., in the form $r=f(\theta)$), is it?
Comment: It answers your last question about how to eliminate the parameter $t$
Answer: To express $\rho$ as a function of $\theta$, you could express $t$ as a function of $\theta$ by inverting
$$\tan\theta=\pm\frac{1-\cos t}{t-\pi-\sin t}$$and plug the result in the expression of $\rho=\sqrt{x^2+y^2}$.
But there is no closed-form expression for $t(\theta)$ because $t$ appears inside and outside of a trigonometric function, making a transcendental equation.

Following @N74's approach, you can write
$$\rho\cos\theta=\arccos(1\pm\rho\sin\theta)-\pi-\sin(\arccos(1\pm\rho\sin\theta)),$$ which is a nasty implicit polar equation.


How does one customize the 3270 terminal login screen in VM/370?

Question: When using a pre-built system image such as the "VM/370 sixpack" or "MVS Tur(n)key" under Hercules, when a user connects a 3270 terminal, a login screen comes up with a banned identifying the install (sixpack with one closer to the original VM/370 one, and Turnkey with a full custom one). How does one customize those screens? Is there a simple way to restore them to the original IBM provided one?
Comment: First you have to find an IBM custom system integrator.  Then you have to get out your checkbook and write a number with a lot of zeros after it ...
Comment: From what I remember from 40+ years ago this was just an assembler source file that you edited and put in the build.
Answer: It is now 33 years since I last touched anything remotely connected (no pun intended) to VM/370, VM/SP, or MVS, and the little grey cells are now full of C#, Entity Framework, and SQL Server rather than BAL, CICS, and DL/I. However I did find this page which describes in detail the process for modifying the MVS VTAM 'map' for the signon screen:
Customize MVS logon screen
Comment: Stack Exchange discourages link-only answers, as the linked resource may become lost over time. Can you add a summary or other description to this answer to make it more complete?
Comment: @JacobKrall I did - I said the linked page 'describes in detail the process for modifying the MVS VTAM 'map' for the signon screen'. The key words here are 'in detail' since this is not a trivial process susceptible to summarisation, and to reproduce sufficient of the process here to make this a self-contained answer would require near-complete plagiarism of the original document.
Comment: I changed the link to an archive.org immutable URL as a starting step. The instructions are also specific to the TurnKey 4 MVS distribution, but are close enough for me to start figuring it generic instructions.


django unique field

Question: is there another REGEX way (or another way) to ensure that a model class field would be unique? (it is not a key, or at least not declared  as a key, is shoulb be a simple CharField)
Thanks
Answer: The normal way to make a single field unique is to use the unique argument to the field constructor.
Comment: But why does not it work when I add `unique=True` in `user_id = models.CharField(max_length=20, unique=True)
` ?
Comment: This thread seems to suggest that unique can only be done when a table is created:  http://stackoverflow.com/questions/17627556/django-unique-true-not-working

I haven't personally tested to see if that is true.
Answer: If you need to make this unique on more than one field, have a look at:
unique-together
Answer: There are two ways of doing so.
The first is to mark the entire column as unique. For example:
product_name = models.Charfield(max_length=10, unique=True)
This method is good when you want your entire column to be inherently unique regardless of the situation. This can be used for username, id, key etc.
However, if the column cannot be inherently unique but it has to be unique in relation to others, you have to use the manual way.
from django.core.exceptions import ObjectDoesNotExist

try:
    n = WishList.objects.get(user=sample_user, product=sample_product)
    # already exists
    return False
except ObjectDoesNotExist:
    # does not exist
    wish_list = WishList(user=sample_user, product=sample_product)
    wish_list.save()
    return True

Take this as an example. You have a wish list which none of the items can be unique. A single user can have many products and a single product can be in the wish list of many users. However, a single user cannot add one particular product to his or her wish list more than once. And this is where unique=True cannot be used and we have to use try and except

django unique field


Neural Network vs Boolean Network

Question: I have been lately researching and working with ANNs and I found that, despite of being used widely on our machines, we are unable to implement such networks in other paradigms: at a molecular level and so on. While in this case Boolean Networks show a promise.
Though this question may make no sense at first, it is perhaps an interesting problem to consider:
How to convert a neural network to boolean network?

Simply constructing a neural network by connecting basic logic gates AND, NAND, NOR, XOR, XNOR, YES et cetera.
I want to research on the topic, kindly help me as to where should I begin with because I am surely missing some important keywords here.
[Kindly disregard the training/learning process]
Thanks in advance
Answer: I'd recommend starting by looking at artificial neural nets where the units already take binary values. For example, check out Hopfield nets and the McCulloch–Pitts model (the original ANN). The Ising model may also be of interest. Although it was originally a model of ferromagnetism, it has connections to neural networks, and is of interest in neuroscience and physics.
Although the units in these models take binary values, the connection strengths are continuous, so implementing them with digital logic would require something like replacing each unit with a local network of logic gates. This will only be an approximation because real numbers can't be truly represented using a finite sequence of discrete operations--almost all of them are uncomputable. Of course, this also applies to digital computers, which we use to approximate computational models (e.g. ANNs) involving real numbers.
Comment: Hi @user20160, what I am facing problem is the "thresholding mechanism". How to bit blast Sigmoid function to a complex and intricate network of logic gates. In fact, how should I represent binary in first place? And then thridly, how to pass the output signal of neuron like state machine to all other neurons?
Comment: That's part of the motivation for using simple units like Hopfield neurons. They have binary outputs, so just run a wire from the output of one unit to the input of the next. Also, no sigmoids necessary, so you can use standard digital logic circuits like adders (https://en.wikipedia.org/wiki/Adder_(electronics)). There are multiple standard ways to represent numbers in digital electronics (https://en.wikipedia.org/wiki/Binary-coded_decimal). Fixed-point representations will be much easier than floating point.
Comment: Hi, Does ising model require some activation function? Could you please give me links for the same to study ising model for this project! Thanks in advance.

Neural Network vs Boolean Network


Is there an alternative to the Geometry -> Normal Output?

Question: This is the matte I need, created from the mesh with this ring displacement using the "normal" output. I will be using a different displacement in the end but I need this specific information. I am making a fully procedural material and want to avoid baking this texture. I could just manually make circles where they are here but I'd rather use this idea so I don't have to manually change them later if I need too. Is there some way of locking this texture to stay how it is now or is there an alternative node with a similar effect? I just want a matte that's white where the outside and inside wall of this displaced ring would be.
Comment: First time using blender stack exchange, sorry for the symbol brap at the beginning and whatnot
Comment: I want a texture on top of the ring but since the rings sides aren't completely vertical (an intentional design) If I use the texture that the ring is using then the texture i want on top will show up on the sides, so i want this matte so i can subtract it from the top texture so it does not show up on the sides. When i use this matte from the Geometry node, it works, but then when i put it into the displacement the whole mesh updates and the matte changes (as expected).
Comment: Have you tried the normal output of the "texture coordinate" node ?
Comment: Same Story, I've settled with just doing it by hand which isn't too bad. Does the job well
Answer: Taking the dot-product of the Normal output of the Texture Coordinate node with <code>(0,0,1)</code> will return the Z component of the surface normals, in Object space.

This ring has a curved profile on the inside, and is tapered on the outside.
This discrimination is good.. if you had displacements on the curved surfaces which resulted in |Z| = 1 normals, you could further discriminate by absolute Z location in Generated texture space...

Either way.. or both ?
Comment: .. or just strip out the Z with separate XYZ, .. force of habit..


Kronecker delta notation

Question: Is there an easier way to enter KroneckerDelta[n,m] in Mathematica?
When I use the notation $ \delta_{n,m} $, it won't work.
Comment: You can still define `delta[m_,n_]:=KroneckerDelta[m,n]` if you like :)
Comment: In version 9, with autocompletion enabled, only [3 letters are needed](http://i.stack.imgur.com/0R5GT.png).
Comment: You can enter the $\delta_{n,m}$ in a `TraditionalForm` equation cell, and then copy the equation into an input cell. That cell can then be evaluated if you allow *Mathematica* to interpret `TraditionalForm` input in the resulting dialog box. If you want more streamlined input, this is essentially the same as: [Can I enter the traditional form for Binomial as input in an expression?](http://mathematica.stackexchange.com/q/45488/245)
Comment: Would it be worthwhile to reformulate this question to something of the type, "What methods are available to simplify entering long function names in Mathematica"?  Having a single location for answers such as those posted in the comments might be beneficial to this community.
Answer: Just
Subscript[\[Delta], m_, n_] := KroneckerDelta[n, m]

or am I missing something?
Comment: You might want to use `^:=` so that the rule gets attached to `\[Delta]` instead of `Subscript`
Answer: You can use the Notation package.
<< Notation`

Use the Notation palette that automatically pops up to define the required notation.
Notation[Subscript[\[Delta], m_, n_] \[DoubleLongLeftRightArrow] KroneckerDelta[m_, n_]]

NOTE: This is only a "summary" of the required definition. You have to enter the full definition using the (first button on the) Notation palette, and then fill in the placeholders. You can enter the lefthand placeholder as $\delta_{m\_,n\_}$.
Now check that your input generates the intended FullForm expression. You can enter Subscript[\[Delta], m, n] as $\delta_{m,n}$.
Subscript[\[Delta], m, n] // FullForm

(* KroneckerDelta[m, n] *)

Kronecker delta notation


permissions not work samba4

Question: first time writing but I'm desperate and I think you can help
me ... my English is very bad I speak Spanish ... I install Samba4 on
Ubuntu 12 and all is well, I can join computers to the domain and can
create users. My problem is the permissions, not how they work! I need
the owner capeta have all permissions and other users can see the
contents of the folder and read but not modify or delete ... I can not
get that .. try all combinations of permissions on linux and does not
work .. also try changing the permissions on the Security tab in the
administrator users and groups windows and does not work .. how can I
get the owner has full control and others only see the content without
removing or changing? Thanks for taking the time to help me ...
Answer: What Samba version your are using? Can you show the content of your samba4 configuration file (smb.conf)? To enable windows permission in samba4 you need install acl package and modify your /etc/fstab; you can follow the instructions in the wiki:
https://wiki.samba.org/index.php/Samba_4/OS_Requirements
My recommendation is build samba4 by yourself (clone de git repository or download the latest tarball from the official samba site). Also you can use the SerNet repository or if you plan to use Debian, you can use the debian backports repository.
I very important if you can show the result of the samba-tool testparm command.
Check the above and tell me.
Comment: are you able to translate your answer that way also other users of this site can use your solution?
Comment: sorry I forgot to translate. Now my answer is translated. Regards

permissions not work samba4


Does the Nikon Coolpix 900 need the exact CF card specified in the package?

Question: I was given a Nikon Coolpix 900 (1998 model) but there was no CompactFlash memory card. Basically in so many words the original package came with a: EC-8CF 8MB CompactFlash card but now I am questioning whether or not I need that exact model (likely an eBay purchase at this point) or can I get a different model with similar size? For context it becomes harder to work with above 200 Mb.
Comment: The card supplied with the initial Coolpix 900 cameras was only 4MB. At highest quality settings this was room for only six images.
Comment: The question made me thinking - both SD and CF memory cards derive their interface from the good old IDE standard, so it should be easy to make a CF adapter for SD cards. A quick search revealed that these adapters are commercially available and fairly cheap. Worth a try, instead of looking for an obsolete memory type.
Answer: Even though there are several variations of CF cards (multiple versions of CF which are backward and forward compatible, IDE, CFast) the camera definitely expects generic Compact Flash. You are definitely not going to have any issues with different brand of cards and different sizes.
The only reason there was a 8MB card in the package is for test purposes or basic usage. Almost all cameras had a small card in the package. 8MB is small even by 1998 standards.
Comment: However since the camera is quite old there is likely an upper limit to the size of CF cards it can support. FAT32 is likely not supported so this would limit the camera to 2GB max CF cards (that may be hard to find these days).
Comment: In most cases larger cards can be used, but the camera will only recognize 2GB. If larger cards are much cheaper than finding older "new" 2GB cards, then it makes perfect sense to use a larger card and live with the size limitation. One might need to use a computer that can reformat the card to the camera's file system, presumably FAT16. Note that per page 74 of the [P900 Manual](https://cdn-10.nikon-cdn.com/pdf/manuals/coolpix/CP900rm.pdf) the camera's internal file system is limited to a maximum of 999 images on the memory card.


Sub panel neutral and ground

Question: Our building (built in 1960) has 5 sub panels everything being run in rigid or emt conduit. The neutrals are isolated. If I need to add some 15A receptacles can I add a ground bar to panel cabinet without running a ground wire back to the main about 40 ft away.
Comment: It would help to note where you are located and what kind of building it is. In the US, at least, there are restrictions on what can be done in commercial & rental properties by DIYers.
Comment: I think this question is really about what is the proper way to attach neutral if it is needed generally speaking.
Comment: Are you adding new circuits in metal conduit or cable like Romex or MC?
Answer: You don't need any ground bars or ground wires at all.
All of your wiring is being done in metal conduit. The metal conduit successfully carries the grounding for you.
Simply extend the metal conduit to your new receptacle locations, fit metal boxes, and fish individual black and white THHN wires through the conduits.
If your notion is to do the additional circuits in Romex, forget it. The original builders would have done that if it was legal.
Comment: The OP did not specify the wiring method for the new circuits. Also, how do you derive the conclusion you made about the reason for using all EMT? Houses are wires in EMT all over here in WI and we love our Romex more than cheese!
Answer: If metal conduit is installed properly then it serves as the equipment grounding conductor, and an additional wire is not required. If you choose to run one it needs to be sized per NEC Table 250.122.
Since you have no ground bar I would take a moment and verify that the panels were installed correctly and the bonding screws or straps are NOT installed in the sub-panels.
Normally the model number for the correct fitting UL/CSA/ETL Listed ground bar can be found on the label inside the panel door. Normally Inspectors won't call out a non-listed ground bar if installed properly but they can and have.
Answer: I think the OP is considering adding additional circuits to the panel via Romex. If so, yes you can just add a ground bar to the sub panel and you don't need to run a ground wire back to the main panel as the conduit serves as the equipment ground conductor.

Sub panel neutral and ground


IIS Application Request Routing (ARR) reverse proxy rewrite to Apache with authentication

Question: I'd need to rewrite an IIS site (using the ARR proxy method to keep the original URL) to another one which is hosted on an Apache 2 server. The Apache server requests a basic authentication. The problem is when I try to log in to the Apache auth through the IIS reverse proxy it won't work and I get the auth popup in loop. I guess there's a problem with IIS transmitting the auth informations. Could someone tell if there's a known configuration for this problem?
Answer: Without solution I allowed the access to the IIS servers on the Apache with an "Allow from"


Hypervisor load on local disks

Question: What is the I/O load on the local disk system for the host OS in XenServer? I can't find this info anywhere. As we have a SAN for the VMs themselves, can we get away with cheap controller / SATA disk in RAID-1 for the hypervisor? We won't boot from the SAN as it seems prone to problems.
Answer: I have never used XenServer as such, but in general, the host OS is not having to deal with disk IO much - some log writing, standard OS stuff, nothing else.
The main load is on the SAN LUNs, where the working VMs are.
I have a few hosts with KVM (under RHEV) with very old 60Gb SATA drives, but a lot of CPU cores and RAM. I haven't checked exactly, but the local drives definitely do not seem to be a bottleneck, unless you're going into swap (and you never want to swap with several VMs operating)
Answer: You can get away with the smallest oldest disc you can get your hands on. I would suggest a 16 / 32 gb SSD for maintenance reasons. Low power and makes no differnce to be cheap here.

Hypervisor load on local disks


Cardinality of an equivalence class

Question: Suppose we impose the relation on the set of all real numbers that if the difference of two numbers is a rational number then they related. Then we are forming an equivalence relation on the set of all real numbers and each of the equivalence classes will be countably infinite. So I can say that the cardinality of the set of all equivalence classes is at least countable. But I cannot figure out its exact cardinality. I am not able to prove that it cannot be uncountable or neither can I get a bijection with $\mathbb{N}$. Let me know what you think about its cardinality. Any help will be truly appreciated.
Answer: Working in set theory with the axiom of choice, your equivalence relation partitions the real line into some number $\kappa$ of countably infinite sets. It follows that the cardinality of the continuum is the product $\kappa\cdot\aleph_0$.  But (using AC again), the product of two infinite cardinal numbers is just the larger of the two. So the cardinality of the continuum equals $\kappa$.
In the absence of the axiom of choice, the situation is more complicated. It is still true that the number of equivalence classes is at least the cardinal of the continuum, but that inequality could be strict. (If you think it's unimaginable that there could be strictly more than continuum pieces in a partition of the continuum, then you should  either accept the axiom of choice or stretch your imagination.)
Answer: It should be clear that each rational number has a corresponding equivalence class under this relation.
Given a fixed rational number $r$, the set of points $(x,y)$ in the plane satisfying $y = x - r$ is equal to the set of all points in the plane satisfying $x-y=r$ which is the equivalence class corresponding to $r$. Each equivalence class is now just a line in the plane, which is in bijection with the real numbers.

Cardinality of an equivalence class


Can you pass cathode rays in a non vacuumed tube

Question: Is it possible to have a cathode ray discharge in a non vaccumed tube while having a low pressure?
Comment: Well, it is fairly easy to calculate the mean free path of an electron as a function of background pressure - that will tell you what a 'low enough' background pressure is. Your definition of 'low' may or may not agree.
Comment: What do you mean by "low pressure"?  Even a vacuum tube typically has some pressure, ie, a "low pressure".  I'm not trying to be picky, but since you provide no other context for interpreting what you mean by "low pressure" it's hard to understand the intent of the question.
Comment: From what I know low pressure is maintained in a cathode ray discharged tube so that the molecules of gas are far apart and there is a clear path for the electrons. So maintaining that condition in a non vaccumed tube will electrons flow from the cathode to the anode in the presence of air?
Answer: Well, "low pressure" could be considered almost any CRT built by man, since it is very, very hard to achieve a true, absolute vacuum. Cathode rays were systematically observed in Crookes tubes at 10^-6 atm, which is definitely not a vacuum, but can also be considered "low pressure".
Answer: You could rephrase the question as: what problems will I encounter if I gradually increase the pressure?
A colleague of mine who used to design cathode ray tubes explained that the main reason for pursuing a high vacuum is lifetime. With some residual pressure, the tube would still work, but any (positive) ions that are formed due to gas-electron collisions will be be accelerated to the cathode - 20 kV potential difference - and then hit and damage the cathode.
If you don't care about lifetime, the CRT would still work for a while, but I'd guess that the next big issue at higher pressures is that you would form a big plasma discharge, like in a fluorescent tube. The power supply is not designed to handle that and will probably fail. According to Paschen's law, gas discharges may start occuring if the pressure is 10 Pa or so, depending on the voltage, gas type, and size.


Uninstall programs that are not visible in Application manager

Question: I have an Asus Nexus 7 that is full of games that take up all 29 GB of memory. The kids installed these games, and they are not visible in the Application Manager. Perhaps they were installed in a different way. I found an OBB directory that contains a lot of gigantic files with the extension obb and names that are related to games, but I'm not sure whether I can delete them without damaging the system. Where I should start to find and remove games?
Comment: If "user-installed apps" are not listed here, they're usually no longer installed (and the "big chunk of data" thus must be left-overs from some "unclean uninstallation"). To verify, you can use a terminal app or, better, `adb shell` from the computer, and run `pm list packages -3`. This lists all user-installed apps using their *package names*. To know what the "app name" behind them is, you can e.g. visit their app-page at Google Play: `https://play.google.com/store/apps/details?id=`. If the corresponding apps are not listed here either, they're definitely no longer installed.
Comment: OK, getting closer. Now just to check what you mean by "application manager", as some manufacturers ship such for their own apps/stores. Starting from the home-screen, check *Settings › Apps,* and in there select the *Downloaded* tab. That should list all apps installed by "the user", regardless of by what means. Is this what you're talking about? If not, are the apps you want to get rid of listed there?
Comment: I'm talking about "Starting from the home-screen, check Settings › Apps, and in there select the Downloaded tab"
Comment: Do the kids have their own profile on the Nexus 7? If so, have you checked the applications from there? There's no way for apps that are installed to not be listed in the Apps list in settings. But it is possible for the apps, if not installed, to have left file remnants behind. We'll address that after your other answers, though.
Answer: You can use alternative application managers available from the Play store, or even Titanium Backup if you are rooted.
secondly if you are rooted,

Download any root explorer,
Navigate to /system/app/ or sometimes /system/priv-app/ and manually
uninstall by deleting the packages (you may need to delete files
from android folder manually eg. obb files)
Reboot and you are done (optional)

If none of the above works,

Do a backup of apps and data using a backup manager (Recommended:
Helium for non root users, Titanium Backup for root users)
factory reset the phone, and delete '.androidsecure' and 'Android'
folder from external memory if exists.

Voila! you are done!