detecting MITM attacker on WIFI

Question: I have read this: Can I detect a MITM attack? My question is very simple, since a MITM attacker consumes double number of packets, is possible to identify him, isn't it?
Comment: First, there are many attack points other than your WiFi. Even for that, a WiFi MITM can use multiple addresses so each handles no more traffic than a legit device -- and different legit devices usually have wildly different traffic already and there is no 'average'. MITM can cause legit device(s) to retransmit so _they_ appear to have the abnormally high traffic. If the intercepted traffic is to and/or from the outside, instead of being strictly in the 'middle' it can relay to/from a different internet connection (_not_ your WiFi) which you can't see.
Comment: Packet latency probably follows some stastical distribution with mean and variance. Any statistically significant increase in packet latency should be an indicator of possible compromise even if everything appears normal. False positives might be a problem.
Comment: I think I know what you are asking. A mitm such as arpspoof would cause all layer 3 traffic to first pass through the attacker, and then get forwarded to the access point. Sniffing wireless traffic, you would see a lot of duplicate traffic. Technically you'd see ~3x the layer 2 frames, since the AP is contacted between each device.
Comment: Could you clarify your question? Are you a client or the operator of the network? In what way does a MitM attacker "consume double numer of packets"? How would you detect that? What exactly do you mean by "identify"?
Comment: Supposing that a MITM attacker has managed to connect to my WIFI network, if somehow I identify from all the connected devices that a device consumes double number of packets than an average can't I result in that the device that does that also does MITM attack?
Comment: @ multithr3at3d: Ok, is this an indication that this specific node is a MITM attacker? Is it enough to conclude in this assumption?
Answer: Technically, if the attacker is sitting between point (A: Your Device) and point (B: Server/ Another User/ ..etc). The attacker will be trying to sniff all the traffic between A and B in order to get access to sensitive information.
Now theoretically speaking, the attacker will be generating a larger amount of traffic since he is sniffing the traffic, maybe modifying it before relaying it to (B), on top of the network traffic it generates.
Now, just because of a attacker generates a large amount of traffic on your network, is not necessarily a correct indication that an MITM attack is taking place.  However, the device in question may be a likely candidate. Even then, it is not a valid indication.
Also, it is import to note that the attacker not necessarily needs to sniff of the traffic originating from (A), it is possible to regulate it, in this case, your hypothesis of double the traffic generating will fail.
I am not sure if you are understanding a MITM attack properly. Here is an Okayish guide that might be useful: https://www.wandera.com/mobile-security/man-in-the-middle/man-in-the-middle-attack/
Comment: WireShark. Use this guide as a starting point: https://www.commonlounge.com/discussion/2627e25558924f3fbb6e03f8f912a12d
Comment: I think I understand what MITM is. A second question. The MITM attacker that is connected to a WIFI is able to catch the whole traffic (of all the nodes connected to the access point)? Or the traffic between the WiFi access point and a specific node, each time?
Comment: Theoretically, you can sniff traffic from any node in the network, or choose to sniff the traffic generated from one node. Realistically speaking it will depend on the resources available to perform the MITM and the number of nodes involved.
Comment: Is there a program/application that can let me "see" in such a low level (in the 7 OSI layers), so that can I measure the packets received/sent from/to a specific node in order to see if the node is doing MITM attack to my network?
Comment: Note: There are a number of other tools too. But they might have a bit of a learning curve and is not as intuitive as Wireshark.
Comment: I tested wireshark and I see that it shows the whole traffic in my wifi network, so to specific see a node, I must follow a specific IP?? Right?
Comment: That's correct. You will have to filter traffic according to your requirements to avoid all the random/normal network traffic that is already present on your wifi network.

detecting MITM attacker on WIFI


Get file system type in AIX

Question: I want to fetch the file system types in AIX like NFS and all. du command shows just the file systems not their types. How can I do that?
Answer: If you execute command mount you will get output like this:
node   mounted          mounted over  vfs    date              options
----   -------          ------------ ---  ------------   -------------------
       /dev/hd0         /            jfs   Dec 17 08:04   rw, log  =/dev/hd8
       /dev/hd3         /tmp         jfs   Dec 17 08:04   rw, log  =/dev/hd8
       /dev/hd1         /home        jfs   Dec 17 08:06   rw, log  =/dev/hd8
       /dev/hd2         /usr         jfs   Dec 17 08:06   rw, log  =/dev/hd8
sue    /home/local/src  /usr/code    nfs   Dec 17 08:06   ro, log  =/dev/hd8

As you can see the column 4 show the filesystem for particular disk/device as well as other interesting information.
Answer: To list the available filesystem types, you can look at the /etc/vfs file, described by man vfs.
To list the currently-mounted filesystems and their types, use mount as Romeo Ninov demonstrated. Alternatively,  the lsfs command has some useful options, such as: lsfs -v jfs2 to list filesystems of a particular type (jfs2 here), or lsfs -c to list filesystems in a colon-delimited format (useful for subsequent parsing).

Get file system type in AIX


Does Amazon S3 make any sort of guarantees on your data?

Question: I've read over the agreements several times, and I can't find anything that guarantees Amazon will not lose or corrupt your data. Do they make any such guarantees? Can I trust S3 as my long term backup storage?
Comment: This isn't a programming question, so it really doesn't belong here. I'd suggest asking Amazon, or maybe reading their SLA http://aws.amazon.com/s3-sla/
Answer: See Amazon's terms, specifically, section 11.5:

WE AND OUR LICENSORS DO NOT WARRANT
  THAT THE SERVICE OFFERINGS WILL
  FUNCTION AS DESCRIBED, WILL BE
  UNINTERRUPTED OR ERROR FREE, OR FREE
  OF HARMFUL COMPONENTS, OR THAT THE
  DATA YOU STORE WITHIN THE SERVICE
  OFFERINGS WILL BE SECURE OR NOT
  OTHERWISE LOST OR DAMAGED.
Answer: The general consensus is no guarantees.
But if there was a guarantee and, despite their best efforts, your data was lost or corrupted the guarantee can't recreate your data. Many guarantees are limited to returning what you have paid for the failed service or giving you another (blank) disc; and most guarantees would disappear if the company no longer offers the service (most services will give you your data back today but cannot offer guarantees for next year or in ten years' time).
If this really concerns you, consult a suitably qualified lawyer.
Otherwise (or in addition), be diligent in taking backups and securing data you don't want (or can't afford) to lose. Don't trust any one method, whatever guarantees come with it. Test restore mechanisms regularly (especially if a restore would use different software, drive or machine than the one used for the backup). For on-line services also make sure you have a separate record of any authentication credentials needed to access the service!
Answer: According to wikipedia s3 does not make any guarantees about data loss, but that statement does not have a source, so take it with a grain of salt
Comment: how can an absence of guarantee have a source?
Comment: @Andy, its called a disclaimer. Something along the lines of "Amazon makes no guarantees of data loss or corruption".
Comment: @andy If the Amazon S3 TOS contained/contains a sentence like "We make no guarantees"
Comment: There - it's been added now :)
Answer: No. S3 has no guarantee that customer data will not be lost. I would not trust S3 as your sole backup storage.
This is also the case with other online storage companies such as Mozy.
Your best bet is a comprehensive backup solution that includes physical backups, as well as online and offsite storage.
Answer: As far as I know, they make absolutely no guarantees.
You could probably trust them, simply for the fact Amazon does try to have the best customer relations, and having a reputation for losing data probably would hurt their business.
I would still keep personal backups though. Solely trusting any online storage solution is a bad idea.
Answer: I could be wrong, but I believe Mozy has a guarantee of some sort, if you're interesting in an alternative.
Answer: Section 4.2 of the Customer Agreement explicitly makes backups the responsibility of the customer. Amazon take all steps they reasonably can to ensure no data loss, but in the end it is your responsibility.
Answer: I've seen posts from people saying s3 keeps 3 copies of every file, but haven't found a page on Amazon to confirm that yet.
Answer: No. Plain and simple. Their SLA does have an uptime "guarantee," but that's the extent of it.
Answer: It is impossible to do any kind of guarantee that your data will not be lost. The best you can hope is to receive some kind of remedy which wont help you much if what you need is your data. This being said, S3 is probably much much better in keeping your data then you can do by yourself. Unless you do multiple copies of everything in separate data-centers that is.


What type of adhesive is recommended for a curved shower curtain rod on ceramic tile?

