Best saw to notch a tricky floor joist

Question: I'm running a new light switch and have to unfortunately notch out a hard to access joist to get into the wall above. Our house is a small antique cape house and this will not affect the floor's integrity. What kind of saw would be best for a hard to reach 2x8 board like this?
Comment: The layout is not clear. Using the "edit" button below your question text, and the "moon and mountains" button over the resulting editing window, please attach a photo of the joist you're asking about.
Comment: Probably an oscillating saw ("Fein", etc), but not sure since the picture didn't upload.
Comment: It's impossible to say from what little information we have. Photos are necessary.
Answer: Before you get wrapped up in "notch", have you considered drilling a hole? A long(ish) bit, either auger or spade, will go a good long ways, which makes it easy to deal with tight spaces. And you can pick up a 10-14 inch extension if you need one.
Comment: I can't see a hole saw working well,  they are best for thin material.
Comment: @MikeL I would look into a long "electrician's augur" bit. They are available in lengths up to 48" or so, and augur bits have a screw thread at the end that makes them self-feeding after a small push to get them started. They also have a flexible shaft so you can get it in through the hole in the wall, then bend it and push it up into the top plate above. They can be a bit spendy, but your local tool rental place will probably have them for a very reasonable price.
Comment: I'm now leaning toward a hole with possibly a small hole saw bit. Thank you for the advice, it should also better preserve the joist.
Answer: There's several options,
You could just carve the notch using chisels.
You could drill the notch using a spade bit and changing the drill angle as the hole grows. you may want to practice the technique on some scrap before you use it in anger.
You could screw a temporary guide block to the joist and drill a hole partially in the joist and partially in the block.
You could drill a series of shallow holes to make a notch.
You could use some combination of the above.
Comment: Thanks so much for the ideas everyone. I'm going to use some type of drill method, possibly a flexible bit
Answer: Notching always compromises strength. Drilling is by far the least compromising option.

Best saw to notch a tricky floor joist


Why does live usb boot take up almost full space and are there any ways to get around that?

Question: I recently downloaded Puppy Linux which is almost 280MB .iso file. I had a 4GB USB drive. So I fired up good old dd command to burn the iso to the live usb. Everything went well, however, after live boot, all I was left with was 4MB ish disk space in the USB. Then I formatted it, burned a Debian distro in the same USB, and live booted and also got the same 4MB ish space left. Are there any ways to get around, because I think PuppyLinux would most probably not use all of the space as same as a 3GB .iso file from a Debian distro.
Answer: With dd you write the disk image including partition table as is. Since the Puppy image is minimised to the required content, the partition size of the ISO is independent from your USB size and only contains Puppy (plus 4MB free).
I'm not aware of a direct option on booted Puppy to expand the partition to full USB size (like it is available of Raspberry Pi images). One option could be to mount the USB on another Linux and expand the partition with gparted.
Other option would be to do a proper install on the USB drive (not just dd the iso) as described in the Puppy manuals: Puppy Linux Installation and Usage.
Answer: Puppy Linux

Puppy Linux suggest that you start with the simplest method, cloning, to a USB drive. This will be a live-only drive without persistence. The drive space behind the cloned image will not be used.

The next step for Puppy Linux in a USB drive is done in a two step procedure starting from a live-only drive.

Boot into Puppy in the first drive
Create a suitable partition and file system with gparted
Open the Puppy Installer from Setup in the main menu ...

From this link:

So you want to install Puppy
Naturally you can actually install Puppy if you wish. Once you boot
Puppy and are happy with what you see it is time to open the Puppy
Installer from Setup in the main menu. There are 3 main types of
install; frugal, USB and traditional full install.
...
USB Install (Recommended)
This type of install copies the main puppy files from the boot media (either optical or USB) to your chosen USB drive. Firstly, you
should insert the USB drive that you want to use for installation.
Again using the graphical partition manager GParted you need to make
sure that there is a suitable partition on the USB drive. This can be
formatted to fat32 Windows™ style filesystem (good for portability if
you want to use the drive as storage to be used between Linux and
Windows™) or one of the supported Linux filesystems. (Note: not all
Puppies support the f2fs filesystem. The installer is intelligent
enough to know this.) Again, you are prompted for the location of your
boot media files (either an iso image, optical media or just the files
themselves) and once confirmed these are copied to a folder in your
chosen USB drive. A bootloader is then installed and once finished you
can reboot into your new system. This can be booted on any computer
you like! This is also a type of frugal installation.
Again, this will be a pristine system that requires you to save your session at shut down if you want to keep your settings. Once
saving the session is complete, a pupsave file or folder is created.
On you next boot your files and settings will be exactly as you left
them at last shutdown.

Debian

Also a Debian live iso file can be cloned to create a live-only drive, where the drive space behind the cloned image will not be used.

But it is possible to create a new partition in the unallocated drive space behind the cloned image. This can be used as a partition for persistence or as a simple data partition.
You can do it manually with fdisk and mkfs, or automatically with mkusb-plug

Another alternative is to use mkusb-dus alias mkusb version 12 to create a more advanced persistent live drive with a 'usbdata' partition and a partition for persistence.


Tip the balance

Question: I wanted to know that as the definition of "tip the balance" is (https://dictionary.cambridge.org/dictionary/english/tip-the-balance);
Does this statement make sense?
"Being addicted to computers cuts both ways but the example of telecommuting tips the balance in favor of advantages."
Thank you so much
Answer: In this context, the sentence probably means that even though being addicted to computers has its advantages and disadvantages, telecommuting causes the advantages to outweigh the disadvantages.
So therefore "tip the balance" represents how telecommuting "adds more weight" to the advantages, so it is in favour of the advantages. The balance in this case represents how the advantages and disadvantages cancelled each other out intially.
So yes your sentence makes sense and is correct.
Comment: Yes people can interpret it easily so your sentence should be fine @sourenasaeedzadeh
Comment: Thank you so much, so it makes sense? Because it is my own statement

Tip the balance


going parallel through two lists in a jinja2 template

Question: I am currently writing a small torrent client with flask.
My problem is that when I deal with files priorities, I have two list of the files to deal with, each one containing specific details/commands about the different files.
And I need to go through both of them in the template at the same time and in parallel (so that each time, we speak about the same file !)
Here is the forms :
# each individual file in the torrent have its own priority, thus, we need to manage   them individually !
class TorrentFileDetails(Form):
filename = HiddenField('filename')
priority = SelectField(u'File priority',choices=[('off','off'),('low','low'),('normal','normal'),('high','high')])

class TorrentForm(Form):
hidden      = HiddenField('hidden')
ratiolimit  = DecimalField("ratio")
downloadlimit   = DecimalField("down")
uploadlimit     = DecimalField("up")
bandwidthpriority = SelectField(u'Torrent priority', choices=[( -1,'low'),(0,'normal'),(1,'high')])

# we append each individual file form to this, as we don't know how many there is in each torrent !
files       = FieldList(FormField(TorrentFileDetails))

And here is the view part :
# fetch informations about the torrent using the transmissionrpc python library
torrent = client.get_torrent(tor_id)

###
    if torrent.seedRatioMode == 0:
        torrent.seedRatioMode = 'Global ratio limit'
    if torrent.seedRatioMode == 1:
        torrent.seedRatioMode = 'Individual ratio limit'
    if torrent.seedRatioMode == 2:
        torrent.seedRatioMode = 'Unlimited seeding'

    control = TorrentForm()
    ###
    files = list()
    for f in torrent.files():
        fx = dict()
        fx['name'] = torrent.files()[f]['name']
        if torrent.files()[f]['selected'] == True:
            fx['priority'] = torrent.files()[f]['priority']
        else:
            fx['priority'] = 0
        fx['size'] = torrent.files()[f]['size']
        fx['completed'] = torrent.files()[f]['completed']
        files.append(fx)
        f_form = TorrentFileDetails(filename=fx['name'],priority=fx['priority'])
        control.files.append_entry(f_form)

    if control.validate_on_submit():
        type(button.data)
        #start_stop_torrent(tor_id)
    return render_template("torrent.html", title = torrent.name, files = files, user = user, torrent = torrent, control = control)

Here is the template part :

Files

        File name
        Completed / Size
        Priority

    {% for file in control.files %}

        {{file.hidden_tag()}}
        {{file.name}}	 <- should come from torrent.files() list !
        {{file.completed|filesize}} / {{file.size|filesize}}	 <- should come from torrent.files() list !
        {{file.priority}}
        {# <button type="submit">Send</button>	 #}

    {% endfor %}

As you can see, I have one list which is those coming from transmission and containing just names, size, basic things. These are not to control and so, not in the form. The other list is the form itself, which contains controls, but can't just show file size or other.
So in the template, I should follow both list accordingly, but don't know how !
Anyone has an idea ? Suggestion ?
Thanks !
Answer: Solved by using HiddenField in the forms to pass the pieces of text I need.
For exemple, filename and size become hiddenfield :
filename = HiddenField('filename')
size     = HiddenField('size')

After that, I don't need anymore the fx dict, nor the files() list.
In the template, the pieces of text are printed with their value :

Files

        File name
        Completed / Size
        Priority

    {% for file in control.files %}

        {# {{file.hidden_tag()}} #}
        {{file.filename.data}}
        {{file.completed.data}} / {{file.size.data}}
        {{file.priority}}
        {# <button type="submit">Send</button>	 #}

    {% endfor %}


Could the existence of a kaiju (giant monster) be justified by anything besides magic?

Question: Would aliens be able to create one using sufficiently advanced technology (perhaps sufficiently advanced biology or materials science) or could a kaiju that doesn't call the gravity-less vacuum of space home only exist because of magic? Is there ANY proposed theories or hypothetical future/alien technology that could plausibly explain the existence of kaiju? Or does the villainous square cube law continue to wresk havoc upon the dreams of innocent writers?
Comment: Check out Clarke's 3rd law.
Comment: I'm aware of Clarke's Third Law and I recognize the relevance of it, however I'm looking for answers that might plausibly explain kaiju using technology that doesn't exist yet, but which conceivably could. Rather than just wave my hands and say "MAGIC!" or "ALIENS!", I want an explanation that at least partially explains how such creatures might be possible using real, if slightly exaggerated, science.
Comment: Cyborgs.  Give 'em advanced materials (internally) for support and power (fusion reactors!), and you can move even a mass-y mostly-biological kaiju around... stomping humans and tanks like ants.  Also, if you don't mind smaller ones, T.Rexes stomple pretty good. 2-ton lift strength even in those puny arms, iirc.
Answer: If the kaiju is a construct built by the mass application of nanotech assemblers, then it may be built from any sufficiently strong material, and may superficially resemble any naturally-evolved and grown organism - or not, as its designers choose.
Nanoassemblers are currently science-fiction, but since the technology of automated assembly is advancing all the time, it is a logical extension of current technology that nanoassemblers might one day exist.
The question then becomes: How big could the kaiju be?  See: How large a bioengineered mobile lifeform could exist on Earth?.
Comment: This is a very good answer for an un-answerable question.
Comment: [Sufficiently strong material](http://worldbuilding.stackexchange.com/questions/29801/what-are-some-plausible-super-materials/29834#29834).
Comment: Sufficiently strong biological material, that is.
Answer: Air composition.
There are two main places where the square-cube law hurts large creatures.
One is the problem of moving things around. How do you get nutrients and chemicals to different parts of the body? The problem shows up the fastest with oxygen, since that's needed for pretty much everything. If your leg isn't able to get oxygen, it won't be particularly useful. (This also applies to any other chemical replacing oxygen; I'm not aware of any hypothetical creatures which don't need to move reactive chemicals around their bodies.)
Humans use a centralized system, where there's one incredibly-complex system in the middle of the body (the heart and lungs) which sends oxygen everywhere else. But this gets more and more difficult as the body size increases, since that single pump is pushing more material over a greater distance.
One alternative is to use a distributed system: effectively, the different parts of your kaiju's body breathe separately. This is sort of what insects do, with gas exchange happening all throughout the body rather than in a central organ. However, this requires that the gas exchange mechanism be both simple (to allow for multiple instances in the body) and efficient (to actually work). In Earth's atmosphere, insect respiration is unable to support anything more than about 3cm across. But higher oxygen levels in prehistoric times made it significantly more efficient, allowing insects to grow significantly larger.
So if you increase the levels of oxygen (or whatever equivalent chemical) in the atmosphere, that makes one of the barriers easier to overcome.
The other problem is, plain and simple, support. Strength tends to grow as the square of length, while weight grows as the cube. So scaling something up directly would make it weaker and weaker.
But weight can also be offset by buoyancy. Sea animals on Earth can grow much larger than land animals, because the buoyant force of the water around them can offset their greater weight.
So if you could greatly increase the density of the atmosphere—by multiple orders of magnitude—that would provide somewhat more support for the kaiju's body.
However, at this point, your planet would look very different from Earth.
Completely changing the properties of air would affect human life tremendously as well: for one, in air dense enough to support kaiju, you could effectively "fly" or "swim" in any direction.
So since you mention alien design, the best choice is probably to rely on a hypothetical future material being arbitrarily strong to support the skeleton, and hypothetical future power systems being arbitrarily effective to keep it all running.


When is a control point contested vs being captured?

Question: When is a capture point being contested and when is being captured in Team Fortress 2? Whenever the announcer announces that a control point is being threatened by the other team, how is the determination made? It doesn't seem like there's much of a difference as there doesn't seem to be criteria for either. Is there a difference or is just random?
Answer: According to the TF2 wiki page on Control Point:
Captured:

Control points are captured by standing on top of them.

Contested:

If players from both teams are on the same, unlocked control point, that point is said to be contested, which means no progress is made toward the point changing team control.

So if you/your team are the only ones on the point, you will capture. A point is contested when both you and the enemy team are trying to capture the same point.
Comment: I'm pretty sure it is not possible to capture a control point if there is an enemy player on the point. Regardless how many players of your own team are there.
Comment: @eee You are correct. You will ***not*** be able to capture if there are any enemy players on the point. It even says it in the quoted text for "contested"
Answer: The Administrator has multiple voice lines for the same events, and in this case, I don't think it makes any difference which word she's using.
Comment: Because there's a difference between voice lines and some of the technical terminology used elsewhere.
Answer: rosuav is correct. Although the wiki defines the terms "captured" and "contested", in actual gameplay the Administrator uses both words interchangeably regardless of whether any defenders are on the control point at the time the attackers walk onto it. It is completely random, and the game doesn't make any distinctions at all.
Comment: Really? That's weird how the wiki makes a distinction but it doesn't reflect in the voice lines. If this is true, I'll go ahead and accept Rousav's because he answered first, but if there was maybe some reference material that be better.
Comment: @Andrew Li: Yeah, I'd upload some footage to support the answer but I'm not about to make a YouTube account just for some one-off videos. Perhaps something changed over the years, or perhaps it was an oversight from the very beginning.
Comment: Okay. I'll go ahead and trust this because it does seem a bit random in my own experience. Thanks.
Answer: If a point is contested, it means that at least one of your own teammates is standing on the point at the same time as at least one enemy. In this case, the point can not be captured by the enemy until your teammate leaves the area or dies.
If a point is being captured, it means that at least one enemy stands on the point and makes progress towards capturing it for his team.


Hydrogenation of pent-4-en-2-one

Question: If one equivalent of $\ce{H2}/\ce{Pt}$ is made to react with one equivalent of pent-4-en-2-one, what will be the product formed?
Comment: Generally the double bond goes, but it depends on the catalyst system used.
Comment: Is there a reason to say so?
Comment: For your information, actually C=C is stronger than C=O bond with bond strengths 680 & 500 KJ/mol respectively.
Comment: @Neon Prince I have edited the question. Thanks
Answer: You have not specified the full reaction conditions - temperature and pressure can make a considerable difference - however this quote from Chemistry Libre Texts  here (in turn quoting Basic Principles of Organic Chemistry by Roberts & Caserio) gives us a clear indication of the relative ease of hydrogenation of ketones vs double bonds.

Hydrogenation of aldehyde and ketone carbonyl groups is much slower than of carbon-carbon double bonds so more strenuous conditions are required. This is not surprising, because hydrogenation of carbonyl groups is calculated to be less exothermic than that of carbon-carbon double bonds....It follows that it is generally difficult to reduce a carbonyl group in the presence of a carbon-carbon double bond by hydrogenation without also saturating the double bond. Other reducing agents are more selective:

Hydrogenation of pent-4-en-2-one


Extract notification text from parcelable, contentView or contentIntent

Question: So I got my AccessibilityService working with the following code:
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
    if (event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) {
        List<CharSequence> notificationList = event.getText();
        for (int i = 0; i < notificationList.size(); i++) {
            Toast.makeText(this.getApplicationContext(), notificationList.get(i), 1).show();
        }
    }
}

It works fine for reading out the text displayed when the notifcation was created (1).

The only problem is, I also need the value of (3) which is displayed when the user opens the notification bar. (2) is not important for me, but it would be nice to know how to read it out. As you probably know, all values can be different.

So, how can I read out (3)? I doubt this is impossible, but my notificationList seems to have only one entry (at least only one toast is shown).
Thanks a lot!
/edit: I could extract the notification parcel with
if (!(parcel instanceof Notification)) {
            return;
        }
        final Notification notification = (Notification) parcel;

However, I have no idea how to extract the notifcation's message either from notification or notification.contentView / notification.contentIntent.
Any ideas?
/edit: To clarify what is asked here: How can I read out (3)?
Answer: I've wasted a few hours of the last days figuring out a way to do what you (and, me too, by the way) want to do. After looking through the whole source of RemoteViews twice, I figured the only way to accomplish this task is good old, ugly and hacky Java Reflections.
Here it is:
    Notification notification = (Notification) event.getParcelableData();
    RemoteViews views = notification.contentView;
    Class secretClass = views.getClass();

    try {
        Map<Integer, String> text = new HashMap<Integer, String>();

        Field outerFields[] = secretClass.getDeclaredFields();
        for (int i = 0; i < outerFields.length; i++) {
            if (!outerFields[i].getName().equals("mActions")) continue;

            outerFields[i].setAccessible(true);

            ArrayList<Object> actions = (ArrayList<Object>) outerFields[i]
                    .get(views);
            for (Object action : actions) {
                Field innerFields[] = action.getClass().getDeclaredFields();

                Object value = null;
                Integer type = null;
                Integer viewId = null;
                for (Field field : innerFields) {
                    field.setAccessible(true);
                    if (field.getName().equals("value")) {
                        value = field.get(action);
                    } else if (field.getName().equals("type")) {
                        type = field.getInt(action);
                    } else if (field.getName().equals("viewId")) {
                        viewId = field.getInt(action);
                    }
                }

                if (type == 9 || type == 10) {
                    text.put(viewId, value.toString());
                }
            }

            System.out.println("title is: " + text.get(16908310));
            System.out.println("info is: " + text.get(16909082));
            System.out.println("text is: " + text.get(16908358));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

This code worked fine on a Nexus S with Android 4.0.3. However, I didn't test if it works on other versions of Android. It's very likely that some values, especially the viewId changed. I think there should be ways to support all versions of Android without hard-coding all possible ids, but that's the answer to another question... ;)
PS: The value you're looking for (referring to as "(3)" in your original question) is the "text"-value.
Comment: Not much to add on Tom's solution except that for 4.2.2 viewIds are null because they are not contained in `action.getClass().getDeclaredFields()` so in order to get them you need to use `action.getClass().getSuperclass().getDeclaredFields()`.
Comment: +1 for the hard work. To get away from the hard coding, you might get more mileage out of text.values which gives you a Collection. If you iterate through this I get two iterations, 1st is the sender's number, 2nd is the message.Collection col = text.values();
String testStr = "";
for (String el : col)
   testStr = el;// 2nd iteration -> msg
Comment: I have use your code inside onAccessibilityEvent, and is giving me Null pointer Exception at RemoteViews views = notification.contentView
Comment: @Zap was able to verify that this code works on 4.2, too, but: "I've verified this on 4.1.x and 4.2 and it seems to still hold fine in general. However, note that under 4.2 (as opposed to 4.1.x and 4.0.x as far as I've seen) the viewId will sometimes be null so you need to be careful in your tests!"
Comment: +1 for both of you! It seems to work on 2.3.7 as well, but I will do more testing. Awesome! You will definitely get the bounty, but I will just leave it a couple more days so your answer gets more attention.
Comment: Has anyone managed to get around the issue of viewId being null on 4.2? I'm trying to extract the text from the ContentView as described
Comment: It seems to me that this code does not work under GB. `16908358` is not the value for the content text. Any ideas who I can get this code work under GB?
Comment: It works good with 1 lined notification text. It doesn't show all text of the expandable notification which contains more than 1 line of text. Please, give a tip how to fix it. Many thanks.
Comment: @TomTasche NickT  thanks for nice answer it work in android 4.0 but when i test in on kitkat 4.4.4 not working.Any help?
Comment: @SmartphoneDeveloper I am getting the same exception. Have you already found a solution?
Comment: I am also getting Null pointer Exception at RemoteViews views = notification.contentView please suggest me any alternative solution.
Answer: I've spent the last week working with a similar problem and can propose a solution similar to Tom Tache's (using reflection), but might be a little bit easier to understand.  The following method will comb a notification for any text present and return that text in an ArrayList if possible.
public static List<String> getText(Notification notification)
{
    // We have to extract the information from the view
    RemoteViews        views = notification.bigContentView;
    if (views == null) views = notification.contentView;
    if (views == null) return null;

    // Use reflection to examine the m_actions member of the given RemoteViews object.
    // It's not pretty, but it works.
    List<String> text = new ArrayList<String>();
    try
    {
        Field field = views.getClass().getDeclaredField("mActions");
        field.setAccessible(true);

        @SuppressWarnings("unchecked")
        ArrayList<Parcelable> actions = (ArrayList<Parcelable>) field.get(views);

        // Find the setText() and setTime() reflection actions
        for (Parcelable p : actions)
        {
            Parcel parcel = Parcel.obtain();
            p.writeToParcel(parcel, 0);
            parcel.setDataPosition(0);

            // The tag tells which type of action it is (2 is ReflectionAction, from the source)
            int tag = parcel.readInt();
            if (tag != 2) continue;

            // View ID
            parcel.readInt();

            String methodName = parcel.readString();
            if (methodName == null) continue;

            // Save strings
            else if (methodName.equals("setText"))
            {
                // Parameter type (10 = Character Sequence)
                parcel.readInt();

                // Store the actual string
                String t = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel).toString().trim();
                text.add(t);
            }

            // Save times. Comment this section out if the notification time isn't important
            else if (methodName.equals("setTime"))
            {
                // Parameter type (5 = Long)
                parcel.readInt();

                String t = new SimpleDateFormat("h:mm a").format(new Date(parcel.readLong()));
                text.add(t);
            }

            parcel.recycle();
        }
    }

    // It's not usually good style to do this, but then again, neither is the use of reflection...
    catch (Exception e)
    {
        Log.e("NotificationClassifier", e.toString());
    }

    return text;
}

Because this probably looks a bit like black magic, let me explain in more detail.  We first pull the RemoteViews object from the notification itself. This represents the views within the actual notification.  In order to access those views, we either have to inflate the RemoteViews object (which will only work when an activity context is present) or use reflection.  Reflection will work in either circumstance and is the method used here.
If you examine the source for RemoteViews here, you will see that one of the private members is an ArrayList of Action objects.  This represents what will be done to the views after they are inflated.  For example, after the views are created, setText() will be called at some point on each TextView that is a part of the hierarchy to assign the proper Strings.  What we do is obtain access to this list of actions and iterate through it.  Action is defined as follows:
private abstract static class Action implements Parcelable
{
    ...
}

There are a number of concrete subclasses of Action defined in RemoteViews. The one we're interested in is called ReflectionAction and is defined as follows:
private class ReflectionAction extends Action
{
    String methodName;
    int type;
    Object value;
}

This action is used to assign values to views.  A single instance of this class would likely have the values {"setText", 10, "content of textview"}.  Therefore, we're only interested in the elements of mActions that are "ReflectionAction" objects and assign text in some way.  We can tell a particular "Action" is a "ReflectionAction" by examining the "TAG" field within the Action, which is always the first value to be read from the parcel.  TAGs of 2 represent ReflectionAction objects.
After that, we just have to read the values from the parcel according to the order in which they were written (see the source link, if you're curious).  We find any string that is set with setText() and save it in the list.  (setTime() is also included, in case the notification time is also needed. If not, those lines can be safely deleted.)
While I typically oppose the use of reflection in instances like this, there are times when it is necessary.  Unless there is an activity context available, the "standard" method won't work properly, so this is the only option.
Comment: @Jon C. Hammer you provided perfect solution, but i am facing problem in android 4.4.4 and above version,notification data is not accessible .Have you faced same issue?
Comment: Great man. Can you tell me how you dig into this, like I wanted to learn how to dig into problems like this and find the solutions. I am really impressed with the explanation you provided. Great work..thanks a lot...
Comment: For this particular problem, necessity. I had to find an answer in order to get the functionality I wanted. Technically, the Eclipse debugger was very helpful, since it showed all the private members of all of the objects. Between that, looking through the source, and researching on SO, I eventually figured out how it worked.
Comment: notification.contentView it has deprecated, Is there any alternative solution available please suggest me.
Answer: There's another way if you don't want to use reflection: instead of traversing the list of "actions" that are listed in the RemoteViews object, you can "replay" them on a ViewGroup:
/* Re-create a 'local' view group from the info contained in the remote view */
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ViewGroup localView = (ViewGroup) inflater.inflate(remoteView.getLayoutId(), null);
remoteView.reapply(getApplicationContext(), localView);

Note you use remoteView.getLayoutId() to make sure the inflated view corresponds to the one of the notification.
Then, you can retrieve some of the more-or-less standard textviews with
 TextView tv = (TextView) localView.findViewById(android.R.id.title);
 Log.d("blah", tv.getText());

For my own purpose (which is to spy on the notifications posted by a package of my own) I chose to traverse the whole hierarchy under localView and gather all existing TextViews.
Comment: I know this is old but I this might help others as well. You can get the content using `TextView tv = (TextView) localView.findViewById(16908358);` with `16908358` taken from TomTasche's answer. As stated above this might return nil in some cases.
Comment: Here's more if anyone's interested:
    static final int TITLE = 16908310;
    static final int BIG_TEXT = 16909019;
    static final int TEXT = 16908358;
    static final int BIG_PIC = 16909021;
    static final int INBOX_0 = 16909023;
    static final int INBOX_1 = 16909024;
    static final int INBOX_2 = 16909025;
    static final int INBOX_3 =16909026;
    static final int INBOX_4 = 16909027;
    static final int INBOX_5 = 16909028;
    static final int INBOX_6 = 16909029;
    static final int INBOX_MORE = 16909030;
Comment: You could use the above to identify what type of bigcontent style is being used. BIG_PIC and INBOX_ are unique for bigpic style and inbox style respectively.
Comment: Perfect! Thank you. I've been able to get title and largeImage of the notification, but no luck with the content text so far. Do you know how to do it?
Comment: Turns out these are device specific. See my answer below.
Answer: Adding on Remi's answer, to identify different notification types and extract data, use the below code.
Resources resources = null;
try {
    PackageManager pkm = getPackageManager();
    resources = pkm.getResourcesForApplication(strPackage);
} catch (Exception ex){
    Log.e(strTag, "Failed to initialize ids: " + ex.getMessage());
}
if (resources == null)
    return;

ICON = resources.getIdentifier("android:id/icon", null, null);
TITLE = resources.getIdentifier("android:id/title", null, null);
BIG_TEXT = resources.getIdentifier("android:id/big_text", null, null);
TEXT = resources.getIdentifier("android:id/text", null, null);
BIG_PIC = resources.getIdentifier("android:id/big_picture", null, null);
EMAIL_0 = resources.getIdentifier("android:id/inbox_text0", null, null);
EMAIL_1 = resources.getIdentifier("android:id/inbox_text1", null, null);
EMAIL_2 = resources.getIdentifier("android:id/inbox_text2", null, null);
EMAIL_3 = resources.getIdentifier("android:id/inbox_text3", null, null);
EMAIL_4 = resources.getIdentifier("android:id/inbox_text4", null, null);
EMAIL_5 = resources.getIdentifier("android:id/inbox_text5", null, null);
EMAIL_6 = resources.getIdentifier("android:id/inbox_text6", null, null);
INBOX_MORE = resources.getIdentifier("android:id/inbox_more", null, null);

Answer: To answer your question: This does not seem possible in your case. Below I explain why.
"The main purpose of an accessibility event is to expose enough information for an AccessibilityService to provide meaningful feedback to the user." In cases, such as yours:

an accessibility service may need more contextual information then the
  one in the event pay-load. In such cases the service can obtain the
  event source which is an AccessibilityNodeInfo (snapshot of a View
  state) which can be used for exploring the window content. Note that
  the privilege for accessing an event's source, thus the window
  content, has to be explicitly requested. (See AccessibilityEvent)

We can request this privilege explicitly by setting meta data for the service in your android manifest file:
<meta-data android:name="android.accessibilityservice" android:resource="@xml/accessibilityservice" />

Where your xml file could look like:
<?xml version="1.0" encoding="utf-8"?>
 <accessibility-service
     android:accessibilityEventTypes="typeNotificationStateChanged"
     android:canRetrieveWindowContent="true"
 />

We explicitly request the privilige for accessing an event's source (the window content) and we specify (using accessibilityEventTypes) the event types this service would like to receive (in your case only typeNotificationStateChanged). See AccessibilityService for more options which you can set in the xml file.
Normally (see below why not in this case), it should be possible to call event.getSource() and obtain a AccessibilityNodeInfo and traverse through the window content, since "the accessibility event is sent by the topmost view in the view tree".
While, it seems possible to get it working now, further reading in the AccessibilityEvent documentation tells us:

If an accessibility service has not requested to retrieve the window
  content the event will not contain reference to its source. Also for
  events of type TYPE_NOTIFICATION_STATE_CHANGED the source is never
  available.

Apparently, this is because of security purposes...

To hook onto how to extract the notifcation's message either from notification or notification.contentView / notification.contentIntent. I do not think you can.
The contentView is a RemoteView and does not provide any getters to obtain information about the notification.
Similarly the contentIntent is a PendingIntent, which does not provide any getters to obtain information about the intent that will be launched when the notification is clicked. (i.e. you cannot obtain the extras from the intent for instance).
Furthermore, since you have not provided any information on why you would like to obtain the description of the notification and what you would like to do with it, I cannot really supply you with a solution to solve this.
Answer: If you've tried TomTasche's solution on Android 4.2.2, you'll notice it doesn't work.
Expanding on his answer, and user1060919's comment...
Here is an example that works for 4.2.2:
Notification notification = (Notification) event.getParcelableData();
RemoteViews views = notification.contentView;
Class secretClass = views.getClass();

try {
    Map<Integer, String> text = new HashMap<Integer, String>();

    Field outerField = secretClass.getDeclaredField("mActions");
    outerField.setAccessible(true);
    ArrayList<Object> actions = (ArrayList<Object>) outerField.get(views);

    for (Object action : actions) {
        Field innerFields[] = action.getClass().getDeclaredFields();
        Field innerFieldsSuper[] = action.getClass().getSuperclass().getDeclaredFields();

        Object value = null;
        Integer type = null;
        Integer viewId = null;
        for (Field field : innerFields) {
            field.setAccessible(true);
            if (field.getName().equals("value")) {
                value = field.get(action);
            } else if (field.getName().equals("type")) {
                type = field.getInt(action);
            }
        }
        for (Field field : innerFieldsSuper) {
            field.setAccessible(true);
            if (field.getName().equals("viewId")) {
                viewId = field.getInt(action);
            }
        }

        if (value != null && type != null && viewId != null && (type == 9 || type == 10)) {
            text.put(viewId, value.toString());
        }
    }

    System.out.println("title is: " + text.get(16908310));
    System.out.println("info is: " + text.get(16909082));
    System.out.println("text is: " + text.get(16908358));
} catch (Exception e) {
    e.printStackTrace();
}

Comment: It works good with 1 lined notification text. It doesn't show all text of the expandable notification which contains more than 1 line of text. Please, give a tip how to fix it. Many thanks.
Comment: This works great, but its not working under android 5 anymore. Any solutions? secretClass.getDeclaredField("mActions"); this line throws an NoSuchFieldException, but i see this field in debug mode. Very strange... Please help!
Answer: Achep's AcDisplay project has provided a solution, check the code from Extractor.java
Answer: You can also look at private fields of Notification object for some extra information,Like contentTitle,contentText and tickerText
Here is relevant code
Notification notification = (Notification) event.getParcelableData();
getObjectProperty(notification, "contentTitle")
getObjectProperty(notification, "tickerText");
getObjectProperty(notification, "contentText");

Here is getObjectProperty method
public static Object getObjectProperty(Object object, String propertyName) {
        try {
            Field f = object.getClass().getDeclaredField(propertyName);
            f.setAccessible(true);
            return f.get(object);
          } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }


How do hybrids (half-humans and half-ghouls) rate in strength compared to normal ghouls?

Question: In the anime series, there are several types of hybrids: artificial half-ghouls like Kaneki, biological half-ghouls like Eto and half-humans like Arima. How are they supposed to rate in strength compared to regular ghouls? Are they stronger, weaker or have equal strength? Is this stated in the series?
Comment: Hi. To the one who put up a close-vote, while the question seems opinion-based, a definite answer can be given based on information from the manga and from real-world information. As a manga reader, I don't think the answers to this question is primarily opinion-based :)
Answer: Biological half-ghouls are extremely rare. However,

in the Tokyo Ghoul universe, they are considered an urban legend and their strength are supposed to be superior compared to regular ghouls
To cite examples of their strength, Eto was an SSS rate in her Owl form and S rate without her Owl form; the Underground King waged war against humanity, prompting the creation of the CCG and V;

Artificial half-ghouls are similar.

Looking at the list of successful artificial half-ghouls here, one can see in the manga that their abilities are way above a normal ghoul
While not stated in the manga, I think what affects their strength is the abilities of the ghoul that they were made from (only Rize and Eto was used by Kanou to make artificial half-ghouls, who were at least S-rate ghouls)

Half-humans raised in the Sunlit Garden

have highly developed physical capabilities. While not elaborated upon, I consider their strength still superior to normal ghouls as most, if not all, of them were highly distinguished investigators (as seen in their membership in Arima Squad)

Against each other, it would be difficult to rank hybrids as there are a lot of things to consider. However, even without official information on their ranks, strengths, etc., biology tells us that hybrids have improved or increased function of any biological qualities. (Heterosis) So, it would be safe to say that hybrid ghouls are superior to normal ghouls.


How to setup a fiber optic cabling link between two buildings

Question: I am having issues with speeds (internet/network). Server, modem and fire wall in on building and connected by a 400 ft of cat5 cable. Cable is running over head and tru pvc conduit. I know it should be replaced with fiber optic cable however I am green when it come to fiber optics and to connect to cat5 at the switches. What would be a  good solution on how to get this done?
Comment: 400 ft is about 120 meters in [SI](http://en.wikipedia.org/wiki/International_System_of_Units).
Comment: @longneck Which is why I think getting a fiber run is now on the table.
Comment: Is it really 400 feet? Your about 70 feet past the accepted maximum length of Ethernet over cat5.
Answer: Buy a pre-made multimode fiber cable in the appropriate length with LC connectors . The cable should be rated for pulling. The  nice thing about LC connectors are you can fit them  through conduit. Just don't pull by the connectors.
Make sure your conduit does not have any right angles in it and any  bends should  have at least a 6 inch radius.
Get yourself a bottle of wire pulling lubricant. Be generous.
If your switches don't have LC fiber connectors built in, buy SFP transceivers (if you switch has SFP ports) or media converters.
Comment: One missing detail is the class of fibre; for 400ft it shouldn't matter too much, although if you think you might ever possibly want/need this link to be 10gbit, go with OM3 or higher. Make sure you don't mix the fibre classes. For example, if you terminate the fibre to a patch panel instead of plugging it directly to the switch/media converter, make sure you use a matching class of patch cable to connect the patch panel to the switch/MC.
Comment: @Brian Class refers to the optical properties of the cable, not the construction of the cable covering. The spools of cable you are talking about were probably rated for direct burial and UV exposure and armored with built-in minimum bend radius protection. The cable I am suggesting is much less expensive and designed to be run through appropriate conduit.
Comment: Good call on the OM3.
Comment: I don't know what class the Army uses, but when I was in the Signal Corps, we had SPOOLS of fiber that we pulled all over the place, right angles, left angles, you got it. Left it outside for days, buried it, no conduit. Lasted a year in Iraq. No wire lubricant at all.
Answer: Personally, if you're green with fiber optic I would forget about doing that yourself, either get someone in or leave it.
400ft is over the maximum length of cat5 standard (max 100m ~330ft), so the simple solution if it's available to you is to put a suitable hub or switch in the middle. Of course if this is through walls and conduits you may not find a suitable place where it's available for maintenance, don't just seal it in the wall...
Another option is to use ATM or some other suitable long distance system, but ethernet over cat5 will cause you issues.
Comment: Fiber, at least in this instance is not all that complicated. It is easy to find pre-terminated fiber in all sorts of lengths. Combine that with a couple of media converters (or SFPs if the switch support them), and Bob's your uncle.
Answer: Fiber is somewhat fragile, and it can break (and be rendered useless) if it is subjected to too much strain.
You can't just pull it over a very long length without taping it to something else (that you'll also be pulling) at regular intervals to relieve the strain.
You can buy special, relatively inexpensive network pull string for the purpose, or if you don't have any of that you can use any high tensile strength string (not twine, it breaks too easily, and avoid stretchy string because that sort of defeats the purpose – you want the string to help pull the fiber, not the other way around).
The fiber I've seen needs to be inside something to protect it (no direct burial) – you can use cheap irrigation pipe for the purpose, as long as it's large enough for the connectors at the ends to pull through (don't try to be thrifty and undersize the pipe, but at the same time realize that fiber with the small LC connectors has plenty of room inside a standard one inch irrigation pipe, assuming you're not pulling several multiple fiber pairs or other wires and cables).
Also, you should use pulling lubricant on long pulls to prevent damage to the fiber jacket.
(Information taken from fiberstore.com)
Answer: As said before: Order preconfigured OM3/OM4 cabling in the fitting length and buy a pair of SFP (SX-LX) transceivers specified to fit your switches (don't go for cheap "compatible" ones, better stick to the manufactorers.
Use good cabling with a thick and strong outer casing and be careful not to either bend or pull too much on installing (fibre is more liable to break than copper). And make sure you have some extra pairs of fibre for either swapping out defective ones or further expansions. Won't make too much of a difference, and will be very very much cheaper than having to run a new cable some time later - labour costs can be twice or more than the cables itself...
tsg
Answer: Longneck's suggestion of a Multi-Mode lead with LC connectors is sound but you could also consider your options for expansion later and install a higher capacity cable, maybe try something with  MTP/MPO connections (12/24 core) with a plug-n-play FOBOT at each end.  Definitely go with Laser optimised OM3 or OM4.
Whichever option you go with make sure you clean before you connect. Even if you just use some of the disposable fibre wipes.  One of the biggest causes of fibre issues is dirty mating surfaces.
Answer: Before going through the effort and expense of running fiber, you might try using an Ethernet extender like the ones shown here:
http://www.netsys-direct.com/category_s/1814.htm
I've had excellent success with the above company. If you need to do gigE, the above won't work. But if you're happy with 100mbps (or close to it), you should be good.


How to create a new user without home directory and with specific UID

Question: How can I add a new user "Kids" with UID = 500 and without home directory with adduser command in terminal? I'm trying this: sudo adduser --no-create-home --uid ID 500 Kids and after correctly entering password it says that value "ID" is invalid for option uid. Then I have tried the same thing only without "ID" and got: Please enter a username matching the regular expression configured via the NAME_REGEX[_SYSTEM] configuration variable.  Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.
Answer: First - UIDs less than 1000 are usually system reserved, pick a higher UID.
Second - Why are you wanting it to not have a home directory.  Keep in mind the --no-create-home doesn't mean the user doesn't have a home directory assigned, it just isn't created.  An error will be logged every time that user logs in.
Third - Please remember to post errors your get, else we can only assume as to what the problem is.  I'm assuming it has to do with the name format, in which case, you can bypass this using --force-badname, as the error message would say, or use all lower case characters.
*edit typo
Answer: adduser command will let you include all the default home directories automatically. So you can not with adduser directly.
you can use useradd instead.
sudo useradd <username>

will create the user with the given user name.
While coming to UID , the Range 499 reserved for system users i.e in Linux each service creates its own user and below 499 UID will allocated for those users.
hope that helps.
Answer: useradd -M username --- creates user without home directory
we can check it as tail -5 /etc/passwd which doesnot show the users home directory as it shows nologin
useradd -u userspecificid username

user specific id will be displayed after 999
Comment: where is the answer for specific UID ?
Answer: You can still use "adduser".
Try again with:
adduser -u 500 kids --no-create-home


Other users's helpful flags invisibility

Question: Why can't I see how many helpful flags a user has, in his/her profile? Is it considered as private information? It's something similar like review which I can see at least when hovering over an image in recent reviews.
Answer: Not sure on the official reason, but being able to see others' helpful flags could influence some users in their opinion of a user.
Affecting their decision towards answering a user's question or not, or influencing how they vote up/down that user's answer/question.
Which is unfair, as the community moderating aspect of the site is voluntary, and a user shouldn't be judged just because they've not had any helpful flags. That user might not help out at all with suggested edits or reviewing etc, but their answers and/or questions are in themselves providing invaluable content to the site.
Also, I don't see any need for being able to see such information on other users, other out of interest/being nosey etc
Comment: @OndrejJanacek - It should be pointed out that the one time this information is useful to know, during moderator elections, helpful flag counts are now made visible for candidates: http://stackoverflow.com/election/4
Comment: There are other things that are visible in users' profiles which I browse just out of interest. So why not this one? Activity, favourites and profile views are some of them.
Comment: *"but being able to see others' helpful flags could influence some users in their opinion of a user."* - what's wrong with that? There are many more things that make me think *very* poor of a user which I can see even without any kind of moderator powers.
Answer: Yes, flags were originally designed for diamond moderators in mind, and information about these flags is strictly confidential.
Today's flags include a variety that only appears in the review queues and is not seen by us in the moderator queue, but at the end of the day flags are still a fundamental moderation tool, and therefore the only people who should be concerned with a user's flagging information and statistics are moderators and members of the SE team. So, as James has mentioned, there is no need for the average user to be able to see this sort of information; curiosity/nosiness alone is not a good reason for the system to reveal this sort of information to just any user.
To reinforce the privacy aspect, note that users with at least 10k reputation are considered to have "access to moderator tools", but for the sake of confidentiality all flags listed in the 10k queue (i.e. that are not limited to diamond moderators) are anonymous — you would only be able to see posts that were flagged, but not the users flagging them. That is something only we can see, and are under no obligation to disclose unless the user chooses to do so on their own. (In fact, moderators have to abide by the moderator agreement, which states that we are not to disclose information that only we can see.)


why is link generated in YUI javascript failing to render in rails?

Question: Using YAHOO.widget.treeview to generate a table with three levels of data: module, submodule, and detail.   If there is an image associated with a detail row the javascript generates a link:
"Screenshot	"

that is appended to the html for the row.
The url is generated correctly and the link appears.   When clicked nothing happens except the word 'Done' appears in the browser status bar.
Am calling the very same url from another page that does not use javascript and the screenshot page appears as expected.
Here is the controller.
class ScreenshotController < ApplicationController
  def show
      if @detail.screen_path.length > 1
    @imagePath = "#{RAILS_ROOT}" +
      "/private/#{Company.find(@detail.company_id).subdir}/" +
      "#{Project.find(@detail.project_id).subdir}/screenshot/" +
      "#{@detail.screen_path}"
       send_file ( @imagePath, :type => 'image/jpeg', :disposition => 'inline')
    end
  end
end
A sample url:  http://localhost:3004/screenshot/show/20854
This code from show.html.erb belonging to the detail model works:

View', :controller => 'screenshot', :id => @detail.id, :action => 'show' %>

Any ideas???
Answer: maybe there's some unwanted js that intercepts your click on generated links?


"Sea of Electrons" - do the individual electron shells interact with each other?

Question: I've often heard metals as having a "sea of electrons". I was wondering how the actual relationships between the electron shells of individual atoms are... do the electrons orbitals overlap the same space as each other, so the electrons are free to move or do they have to jump from the outermost orbital of their atom to another's? Is it something different entirely?
Comment: (Only) the outermost valence electrons occupy a huge set of closely-spaced orbitals (the overlapping valence and conducting band) that ideally span the whole piece of metal. All other electron shells are bound as usual to one nucleus. de:wp has a picture that i find most instructive https://de.wikipedia.org/wiki/Leitungsband
Answer: The electrons do interact with eachother, and their orbitals do intersect, but electrons in higher orbitals will be, on average, further from the nucleus of the atom. Check out this page on wikipedia:
https://en.wikipedia.org/wiki/Atomic_orbital


Need information about UK- Irish visa scheme

Question: Currently I am in Dublin on training visa which is sub type of Irish business visa. Visa is valid for 90 days from date of entrance. So just want to understand can I able to visit UK on same visa as per Irish-UK visa scheme.
Answer: If you are eligible for the British Irish Visa Scheme, your visa will have "BIVS" printed on it.
With this visa, you can visit the UK from Ireland and remain for the remainder of the 90 days stay you were granted on arrival into Ireland, or you can return to Ireland as well. In either case your total stay is limited to 90 days from when you first entered Ireland.
Also be aware that under this scheme, you must always enter via Ireland if you have an Irish visa, and then travel to the UK. You will be refused entry if you attempt to travel to the UK without first entering Ireland. This also means you should avoid booking tickets to Ireland which transit a UK airport. (The reverse is true if you hold a UK BIVS visa.)
See the British Irish Visa Scheme Information Note published by Ireland Department of Foreign Affairs for complete information about the program.


Mantaflow smoke behavior at boundaries

Question: In Mantaflow smoke simulations, the borders of the simulation act as boundaries whether "border collisions" are on or off.   Is this the expected behavior?  It seems like it should be considered a bug.
Answer: From the Blender 3.0 docs:

Border Collisions
Controls which sides of the domain will allow fluid "pass through" the
domain, making it disappear without influencing the rest of the
simulation, and which sides will deflect fluids.

So unless the documentation is incorrect, this does appear to be a bug.
Answer: the domain walls yes.. if you add another object inside the domain, THAT object will be affected by the "collision on/off"

Mantaflow smoke behavior at boundaries


Can activated charcoal be used to filter bacteria out of air?

Question: As the title says: Can activated charcoal be used to filter bacteria out of air and or gas?
Comment: It is probably a bad idea: activated carbons have most of its porosity mainly in micropores (channels smaller than 2 nm) and some have mesopores (between 2 and 40 nm). Bacteria are much larger than this.
Answer: Activated charcoal has been shown to be able adsorb certain species of bacteria, but the effectiveness varies between species [1] (which is potentially useful for medical applications), and has not been tested for many, so it is unlikely that activated charcoal could be used to adsorb all the bacteria from the air or a gas.
Activated charcoal general usage is in the adsorption of toxins.
[1] Naka, Katsumi, et al. "Adsorption effect of activated charcoal on enterohemorrhagic Escherichia coli." Journal of Veterinary Medical Science 63.3 (2001): 281-285.


Estimate Causal Effect of Countinuous Treatment on Binary Outcome

Question: I am trying to estimate the causal effects of a continuous treatment variable $T$ on a binary outcome $Y$. I have a set of nuisance variables $X$ that I know effect both $T$ and $Y$. I have read about a fair number of techniques but none seem to be set up to handle this situation. Matching, Propensity Scores, Double/Debiased, etc. they all seem to either be examples of having a non-continuous treatment or both a continuous treatment and outcome.I have a large data set but for the most part the $T$ is not randomly assigned. Recently I have been able to randomly assign a plus/minus 16% shift in whatever the baseline assigned $T$ is, I'm unsure though how I can use this fact to my advantage although intuitively the randomness seems like it should help.
Answer: I am not aware of any causal inference methods that care whether the outcome is continuous or binary, this should not matter (e.g. $E[Y|A,X] = P(Y=1|A,X)$). Continuous treatments definitely require specialized methods. You could use this method: https://code.nimahejazi.org/txshift/ which estimates the causal effect of various shift interventions on the treatment (e.g. what would happen if everyone's treatment dose were increased by 20%).
Paper
https://onlinelibrary.wiley.com/doi/10.1111/biom.13375
Also, $T$ need not be randomized. That is the main point of causal inference: to estimate causal effects using observational data.
Comment: Thanks for the answer! If $T$ is partially randomized and I want to estimate counterfactual in the way that you are saying "(e.g. what would happen if everyone's treatment dose were increased by 20%)." Is it reasonable to just run a logistic regression and have it predict $Y$ at different dosages?
Comment: You want to use the specialized causal inference method/package I mentioned in my post. Behind the scenes, it does things like compute the estimated regression function at different doses, but it does it in a nonparametric way that allows for valid and efficient statistical inference. If you want to do some exploratory analysis for yourself, you can just change everyone's treatment value by 20% and get the regression values at the new doses. You can then take the empirical average of them for example, and plot these averages as a function of the increase dosage amount (e.g. 10%, 20%, 30%, 50%)


I was light on a hand, namely six dollars short.

Question: I was light on a hand, namely six dollars short.  I took six chips out of the pot (agreed to by the players) and lost the hand. I gave the winner six dollars cash (representing my short in the hand) and then the player wanted the chips as well.  Didn't I just give him $12?
Comment: What does "light on the hand" mean? Are you saying your opponent bet $12 but your stack was only $6 in chips?
Comment: You borrowed $6 in chips, and then bet them and lost to the winner. So give the chips you lost to the winner, and then pay back the $6 you borrowed. Yes, you are "giving him $12". $6 that he won from you, and $6 to pay back what you borrowed.
Comment: Can you lay out the whole hand in text format? That would make it a bit clearer, thanks.
Answer: In low-stakes home games it is sometimes allowed, as you point out, for a player to "go light", meaning to borrow money from the pot itself to make a call. This is never allowed in Casinos or more serious games of course, which are always "table stakes", where a player simply goes all in and can only win the bets he can cover.
To signal going light, as you say, you drag chips from the pot in the amount you are borrowing, leaving them in front of you as a marker. But the money still belongs to the pot.  If you win the pot, all is well--you just drag the chips. If you lose the pot, your friend is right--he gets all the chips AND you must cover your lights. Think of it this way--you're borrowing from the pot to make the call, and you're buying $6 worth of chips from the winner to cover your debt. You are out exactly $6 more than you would be if you had gone all-in.
If you had split the pot with him, you can short-cut the process by just giving him your lights and splitting the remainder, but that's for the advanced class. :-)
Comment: Nice answer. Never have experienced something like this, thanks for the insights here.


Phone is being overrun with ads

Question: Whenever I switch on my Internet every morning I get a page which opens up with applications and games that aren't from the Play Store and I see a message that says my phone has stopped outside applications from being downloaded. Plus my gallery gets flooded with pictures of game icons and stuff and no matter how many times I delete them, they come back again. How do I make this stop?
Comment: You have installed something a bit dodgy by the sounds of it. Try AVG or AVAST security (both are free on play store) and see if they find the app then uninstall it. You could factory reset if it gets very bad, but lets not do that first!
Comment: I would never recommend an anti-virus Android app. They are bloating and unnecessary.
Answer: You have downloaded an app using an advertising platform that uses these ads.
These ads are actually against Google Play's Developer Policies, so when you find the app (see below) that is doing this, be sure to report it.
There are a few ways to find the app:

When did the adverts start? If you can remember this, try and think of any apps you might have installed not long before they started, and uninstall them.
Are there any apps in your Manage Apps area that shouldn't be there? Uninstall them, and see if the adverts go away.
Check through all your apps, and look at the permissions. Adverts like these will need loads of permissions, so if you see an app with many permissions which it may not need, uninstall it and see if the adverts go.

If the worst comes to the worst, you can factory reset and reinstall all your apps one by one, however this is a last resort, as you will lose all of your data.

Phone is being overrun with ads


Do People Prefer to watch TV/Movies on Tablets larger than 8 inches?

Question: Recently I was told by a friend that most of watching users prefer larger tablet (more than 8 inch with ratio 80 /20). Because it is a big difference  I`am wondering if there is any research or statistics that actually gives a statistical preference
Comment: As one who used to work in film and TV, and am still on the fringes, we cringe at the very thought of tablets themselves.
Comment: Purely subjective observation: my family seems to have zero preferences. My kids will watch shows on their Nintendo DS as much as their tablet as much as the Roku hooked to the TV. I think context also matters. Are we talking living room or bus, for example. Ultimately, people are after the content first and foremost.
Answer: I haven't seen statistics on either fact. What I know as a person who has both tablet sizes and with many friends and colleagues with both (plus smartphones and "phablets") is they it doesn't matter. For a tv show, people will watch it on anything. The bigger screen is better, but there's a cost-benefit analysis that determines if time put into getting that larger device (or even connecting to a TV) is worth the effort over just watching it on the smaller screen.
Personally I love watching stuff on a tablet because mine has an amazing OLED display. Picture quality is way better than my tv. But there is never a case where I'd rather watch something at the end of the day on the tablet instead of the TV, where I could lounge back on the couch and relax, without having to hold a device directly. And I know that sentiment is widespread.


Does a hardware generated pin plus SMS verification count as two factor authentication?

Question: I am  a little confused about the definition of two factor authentication. Does a login method containing a hardware generated pin and SMS verification constitute two factor authentication?
Comment: For the `hardware generated pin`, I suppose you must be talking about a synchronized PIN like SecureID, right?
Answer: Strictly speaking 2FA only means two factors are used to authenticate a user.
What we usually see is a password based authentication coupled with an SMS or app (e.g. RSA Secure ID or Google Authenticator) generated OTP (One-Time Password) code.
In your example, two factors are used.

Hardware generated PIN
SMS verification

However this doesn't comply with the best practice where at least two of the following principles are considered.

Who you are (Identification), like just giving your username.
What you know (1st Authentication), like giving your password.
What you have (2nd Authentication), like giving an OTP from a token/app.
What you are (3rd Authentication), like giving IRIS-scan or fingerprint (although this is debatable because some state that bio-metrics is a means of Identification).

Both the SMS and the hardware generated PIN are in the category 'What you have'. If you use two 'What you have' factors, both are equally likely to be stolen [Remember why noting down passwords is a bad practice.]
Answer: Most infosec professionals refer to an authentication solution as "two-factor" when it combines factors from two different authenticator categories: what you know, what you have, and what you are (biometrics).  A hardware device generating a PIN (one-time password presumably?) and a phone receiving a SMS verification code (also presumably generated randomly by the authentication server) would normally be considered two 'what you have' factors.
Thus they wouldn't meet the normal definition of two-factor authentication, despite offering pretty good security against attacks.


How is "あるちゃあるけど" used?

Question: As far as I understand "あるちゃあるけど" is close in meaning to "ないとは言い切れない" and "しいていえばある" but I could not find how it is used, nor understand the exact meaning.
Comment: Do you mean しいていえばある?
Comment: Related? https://japanese.stackexchange.com/q/21318/9831
Answer: Since you haven't provided any context, let me point out that ある could be used in several different ways, like

stating that something exists (the literal meaning)
stating that something is reasonable/common/good (cf. それはないよ).

あるちゃあるけど is sometimes used in a longer version

あるちゃあるけど、ないちゃない

with a loose translation being

You can't say that it's not a thing, but you can't really say it's a thing either.

(where ある is translated here with the second meaning).
あるちゃあるけど by itself means essentially the same thing:

あるちゃあるけど
I guess you could say that [but why would you? / but I don't fully agree / ...]
Answer: Believe you're missing a letter:

あるっちゃあるけど

It's an extremely informal way of saying:

あると言えばあるけど

I won't deny that we have it

But the underlying connotation is that item is not available for sale/use, or it's reserved for some reason.
-- Starfox

How is "あるちゃあるけど" used?


Check in comments missing in Office 365 workflow

Question: I am trying to get Check-in comments from SharePoint forms library with versioning enabled but in the workflow there is no option of "Check in item " showing in workflow current item.
Answer: You can find Check in/Check out under ... > More > in order to check it in. If you want a workflow for that behavior you can create it using one of the out of the box workflows like 'Request manager approval for a selected item'.


Does being slowed prevent using multiple shoves/grapples during an attack action?

Question: If a creature has been slowed either from the slow spell or a stone golem's slow ability, it can't make more than one attack per turn. If a character can make multiple attacks per turn however (eg. via extra attack) they can normally substitute a shove or a grapple in place of one of those attacks. Can a character capable of multiple attacks per turn, who is currently slowed, make a single weapon attack and then use their remaining attacks to shove/grapple?
Comment: @PurpleMonkey The rules state that, if you can normally make multiple weapon attacks as part of an attack action, you can substitute shove or grapple in place of one of those attacks. Even if you can't shove multiple creatures (I can't see anything preventing it) I'm asking if you can use an attack and a shove/grapple if you are slowed.
Comment: Does this answer your question: "[Does a Grapple or Shove count as an attack for the Mobile feat?](https://rpg.stackexchange.com/questions/116663)"
Answer: Grapples and shoves are attacks; you only get one attack while affected by slow
The slow spell states:

[...]  Regardless of the creature's abilities or magic items, it can't make more than one melee or ranged attack during its turn [...]

The sections on "Grappling" and "Shoving a Creature" state:

When you want to grab a creature or wrestle with it, you can use the Attack action to make a special melee attack, a grapple. If you're able to make multiple attacks with the Attack action, this attack replaces one of them [...]
Using the Attack action, you can make a special melee attack to shove a creature, either to knock it prone or push it away from you. If you're able to make multiple attacks with the Attack action, this attack replaces one of them [...]

This shows us that both grappling and shoving are considered attacks, and thus the slow spell also prevents you from making multiple grapples or shoves, or even a regular attack and a grapple/shove. You only get one attack, total, for your turn, this includes regular attacks, grapples, and shoves.
Some questions on similar/related things:

Does a Grapple or Shove count as an attack for the Mobile feat?
Does grappling count as a hit?
What does upper-case-A-Attack action vs. lower-case-a-attack mean?


Why is three-phase offset by 120 degrees?

Question: For three phase electricity the wave is offset by 120 degrees(2\$\pi/3\$ Rad). Why aren't the phases closer together? Is it because it will affect the frequency of the phases? How was this 120 degrees chosen?
Comment: Not sure I know the official answer, so I'm just posting as comment instead. With three phases, 120 degree shift between any two phases is the natural way to do it, since 360/3=120. This makes it easier to work with, control etc. Theoretically, there is no reason you couldn't have any arbitrary relationship between the three phases. But there may be more to it than that... for example, maybe it is easier to construct a three phase AC generator to produce output waveforms 120 degrees apart... but I don't know for sure.
Answer: When there's 120° between phases the sum of the voltages at any time will be zero.

This means that with a balanced load no current flows in the return line (neutral).

Also, if each phase is 230V with respect to the neutral (star operation), then there will be 230V \$\times\$ \$\sqrt{3}\$ = 400V between any two phases (triangle or delta operation), and they're also equally spaced, i.e. at 120° angles.
(images from http://www.electrician2.com/electa1/electa3htm.htm)
Comment: This is certainly why the three-phase system as it is currently designed is *nice*. I think the original reason behind why it is as it is is that it's easiest to wind a motor with the output phases equally spaced.
Comment: @Fake - Equally spaced is the evident way to keep it mechanically balanced. But you also need it that way to have the voltages equal, so that the net current is zero in a balanced load.
Answer: Being 120 degrees apart makes the phases balanced such that power transfer at any instant is a constant.  If you had phases 'closer together' as you suggest, there wouldn't be any real advantage over single phase power.
Comment: of course, if you have a system with at least two unique phases, you can derive balanced 3-phase from it (using suitable transformers) and thus put constant power into a load, but the resulting transmission line currents will be asymmetric; with unequal phase angles you'd either have to (1) live with time-varying instantaneous power, (2) under-utilize some of the transmission line conductors, or (3) have differently sized conductors. Equally spaced phase angles give the optimum solution w/regard to conductor sizing-vs-utilization.
Comment: the short answer - because three evenly spaced phases are simpler to work with (motors/generators don't have to deal with asymmetry) and more economically feasible (all 3 conductors can be spec'd the same) than any other system of three phases.
Comment: This is the correct answer.
Answer: In principle, any power generator has a rotor with magents and coil on the periphery, one rotation of rotor is one cycle of 360 degrees.
Suppose the generator has one magnet and one coil,then as the magnet/rotor rotates one turn,the voltage generated in the coil gradually rises and reaches peak(max) when the coil comes closest to the magnet and  reduces gradually as the magnet moves away.
Suppose we connect the bulb then the flicker rate is clearly visble. This is called 360 deg, single phase AC.
Now, suppose the generator has two magnets and two coils placed equidistantly, then the flicker rate is increased, it is 2-phase , 360/2=180 degrees AC.
Say generator has 3 magnets and 3 coils placed equidistantly, then the flicker rate is much increased; it is 3 phase with 360/3=120 degrees AC.
if we have 4 magnets and 4 coils placed equidistantly then the flicker rate is much more increased (not visible), then it is 4-phase with 360/4=90 degrees, 4-phase AC.
In practice, 3-phase is much more suitable for design.
Comment: I think this deserves far more votes than it's had - physically it's most convenient (and I'd assume most efficient) to produce motors/generators with 3 poles, giving a smooth & efficient power delivery. I'd put money on the design choice being a compromise of "smoothness" (more phases) Vs cost (fewer separate windings). Very much like the tradeoffs in car engines regarding the number of cylinders they use.
Comment: I think it's worth taking a look at [this image from Wikipedia showing an animation of a 3 phase generator](https://upload.wikimedia.org/wikipedia/commons/7/78/Simpel-3-faset-generator.gif)
Answer: By separating the phases by 120° one keeps the voltage peaks (for instance) evenly spaced.  For example, 60 Hz has peaks every 16.66 msec, so phase A, B, C peaks would come one third of that time apart, in this pattern: A-5.55ms-B-5.55ms-C-5.55ms-A.  If one separated phases A & C from B by, say 100° then phases C and A would be separated by 160°, and the pattern of peaks would be A-4.63ms-B-4.63ms-C-7.40ms-A.
Such a stuttering set of phases (with, say, 100°, 100°, 160° separation) would entail many inefficient, unnecessary consequences, not least of which would be designing an AC motor which could effectively use the staggering impulses of such syncopated voltage peaks.
Answer: Most of the electric energy is made by AC generators.
2/3 of electric energy is used by AC electric motors (electric energy in - mechanical energy out), they are built very similar to the electric generators (mechanical energy in - electric energy out).
In order to create a rotation in AC electric motors you need to have equally spaced windings in the stator fed by equally spaced magnetic fields; equally spaced magnetic fields are created by equally spaced currents (this answers your question of the 120 degrees for the 3 phase system).
The reason of using 3 phases instead of 2, 6 or 12 it's because it's the most efficient system (having 2 would mean more power losses during transmission, having 6 phases would mean to transport the energy with 6 wires instead of 3).
Comment: this and the other one like it are the answer.   it comes from physical spacing in the generator.  not complicated.
Answer: Also keep in mind that the phase to phase voltage would drop tremendously with more phases. You would only be able to use it phase to ground if you added more phases. With a regular wye transformer, we can still have equipment be on 208 volts and 240 single phase. Add more phases it would be a lot more harder to add 3 phase equipment or more.
Comment: For example, with 90 degrees with a 4 phase system, on a why transformer, 120v to ground, you would get 180v phase to phase. Would have to use it just for single phase circuits since phase to phase would no longer be as efficient.


Sprintf equivalent in Java

Question: Printf got added to Java with the 1.5 release but I can't seem to find how to send the output to a string rather than a file (which is what sprintf does in C). Does anyone know how to do this?
Answer: // Store the formatted string in 'result'
String result = String.format("%4d", i * j);

// Write the result to standard output
System.out.println( result );

See format and its syntax
Answer: Strings are immutable types. You cannot modify them, only return new string instances.
Because of that, formatting with an instance method makes little sense, as it would have to be called like:
String formatted = "%s: %s".format(key, value);

The original Java authors (and .NET authors) decided that a static method made more sense in this situation, as you are not modifying the target, but instead calling a format method and passing in an input string.
Here is an example of why format() would be dumb as an instance method. In .NET (and probably in Java), Replace() is an instance method.
You can do this:
 "I Like Wine".Replace("Wine","Beer");

However, nothing happens, because strings are immutable. Replace() tries to return a new string, but it is assigned to nothing.
This causes lots of common rookie mistakes like:
inputText.Replace(" ", "%20");

Again, nothing happens, instead you have to do:
inputText = inputText.Replace(" ","%20");

Now, if you understand that strings are immutable, that makes perfect sense. If you don't, then you are just confused. The proper place for Replace() would be where format() is, as a static method of String:
 inputText = String.Replace(inputText, " ", "%20");

Now there is no question as to what's going on.
The real question is, why did the authors of these frameworks decide that one should be an instance method, and the other static? In my opinion, both are more elegantly expressed as static methods.
Regardless of your opinion, the truth is that you are less prone to make a mistake using the static version, and the code is easier to understand (No Hidden Gotchas).
Of course there are some methods that are perfect as instance methods, take String.Length()
int length = "123".Length();

In this situation, it's obvious we are not trying to modify "123", we are just inspecting it, and returning its length. This is a perfect candidate for an instance method.
My simple rules for Instance Methods on Immutable Objects:

If you need to return a new instance of the same type, use a static method.
Otherwise, use an instance method.
Comment: This answer seems to have nothing to do with the question.
Comment: -1. Downvoted b/c it's tangential. And not necessarily the best style for immutables. This style is more verbose than simple method calls, particularly for chained operations. And it gives up run-time polymorphism because it's calling static methods, which is significant. YMMV.
Comment: I see that you somehow you got the idea I was suggesting the format string was to be modified. I never considered the possibility that someone might expect a String to change, since their immutability is so fundamental.
Comment: Seeing as the format string is usually more like "The Price is %4d", and not "%4d", I still see a lot of potential for confusion. What do you have against static methods? :)
Comment: The answer isn't even Java, seems to be more relevant to .NET
Comment: Following your logic. `"ABC".toLowerCase()` would be wrong as well.
Comment: Explaining why a putative `String.Format` should be a static method rather than an instance method does *nothing* to answer the question "what is the equivalent of sprintf in Java?".  (The answer is "`String.format`, which is a static method" btw.)
Comment: This API has been added tentatively to Java 13. E.g., `String str = "%s: %d".formatted(name, val);` is now supported. This will be especially helpful for forming exception messages.
Answer: Since Java 13 you have formatted 1 method on String, which was added along with text blocks as a preview feature 2.
You can use it instead of String.format()
Assertions.assertEquals(
   "%s %d %.3f".formatted("foo", 123, 7.89),
   "foo 123 7.890"
);

Answer: You can do a printf with a PrintStream to anything that is an OutputStream.
Somehow like this, printing into a string stream:
PrintStream ps = new PrintStream(baos);
ps.printf("there is a %s from %d %s", "hello", 3, "friends");
System.out.println(baos.toString());

This outputs following text there is a hello from 3 friends
The string stream can be created like this ByteArrayOutputStream:
ByteArrayOutputStream baos = new ByteArrayOutputStream();

You can accumulate many formats:
PrintStream ps = new PrintStream(baos);
ps.printf("there is a %s from %d %s ", "hello", 3, "friends");
ps.printf("there are %d % from a %", 2, "kisses", "girl");
System.out.println(baos.toString());

This outputs there is a hello from 3 friends there are 2 kisses from a girl
Call reset on ByteArrayOutputStream to generate a clean new string
ps.printf("there is a %s from %d %s", "flip", 5, "haters");
baos.reset(); //need reset to write new string
ps.printf("there are %d % from a %", 2, "kisses", "girl");
System.out.println(baos.toString());

The output will be there are 2 kisses from a girl
Answer: Both solutions workto simulate printf, but in a different way.
For instance, to convert a value to a hex string, you have the 2 following solutions:

with format(), closest to sprintf():
final static String HexChars = "0123456789abcdef";

public static String getHexQuad(long v) {
    String ret;
    if(v > 0xffff) ret = getHexQuad(v >> 16); else ret = "";
    ret += String.format("%c%c%c%c",
        HexChars.charAt((int) ((v >> 12) & 0x0f)),
        HexChars.charAt((int) ((v >>  8) & 0x0f)),
        HexChars.charAt((int) ((v >>  4) & 0x0f)),
        HexChars.charAt((int) ( v        & 0x0f)));
    return ret;
}

with replace(char oldchar , char newchar), somewhat faster but pretty limited:
    ...
    ret += "ABCD".
        replace('A', HexChars.charAt((int) ((v >> 12) & 0x0f))).
        replace('B', HexChars.charAt((int) ((v >>  8) & 0x0f))).
        replace('C', HexChars.charAt((int) ((v >>  4) & 0x0f))).
        replace('D', HexChars.charAt((int) ( v        & 0x0f)));
    ...

There is a third solution consisting of just adding the char to ret one by one (char are numbers that add to each other!) such as in:
...
ret += HexChars.charAt((int) ((v >> 12) & 0x0f)));
ret += HexChars.charAt((int) ((v >>  8) & 0x0f)));
...

...but that'd be really ugly.
Comment: All great ideas, but turns your code into write-only code impossible to understand for your coworker.

Sprintf equivalent in Java


Google Chrome can't load too many tabs together!

Question: This is an annoying problem that I face and friends of mine agree to this too. When using a site like Digg I tend to browse the page and open a lot of tabs simultaneously before reading each tab individually. Now what happens is, when there are 4-5 or more tabs loading up, all of them just stop loading.I can still see that annoying circle rotating (which means it is trying to load) but nothing happens. I have to stop the load and then refresh one tab at a time to see these pages. I never faced these problems on firefox or opera. What can the possible reasons for this be and how do I overcome this issue ? I'm using Ubuntu 10.04 and my Chrome Version is 5.0.375.55. PS: I use the internet from behind a proxy server at my college. I wonder if that could cause these problems. My friends in college also face the same problem.
Comment: Can you try this from somewhere outside of your college to test?
Comment: I've never seen this issue, and I'm using Chrome on 10.04 as well.  And I'm a tab-a-holic (I usually load around 20 to 30 tabs when I start Chrome)...
Answer: Sounds like they are limiting the number of open connections you can have.  This is probably designed to prevent people from using bit torrent (which usually requires a large amount of really slow connections, but can really add up).
If my guess is correct, you should have this same problem using firefox.  Also, when chrome is currently maxed out, if you try to open firefox it should let you open at most 1-2 web pages.
EDIT: I've been searching for a way to limit the number of tabs that load at a time to prevent them from stopping.  The only solution I have found is in firefox by limiting the network.http.max-connections and network.http.max-connections-per-server variables (which was suggested here).  This will make it so only a certain number of tabs load at a time, but it will hopefully prevent them from stopping altogether like it has been for you.  Perhaps start off by limiting network.http.max-connections (type about:config into your firefox browser) to 3 or 4 and seeing if that works.  You can play around with tweaking the value to see what works best for you.  I haven't been able to find a Chrome solution yet.
EDIT2: If it is truely stopping your connections (not just limiting it to 5 open connections, but if it is stopping all connections once you hit 5) then you probably want to find a way to keep your computer from requesting too many.  You may be able to do something in Ubuntu IPTables or elsewhere to prevent Ubuntu from requesting too many connections across all applications.  I do not know how to do this though, may be worth asking it in a different question.
Comment: You answer certainly seems logical but I tried it out on firefox and opera and they don't seem to show problems till i try and open more  than 15-20 tabs together whereas the problem shows up in chrome with just about 5 tabs. I would like to continue using chrome so if someone could come up with a solution for chrome, that would be great :). Thanks for your answer dan.
Comment: @tapan Then Chrome might be using a trick called "pipelining" in an attempt to make their browser faster.  This involves sending multiple requests each time you try and make a connection in the off chance that your 2nd or 3rd request might get back faster, which means your browser can load the website faster than if it just had made 1 request.  I didn't realize Chrome did this by default and don't know how to turn it off (It is off by default in firefox, and I know how to turn it on there, but that is the opposite of being helpful).
Comment: @tapan upon further research I have found chrome does NOT use pipelining.  The only thing I can think of left to try is my other suggestion of limiting the number of total connections your system allows using IPTables or some other method in Ubuntu.  Sorry I don't know more details about how to do that and can't really be of any more help.
Answer: I had the same problem, ~25 tabs open usually and nothing loads when I fire up Chrome - they all just hang and then I refresh them one by one. Usually I can see around 350 sockets open after launching Chrome.
I just managed to clear the problem by turning off "Predict network actions to improve page load performance" in Preferences -> Under the hood. All tabs load up nicely after closing and starting browser.
Answer: Does your machine have a private IP address? This would be an address of the form:

10.x.x.x
172.16-31.x.x
192.168.x.x

If so, you are connecting to the internet through a NAT box and it is getting overloaded or has limits on it to prevent overloading. This would be very unsurprising policy or accident in a university dormitory especially one where the "network shuts down from midnight to 7:00 am everyday". You may also be making a false correlation between your using Chrome and the failure; the kid down the hall may have set up a webserver or sumptin on the same day as you began using Chrome.
Try another browser, and if that fails, learn to decode your sessions with wireshark to really see what is happening.
Comment: Quoth IIT Bombay IT Policy: "I understand that network capacity is a limited, shared resource. I agree that physically tampering with network connections/equipments, sending disruptive signals, or making EXCESSIVE USE of network resources is strictly prohibited. ...". They may well be intentionally limiting connections. http://www.cc.iitb.ac.in/cgi-bin/policy.cgi
Comment: Yes, we do have private IP addresses. And yes a lot of people in college do use the network resources excessively :P. But I only have this problem with Google Chrome. Firefox and Opera work perfectly. Btw good job getting the IT policy, signed it so long back :D.


Transfer iPad games to external hard drive?

Question: I have a 16gb iPad 2. Most of the space is taken up by games and it's hard figuring out what games I want to remove to open up space. Is there a way to transfer the games wirelessly to an external hard drive? I know on Android, you can transfer games to a micro sd card. Not sure if it's possible on an iOS device.
Answer: No, unless the device is jailbroken. Without jailbreaking, the applications can't be transferred elsewhere and remain useable.
Comment: @Buscar No-one but Apple can answer the 'why is it that way' but Apple have never wanted filesystem interaction on iOS. It's not useable because the files are external to the default location and can't be executed.
Comment: heh, that's what I thought.  oh well.  I'll just remove games I don't play that often.  considering buying a 64gb ipad when I have enough money.  that's the advantage of android tablets and smartphones: storage space is expandable and transferable, really versatile.
Comment: Could you elaborate, why is it that way, what makes it not useable?
Answer: You can use iFunbox to backup your data to your mac/pc.
Note: This does not transfer your data.
If you want to transfer your data too, select everything and and save it to your mac/pc
Next, when you want to use the app, re install it through iFunbox, delete the old content and copy the data you saved to your mac back into the file in your mac.
(This is a very troublesome and long method)
A alternative is iUSBport by hyper, but I don't have it and am not sure if it works.


How to implement Game Center Leaderboards in iOS 7?

Question: I am creating a game for iOS 7 and am trying to implement Game Center leaderboards. I got the app to open the leaderboard when I click a certain button, but it says "No Items". I am not sure right now if it is a problem with the submitting scores or retrieving leaderboards. It appears to be a problem with submitting the score because it says the app name on the top of my leaderboard, but I can't find my error.
My code to submit score:
<code>-(void)reportScore:(NSInteger ) highScore
{
    if ([GKLocalPlayer localPlayer].isAuthenticated) {
        GKScore *scoreReporter = [[GKScore alloc]  initWithLeaderboardIdentifier:@"flapjacks1" forPlayer:[GKLocalPlayer localPlayer].playerID];
    scoreReporter.value = highScore;
        NSLog(@"Score reporter value: %@", scoreReporter);
    [GKScore reportScores:@[scoreReporter] withCompletionHandler:^(NSError *error) {
        if (error != nil) {
            NSLog(@"Error");
         // handle the reporting error
         }

    }];
    }
}
</code>
This is my method for retrieving the leaderboard:
<code>-(void)displayLeaderboard
{
//NSString *_leaderboardIdentifier = @"flapjacks1";
[[GKLocalPlayer localPlayer] loadDefaultLeaderboardIdentifierWithCompletionHandler:^(NSString *leaderboardIdentifier, NSError *error) {

    if (error != nil) {
        NSLog(@"%@", [error localizedDescription]);
    }
    else{
        //_leaderboardIdentifier = leaderboardIdentifier;
        GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];
        if (gameCenterController != nil)
        {
            gameCenterController.gameCenterDelegate = self;
            gameCenterController.viewState = GKGameCenterViewControllerStateLeaderboards;
            //gameCenterController.leaderboardTimeScope = GKLeaderboardTimeScopeToday;
            gameCenterController.leaderboardIdentifier = @"flapjacks1";
            [self presentViewController: gameCenterController animated: YES completion:nil];
        }
    }

}];

}
</code>
So, I'm not sure if I am improperly accessing the leaderboard or if the leaderboard really has no data. I have been searching all over and can't find an answer. Help is greatly appreciated.
Comment: If you are developing in sandbox mode, this is a very common problem. The leaderboards just don't show properly. Open the Game Center application in your device and look for your game in the list - tap it and check the leaderboards from there. This has proven to be more accurate than checking the leaderboards in your own app.
Answer: Have you added the leaderboard information to the Application in iTunes Connect and submitted your application so that the Status is Waiting for Binary Upload? You may also need to wait 24 hours after setting the application status, before you can use the Sandbox version of new leaderboards.
You need to make sure you enable the Game Center components (Leaderboards and Achievements) for the version of the application you are submitting, which is separate from the area where you create the leaderboards in iTunes Connect.
Answer: Are you sure you are initializing and updating score in the same class?
if you initializes in app delegate but uploading score in some other class then it can create the problem, for example look the following:
You authenticated the player in app delegate:
<code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

if ([GameCenterManager isGameCenterAvailable])

{

    isGameCenterAvailable = YES;
    self.gameCenterManager = [[[GameCenterManager alloc] init] autorelease];
    [self.gameCenterManager setDelegate:self];
    [self.gameCenterManager authenticateLocalUser];
    }
else
    {
    isGameCenterAvailable = NO;
    // The current device does not support Game Center.
    }
</code>
then want to upload the score in some other class, use the object of app delegate:
<code>- (void) submitScore2 : (int) curScore
{
    if(curScore > 0)
    {
    [[self delegate].gameCenterManager reportScore: curScore forCategory: self.currentLeaderBoard];
    }
}
</code>


How can i buy a products in Tor browser?

Question: If i going to buy some products like mobile market using Tor browser, how to do buy a product and what is the safe way of buying products? is this safe and original?
Answer: Tor Browser is just a normal web browser except that it works to keep you anonymous. You can do anything with it that you can do on any other browser.
With that said, there are a few things that must be said:

If the company doesn't allow anonymous transactions or doesn't allow people using Tor to use their website, then you can't use Tor Browser
As soon as you log in or give someone your address then you are not anonymous anymore and so Tor Browser isn't doing much for you
If your question is about how to buy something illegal on a darkweb market, then that is against the stackexchange rules and you won't find what you are looking for.
Comment: No no im not saying illegle products, i expect like mobile phones
Comment: Oh OK, in that case, I answered your question. You do it like with any other browser as long as the company allows Tor users to use their website.