Question: What type of adhesive is recommended for gluing metal brackets for a shower curtain rod to ceramic tile. I want to avoid drilling and using fasteners. The rod is an arched type that bows out to make the shower stall a little more roomier. Also, I  don't want the ceramic to be damaged if the brackets need to be removed.
Comment: I don't think I would trust any adhesive or epoxy if it was strong enough to hold it would damage the tile, the expanding type are made in a bowed style  the one we have has rectangular end plates , I ended up drilling small holes to pin it in place after several times coming down.
Comment: And that's what I ended up doing too. appreciate the advice.
Comment: Unfortunately it will never work.  Shower rods are a nightmare!  The press out type are indeed best.
Answer: There are many tension rods on the market that are expandable to fit a regular shower. They don't require any screws or adhesive. A screw mechanism in the rod holds the rod in place after tightening. Just a thought.
Comment: There are now curved varieties of tension rods that work reasonably well, also.
Answer: For a curved rod, with its substantial torque load (twisting force), not much short of epoxy or urethane will hold reliably. I just wouldn't do it since removing those things from tile would be a chore and may result in surface damage. Wall tile is often soft with a very thin glaze.
One other option might be to mount a bracket or plate above or alongside the tile, lapping it over the tile for mounting of the rod brackets.
Comment: @jay  Stay in the grout lines if you can.
Comment: I can't do that unfortunately since the tile goes all the way  upto the ceiling of the stall and the ceiling is tiled too. Looks. like I'll be drilling.
Comment: Mounting above the tile is what I ended up doing.  I had to buy and extra long shower curtain (84"), but it was worth the hassle of ordering online for the end result.
Comment: Interesting idea. I think I might have to drill and mount the brackets with fastener if there isn't a suitable adhesive.
Answer: I would definitely not even try the adhesive approach for mounting a curved shower curtain rod. I have seen so many of these now popular rods that were so poorly secured that they were sagging a good six to eight inches or about to fall down. Especially seen in motel rooms or b&b type rentals. In almost all cases they are using small mount points similar to these:

The just are not up to the added torque and strain that exists with a curved curtain rod. Add to that the rough treatment that can come from kids or other mishandling and the installation can look like a mess. Even if mounted into a stud or header blocking in the wall these types of mounts are not optimum.
What you should look for are rods that have spreader plates welded to the ends or even double rod units that have an elongated mounting plate offer better mounting options such as like these:

I was in a hotel not so long ago that had stone type tiles on the walls of the shower. Their shower curtain rod was curved out a lot but used welded stainless steel end plates that were in fact bonded to the wall with adhesive. I do not have a picture to show so I cobbled up the example below to show how large the end plates actually were.
Comment: Thanks very much for this extensive response. I ended up drilling and was lucky enough to find  a stud  for each 3" wood screw to grab into Job done!  She's very happy now and so am I!
Answer: If your tile layout and curtain bracket allow it, you could position thins so your holes end up through the grout lines. That way, if you want to take the curtain down, it would be relatively easy to fix: grind out a little more grout, and fill it in again.
Comment: The brackets did not line up on any grouts lines so it was simply drilling into the tile.  Job done! appreciate the advice.
Answer: Whatever type of adhesive you use will eventually fail and fail miserably for this use case.   You will not only have a fallen curtain but you will have a big chunk of your wall torn out with it when it fails.   You are in an environment that is hot and cold and steamy and dry, constantly.
You have two options:

If your tile goes to about 6-7' it is simple to just install a rod that uses tension springs.   The ends sit above the tile and even if the tension fails a bit the rod just slides to the tile.    This is the most common way I have put up curved rods.
You screw the rod cap into the wall.   You can either go directly into framing (if you planned well), you can use anchors (least preferred), or if you do not have framing available using either a square molding piece or a shower flange to match the rod.

Installation:

First cover the area with tape.  I prefer duct tape - people disagree with me because of the gummy residue it leaves.   Others use painter's tape.
The mark the flange holes on the tape.  Note that when doing a curved rod installation there is usually a left and right side.   Make sure these are put right and at the right angle that the curved rod needs to be in.   For straight rods the only thing that matters with the flanges is allowing the entry to face up (if there is one)
I prefer a predrilling.   So find a very thin bit you have and go through the tile.   Too thin and your bit may break but just a really thin bit.
This small hole will provide a pilot for a larger bit.  Proceed with size you need on non-glass tile.   However if you are doing glass I would start with a very small glass bit and work your way up almost by size.  For glass I may use 4 bits... yep.     You do not do this for other types as a regular bit becomes "stuck" when going up incrementally and puts outward pressure that could cause a chip or crack.
When sizing your hole it should be bigger than your screw.   If your screw is being held by the tile the chances are your tile will eventually crack.    So you have two options here - you are going into framing (TOO LATE NOW BUT YOU SHOULD ALWAYS ADD EXTRA FRAMING FOR THE OUTSIDE EDGE OF A SHOWER OR BATH - I will often flip a 2x6 on its side to hold a potential glass frame or shower curtain).   If you do not have framing you need to epoxy (glue) anchors in.   If you do have framing you want to make sure screws will go in at least an inch.
The screws you got with the kit may not be up to snuff.  Often I replace these with longer or thicker screws.
So you have your holes, you are going into the framing or using anchors.  Put your flanges up.  When screwing these in you should not tighten with mechanical drill.   Get them 90% screwed in and then use a hand screw driver for the rest.   Two reasons here.  First if you over tighten you can crack tile.   Second when applying a lot of pressure to a hand drill, especially horizontally in a weird space/angle it tends to slip and drill bit can scratch flange or tile.
If something going bad or there is a mess up...   You can always buy an oversized flange, like below to cover the area.   These often look great and can fix even big mistakes.   Note that this area of shower has no "water issues".
Comment: The tile was all the way up to the way and on the ceiling too. I ended up drilling and sank 3" wood screws in studs and all is well. appreciate the advice.
Comment: @jay - that is the best solution.   You cannot put a tension rod on tile up to ceiling - they will slip especially the curved types.    Note that if you ever have issues you can always get an oversized flange and caulk around that - these usually look pretty good and hide any tile issues.
Answer: None. You need to mechanically bond the shower rod in some way.
Just think about the daily stresses that the shower rod endures of opening, closing, and the occasional, albeit accidental, downward tug.
Any kind of adhesive strong enough to support this abuse for years is one that will likely be unremovable from your tile when you want to update your curtain rod.
Mechanically bond it to the wall or come up with some sort of ceiling-based solution.
Answer: You indicated in a comment that this is to install a curved rod.  That's a problem because the curve introduces a torque to the brackets on the ends.  My answer below assumed the brackets would have an almost straight-down force.  Since this is a curved rod, I'm not sure that any "soft" adhesive would be viable.  Soft set adhesives are easy to remove, but they won't be strong to a rotating or pulling force.

(written assuming a straight rod)
Based on your requirements, I would try hot glue. Use the stronger kind sold in hardware stores - not the cheap low-temp craft glue.  In the future it can be softened with heat to remove.
Here is one example that I use for hanging things outside.  Really any name brand should be fine, just avoid stuff that looks like its made for hobbies.  Hobby glue tends to feel soft or gummy, is very cheap, and might be a store brand or have branding that makes it obvious that it's not for heavy duty use.  The stronger glue feels harder in stick form and might be advertised for use in "heavy duty" or outdoor uses.
Answer: Silicone. Strong bond, easy to work with, easy to get off the tiles if no longer needed.
Comment: Definitely not for a curved rod. Silicone is soft and will certainly tear loose. I'm not sure it's even appropriate for a straight rod give the small contact area. RTV, maybe, which is a fair bit tougher.
Comment: @isherwood yes bonding surface is key, but silicone has good shear strength or it would not be used for fish tanks. I would definitely give it a try, given that it is cheap and that there is not much to lose.
Comment: ok, thanks - would you make a recommendation for a particular brand, type that I could easily get from one of the big box DIY stores.
Comment: The aquarium example isn't great because there's virtually no torque on those joints and plastic frames sustain most of the stress. Only to the degree to which the glass bends between the top and bottom frames does the silicone bear any load. I've experimented with silicone many times and wouldn't expect this to work.
Comment: @isherwood I have only ever built frameless fish tanks. Oh, and by the way, I mounted a shampoo/soap/conditioner dispenser in my shower stall many years ago. When all three containers are full, it is quite heavy, and it is only held by a little bit of silicone.


Is it possible to buy a .sg domain with no affiliation to Singapore?

Question: I am considering buying another domain for my site. Possibly wanting to buy .sg domains.  Is it possible to buy when my company is not in Singapore, and I am not Singaporean?
Comment: Why you want to buy sg tld name for your site and why you want that tld when you are not a Signaporean? Does your first website anyway related to Singapore?
Comment: Hi,
No, the company i work with is not in anyway related to Singapore, but it is situated pretty close to it.  I thought by having .sg domain name i would reach more customer and be better for SEO as well.
Comment: Is it bad for SEO to have multiple domain that points to your site? i am pretty new in this so it would be great to get all the help i can get.  Thanks
Comment: Choose a (dot)com. you can optimize for any country if you do better SEO.
Answer: Sure it's possible.
Using a country code top-level domain could have negative implications for your website's SEO but you could always use a different domain as your primary domain and forward your .sg domain.
It shouldn't hurt your SEO to simply have another domain (unless it has spammy backlinks) but make sure to set it as a secondary domain and redirect traffic from the .sg to your primary domain.
I'm also curious why you want a .sg domain (I can't think of a domain hack that would end in sg).


Do you need eggs for extruded pasta dough?

Question: I'm wanting to make pasta using my KitchenAid pasta press. Many recipes I see use eggs, but some use only water. I'm thinking using so many eggs would get expensive if I do this regularly, so I'm wondering what benefit they add? Can they be partially or fully replaced with water?
Comment: I believe that commercially extruded pastas are usually water-based and egg-free.
Answer: The original pasta recipes of old were simply wheat and water.  Eggs or oil (the two most popular "water substitutes" in pasta recipes) are not at all necessary to make pasta dough, but they will have an impact on how the dough turns out.
Now, it's hard to give a firm "this is the best way to do it" answer, because everyone has their own preferences on pasta doughs, but you will tend to find that egg-based pastas are a litte more "creamy" than water-based ones.  In my experience, they work fairly well for rolling and cutting, but seem to be a little to "sticky" when extruding.  When I've tried it, the dough has had some issues with sticking to the various extruder plates, causing the pasta to tear.
Now, I have not tried it myself, but I've heard that water-based pasta doughs to much better with extruders/presses, because you can control that "stickiness" a little better and make a slightly drier dough, which comes out much more smoothly.  I've been meaning to try it myself, but have not gotten around to it yet (I really love the flavor of egg pastas, so I tend to just make those and cut them, instead   :)   ).
Answer: For everyday pasta, use your recipes that call for only water and save your eggs for special occasions.


What is the difference between shuffle in fit_generator and shuffle in flow_from_directory?

Question: I am using Keras to create a deep learning model and I would like to know that what is the difference between shuffle argument in fit_generator() method and shuffle argument in flow_from_directory() method?
Answer: From fit_generator() documentation:

shuffle: Boolean. Whether to shuffle the order of the batches at the beginning of each epoch. Only used with instances of Sequence
  (keras.utils.Sequence). Has no effect when steps_per_epoch is not
  None.

So if you are using a generator and set steps_per_epoch it would have no effect. In case of using a Sequence generator, it would get the batches in different order at each epoch. For example, in first epoch it might get my_seq[0] and then my_seq[1] and then my_seq[2] (and so on) and in the second epoch it might get my_seq[2] and then my_seq[0] and then my_seq[1] and so on for the next epochs (i.e. note that my_seq[i] is the i-th batch generated by the Sequence generator we have defined).
From flow_from_directory() documentation:

shuffle: Whether to shuffle the data (default: True)

It is not clear when and how shuffling is done. So we must take a look at the source code. By doing so, we find out that flow_from_directory() method returns an instance of DirectoryIterator class which in its docstring we can see the following:

shuffle: Boolean, whether to shuffle the data between epochs.

So it would shuffle all of the data (i.e. list of all the training images to be read at each epoch) at the beginning of each epoch.


Transforming a encryption of binary representation of a number to an encryption of vector representation

Question: Suppose Alice chooses a number $n\in Z_q$ and decompose it to its binary representation $b_0,b_1,...,b_d$. Then Alice encrypts these bits (can be any encryption scheme). Is it possible for Bob (who does not have Alice's decryption key) to read these encrypted bits  and create a vector of size $q$ so that each entry is an encryption of $0$ except at index $n$ where there is an encryption of $1$. We cam assume that Alice can send to bob information (non interactively) of size at most log(n), while keeping the number $n$ private.
Answer: If you use FHE then Alice can encrypt the bits $b_i, i \in [d]$, where $d$ is about $\log q$, send it to Bob, and then have Bob run a demultiplexer circuit. The output should be $q$ ciphertexts where all of them are encryptions of $0$ except one that encrypts $1$ at index $n$. A recursive definition can be found in Protocol 2 of https://eprint.iacr.org/2014/137.pdf, although the paper is about MPC, it can also be applied for FHE since this circuit only involves addition and multiplication.
A more recent paper also has a description of the demux circuit but in a procedural form, see Section 3.2 of https://eprint.iacr.org/2022/757.pdf
Comment: That is great. Thank you very much!


Is there a preferable way of structuring partitions/mounts for /home/userX

Question: I change linux versions/distributions quite often on one of my computers but I would like to keep my home folder working (keep configuration and files), is there another better solution than making a separate partition for /home ?
Comment: If your naming your user with the same name, everytime you reinstall. You could just simply back up your `/home/userX` and place it on the new system.

I totally dont see what the issue is. Maybe elaborating on your question.
Answer: I tend to make /home it's own partition. Exactly how big depends on personal preference, but on a simple Ubuntu desktop probably doesn't need more than 20GB of root filesystem space (the desktop across the room from me is using a whopping 6.5GB!); the rest of the drive could become /home if you wanted.
However...
You should remember that not everything pertaining to your user account(s) is stored in /home. There's lots of system-centric stuff in /etc that won't survive a reinstall. In particular /etc/passwd, /etc/shadow, /etc/group, and /etc/gshadow are important. If you reinstall and recreate your users and groups in the wrong order, the UID's and GID's won't match those recorded in your /home filesystem, and your file ownerships will be all messed up.
The solution to this extended problem is a little more complex, since the exact set of files in /etc that you'd need to preserve are likely to be very specific to your system and what you're doing. One option would be to make a protected directory under /home and make backup copies of /etc into it. At least that way you could get back the files that are missing after the reinstall. You might look at etckeeper (yes, it is packaged) as a way to make this more automated. You wouldn't want to restore /etc en-masse, of course: after a reinstall-upgrade there are likely to be major changes and you'll want to restore files from your archive or repository very carefully.
Answer: Nope, I wouldnt say. Unless you want to copy home folder alot!
Answer: If you have another computer which is connected to yours via network, you can share your home directory via NFS (or some other filesystem). This solution allows you to change your mount and without repartinioning.
Putting your home directory on some USB stick and mount it from that stick could also be an option, depending from your preferences.


Color key or transparent images?

Question: Ive seen a lot of people make sprite sheets magenta instead of transparent and then they make the magenta transparent using code. What is best (Performance) to use transparent images or use a color (example : magenta) instead of transparency?
Comment: I could give a more helpful code sample with my answer if you give more details- what kind of graphics are you going for? How many different levels of transparency do you need?
Answer: It is quite the same thing. When rendering occurs, the program can compute opaque and transparent pixels to be drawn for color interpolation on the screen. The only difference on the two techniques you mentioned is that trasparent images carry transparency information on their own, and color key gives transparency information to an image from within the program, but when the engine draws on the screen it still checks for what to draw and what not to draw, every frame.
Comment: There are some important differences. Alpha transparency requires a separate colour channel, and so it can increase the size of the texture on disc & in memory by about 33%. But it's also natively supported by GPU texture compression formats, so if your textures are amenable to compression this can often be just as efficient or even moreso than storing an image with palette transparency.
Comment: @DMGregory: More generally, in some systems the fastest graphic formats to work with may use color-keyed transparency, while on others alpha-keyed transparency might be better.  Historically, some systems had hardware support only for color keying, and some embedded systems (typically those with 16-color or 256-color hardware) still do, but most systems today support alpha channels.
Comment: @MichaelHoffmann: Some TFT-LCD controllers of the style used in cell phones have a color-keyed mode; I can't think of any I've seen with an alpha-channel mode; when clocking out 16 bits per pixel, they always use the extra bit for green.  Display hardware with fewer than 16 bits per pixel almost always uses a reserved color for transparency if it supports it at all.  I find it somewhat curious, actually, that transparency support isn't more common in TFT-LCD controllers, since nearly all of them allow an arbitrary rectangular area to be written in any combination of row-major, column-major,...
Comment: @supercat, can you give some examples of where color-keying has hardware support? I read a few good articles on that years ago, and some references would be a great refresher.
Comment: ...row increasing/decreasing, and column increasing/decreasing, without having to reload coordinates during the process (very useful for DMA) but on devices without transparency support the value of that ability is limited unless the application only has need for opaque rectangles.
Answer: It depends entirely on your needs: using transparency keys, you usually only have fully-transparent or fully-opaque colors*; using an alpha component, you can have 255 different levels of opacity. Do you want transparent smoke and flames for your explosion sprites, or just Super-Mario-Fireball style ones, with all-or-nothing opacity? It depends on your application's needs.
*Unless you use multiple transparency keys to represent different levels of opaqueness. For example, your program could treat magenta pixels as fully transparent; pixels with odd-numbered R-components as half transparent; and pixels with prime-number G components as 3/4 transparent. Whether that's a more memory-efficient option requires a lot of case-specific math to determine, but it's pretty much always more complicated than just using an alpha component in the source content, and it can really limit the colors available to you if you use too many color keys.
(Please comment if you'd like a code sample and/or images- I'm on mobile right now.)

Color key or transparent images?


How to make instances appear periodically around an object

Question: I'm experimenting with geometry nodes and I'm stuck with something I think is pretty simple but can't find a way. I just want the instances to appear around the cilinder growing and shrinking the same way I can rotate the white part of that cilinder in the shading editor
Comment: Hello and welcome. That is not Geometry Nodes. You are only showing us the Shader Node Editor.
Comment: Hi! I know, it was just to give an idea of what I wanted to do, I've added a screen of the same thing in geometry nodes
Comment: Hey is it ok if the gradient is not this specific one? A similar result can be generated using the proximity node with a line for the proximity.
Answer: You can get the polar-angular coordinate easily using Gradient Texture: Radial, which outputs a normalized value 0..1, with a sudden change from 0 to 1, which you can fix in a Color Ramp (Math: Ping Pong would work too and be more performant…). Then you can add current frame to animate the offset, and take fraction to keep it in the 0..1 range, but also divide the offset so it doesn't rotate as fast as a beacon on cocaine:

You could (since B3.6) copy-paste the Color Ramp branch to a shader, except shaders don't have Scene Time node , so you need to emulate it with a frame driver:

Keep in mind Texture Coordinate node also had to be added, because Gradient Texture has a different default coordinate in shader and geometry nodes. See: Geometry Nodes - Image texture mapping. How to?


Purge all data on remote server with rm command

Question: Let's say theoretically, I've been using a cloud server instance (such as an AWS EC2 Linux instance) and I want to delete the instance, but before I delete the instance I want to purge ALL the data that is currently on the server before I delete this instance. Can this be done by simply performing a rm -r -f /* command? I've used this before, and I would think that it removes EVERYTHING (even to the extent that one would no longer be able to login via SSH anymore). Does this really remove everything? Or does it only appear to remove everything? Since all the commands in the /bin directory are gone at this point, I can't see what's left over. So I'm just wondering, by the time the "rm" command removes itself, would everything else be deleted?
Comment: There are a few general questions about `rm -rf /` on the site that someone will be along to note as duplicates soon, but note also that "deleting" on these sorts of servers may mean even less deletion than on local hardware. It's unlikely to get any more deleted when you delete the instance either way. (This may or may not mean that the purported duplicates aren't, depending on specifics)
Comment: While your shell is still running you've got `cd` and `echo` commands, so you can (for example) `cd /bin; echo *` to see what's there.
Answer: Even on physical hardware, rm -rf / will just unlink every file, not "delete" it in the sense that it wouldn't be possible to recover by looking at the contents of the hard disk with a disk editor or a tool like photorec.
On a cloud server, you often have no idea how the data is actually stored and what the specific effects of an rm command will be. Even dd if=/dev/zero of=/dev/sda or similar is not guaranteed to actually overwrite anything; for all you know, the zeroes could be written to new storage while the old one could live on in a snapshot, invisible to you but accessible to the provider.
If you're worried about the cloud provider recovering your data after you cancel your cloud server, you should encrypt the storage. Since the provider has access to the cloud server while it is running, they can still extract the encryption key (as well as any other data they want), but once it's switched off (and provided it's really switched off) it would be a lot safer than after any attempt to merely delete the data.


Why does Samsung not allow making more than 1 user?

Question: I would like to add more users via pm on adb shell. Unfortunatly my S20 FE is set to only allow 1 user, 1 work profile and one secure folder user.
I tried to add more with pm add-user gab1 but it said "Error: android.os.ServiceSpecificException: Cannot add user. Maximum user limit is reached. (code 6) Error: couldn't create User.". I know that this worked back on Android 4 and 5 but then it also got limited by OEMs like Samsung.
Is there a way to add more users without rooting the phone?
I appreciate your answers.
Answer: <code>~> adb shell pm get-max-users
Maximum supported users: 1
</code>
I don't know specifically why Samsung does this but you can work around this restriction and have a secondary user by creating a guest user :
<code>adb shell pm create-user --guest gab1
</code>

Guest user: Temporary secondary user. Guest users have an explicit option to quickly delete the guest user when its usefulness is over. There can be only one guest user at a time.
https://source.android.com/docs/devices/admin/multi-user?hl=en


Inductive and capacitive terms

Question: What it means when we say that some component or device is inductive or capacitive? How these terms are related to capacitors and inductors?
Comment: if the most general term, a capacitor component is a component that will stock the energy into a electric field and a inductive component will stock the energy into a magnetic field.
Comment: From what perpective? Physic, power application, RLC? There is so much to talk about here.
Comment: I think in general. @MathieuL
Comment: If you are interested i can post a answer that talk about these element but from the electromagnetic perspective.
Comment: @MathieuL post please.
Comment: I will post this night, I need to recheck some electromagnetic books.
Answer: A component, device or circuit would be said to be inductive if, upon application of DC voltage, the current through or into the component, device or circuit rises with any delay in comparison to the rise of voltage applied to the component, device or circuit.
A component, device or circuit would be said to be capacitive if, upon application of DC voltage through a series resistance, the voltage at the input of the component, device or circuit rises with any delay in comparison to the rise of current through or into the component, device or circuit.
If an AC voltage is applied, any lag in current compared to voltage would indicate an inductive component and any lag in voltage compared to current would indicate a capacitive component.
Note that the delay can be any delay for an inductive or capacitive component that is not an ideal inductor or capacitor while in an ideal capacitor or inductor, the delay is 90 degrees of a sine wave.
I should add that a component, device or circuit could be exhibit either inductive or capacitive characteristics depending to frequency.
EDIT:
Additional attention is being sought for this question. I could add that when we say that some component is inductive or capacitive, that would generally mean that inductance or capacitance is predominant in the behavior of that device. The operating frequency of the circuit is an important factor in determining what characteristic is predominant.
Peter Smith has provided quite a bit about ESR and ESL. Capacitors can also have effective or equivalent parallel resistance. That accounts for self discharge or leakage of capacitors that are not connected to a circuit or passage of DC current that the capacitor is intended to block.
I don't think that it's appropriate in this forum to try to develop a discussion about the theory and application of inductance and capacitance. If more is needed, I think additional specific questions may be required.
Answer: A capacitor is a device specifically designed to have capacitance; likewise an inductor is specifically designed to have inductance. For a capacitor, this means we are exploiting electrostatics for a useful part, and for an inductor, we are exploiting magnetics for a useful part.
In a real component that is not an inductor, there will still be some self-inductance, and likewise there will actually be some parallel capacitance.
A real capacitor will have an Effective Series Inductance (usually abbreviated esl), and a real inductor will have an effective parallel capacitance (and inter-winding capacitance).
In addition, each will also have an effective series resistance.
A resistor will have an esl and an effective capacitance, and indeed all passive components are in fact RLC circuits, although the effects may not be of interest in many applications.
If we consider that capacitance exists between any two points of differing electrical potential and that self-inductance exists in any current carrying item, things become a bit clearer.
We would normally use the terms 'capacitive' and 'inductive' in relation to components where the effects of each must be taken into account and it is not apparent from the symbol that the part may operate in an inductive or capacitive mode.
As an example, decoupling capacitors in very high speed systems are in fact inductive at those frequencies (they have a self-resonance at 1/2pi sqr(LC) where L is the self-inductance of the part). The typical self-inductance of an 0805 surface mount capacitor is about 1.1nH
Above this frequency, the self-inductance of the part dominates its response, and would therefore be termed 'inductive' at those frequencies, even though it is patently not (deliberately) an inductor.
HTH
Answer: In very basic terms: Inductive components (Inductors), resist change in current. While capacitive components (Capacitors), resist change in voltage.
Both types can be used for all kinds of filtering methods (HP, LP, etc.).
Capacitive and inductive components also introduce a phase shift. They are not considered to have a resistance, but a reactance. This is the imaginary component of impedance (impedance = resistance + j*reactance). Where j is the imaginary unit.
Best of luck!
Answer:
If a component of a device is capacitive, it tends to exhibit the following characteristics,

In a dc perspective, it essentially means that it restricts the change in voltage in the parallel branch in which capacitive behaviour is observed. Moreover the current in the branch increases in a exponential fashion. And also the component becomes an open circuit in a very short span of time, because the capacitor will build up a voltage equal  to the voltage across its parallel branch.
For more reading on dc capacitors visit,
http://www.allaboutcircuits.com/textbook/direct-current/chpt-13/electric-fields-capacitance/
In an ac perspective, it essentially means that at low frequencies the capacitive component tends to open circuit itself, whereas at high frequencies it becomes a short circuit. It also makes the voltage lag current by 90 degree.
For more reading on ac capacitors visit,http://www.allaboutcircuits.com/textbook/alternating-current/chpt-4/ac-capacitor-circuits/

If a component in a device is inductive, it tends to exhibit the following characteristics,

In a dc perspective, it essentially means that it restricts the change in current in the branch in which capacitive behaviour is observed. Moreover the voltage in the branch increases in a exponential fashion. And also the component becomes an short circuit in a very short span of time, because the inductor will build up a current equal  to the current in its branch.
For more reading on dc inductors visit,http://www.allaboutcircuits.com/textbook/direct-current/chpt-15/magnetic-fields-and-inductance/
In an ac perspective, it essentially means that at high frequencies the inductive component tends to open circuit itself, whereas at low frequencies it becomes a short circuit. It also makes the current lag voltage by 90 degree.
For more reading on ac inductors visit,http://www.allaboutcircuits.com/textbook/alternating-current/chpt-3/ac-inductor-circuits/

How are inductor and capacitors related?

If you know about the duality principle, you should have an answer to this. From what I said above it can be seen that for a capacitor
I=C(dv/dt) where C is the capacitance of the capacitor.
In the above expression if you are going to change the Parameters I to V and C to L, where L is the inductance of the inductor you get the equation of the inductor,
V=L(di/dt) where L is the inductance of the inductor.
They are essentially duals in nature. Capacitor becomes an inductor if you are going to change the parameters of it.
https://en.wikipedia.org/wiki/Duality_(electrical_circuits)

Inductive and capacitive terms


Does any Spinrite level intentionally result in data loss?

Question: That is, are any of the operational levels designed in a way which writes over or otherwise destroys existing data on the disk? I looked around but couldn't find an answer to this question, and can't deduce it from the jargon used by Spinrite documentation.
Answer: The short answer is no. In fact, it will make previously unreadable blocks of data readable again.
Now for a synopsis of the long answer..
What Spinrite does is to test the operation of the disk at the hardware level. It does so by verifying the disk's ability to reliably read and write data. Because it does so outside of your operating system, using instructions directly at the hardware, it goes far beyond what Windows' built-in CheckDisk does. It reads and writes back to the whole surface of the disk. It reads each block, inverts the binary data and writes it back to verify writability, then re-inverts the data and writes it to disk, verifying again that the data is readable. This has the effect of not only verifying the ability of the disk to function properly, but also to refresh the data stored on the disk.
It's a fantastic program. I use it on all of my systems periodically, and on all customer machines when they first come into my shop. This has corrected many problems for me, including non-booting systems and periodic BSOD symptoms. If you're considering buying it, go ahead. Steve is working on updates to the program that will vastly improve the speed with which Spinrite works, and the updated program will be available for free to all owners of the current version (Spinrite 6.0).
Answer: To all intents and purposes I would say it does not destroy data and I do use the program and I find it very useful, if somewhat awkward to use with modern hardware.
If an OS tries to read a file containing a corrupted sector on a disk the disk usually tries briefly, then reports to the OS that the file is corrupted (the checksum tells the disk the sector was read incorrectly so it reports a read error). Most likely you won't be able to open the file at all.
If you run SpinRite on the disk (usually using Level 2 for data recovery), then it will force the disk to make very many more attempts to read the corrupt sector and it may well recover it and then rewrite it safely.
If you are running SpinRite on hardware that can fully access the drive (using the ancient commands that SpinRite 6.0 is still using) then it can read the individual bits of the corrupt sector and do a statistical analysis "dynastat" to try and correctly read the data (using the checksum to confirm that it got it correctly). If it fails to get it correctly, it may nevertheless have read the majority of it correctly, but because some bits are incorrect, the checksum does not match. What SpinRite does next could rile some people... it rewrites the sector with it's best guess of what it should read and it sets the checksum so the disk now thinks the sector is OK. So now when the OS tries to read the file containing that sector it will think there is nothing wrong with it.... however, some bits inside that file will be corrupt.
Now that has good and bad effects. The corrupt bit(s) may be completely inconsequential. They may be in an unused sector. They may be in the slack space after the end of a file's contents. Or maybe the file is a text file and a few characters are now garbled (but at least the file is now readable). If it is a binary executable it may crash when run. If it is part of a FAT directory, then a filename may have some garbled character, or the wrong size... or wrong location... but most likely a bunch of previously 'lost' files will have re-appeared.
So although it may sound bad to have a file with some corrupt data in it... in almost all circumstances you are better (or at least no worse off) than you were before running SpinRite.
Unfortunately, because SpinRite ignores the actual file system on the disk, you don't get any report as to which files are potentially corrupted.
(on the plus side again - the fact that SpinRite doesn't consider the file system is an advantage in that it means it works equally well on any disk irrespective of what operating system or file system it contained... from mass memory to TIVO disks)
One other worry you may have is that for a dying disk it will tip the disk into failure. Perhaps spreading debris in the drive or fatally wearing out a read head. That has not been my experience. I can't say it can't happen, but in the cases of failing disks that I have encountered it has not seemed to make the problems worse.
Answer: one other very fine point ("fine" as in "picky" and "fine" as in "applicable") is that most File System-dependent drive and data programs do not do this: read and recover most (if not all) bad bits within a sector. This has made drives functional. Once a drive comes back to life via SpinRite, BACK IT UP CONSTANTLY, (like maybe I should have done)? And BTW: HEAT is a factor; I have never had several 320GB Western Digital 7200RPM drives (about 10) fail, still in use for over 10 years, because I spent the money and did the metal-craft where necessary, to mount those dedicated HDD fan assemblies directly to the bottom of the drive. I even wired some two-fan assemblies with the fans in series, run slowly and quietly, but still absolutely prevent overheating because they keep the air moving directly on the HDD, and their metal structures wick heat away too.
I do the same to SSD's (2.5 in) and will just KLUGE a way when I use mSATA and NVMe, to KEEP THEM COOL. Because they DO get hot in use, and that is bad, and that is why heatsinks are now marketed for SSD's as well as RAM.


Cat pooping under the bed

Question: We recently got a new Shepherd Dog and now mycat. is scared to go to the litter box.  She has decided to poop under the bed.  Is there a spray or product out there that will make her stop.  she is stressd out but there has to be something we can do.
Answer: My advice here would be:
Reduce your cats stress!
A new family member no matter whether it is a dog, cat or human can be stressful for a cat. What I think is most important:

Make your cat and dog get along or atleast accept each others presence
Move the litterbox to a place where the dog cannot get, maybe even get another one so the cat can choose the one where she does not have to pass by the dog to get there.
Maybe move the litterbox to the bedroom for now if it is the cats hiding place.

If your cat is house trained and suddenly goes on the floor anway it is always a sign of something being wrong. You have to make her understand that everything is ok, the dog is not a danger or bother and she will go back to "normal". I mean would you dare go to the bathroom if someone put a huge, easily excited fluffball in your home?
Tips on how to make dog and cat get along can be found all over this forum
Senior cat and full grown dog
Introducing cat to dogs It is about getting a cat but the answer is still good

Cat pooping under the bed


Is my Google account only as secure as the recovery email?

Question: Regardless of how careful I am with my account, is it not only as secure as the recovery email registered with it?
Answer: Yes, or your recovery phone #.  There was a story recently about somebody convincing verizon to switch their phone number to a hacker's phone.   They used that to compromise the gmail address.
Fortunately, it's not always obvious what the recovery email or phone # is.
Answer: Largely, yes. Typically, in a good password recovery scheme, the recovery token is restricted in validity. It is 1) a one-time-use-only token and 2) expires over a specified time. This should reduce the attack window to the bad guy being the first to use the reset link and is able to do so within time period X.
That said, I have never personally tested the validity length of a Google recovery token, but I'm sure its not valid over a great length of time.


How to sequence better while cooking

Question: I often struggle with sequencing specific cooking activities in the kitchen, and either panic, screw something up, or more often than not the dish takes a lot longer to cook. I've tried prepping more, but I find that takes long and my cooking is delayed. If I follow a recipe, things usually turn out well, but when I'm free-cooking I tend to run into trouble. I know this problem is relating to something called sequencing. Does anyone have any good basic pointers that I could start with for sequencing so I can be more capable in the kitchen?
Comment: I am a bit confused by what you want. You say that if you prepare the main problem is that it takes "a lot longer" but if you don't prepare, it "takes long"? Also that you have most trouble when you are "free cooking"? Methods which shave time off of the cooking process rely on planning it well and preparing it. You can't use them when improvising. Also, if the time spent on organizing yourself is not somehow "extra time", you either have to spend it in preparation or during cooking, and this is what you report. Could the problem be in your expectations? What makes the time "too long"?
Answer: I actually routinely peel thing 2 while thing 1 is frying. To me the key is to work out your critical path. But you don't have to plan as I do. Just work out what your goal is:

get everything done in the least time possible
get everything done as calmly as possible
make sure nothing burns, dries out, overcooks, or cools and gets gluey

Say you want to make a piece of panfried meat (steak, chop, chicken etc) that needs to rest, along with mashed potatoes and some steamed veggies. So work out all the steps and how long they take:

sear meat 3 min each side, 10 min in oven (oh ooh, need to preheat oven), rest 10 min
peel potatoes 5 min (or however long you need), water come to boil 10 min, boil 10 min, mash 1 min
prep veggies 5 min, heat up steaming water 5 min, steam 5 min

(You can adjust all these numbers of course.)
Now you can sort it out into order so that you take as little time as possible and end up done at the same time.

dinner - 26 minutes: start searing steak. Preheat oven.
put potato water on to boil
peel potatoes (partway through, turn steak)
should be about dinner - 20 minutes now. Put steak in oven.
wait 5 minutes (tidy up?)
dinner - 15 minutes put potatoes into water
turn on steaming water
prep veggies
dinner - 10 minutes, steak out to rest
dinner - 5 minutes, put veggies into steam
dinner - 1 minute, mash potatoes, put into serving bowl, put veg into serving bowl, put steak onto serving plate, dinner is ready

The exact order will be different every time but you work it out by finding the longest chain and starting that first. For each thing you want to end up serving, you need to work back the steps to get you there and therefore when you want to start that chain. Keep in mind that an oven can preheat or a pot can boil for a few extra minutes without consequences.
Now this approach keeps the overall time the lowest and gets it all on the table at once. But you might find that too stressy. So you could do it like this:

preheat oven
peel potatoes and put them in a pan of cold water.
prep the veggies and put them in the cold steamer.
pan fry the steak, focusing on nothing else for 6 minutes
put the steak in the oven
turn the heat on under the potatoes
after 10 minutes, take the steak out of the oven to rest
turn the heat on under the steaming veg
after 10 minutes, everything should be ready

This takes 10 minutes longer because you "get your mise en place together" (that is do all the peeling and prepping) before you do anything else. But it spares you doing two things at once, and if your peeling takes 7 minutes instead of 5, all that happens is you eat a little later, you don't throw other timings off because you haven't started anything else yet.
It doesn't matter which of these approaches you take, you can still work out the order and the times when you just need to wait for a bit. As you get faster at prepping and more confident in your prep time, you may naturally start to take a more overlapping approach.
Comment: "water come to boil 10 min" This is what electric kettles are for. Bringing cold water to the boil on the stove is slow and energy-inefficient.
Comment: @DavidRicherby not arguing (and I've done it lots of times) but not relevant to working out the timing either. What matters is knowing how long a potato-pot-sized or steamer-sized pot of water needs to come to the boil on your stove or with your kettle or however you do it.
Comment: If you really want to speed it up you can put half of the water in the pot on the stove, and more in the kettle...
Answer: The short answer...This is mostly about timing and organization. Most important is, mise en place, that is, prep everything you are going to need so that you are ready to actually cook. For example, you don't want to be peeling something as another ingredient is frying. When everything is prepped, start with the item that is going to take the longest to cook...timing things so that everything is done at about the same time.
Comment: The first sentence seems un-useful. That is restating the question which is "how can I be better at organization and timing so that ...?" It is not a short answer -- be better by being better
Comment: Agreed, it's all about being prepared for what you are going to be cooking. Another thing you can do to help yourself out is to use a sous vide machine to cook your meat/fish. Sous vide will cook your proteins to the correct temperature slowly and allow you to finish your other side dishes while keeping it the correct temperature.
Comment: Actually, @LyndonWhite, the question was "how do I get better at sequencing."  In fact, organization and timing are critical elements if one wants to improve their ability to efficiently get the steps in the right order.
Comment: Ok, I know TV cooking is not "real" cooking, but every time I see them put something together, everything is prepped ahead of time. I can't multitask too well in the kitchen, so this mise en place approach seems to work better for me.

How to sequence better while cooking


How to create repeating circular dotted effect in Photoshop

Question: How can the circular dotted effect be easily applied to the edge of a rectangle in Photoshop? I tried using the lasso tool on a rectangle I create but couldn't get even spacing.
Answer: I'm going to suggest you don't use Photoshop to make your shape, but use Illustrator instead. It's much easier. Of course you can then use the vector shape as a mask in Photoshop.

Create a pattern Brush in Illustrator. All you need is a single shape like this. A square with a circular piece cut out. I used Path Finder Minus front to create it. Then drag it to the Brushes dialog, and select Pattern Brush as the the brush type.

Then apply the brush to a rectangle.

Select the shape, then do Object > Expand Appearance, and Object > Clipping Mask > Release, then use the Shape Builder tool to delete the corner circles which have filled in, and unite the shape as one. Obviously, make sure the finished rectangle has a black fill.

Then you can click and drag the rectangle shape into Photoshop, and clip an image layer to the shape.

The beauty of this method is that you will have a Vector Smart Object layer which can be resized and applied to any image without any blurring/degradation in image quality.
Comment: @Vincent - Fixed!
Comment: Do I see a connection problem / hairline there between the different segments in the pattern brush? It's relatively obvious in the bottom border of the your last screenshot.
Comment: Can you provide a sample project file for this please?
Comment: @SD8256E Sorry, no. I didn't save it.
Answer: I will take advantage of Photoshop selection tool and masking.
Draw a circle and duplicate it multiple times. Move the last circle and 1st circle layer at both ends so you can use alignment tools and distribute spaces between all of them, like this:

Group all the circles, and twist overall size according to requirements and so that it also crops corners of your rectangle.
Rastererize whole group and make a selection of it or individually make a selection of each circle (Cntl + Shift + Click). And then go to Select > Inverse.

Select your rectangle layer and create a mask. Then hide the circles layer. Repeat same for other edges.

This method might seem a bit complicated and not so perfect in terms of measurement and size. But that's what I know at the moment. I feel there could be any easier way, maybe using Patterns. Some experienced users might answer that later.


CF objects vs NS objects

Question: I'm trying to understand why there exists both CF and NS objects, which seem to do the same thing and are interchangeable through toll-free bridging. If, say, CFArray and NSArray do the same thing, and I can cast between them freely, what's the point in both of them existing? Are there rules of thumb about when to use one over the other? Are the CF objects just legacy objects from old frameworks? Any insight into this would be greatly appreciated.
Comment: It should be noted that a) not all CF types have an NS equivalent and vice versa, and b) not everything whose names are the same aside from prefix are in fact "toll-free bridged"; `CFBundle` and `NSBundle`, for example, are not. More [in the docs](https://developer.apple.com/library/mac/documentation/General/Conceptual/CocoaEncyclopedia/Toll-FreeBridgin/Toll-FreeBridgin.html), as always.
Answer: To answer your questions in order:

What's the point of them both existing?  There are a few reasons.
If you want to provide a C API, like the Carbon API, and you need things like arrays and dictionaries of referenced-counted objects, you want a library like Core Foundation (which provides CFArray), and of course it needs to have a C API.
If you want to write libraries for third-parties to use on Windows (for example), you need to provide a C API.
If you want to write a low-level library, say for interfacing with your operating system's kernel, and you don't want the overhead of Objective-C messaging, you need a C API.
So those are good reasons for having Core Foundation, a pure C library.
But if you want to provide a higher-level, more pleasant API in Objective-C, you want Objective-C objects that represent arrays, dictionaries, reference-counted objects, and so on.  So you need Foundation, which is an Objective-C library.
When should you use one or the other?  Generally, you should use the Objective-C classes (e.g. NSArray) whenever you can, because the Objective-C interface is more pleasant to use: myArray.count (or [myArray count]) is easier to read and write than CFArrayGetCount(myArray).  You should use the Core Foundation API only when you really need to: when you're on a platform that doesn't have Objective-C, or when you need features that the Core Foundation API provides but the Objective-C objects lack.  For example, you can specify callbacks when creating a CFArray or a CFDictionary that let you store non-reference-counted objects.  The NSArray and NSDictionary classes don't let you do that - they always assume you are storing reference-counted objects.
Are the CF objects just legacy objects?  Not at all.  In fact, Nextstep existed for years with just the Objective-C Foundation library and no (public) Core Foundation library.  When Apple needed to support both the Carbon API and the Cocoa API on top of the same lower-level operating system facilities, they created (or made public) Core Foundation to support both.

Incidentally, some of Core Foundation is open source.  You can find the open source part of it for Mac OS X 10.10.5 here: https://opensource.apple.com/source/CF/CF-1153.18/. I have found the source code of CFRunLoop and CFStream to be very informative.
Comment: Awesome summary, Rob. Thanks!
Answer: Core Foundation is a C API to a variety of common data structures. Most of these data structures have equivalents in Cocoa, but not all of them. Most of the ones that are equivalent are toll free bridged, allowing them to be used interchangeably, but not all of them either.
Toll free bridging is a very clever implementation trick. If you want the underlying details, see the ridiculous_fish post that @Matt Wilding points out. It's the most authoritative on the subject (and a major influence on iOS:PTL chapter 19 which also explains how it all works). But it doesn't really matter for most purposes. As Matt notes, you can generally pretend that an NSArray is the same as a CFArrayRef. This isn't really true in many cases, but it's sometimes true, and close enough most of the time. It's the same as saying that @"stuff" is the same as an NSString containing stuff. It's mostly true, but not exactly.
When OS 9 moved to OS X, it was very convenient to provide C access to Objective-C-like data structures. Many low-level frameworks today expose C APIs for performance reasons. You shouldn't think of CF as "legacy" or "internal." You should think of it as low-level and you should only use it when you need the power it provides, or are dealing with a low-level framework that requires it.
CF objects are often more flexible than their NS counterparts. For example, CFDictionaryRef can contain non-object keys and values, while NSDictionary can't. (Of course they're toll-free bridged, so you can create a non-retaining CFDictionaryRef and then treat it as an NSDictionary. Tricky that....)
As Apple releases new frameworks, you'll notice that they often expose C APIs first, and then later add Objective-C APIs. This is a reason that it's a good idea to learn Core Foundation, even if you don't use it every day. But when possible, you generally should be using ObjC.
Comment: @"string" is actually a `__NSCFConstantString`, which is a (sort-of) subclass of `NSString`. ("Sort-of" because it's a toll-free bridge class, which isn't exactly the same as a subclass.) Constant strings are in the __TEXT segment, not the heap (along with their underlying cstring, which is stored separately), and they ignore `retain` and `release` calls.
Comment: Rob, great explanation. You brought up a point that I thought was interesting. What IS the different between @"string" and NSString containing "string"? I thought that @"string" was in implicit NSString...
Answer: There's some history to this question. Core Foundation is the brains of the operation. It's written mostly in C. It was created with Apple's acquisition of NEXT and their APIs and owes a lot to them. The NS* classes are often just Objective C abstract interfaces built on top of the CF* types. So, when you ask why both CFArray and NSArray exist, the answer is that they actually don't. NSArrays are CFArrays, NSStrings are CFStrings, etc. That's why toll-free-bridging is possible.
For more interesting and detailed reading, I would refer you to this blog post.
Answer: CF stands for CoreFoundation. Exposed objects with CF in their names are just regular Core Foundation objects, written in C. All objects are toll free bridged with their Cocoa Touch Foundation friends over in Objective-C land.  They are usually opaque pointers.
NS stands for NextStep, which was the old OS that Mac OS X was built upon.  NS-prefixed objects are usually written entirely in Objective-C or C or even some C++.
It really depends on what you need each object to do.  It's certainly easier for me to work in pure Objective-C with NSString, then it is for me to work in a mix of C and Objective-C with CFString, but there are some things that CF objects can do that NS objects simply can't (mostly very low level stuff).  CF objects also dabble a lot more in Ref's, mutations, and inspections than their NS counterparts.
(For future reference, there exist a few more prefixes: CG for CoreGraphics, UI for UIKit, QL for QuickLook, AV for AVFoundation, MP for MediaPlayer, MF for MessageFoundation, GL for GLKit, and MK for MapKit)(If I've missed any, I'll gladly edit).
Comment: This answer is basically correct, but may create some confusion. Core Foundation does not "use Objective C based objects." In some cases Cocoa objects are implemented using Core Foundation objects, but never the other way around. Cocoa apps must link CoreFoundation.framework. Core Foundation apps do not have to link Foundation.framework (which provides NSString and its ObjC friends). I also wouldn't refer to CF as "Apple's internal objects." They are a full public API and commonly used with other Core frameworks such as Core Text. As you say, generally you should use NS unless you need CF.
Comment: @CodaFi, there's not really any such thing as "C objects". There's C structs, and functions that operate on them, and if you take the effort to hide the actual definition of a C struct with an opaque pointer, you can create the illusion of "C objects". This is what Apple does with the CF* types, and is why you always have to pass a CF*Ref to all the CF* functions. C++ objects, however, can be created on the stack, so that's probably what you're thinking.
Comment: @CodaFi, that's because CFStringRef is just an opaque pointer. The actual instances of CFStrings must be dynamically allocated like everything else.
Comment: What do you mean when you say that CF objects are statically allocated?
Comment: You don't need a * when you write them:  I can write CFStringRef ref; without any problems
Comment: I thought most C objects were statically allocated (or I may just be confusing it with C++)?

CF objects vs NS objects


Can CodeIgniter Website be deployed to Cloud Hosting?

Question: Currently I'm thinking of making a website in CodeIgniter and planning to deploy it in cloud hosting but I don't know if that is possible.
Answer: The documentation for installing CodeIgnitor says:

Download the latest version, and extract it to become your project root.

That is certainly something that con be done on cloud hosting.
It sounds like you don't know what cloud hosting is. Cloud hosting is very similar to getting a dedicated server or a VPS:

You get ssh access to a machine running an operating system of your choosing.
You are responsible for installing all your own software
You can usually install anything you can install on any other headless computer over ssh

The differences of cloud computing compared to dedicated servers or a VPS are in how the resources are allocated and priced:

You use a web interface or API to create and manage new servers
Billing is typically done per hour rather than per month

Given how much cloud instances look like more traditional servers, there is no reason you can't put CodeIgnitor on them.
Answer: You can do that for sure. You just have to deploy the public folder or you can just execute spark(startup manager for ci4) if you are using VPS.


After upgrading from Xcode 4.3 to Xcode 4.4 one of .xib file is not loaded

Question: I have one .xib is not loaded after upgraded from 4.3 to 4.4. I tried to change developement target to 4.4 from interface builder --->file inspector but same. I have another Mac with Xcode 4.3 same project works fine there.

Answer: I figured it out. It was not a problem with version of Xcode. Seems like Xcode 4.3 and earlier versions do not care about @synthesize in .m files once i put @synthesize in .m file my .xib file successfully loaded.


Good book on vector valued distributions?

Question: I just started a new job essentially working as a Data Scientist / Software Engineer. I have a background as a math Ph.D. and as part of that training, I've taken the typical measure theoretic probability class and fair amount of analysis (measure theory, Fourier, PDEs). However, I've never really studied any practical probability theory nor stats and one gap is all this stuff about random vectors, covariance matrices their significance etc. I can look this stuff up on Wikipedia, but a coherent treatment would be nice, so I don't end up missing things one should know about.
Question: Does anyone have a recommendation of a good book that talks about joint distributions, multivariate Gaussians etc. and whatever other important distributions there are in the higher-dimensional settings? Preferably something that assumes that the reader is familiar with linear algebra. It also wouldn't hurt if the book contained rigorous treatments of stuff like SVD and how it applies to PCA, since this is not typically part of a pure math linear algebra class. I assume there are other similar topics in linear algebra, which are useful in stats, but typically omitted in the standard linear algebra and grad abstract algebra classes. If no single book covers this, a reading list of a few books would not hurt either.
Answer: The suggestions would be subjective. But from I learned about your background and your job, I believe the ESL book should be what you needed for the bridge on math and real world applications.
The Elements of Statistical Learning


Is 'liege' masculine?

Question: 'Liege' seems to most often refer to a man.  Is that because most lords in history and fiction are men, or because 'liege' is a masculine noun?  If the latter, is there a feminine counterpart?
Comment: English nouns do not generally have grammatical gender. Vestiges of it survive in a few loan words, but it has no grammatical function in English.
Comment: Sorry, I'm not meaning to ask about strict grammatical gender.  What are the proper terms for gendered terms like 'milkman' and 'congresswomen' if not 'masculine' and 'feminine'?
Answer: To my knowledge, there is no feminine form of the noun liege.  There are obvious historical reasons for this, but I lack the knowledge to give an apt explanation.
However, the decidedly masculine phrase liege lord was also quite common and more or less identical in meaning.  Although I have never knowingly come across it in reading, the obvious feminine form of this is liege lady. Google Ngram leads me to believe that liege lady is used at least occasionally.
The more direct feminine form would seem to be liegess, but I have never seen or heard it used, nor does Google Ngram display a single instance of it.
Answer:
Liege (adj.)
word used by a vassal to address his superior or lord in the feudal system, c.1300, from Anglo-French lige (late 13c.), Old French lige "(feudal) liege, free, giving or receiving fidelity," perhaps from Late Latin laeticus "cultivated by serfs," from laetus "serf," which probably is from Proto-Germanic *lethiga- "freed" (cognates: Old English læt "half-freedman, serf;" Old High German laz, Old Frisian lethar "freedman"), from PIE root *le- "let go, slacken" (see let (v.)). Or the Middle English word may be directly from Old High German leidig "free." As a noun from late 14c., both as "vassal" and "lord." Hence, liege-man "a vassal sworn to the service and support of a lord, who in turn is obliged to protect him" (mid-14c.).
Source: Etymonline

It's origin, anyway, seems to support your view on its use being mainly referred to men.
Answer:
"In general, my liege lady,' he began, 'Women desire to have dominion Over their husbands, and their lovers too; They want to have mastery over them. That's what you most desire—even if my life Is forfeit. I am here; do what you like."
― Geoffrey Chaucer, The Canterbury Tales
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

Is 'liege' masculine?


php file/folder treeview with descriptions script?

Question: I am displaying a file/folder structure using a treeview component using PHP, for an online library. Now I need to be able to add optional descriptions to each folder/file, so I guess I need to cross this with a mysql database. I was wondering if someone knows of an opensource script that will let you do this, so as not to have to write it from scratch?
Basically it should map a server folder/file structure to a mysql database, let you upload files and new folders, along with descriptions and allow navigation of the structure via a webpage.
Thanks!
Michael
Answer: Try the PEAR::HTML_Tree


How i can select opposite part of object in blender

Question: I have a question. How i can select opposite part of object in blender. Like if i want to make object with symmetric parts. I Hope you understood it.
Comment: Try using a [Mirror Modifier](https://blender.stackexchange.com/questions/353/how-can-i-make-the-mirror-modifier-work-right) instead
Answer: The quickest and most comfortable way to do this is with a Mirror Modifier. See the images below for reference.
Where to find the modifier:
you can find it in the properties panel, just click in the little blue wrench symbol, then click on "Add Modifier" and select it from the list that appears

Properties:
now you have to make sure you select the correct axis in which you want to mirror the object (you can select more than one if you need to), In the image below the Y axis is selected so the object is mirrored alongside that (the green one just to be clear). Another important property you want to select is clipping which prevents part of the object to go "through the mirror" and therefore intersect its mirrored half. In the example below the right part is the original object and the left part is the mirrored one; each vertex of the original one can never go on a position with a negative value for Y because clipping is enabled.

Mirror Plane
Another important thing to keep in mind is the so called Mirror Plane: it is a plane perpendicular to the axis you select to mirror the object (hence, it is formed by the other two axes) and it is located in the same spot where the object origin is. So you have to make sure that the origin is placed where you want the mirroring to happen. As an example, in the image below the two object are mirrored alongside the same axis but the origin (= the yellow dot) is placed in different places (and so is the mirror plane), risulting in different kinds of mirroring.

Every modification is automatically mirrored on the other side!

Final advice:
remember to apply your modifier only after you are done modeling your object, as clicking on Apply will add the mirrored part to the mesh data of the object. In that case if you want to keep modeling symmetrically you'd have to delete half of your object and use another mirror modifier.
Remember also that you must be in object mode in order to apply a modifier.
Comment: Important to point out that you don't *have* to apply the mirror modifier if you don't have a reason to.
Comment: Yes that's right, I forgot to point that out because I'm used to apply it anyway once I'm done, thanks!


Where do terminated incomplete downloads go when using firefox?

Question: Where do terminated incomplete downloads go when using firefox?
Answer: They should stay in the designated folder. Mine is /Downloads, and they can have either the filename.part or some weird name.part. Either way, they should be in your downloads or designated folder. If you cannot find it, right click and do show in finder, and it will open the folder containing it.
Answer: To the "great bit-bucket in the sky".  Whenever I cancel a download with Firefox, it cleans up after itself.  Leaving partial downloads around is abnormal, e.g., if I crashed or killed Firefox during the download.
Comment: In fact, if you crashed or killed Firefox, removing partial downloads would be abnormal, because it would neglect the possibility of *resuming* it, which on a large file can be a pain if not available. Now when you explicitly cancel it, then that's another story and it would be removed (or at least it should ask).


Escape of Upscaling image in Scale and Crop option

Question: I am using Image Style with Scale and Crop option with the dimension 110 * 110. If the style applies on small image it upscales the size to 110 * 110. I don't want to upscale it. How to do that?
Answer:
A separate scale image effect followed by a separate crop image effect won't give you what you want.
Imagecache Actions does not offer a single image effect that does what you want.

However, what you could do is use the aspect switcher image effect of imagecache_actions:

aspect switcher:

if portrait: scale to 110x(empty) (no upscaling)
if landscape: scale to (empty)x110 (no upscaling)

crop to 110x110
Comment: It works but it sets black background in images. i dont want black background.
Comment: I tested it with a smaller image and with a portrait and a landscape image that are larger and it seems to work for me. The larger images are 110x110,the smaller one remains smaller. There is an error in core though, as it sets the dimensions to the specified crop dimensions, also for smaller images. So the width and height attribute of the img tag are incorrect.
Comment: OK, with GD as toolkit it fails as you describe, with imagemagick it works. Another error in core?
Comment: It doesn't work. ehh
Answer: ImageCache Actions module gives you way better control. Using it, you can create an "downscale, crop, put on background" set of commands that will give you 110 x 110 px image without upscaling.
Answer: With the image style scale and crop option, it will always upscale the image. It is only with an image style like scale that you have the options of not up-scaling. So your best option is to find another image style that might meet your need. For more image style options, check out the Imagecache Actions


Linux: Copy/paste in TTY

Question: I am looking for a way to copy and paste within a TTY. I only have a touchpad, and using it with gpm is a pain. The only possibility I can think of is to use "screen" but even after having remapped Ctrl-A to "`", it is still inconvenient and slow.
Are there any more-comfortable approaches?
Comment: Interesting question. GPM has been around for a long time and I haven't heard a lot of complaints, so I'm a little dubious about finding a good alternative...
Comment: gpm works fine here but it is not flexible enough for my needs. Navigating using the keyboard is much faster than using the mouse. Therefore I also prefer VIM instead of graphical editors. So VIM-inspired key bindings for TTYs could enhance navigation.
Comment: IMHO after testing it I would recommend using screen for copy-paste. It supports all console apps, so You can copy and paste with lynx/links.
Answer: If you don't like screen or gpm, your alternatives are quite limited.  The other options I can think of are:

Run terminals under X, maybe using a tiling window manager for a minimalist, console-like look.
Run a *BSD instead of Linux, which will let you use sysmouse instead of gpm.  I hear it's better, and my limited BSD experiences suggest that it may very well be better, but I don't know if it's better in the area of clipboard support.  Sounds like you mostly just don't like your trackpad though, which is probably unfixable without replacement.
Use pipes, named pipes, scratchfiles, etc.  For example, most unix editors will let you process selected text via normal command line scripts, which could be setup to save the selection to ~/.clipboard, for instance.  Running commands that input text (cat ~/.clipboard) should be even easier.
Use an editor that supports multiple files, and copying/pasting across them.  vim does, and emacs does too, I'm sure.
Comment: What also troubles me is the bloat. X.org is a huge chunk of complex code. As I am not a gamer, nor do I have to maintain many remote desktops, personally I have absolutely no need for direct rendering, X forwarding etc. Actually, the framebuffer offers all I need for working. Only the number of available applications is a bit limited. :)

2) This would not really solve my problem as I want to get rid of my mouse.
Comment: 1) There are a few flaws with the X-Server that prevent me from being effective in it. The first one is that the keyboard strangely reacts much slower than in the framebuffer. This really annoys me as scrolling in a document (VIM) in a URxvt is not by far as fast as a VIM started in a TTY. The next issue is the performance. Although I am using KMS and a tiled window manager (i3), the X-Server does not start up immediately. Neither do the applications. Even small applications such as URxvt take various seconds to start.
Comment: 3) Yes, that is what I am currently doing whenever I want to visit a link within a plain text document in VIM but honestly, copying the link into the buffer with "yy", then typing ":tabnew url" followed by a "p" for pasting and a final "w3m $((cat url))" on the shell is not as comfortable as an URxvt with "clickable" links.
Answer: You can use Ctrl+y to paste. To copy, it depends of what you want to copy.
If it is on the prompt : Ctrl+u to cut from the beginning, Ctrl+k to cut until the end.
Comment: Thanks. These key bindings are really useful. Unfortunately I can only make use of them when I am working on the shell but not in text-browsers or other console tools.
Answer: tmux is similar to screen and gives you the ability to copy-paste.
dvtm can copy/paste with mouse.
Answer: depending on what you are trying to copy and paste... bash does have a vi mode which you can edit your commands in a more like vi way than emacs(bash default) (zsh has a vim mode). putting set -o vi in ~/.bashrc enable's it.
Comment: Nice! As I am also VIM user, key bindings similar to the VIM ones come in handy. Actually, one small problem persists: Sometimes there are websites where URLs are not hyperlinked but rather in plain text. If I visit such websites in w3m, I would have to manually copy that link in order to navigate to it. Another example is VIM: If I am viewing a document containing URLs, it is not possible to just "click" them (as in URxvt). Here as well, I have to manually copy them. These are the only two applications, a global clipboard support could be useful. Any ideas?
Answer: Try this:
ls $(xsel -o --display :0)

If there is "wa*" in the clipboard it will produce this in any TTY terminal:
$ ls -l  $(xsel -o --display :0)
-rwxr-xr-x 1 root root 1254 Jan 30 11:44 wav_to_mp3.sh
$

Maybe it can be made even easier via bash aliases.
Anyway I solved that finally this way:
1) copy text into clipboard in TTY7 - GUI
2) then I switch into say TTY1 and I write command:
expandclipboard.sh youtube-dl cb
3) the script expands the command and inserts the content of the clipboard at the place of cb and runs is.
the code of the script is:
    #!/bin/bash
    var1=$1
    if [ "$var1" = "cb" ]; then
    var1=$(xsel -o --display :0)
    fi

    var2=$2
    if [ "$var2" = "cb" ]; then
    var2=$(xsel -o --display :0)
    fi

    var3=$3
    if [ "$var3" = "cb" ]; then
    var3=$(xsel -o --display :0)
    fi

    var4=$4
    if [ "$var4" = "cb" ]; then
    var4=$(xsel -o --display :0)
    fi

    var5=$5
    if [ "$var5" = "cb" ]; then
    var5=$(xsel -o --display :0)
    fi

    var6=$6
    if [ "$var6" = "cb" ]; then
    var6=$(xsel -o --display :0)
    fi

    var7=$7
    if [ "$var7" = "cb" ]; then
    var7=$(xsel -o --display :0)
    fi

    var8=$8
    if [ "$var8" = "cb" ]; then
    var8=$(xsel -o --display :0)
    fi

    echo $var1 $var2 $var3 $var4 $var5 $var6 $var7 $var8
    $var1 $var2 $var3 $var4 $var5 $var6 $var7 $var8

I know it is immensely primitive, but I am lazy to pretend that I am any cleverer than this script. :-)
Answer: You can connect with other computer by SSH, it's a option =).
Comment: Welcome to Superuser.  Please take the tour at https://superuser.com/Tour to get the most out of this site.
Comment: If, after taking the [tour](/tour), you still really believe that this is a valid, useful answer, please [edit] it to explain how it answers the question.  Do not respond in comments; [edit] your answer to make it clearer and more complete.

Linux: Copy/paste in TTY


Number of pages for journals?

Question: I am aiming to publish my masters thesis in psychology and found some journals fitting my topic. Is there a recommended number of pages for the parts introductions, methods, results, discussion and conclusions? I could not find this in the authors guides of the journals I was looking for. These are some of the journals of interest: BMC Psychiatry, IEEE-Transactions on Affective Computing, Speech Communication, Computer Speech and Language.
Comment: How about reading papers in your target yournals and use these as orientation?
Comment: Good idea, thank you!
Answer: I know of no psychology journal that gives an explicit statement about the proportion of each paper that is expected to be devoted to the introduction, methods, etc. Indeed, it frequently seems to me that the decision by many journals to impose high minimum-word-lengths on articles means that a great many are unnecessarily verbose. When faced with the problem of an appropriate division, probably the best you can do is to see how other authors in the same journal have managed the available space.
However, there is another option which I have only recently encountered. Some journals ("Self and Identity" being the example I saw) make it clear that they will accept articles of (almost) any word length, with figures, tables and references formatted in any style of your choosing. Within the simple constraints of, say, Background, Rationale, Methods, Results, Discussion, you can then present your own research in its best light, choosing a length that best suits you, with the lengths of the sections determined by the demands of the content.

Number of pages for journals?


503 error while deploying Google App Engine application

Question: I am trying to deploy an application on Google App Engine. While using appcfg.py to update my application, it is showing the following error:
Precompilation starting.
Error 503: --- begin server output ---
Try Again (503)
An unexpected failure has occurred. Please try again.
--- end server output ---
Precompilation failed. Your app can still serve but may have reduced startup performance. You can retry the update later to retry the precompilation step.
I dont know how to solve this problem. Can anyone suggest me a method to solve this? Thanx in advance..
Answer: I believe this is just temporary. See here.


Interesting documetaries on graphic design and any kind of design

Question: I'm looking to be introduced to interesting documentaries in the field of design, I saw Helvetica and it blew my mind and am looking for films similar to this one.
Comment: This question asks for fictional movies but one of the answers provides a bunch of documentaries: [**Are there any films about graphic design?**](http://graphicdesign.stackexchange.com/q/20519/8708)
Answer: Whoa! Major subject! I think the simplest answer would be the Architecture and Design Film Festival(s)
On that page, you can go through a massive backlog of previous films, filmmakers and subjects.
...or you could search youtube for "design film"....


How does a minority government work in the UK?

Question: In light of the exit polling, it looks like the UK will have a hung Parliament. In the event that no coalition/working relationship deal is made, am I correct in thinking that the country is then run by a minority government? How does it work exactly?
Answer: A minority government can be formed if no party gets a majority. Should they be unable to put together a coalition, they can form a minority government and fill all the ministerial positions themselves.
This Independent article explains how minority governments are formed:

How can they exist?
If a proposed government wins a confidence vote in parliament, it becomes the government. Other parties could support a government without actually joining it.
This could happen for a variety of reasons: the supporting party might think the resulting government was a better option than something else, the minority government might be the only option to form a government other than another election, or the supporters might get concessions.

Basically, the party will still have to cooperate with smaller parties to pass legislation in Parliament as it requires a majority.
This BBC article explains this:

If the Conservatives or Labour are unable to put together a coalition or decide to go it alone, they can form a minority government, filling all the ministerial positions themselves.
This party would be unable to pass laws and legislation without the votes of other parties that are not part of the government.

It's worth noting that minority governments often don't last long as it's difficult to govern and pass legislation in Parliament. An notable one would be Harold Wilson's minority Labour government that lasted only for 7 months in 1974, though he managed to win a small majority after calling an election.
A relative more successful1 one would be John Major's government that became a minority after losses ay by-elections. It existed for 2 years from 1996 to 1997.
1 It's considered successful as it managed to last much longer than Wilson's minority government in 1974.
Comment: Note that there have been longer-lasting minority governments in the Scottish Parliament and Welsh Assembly.


Automatically skip empty commits when using git rebase

Question: Usually, you have to do git rebase --skip, it would be nice if there was a switch to automatically skip over these empty commits. Anyone know how to do this?
Comment: It's a pain in the neck indeed. I just want to get the latest code asap and not be bothered with such a minor thing that can be fixed later.
Answer: Very old topic, but for me was the first result on the search engine.
I finally found there is a --empty parameter that can take one of the following values: keep, drop, and ask.
Link to the documentation:
https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---emptydropkeepask
So you now can simply do git rebase ... --empty=drop
Comment: Would be nice to have this also for other commands like `am` :( Git is a mess in command parameters, not many consistency...
Comment: Very cool, I wonder when this flag was added
Answer: G2 - uses the following alias continue
Url to G2 - https://github.com/orefalo/g2
Cheatsheet - http://orefalo.github.com/g2/
#!/bin/bash
#
# This command is used to resume a conflict, either rebase or merge
#  it will smartly do a rebase --skip when necessary

state=$("$GIT_EXE" g2brstatus)

[[ $state = "rebase" ]] && {

action="--continue"
if git diff-index --quiet HEAD --; then
    echo "The last commit brings no significant changes -- skipping"
    action="--skip"
fi

"$GIT_EXE" rebase $action 2> /dev/null

}

[[ $state = "merge" ]] && {
# Count the number of unmerged files
count=$("$GIT_EXE" ls-files --unmerged | wc -l)
[[ $count -ne 0 ]] && echo "I am afraid you still have unmerged files, please run <g mt> to resolv conflicts" ||"$GIT_EXE" commit
}

Comment: That seems very helpful, but I'm looking to do it once at the beginning, something like "git rebase --skip-empty" rather than stop on each one. I will try this though if nothing else turns up
Comment: I don't know of any flags on rebase. remember you skip after a conflict resolution and git expects you to know if you should rebase or continue. g2 fixes that issue by figuring it out for you. You may change the script to you likings.


Pixellated Gradients when exporting PDF from Illustrator

Question: I designed a business card with some graphics that have gradients, but every time I export a PDF the gradients show up pixellated. I tried setting Print > Advanced > Transparency and Overprint > High Quality but that did not work. Does anyone know how I can export a PDF for print that has smooth gradients? I would appreciate any ideas you have.
Here's what it looks like in Illustrator.

And here's what it looks like in the PDF.
Comment: What zoom percentage are you looking at the PDF? **All** gradients in  will be "pixelated" if you zoom in.
Comment: Can you attach the file?
Comment: I have had this concern before with small sizes. You "fit to screen" and see the artwork in a much larger scale than you would with a poster and everything looks pixelated. It is probably fine. I think that a gradient mesh needs to be rasterized in a pdf, and you have used "High Quality" = 300 ppi. You could try adding a 300 ppi image next to the graphics and compare the pixel size in the pdf.
Comment: Take a look at the **compression** settings in **Save Adobe Pdf** dialog.
Comment: Thanks Scott and Wolff, I think my issue was just that I was zooming in too far. If I zoom out, it looks okay.
Answer:
go to  Effects/ Document raster effects settings ...
change your resolution to 300 (even more if you want better quality)

The reason for this is that mesh gradients are not rendered inside a PDF (or web browsers ) so they get rasterized before exporting


Easiest way to block access to a site for a group

Question: I'm looking to remove access to select sites in our Sharepoint intranet for a group of users in a division we're divesting. I have a "M365" type dynamic group which should include all those employees. I don't see a "deny access" permission level I can use so am wondering if there's another way without resorting to conditional access policies (which don't seem to work).
Answer: You wouldn't "deny" access as such, you simply wouldn't grant those users permissions to the site. If you've granted permissions to the site via a group that contains those users, then you'll either need to remove the users from that group or use a different group to grant access that doesn't contain those users.
Comment: We're tied to Azure AD and the "everyone" token includes all employees so I suppose I could create a dynamic group excluding those tied to the business unit being divested. It affects about 2k users so can't do anything manual.
Comment: There's no choice. SharePoint vs File System are 2 different things when it comes to permission management, it's by design. In File System you can "deny", not with SharePoint.