How to fix bar stools that are too short

Question: I bought bar stool chairs but they are too short for the bar area. Is there a way to make the chair stools longer in length?
Comment: Set them on phone books?
Comment: How short are the legs?
Answer: Um, not really. Unless you got the stools from a mix & match furniture store like Ikea where you can buy the legs separately from the seat.
There are approximately 3 standard chair/table height combinations:
Table height (e.g. a standard dinning table; seat height ~18 inches, surface height ~30 inches)
Counter height (e.g. a kitchen counter; seat height ~24 inches, surface height ~36 inches)
Bar height (e.g. a bar or "high-top" tables; seat height ~30 inches, surface height ~42 inches)
Sounds like you have "counter height" stools with a "bar height" surface.
Answer: The only solution I can think of would be to build a box or frame of some sort, braced for stability and with the chair then firmly attached to it. Good luck finding a way to make that lightweight and attractive; I don't think it's I possible but I doubt it's much more practical than rebuilding the chair from scratch or buying new.
I suppose one way to "justify" it would be to add wheels as part of that frame and get most of the added height from them...... though that has its own stability issues.
Answer: Are the legs wood? If so you could just make longer ones from scratch.  Otherwise, if you're up for something a bit more complicated, you might be able to use a finger joint to extend the legs.  Matthias Wandel recently posted about repairing an axe handle where he used finger joints to extend the handle from the breaking point. If its strong enough for an axe handle, I have to imagine it would be strong enough for a stool leg.
Here's an image from the referenced article showing how the joint works

After gluing together, he shapes the new part to match the old part.
Answer: You could try a dowel screw and a short length of matching wood attached to each leg. I wouldn't use this method to raise up the stool more than 4-6" though, since the legs may become unstable with anything over that.

(Image Source)


How to handle large inheritance

Question: My uncle is ill and doesn't have much longer to live. He's been tying up loose ends and the other day he gave me a briefcase full of $20 bills, neatly stacked. If my math is right it's about $100k. I'm pretty sure it's legit, he owns a small shop and distrusts banks and has been pretty successful. Still I can't exactly deposit it in my bank account without drawing suspicion. What is the best way to protect this money? Would depositing it directly in the bank create problems?
Comment: @Kyle - a recipient doesn't pay a gift tax, the gifter is liable. And in this case, it's well below the lifetime limit, so a Form 709 would do it, no tax due.
Comment: If its legal you can put it in the bank. There may be taxes on the interest. You can claim it as yours. The bank is not the IRS. In all seriousness have your uncle create a trust with a lawyer for a few thousand bucks. It will protect the money and also generate market value above a standard account. Specifically there are tax incentives to this as well.
Comment: if your math is right? lol
Comment: I submitted an edit to the title and text body of this question, so that this doesn't get a spam flag. It also boils down your question to the root of the issue.
Comment: You're "pretty sure it's legit" ???  You better be darn sure that it is legit  before you start spending it or depositing it somewhere.
Answer: It is absolutely legal to have and/or deposit large cash amounts.
There are federal reporting requirements for such transactions over 10k (for the bank, not for you!), and the government agency filters such transactions for potential money laundry. If they contact you, give them the correct story, and it will be fine if it is believable.
It becomes much more difficult if you claim you find such a box of money every week...
One option is that your uncle deposits the money, and then transfers it electronically to you as an official gift (and you can execute this for him as his agent). That way, his name is on the cash transaction, not yours.
Answer: Have your uncle fill out the exemption form for gift taxes, take the money to the bank and deposit it at the bank.  The bank will file a currency transaction reporting form, but you will have the tax form to show where you got the money in the event the Secret Service or the FBI ever followed up, which they wouldn't unless you also are engaging in criminal activities and they are investigating you anyway.
In that case, you would have the tax form to support the origin regardless.  Just be honest if the teller asks you where the money came from.  The teller will record your answer.
After you are done with that, go to a reputable broker and have them help you invest the money.

How to handle large inheritance


Looking for help on help page!

Question: I have a lot of very similar data entry forms on several different tabs.  I'm trying to get decent looking and effective help screens for the data.  Also any ideas on the forms themselves. TIA You can see it here: Help Screen Image http://bit.ly/hAk5N5
Comment: Definitely a UX question. We also need a lot more info, namely things like what's the purpose of this page, who's the target audience, etc.
Comment: It looks to me like the UX is already pretty much done. Dori just needs some help with the look and feel, not the interactions.
Comment: @Mike - it's Royce's question, not mine. I just helped him out by doing a smidge of editing.
Answer: Honestly, I think that a huge goal of good UX is that you shouldn't need to explain to your users what those fields do. The way that the fields are laid-out on the page and the labels for them should make it almost entirely self-explanatory.
(Joel Spolsky has an excellent article on this, Designing for People Who Have Better Things To Do With Their Lives - I highly recommend reading it.)
You want to guide your user through the application - not just show them a page or a form and hope/expect that they figure out what to do.
Contextual help, in my opinion, is often a red-flag that the application isn't helping the user enough. In other words, if you find yourself needing to put in contextual help, it could mean that there is a flaw in the UX design.
So, for example, rather than presenting the "Times Available" text box along with a "Don't Know" checkbox, you could instead have:

A question, "Do you know what times the movies are available?" with a radio Yes/No
If they select Yes, then show the textbox and ask them for the times
If they select No, then you're done.

The wording above may not be quite right for your situation, but the point is that asking the questions that way is much more intuitive to the end user, and also eliminates form fields that'd end up being left blank anyway.
That being said, I did find an example of contextual help that I thought was pretty good. It's slightly different because it's not help for form fields, but it could probably be adapted.
The example is the Plans page for HootSuite. When you hover your mouse over one of the items, a little box appears explaining what the item is, along with an arrow so you know exactly what the box is for. Here's a picture:

You could do something similar, so that when the form field comes into focus a little box appears to the side and explains what the form field is for.
The key features are that the contextual help only appears when it's relevant (so that it doesn't clutter up the page), and the user doesn't have to do anything to get it to show up. You'll probably want to give the user the ability to hide the contextual help, because it may quickly get annoying if they're doing lots of data entry. But that way, the new users see the help messages by default, and once they're comfortable, they can hide them.
Answer: If the help screens are contextual I would strongly recommend either a tooltip or a modal window.
Answer: Would be great if you provided more info or a larger screenshot, but a couple things can be said already. It looks very much like an app, but I suppose that it is after all a website. In that case:

Stack the groups on top of each other, not in two columns. Leave the right column empty.
Display help in the right column - either always or when focus reaches the relevant field / group of fields. Also use the right column for error messages from live validation.
To help you cut down on the height a bit - try laying out the first 6 radios in three pairs, on in two threes. Or better yet, turn them either into a dropdown where "other" enables the textbox, or into a combo box where you can both select a value or type one of your own.
Theater address - what's the meaning of the asterisk? Are all these fields required? I hope not. See if you can suggest autocompletion of the different fields, auto-fill of the address based on zip code, or at least auto-fill of the zip code based on the address. See if you can geo-locate the user and fill the fields in for him.
You can use a date picker that lets you pick a range of dates, instead of two separate date pickers. I'm not sure whether it's such a great idea though, I think they may be more difficult to use.
Take the action buttons out of that dark frame, they blend in and become virtually invisible. Put a large, conspicuous SUBMIT button at the bottom of the form.
Answer: If you think the text would be beneficial to anyone entering in data all the time vs just the first time, you can play an area at the top or bottom that displays the help text as you move between the fields.
If the text help is only useful when they have questions, tooltips or little (?) icons that display the tooltip on hover is the typical route.
Going to another page is a disruptive process and you should add help to the process and not outside of it.
Answer: Wow.. Thanks for all the responses.  I will definitely try to incorporate some of them.  I had actually put a link to my dropbox account for the picture, but I'm not sure why it was forced into an inline picture.  Maybe I have to register?
Just a thought, good UX designers are few and far between.  I'm sure you guys are crazy busy, but it would be great to have a jobboard on the site.

Looking for help on help page!


Finding all neighbors using GeoPandas

Question: I am wondering whether it is possible to identify all neighbors to each polygon using only Python (with e.g. GeoPandas) in the same way as with Python in QGIS (Find neighbors polygon).
Comment: Please, do not forget about ["What should I do when someone answers my question?"](https://stackoverflow.com/help/someone-answers)
Answer: The following script finds and adds neighbors' names joined by comma as a new field value.
import geopandas as gpd

file = "C:/path/to/shapefile.shp"

# open file
gdf = gpd.read_file(file)

# add NEIGHBORS column
gdf["NEIGHBORS"] = None

for index, country in gdf.iterrows():

    # get 'not disjoint' countries
    neighbors = gdf[~gdf.geometry.disjoint(country.geometry)].NAME.tolist()

    # remove own name of the country from the list
    neighbors = [ name for name in neighbors if country.NAME != name ]

    # add names of neighbors as NEIGHBORS value
    gdf.at[index, "NEIGHBORS"] = ", ".join(neighbors)

# save GeoDataFrame as a new file
gdf.to_file("c:/path/to/newfile.shp")

Comment: @Taras Yes, it is a great answer. If my English was good, I would like to give answers like that, but it would take a day (maybe days) to reply such answers in English.
Comment: For more details also check [this great answer](https://stackoverflow.com/a/55557758), ***"iteration in Pandas is an anti-pattern and is something you should only do when you have exhausted every other option."***
Comment: No worries @_@ I probably know what you exactly mean, this is just a reference to keep in mind >_<
Answer: This is an addendum to @Kadir's answer (which works great).
For one, instead of using not disjoint you can just use touches directly, which does the same thing but is easier to read.
If, as the OP asked, you want to search internally to find all neighboring geometries in a single GeoDataFrame:
for index, row in df.iterrows():
    neighbors = df[df.geometry.touches(row['geometry'])].name.tolist()
    neighbors = neighbors.remove(row.name)
    df.at[index, "my_neighbors"] = ", ".join(neighbors)

For a related capability you may want to determine whether each row of a DataFrame borders some particular other shape, potentially from a different DataFrame or some input value (converted into a GeoDataFrame).
someSpecialGeometry = GEOdataframeRow['geometry'].values[0]
df['isNeighbor'] = df.apply(lambda row: row['geometry'].touches(someSpecialGeometry), axis=1)

This creates a boolean-valued column for whether each row borders the shape of interest.
Comment: For more details also check [this great answer](https://stackoverflow.com/a/55557758), ***"iteration in Pandas is an anti-pattern and is something you should only do when you have exhausted every other option."***
Answer: This is a further addendum relating to @Aaron's comment.
If you find 'touches' is failing to find all neighboring polygons like it should this is likely down to the resolution of your polygon borders which may in fact intersect hence 'touches' ignoring them.
I solved this issue using overlaps additionally to touches.
neighbors = np.array(df[df.geometry.touches(row['geometry'])].name)
#overlapping neighbors use if discrepances found with touches
overlap = np.array(df[df.geometry.overlaps(row['geometry'])].name)

neighbors = np.union1d(neighbors, overlap)

Finding all neighbors using GeoPandas


Merging attribute features based on matching field

Question: I have parcel data for a city where my goal is to merge rows which have the same parcel number ID. I have 53,000 total parcels, with about 6 thousand rows that have one duplicate. So far I have been manually merging rows, but now realizing it will take me forever to match these 6,000+ pairs of data. I've attached a screenshot below of one example. I am wondering if there is a code that exists that will merge certain rows based on a duplicate value in one field? I ran a script in the 'test' field that shows me which values have the same parcel number. Now I need to merge these matching values via the 'parcelnumb' field.
Answer: Dissolve your features. Your original parcel data is the input, and use 'parcelnumb' as the dissolve field. Make sure multipart features are allowed (this is the default).


What is the main difference between primitive type and wrapper class?

Question: What is the difference between these two lines?
    int pInt = 500;

and
    Integer wInt = new Integer(pInt);

Or
    Integer wInt = new Integer(500);

Answer: None.
That's the exact same thing. In the first case you just have a supplementary variable.
Note that with autoboxing you rarely need to have both an int and an Integer variables. So for most cases this would be enough :
int pInt = 500;

The main case where the Integer would be useful is to distinguish the case where the variable is not known (ie null) :
Integer i = null; // possible
int i = null; // not possible because only Object variables can be null

But don't keep two variables, one is enough.
Comment: We're saying the same thing : if you want to have a non defined integer, you must use a Integer variable as you can't set a int variable as null.
Comment: There should be some different like using other methods in wrapper class such as int `p2 = wInt.intValue();`
Comment: That's hardly useful when you could simply use `p2=pInt;`. Note that the Integer object isn't even mutable.
Comment: you said is a good way to distinguish an object is null. In another answer @Sumit Singh said I can't define an int null, but I can say Integer is null. What do you think?
Answer: In Java, an instance of a primitve class holds the actual value of the instance, but instance of a wrapper class holds a reference to the object. i.e. The address of the place where the object would be found.
When you write a program with this line:
Integer integer = 500;

The compiler changes it to this:
Integer integer = new Integer(500);

This process is called autoboxing. That is automatically putting a primitive-instance in a "box" of Integer. Hence, output of the following program:
public class PrimitiveToObject {
    public static void main(String[] args) {
        printClassName(1);
        printClassName(1L);
        printClassName((char)1);
    }
    public static void printClassName(Object object){
        System.out.println(object.getClass());
    }
}

is this:
class java.lang.Integer
class java.lang.Long
class java.lang.Character

Also this:
int i = integer;

changes into this:
int i = integer.intValue();

This is called unboxing.
As you can see above, the dot operator(.) is used on the variable named integer but not on i. That is: a wrapper's object can be dereferenced, but not a primitive instance.
Boxing and unboxing may slow down the program a little bit. Hence, to a newbie, wrappers may look like added burden, but they are not so. Wrappers are used at places where the object needs to be a reference type. eg: Map<Integer,String>map=new HashMap<Integer,String>(); is a valid statement, but Map<int,String>map=new HashMap<int,String>(); is not a valid statement.
Another typical case where wrapper is very useful: In MySQL, NULL is a valid entry for a column of INT type. But in Java, int cannot have a null value, Integer can. This is because in SQL NULL symbolises Not Available. So if you are using JDBC to insert integer values in a MySQL table, a null in your java program will help in inserting NULL in the MySQL table.
A wrapper class can also be useful in a case similar or anologous to this:
Boolean decision; // Using wrapper for boolean.
if("YES".equalsIgnoreCase(consent))
    decision = Boolean.TRUE; // In favour
else if("NO".equalsIgnoreCase(consent))
    decision = Boolean.FALSE; // Not in favour
else if("CAN'T SAY".equalsIgnoreCase(consent))
    decision = null; // Undecided

Answer: For starters
int pInt = 500; , here pInt is not an object whereas in
Integer wInt = new Integer(500);
wInt is an reference
This is also a reason why java is not pure Object Oriented Language. Because everything is not object with java.
Answer: Wrapper class will have a box in that box it will cover the primitive data types there are 8 primitive data types namely byte,int ,long ,double, float, short ,Boolean ,char  these all covered in wrapper class .
to use primitive  data types we use like int a;
but to use wrapper class we need to use like Integer a = new Integer(i);
Answer: The types of data are the same, but there are situations that manipulation of objects is more convenient than primitive types, like data structures, where you need more control of your data types.
For example, objects can be null and primitive types can't.
You also can't call methods in a primitive type (.compareTo(), .equals(), ...), but in wrapper classes you can.
The information below describe the types in primitive and wrapper class:
Primitive Types | Wrapper Class (Superclass = Object)

boolean - Boolean
char - Character

Primitive Types | Wrapper Class (Superclass = Number)

byte - Byte
short - Short
int - Integer
long - Long
float - Float
double - Double

To understand how the wapper classes works, consider the example below:
public final class IntWrapper {
    private final int intVal;
    IntWrapper(int intVal) {
            this.intVal = intVal;
    }
    public int getInt() {
           return intVal;
   }
}

Now we can make an object out of our new IntWrapper class and 'box' the primitive int value 41:
int i = 41;
IntWrapper iw = new IntWrapper( i ); // box the primitive int type value into the object
i = iw.getInt(); // unbox the value from the wrapper object

My example IntWrapper class is immutable, immutable means that once its state has been initialized its state cannot be changed.
When the final keyword is applied to a class, the final class cannot be extended. In other words, a final class can never be the superclass of a subclass. A final class can be the subclass of superclass, not problem there. When a class is marked final, all of its methods are implicitly final as well.
It is important to note that when final is applied to a reference variable it does not prevent the members of the object instance from changing values.
This example is to better understanding how the wrapper classes works inside.
Next, to create Integer, Double and other wrapper classes, you can write:
Integer i = new Integer(4);
Double d = new Double(9.62);
Boolean b = new Boolean("true");
Character c = new Character('M');

To get the encapsulated number into wrapper objects, you can write:
long l = i.longValue();
double e = i.doubleValue();
float f = d.floatValue();
short s = d.shortValue();

Each wrapper class include special methods to convert between primitive type to wrapper objects, that represent not number values:
boolean bo = b.booleanValue();
char ch = c.charValue();

Up to Java 5 version, the creation of objects from wrapper classes had to be in the syntaxes like above, but to simplify  these operations, mainly related to insertion of values in the data structures offered in Java collections (that only accept objects), now exists the autoboxing or boxing and autounboxing or unboxing options.
The autoboxing or boxing allows you to insert a primitive value to reference of equivalent wrapper types or Object type:
// Same result of Double d = new Double(-2.75);
Double objD = -2.75;
// Same result of Object objI = new Integer(13);
Object objI = 13;

The autounboxing or unboxing allows you to insert a wrapper object into a variable of primitive type, converting automatically between equivalent types:
// Same result of double vd = objD.doubleValue();
double vd = objD;
// Same result of int vi = objI.intValue();
int vi = objI;

Answer: The most important practical difference I've seen is Integer is way more slower to initialize and do calculations with, than int. I would avoid Integer unless necessary.
int x = 20_000_000;// 20 millions
for (int i = 0; i < x; i++) {
    ix += 23;
    }

it takes 138 ms(average over 50 trials) to complete the loop when ix is an Integer but only takes 10 ms when ix is an int


EF Core Migration with multiple provider always runs SQL Server scripts

Question: I am using EF Core Code first and I have an issue when using multiple DB providers (SQL Server and MySql).
Even when I choose to use MySql DB provider, SQL server migration files are used.
Check the sample project
Comment: This article will help you in managing 2 sets of migration. https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/providers
Comment: You have to use `Add-Migration -Context "YourContextName"`
Comment: @viveknuna I already did. If you check my sample project under the Migrations folder there is a ```scripts.txt```. These are the commands I used to generate migration files
Comment: Any help here much appreciated
Comment: you can raise bug on https://github.com/aspnet/EntityFrameworkCore/issues/new
Answer: In my case, I use the same migration for both providers but sometimes I need to do some changes to migration files manually. for example added annotation for both providers (or change the type of some fields like varchar to nvarchar).
Id = table.Column<int>(nullable: false)
           .Annotation("MySql:ValueGeneratedOnAdd", true)
           .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),

For me it's work fine
Comment: I dont want to use this approach. Having two migration-sets is much more clean.
Comment: @pantonis you are right, it is only one more approach which someone can use
Answer: Writing provider-specific migrations, database initializers, and services with Entity Framework core can be a difficult task.  Use AdaptiveClient to greatly simplify the process.  AdaptiveClient is a utility that works with Autofac for provisioning a service layer against multiple database providers or transports.  AdaptiveClient.EntityFrameworkCore is an add-on that includes utilities for working with Entity Framework Core.  In a nutshell here is how it AdaptiveClient works:
IMigrationContext is a placeholder interface that allows you to associate your DbContext with a specific provider (MSSQL, MySql, etc) for the purpose of creating a migration.
IDbContextOptions is a placeholder interface that allows you to associate an implementation of DbContextOptions that is specific to your provider.
RegistrationHelper is a utility that simplifies registering your components with Autofac. RegisterMigrationContext is a method you can call to easily register your provider-specific migration context.
To create provider-specific migrations you create a class for each database provider you want to target.  These classes derive from your DbContext and implement IMigrationContext (which has no members):
public class MyDbContext_MSSQL : MyDbContext, IMigrationContext
{
    public MyDbContext_MSSQL(DbContextOptions options) : base(options)
    {

    }
}

public class MyDbContext_MySQL : MyDbContext, IMigrationContext
{
    public MyDbContext_MySQL(DbContextOptions options) : base(options)
    {

    }
}

The examples above are complete - you do not have to write any additional code.  You do not need to create a separate DbContext for each provider (unless you wish to do so).  The reason you need to create a class for each provider is because EF reflects on your  assembly to find the correct DbContext when you run dotnet ef migrations add....
Create classes that wrap DbContextOptions and implement IDbContextOptions:
public class DbContextOptions_MSSQL : IDbContextOptions
{
    public DbContextOptions Options { get; set; }

    public DbContextOptions_MSSQL(string connectionString)
    {
        DbContextOptionsBuilder builder = new DbContextOptionsBuilder();
        builder.UseSqlServer(connectionString);
        Options = builder.Options;
    }
}

public class DbContextOptions_MySQL : IDbContextOptions
{
    public DbContextOptions Options { get; set; }

    public DbContextOptions_MySQL(string connectionString)
    {
        DbContextOptionsBuilder builder = new DbContextOptionsBuilder();
        builder.UseMySql(connectionString);
        Options = builder.Options;
    }
}

Use the AdaptiveClient RegistrationHelper to register your classes with Autofac:
registrationHelper.RegisterMigrationContext<Database.Db_MSSQL>(API_Name.MyAPI, DataBaseProviderName.MSSQL);
registrationHelper.RegisterMigrationContext<Database.Db_MySQL>(API_Name.MyAPI, DataBaseProviderName.MySQL);

registrationHelper.RegisterDbContextOptions<DbContextOptions_MSSQL>(DataBaseProviderName.MSSQL);
registrationHelper.RegisterDbContextOptions<DbContextOptions_MySQL>(DataBaseProviderName.MySQL);

In the code above API_Name is just a constant that resolves to a simple string like "MyApplicationName".  Same with DataBaseProviderName.MSSQL and .MySQL.  They are string constants that resolve to "MSSQL" or "MySQL".
Now, here is the most important part:  Just as you register the components of your application using keys such as "MSSQL" or "MySQL",  you also register the connection strings for your application using those same constants.
This allows Autofac to resolve the correct provider-specific or transport-specific components based on nothing more than the connection string currently in use for application.  You can read up on the entire process here.
You can see the complete working example in the Zamagon Demo.  The demo illustrates migrations, database initializers, and drop-and-recreate scenarios for integration testing.


rsyslogd: Any way to get around the number of local facilities?

Question: We have about 9-10 appliances we want to direct the logging to our rsyslog server for. However, there's only 8 local facilities (0-7). How can we get around this limitation?
Answer: Log the application name in your messages.  Filter on the application name instead of facility.  If your applications aren't generating syslog messages directly, you can apply an output filter (e.g., sed) to massage things to look the way you want.
Take a look at the Rsyslog documentation on filter conditions to see how you might configure this behavior.  Based on the information in that page, here's an example of how you could put messages starting with the string "application1" into /var/log/application1:
if $msg startswith 'application1' then /var/log/application1

You can also filter explicitly on the program name, if your application sets this correctly:
if $programname == 'application1' then /var/log/application1

You can perform all sorts of complex filtering in your rsyslog.conf; read through the documentation for more information and examples.
EDIT: rsyslog can use templates to create separate files for each server.  Something like the following should put all log messages into separate files for each hostname.  (This is lifted from the manpage.)
$template DynFile,"/var/log/system-%HOSTNAME%.log
*.*                             ?DynFile

The following is similar but does not log debug messages.  It also uses the connection hostname rather than the message hostname.  (This is based on what I developed to log output from an Obi100.)
$template HostFormat,"%timegenerated% %fromhost% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
$template HostFile,"/var/log/system-%fromhost%.log
if $syslogseverity < 7 then -HostFile;HostFormat

Read the manpage and documentation if you have more complex needs, or want to understand what the above do.
Comment: How do you configure this in rsyslog.conf?
Comment: What exactly do you want to configure?  I'm not even sure I've answered your question, because you don't need a different facility for each application unless you're looking to put the messages from each application in a separate log file...but it only makes sense to do this using syslog if you're sending them remotely; otherwise, you might as well just direct output from our application directly to a file.   Maybe you can elaborate on exactly what you're trying to do?
Comment: They are being sent remotely. The appliances are sending it to an rsyslog server. I want to direct the data to separate log files.
Answer: Filter by host name. (Each appliance should have its own hostname).  If you want you can listen on multiple ports and handle each port separately.
Facilities are designed to handle message categories like authorization, mail, printer, ftp, etc. As UUCP isn't used much anymore you could likely use it for your own uses.  Their may be other unused facilities in your configuration.  However, you are better off using standard facilities values, and filtering by other data.
There are 24 facilities as they are names for bits in a bit mask.  This makes aggregating arbitrary sets of facilities in the same log.  The protocol is specified in RFC 5424.
The other field is severity.  Normally logs contain all logs at or above a given severity.  (More severe priorities have lower values, so the normal comparison is less than or equal to the selected priority.)  However messages of a given facility can be selected, as is often done for the debug log which collects debug messages for all facilities.
You may want to aggregate data for some facilities in the same log regardless of originating appliance.  It is common to log the same message to multiple log files.
Comment: RFC 5424 defines 24 facilities.
Comment: @adaptr: Did a rough count from a man page instead of checking the RFC.  A close view of the RFC shows only 20 unique purposes due to use of multiple facility bits for clock and authentication messages.
Comment: How they're used in practice doesn't change that the protocol is limited to 192 unique values. If you violate THAT, it's not going to be syslog anymore.
Comment: @adaptr: If the facility bit is not used in the environment, then it can be used for a non-standard purpose without collision.  I don't recommend it, but it is possible.
Comment: I agree, but it's a big if.


Apply function to each element of a list

Question: Suppose I have a list like:
mylis = ['this is test', 'another test']

How do I apply a function to each element in the list? For example, how do I apply str.upper to get:
['THIS IS TEST', 'ANOTHER TEST']

Comment: @shantanuo are you the one voting to close similar and older questions to your own? That would make this post the duplicate.
Comment: Although OP would not have had any idea about list comprehensions, I added the tag in the hope that it makes it easier for duplicate closers to find the question.
Comment: @EricHerlitz I closed many questions as a duplicate of this one because it was originally the best I could find for the purpose. However, I was still unsatified, and today after perhaps years of frustration I prepared a more useful canonical from scratch.
Answer: Try using a list comprehension:
>>> mylis = ['this is test', 'another test']
>>> [item.upper() for item in mylis]
['THIS IS TEST', 'ANOTHER TEST']

Comment: Personally I much prefer this. So Python.
Comment: Something like that would be very convenient: mylist = mylist.apply(lambda x: x.upper()) ; F#-ish approach, very compact and easy to read; as far as I know there is no such structure now, but may be in the future Pythons?
Comment: wouldn't looping through a list be much slower?
Comment: If you want list as output then definitely this works better than anything
Answer: Using the built-in standard library map:
>>> mylis = ['this is test', 'another test']
>>> list(map(str.upper, mylis))
['THIS IS TEST', 'ANOTHER TEST']

In Python 2.x, map constructed the desired new list by applying a given function to every element in a list.
In Python 3.x, map constructs an iterator instead of a list, so the call to list is necessary. If you are using Python 3.x and require a list the list comprehension approach would be better suited.
Answer: Sometimes you need to apply a function to the members of a list in place. The following code worked for me:
>>> def func(a, i):
...     a[i] = a[i].lower()
>>> a = ['TEST', 'TEXT']
>>> list(map(lambda i:func(a, i), range(0, len(a))))
[None, None]
>>> print(a)
['test', 'text']

Please note, the output of map() is passed to the list constructor to ensure the list is converted in Python 3. The returned list filled with None values should be ignored, since our purpose was to convert list a in place
Comment: A suggestion: don't create a list filled with `None`s only to throw it away immediately, use `any` instead of `list` around `map`. Also, use `range` with only one argument, the range will start from 0, same as list indices. Final result: `any(map(lambda i:func(a, i), range(len(a))))`. This expression will return `False` , but that can be ignored.
Comment: @ack Your suggestion is good where you care about the status of each element (e.g. you really do want to check if any of the results are not `None`) but not sure why else you would want to go to the trouble of looping through the `None`s to check them, only to throw away a different result? This is only an consideration when using the interpreter.
Comment: We could also use a generator expression instead of `map`. But really, rather than creating a mutating function that has to index back into the list, and providing it with the indices, it would be much cleaner to replace the list contents by slice assignment.
Answer: String methods in Python are optimized, so you'll find that the loop implementations mentioned in the other answers here (1, 2) to be faster than vectorized methods in other libraries such as pandas and numpy that perform the same task.
In general, you can apply a function to every element in a list using a list comprehension or map() as mentioned in other answers here. For example, given an arbitrary function func, you can either do:
new_list = [func(x) for x in mylis]
# or
new_list = list(map(func, mylis))

If you want to modify a list in-place, you can replace every element by a slice assignment.
# note that you don't need to cast `map` to a list for this assignment
# this is probably the fastest way to apply a function to a list
mylis[:] = map(str.upper, mylis)
# or
mylis[:] = [x.upper() for x in mylis]

or with an explicit loop:
for i in range(len(mylis)):
    mylis[i] = mylis[i].upper()

You can also check out the built-in itertools and operator libraries for built-in methods to construct a function to apply to each element. For example, if you want to multiply each element in a list by 2, you can use itertools.repeat and operator.mul:
from itertools import repeat, starmap
from operator import mul

newlis1 = list(map(mul, mylis, repeat(2)))
# or with starmap
newlis2 = list(starmap(mul, zip(mylis, repeat(2))))

# but at this point, list comprehension is simpler imo
newlis3 = [x*2 for x in mylis]


How to Use 3rd Party JAR in Java Project

Question: I'm working on a basic Java project to make me more comfortable with the language (I've just started learning), and have come across a problem when trying to use a 3rd party library - I'm trying to use Apache's Lang library. I'm not using Eclipse to write my program, which I believe has a tool which makes it easy to use 3rd party libraries, so I'm not sure how I can use this library. When I try to use it, the 2 errors I receive are 'error: package org.apache.commons.lang3 does not exist', and 'error: cannot find symbol' on the line in which I call the StringUtils class (part of the Lang library). How can I use the library? (I am definitely a beginner in Java).
Answer: What you're going to need to learn about is the Java classpath. In order to use a third party JAR, it needs to be on the classpath when executing your code.
Here is an excellent StackOverflow post which explains how to accomplish this.
Comment: Thanks - I think that helped a lot. The only problem is, I now cannot run the project, as it gives me an 'Error: Could not find or load main class' error, 'Caused by: java.lang.ClassNotFoundException: MyProgram'. There is no compilation error, but just an error when I run the class. Any ideas? (The command I use to run the class is 'java -cp lib/commons-lang3-3.5.jar MyProgram')


How to check for .NET 4 from InstallShield 2012?

Question: I'm usually in WIX-land instead of InstallShield.
What's the equivalent of NETFRAMEWORK40FULL in InstallShield?  Is there a better way to check for .NET 4.0 from InstallShield 2012?
Please note: I am not interested in installing it from the installer.  Just a simple test to inform the user they need to install .NET 4.0 before continuing.
EDIT:
I could use a bootstrapper, but would rather not if there's a native InstallShield way of doing this.
Answer: I haven't done much on InstallShield. I hope this may address you query.


How to set up a secure system to allow only specific clients to access specific services on a server?

Question: Preface
Please bear with me if I use incorrect terminology or don't express the problem too well since I'm not an expert on system administration/server maintenance. Let me know/correct me if I do so I can learn and clarify my points.
Problem
I have a Linux device, the server, that runs different services on different ports (an HTTP, SSH and FTP server currently, but possibly other servers for other protocols in the future). My friends and I have other devices, the clients, that are running Linux (incl. Android) or Windows, that we'd like to use to access the server's services, as long as both client and server are online on the internet, regardless of whether they're on the same local network.
The other caveat is that we'd like to do this securely such that the server can ensure that it's really only me or my friends accessing it, that we can be sure that the server we're connecting to really is the correct server (not some MITM spoofing their identity as the server), and without third parties being able to obtain (too much) meaningful information by sniffing the exchanged packets.
I'd also like to restrict my friends' access to only specific services (say, only HTTP and FTP for one friend, only SSH for another, etc.).
Possibly relevant information
I have admin access to the server (I can install packages and configure it with unrestricted access) and local network router. The server is running nftables.
Actions considered
I've thought of configuring nftables on the server to only allow inbound packets from specific IP addresses or devices with specific MAC addresses, but I don't think these are appropriate/adequate. First because of the constraint that we'd like to be able to connect from outside the local network, so the client devices' IP addresses can change. Second, because I know that MAC addresses can easily be spoofed so I can't use those to ensure that the client devices really are the allowed ones. Third, because these don't address the constraint that third parties shouldn't be able to obtain meaningful information by snooping on the packets (so ideally, the solution should employ some sort of cryptographic protocols to address this).
Other thoughts
I'm thinking that the solution would involve setting up some sort of accounts-based system where my friends and I each have our own accounts and the server only allows packets of specific protocols from certain accounts.
I'm also thinking I can maybe solve this by setting up a VPN server using a protocol like WireGuard or OpenVPN on the server which would only allow connections from authenticated clients in a whitelist, then route all other traffic like SSH and HTTP through the VPN tunnel, making them accessible only when connected via that tunnel. Would that work? But then I'm not sure how I'd configure that to restrict my friends' access to particular services only. Do these VPN protocols have some feature to restrict the types of traffic allowed per client?
In any case, I don't really have a clue what the optimal solution for this is and how I'd set it up, so I'd really appreciate any useful advice, suggestions and information to solve this.
Answer: Use a VPN. Assign certificates (OpenVPN) or keys (WireGuard) to people and provide specific IP addresses to people too. Then use your firewall to only allow access to services from specified IP addresses. I would probably use Wireguard for this today.
Comment: You control the IP addresses of the VPN endpoints.
Comment: Thanks. To be clear though, when you say "provide specific IP addresses to people", is that something I can do on the server's end? I.e., do you mean I can somehow configure the VPN server to assign specific IPs per key/certificate? Or isn't that something that the client's ISP has control over?


The item of an unregistered user's cart is shown a different unregistered user

Question: Using Drupal Commerce 2 in Drupal 8.8, if an unregistered user puts something in the cart (and doesn't check it out) another unregistered user sees these items in Cart block (provided by view (order)). They aren't shown to the users on the /cart page.
Answer: The reason for the behavior described above is that in Views I changed the advanced option context filter - order id - for "if there is no value for the context filter" from: "static" (the option after installation, which had the effect that no cart was shown at all) to "show all results" (with the effect described above).
I found this link https://www.drupal4u.org/howtos/how-hide-empty-shopping-cart-drupal-commerce saying the correct value would be "Current user's cart order ID", but this was not available. I'm not sure if this is a bug, if things changed for Commerce 2 or if I configured something wrong.
Comment: Maybe file an issue for further investigation.
Comment: I tried a new question https://drupal.stackexchange.com/questions/294319/cart-block-doesnt-show-any-content
Answer: Without know your specific site, it's hard to say what the culprit is, but this sounds like a pretty typical caching issue. Ultimately, you need to prevent Drupal from caching pages or page elements rendered for anonymous users with shopping carts.
Comment: When I use the button "clear all caches" the problem remains. Is this an indication that it is not a cache issue or is this a matter of a different level of cache?
Comment: Even if you clear the cache, as soon as someone visits the page again, it will be re-cached with whatever their cart contents are and then visible for all to see. I'm not versed enough in all the options for cache invalidation, so I'll see if someone else can chime in - but you basically need to get to a point where this element isn't being cached at all.
Comment: If somebody had any idea how to prevent this element from being cached, I would really appreciate it. My first step war to configure order types that an abandoned cart will be cleared after two hours to mitigate the problem.
Comment: I deinstalled the core module Internal Dynamic Page Cache the only cache module that was installed, but it didn't change the site's behaviour.


Exiftool: batch change date to year specified in directory name

Question: I have my old scanned photographs sorted in folders named by the year they were probably taken (1970, 1971 etc); the folder names are just the plain years without any other text. Is it possible to let ExifTool change the Exif date to, say 1.1.<foldername> for all files in the various folders? (January 1st just because no more specific date is known at this point) Any other (free) tool is of course as appreciated.
Comment: It's probably possible, but more details on the directory path would be needed.  Is the folder name just the year or are there other numbers in the path?
Comment: Exiftool can change the date to whatever you want it to be, so the question then becomes how do you determine the value that you want the date to be set to?  Batch mode parsing the directory tree to obtain that value is going to be a function of the OS that you are using.  Which to me suggests that this is not primarily a photography question, and may be better answered on another (OS dependent) SE site
Comment: Almost certainly it is possible by writing a "relatively' simple computer program using a shell or scripting language. The relatively depends on your relative programming proficiency and the pleasure you find in such tasks.
Comment: @StarGeek The directory names are just the plain years. I edited the question accordingly.
Comment: @PeterM I thought it might be similar to [this question](https://photo.stackexchange.com/questions/66100/how-to-use-exiftool-to-write-date-tags-according-to-file-path?rq=1), that's why I ended up posting it here
Comment: @cirko If you had referenced that question in your original post I wouldn't have exposed my ignorance about the capabilities of ExifTool :D
Answer: This can be done with exiftool with this command
exiftool "-Alldates<${Directory;m/(\d{4})/;$_=$1} 0101 000000" /path/to/files/
There are some limitations.  You must give a directory path that includes the year i.e. you can't CD to that directory and use a dot to indicate the current directory, though you can be in the directory above the years and use the -r option to recurse. There can't be any other group of four numbers in the directory path, as that could be mistaken for a year.  Any differences would need modification of command.
This command uses exiftool's Advanced formatting feature to regex match four digits to use as the year.  It then sets the three most common EXIF timestamps, DateTimeOriginal, CreateDate, and ModifyDate to YEAR-01-01 00:00:00.
This command creates backup files.  Add -overwrite_original to suppress the creation of backup files.  Add -r to recurse into subdirectories.  If this command is run under Unix/Mac, reverse any double/single quotes to avoid bash interpretation.
Comment: I'm on a Mac. I did it from the parent directory and had to change it to `exiftool '-Alldates<${Directory;m/(\d{4})/$_=$1} 0101 000000' * -r -overwrite_original` for it to work. I got the `Warning: syntax error for 'Directory' - (path/filename)` for every single file (is that serious?), but it did change the Exifs, so - it works!
Comment: Ooops, I forgot a semicolon before the `$_` (fixed).  Double check to make sure it worked correctly but it still might have worked if there were no extra numbers in the Directory path exiftool received.  I think that's why it worked regardless of my error.


Using QGIS shapefile layer in ArcMap project?

Question: I created a QGIS shapefile layer in QGIS that I want to give to a friend of mine for his ArcMap project. Will he be able to open and use my work?
Answer: You need to understand that there is no such thing as a QGIS Shapefile, A Shapefile is a shapefile regardless of what software was used to create it.
According to ArcGIS Online Help:

A shapefile is an Esri vector data storage format for storing the location, shape, and attributes of geographic features. It is stored as a set of related files and contains one feature class.

But as PolyGeo said, you will not be able to save the symbology directly. The layer files don't work across QGIS and ArcMap directly ( maybe there is a workaround, but I'm not sure)
Answer: If you give your friend the shapefile, and it contains a suitable *.prj, then it should be usable in ArcMap but will need to be symbolized anew. The best thing will be to perform a test transfer of data and see if it works for you.
If you are planning to share the shapefile and a layer definition file (*.qlr) to try and preserve its layer properties I would not expect the latter to be usable.
Comment: There may also be an issue with the .qpj projection file not being read by ArcGIS, and therefore a coordinate system may need to be defined (but only if the .prj is not present or does not agree with the data)


when does a regular graph have a 1-factorization?

Question: Is there a sufficient condition for a regular graph to have a 1-factorization (i.e. being able to pack all of its edges into disjoint perfect matchings, and excluding one vertex if the number of vertices is odd)?
Answer: Being a complete graph on an even number of vertices is a sufficient condition. This being said, testing whether a 3-regular graph is 3-edge-colorable is NP-hard ( http://dx.doi.org/10.1016/j.ipl.2008.05.015 )
You can have certificates that a graph requires more than 3 colors by computing its fractional chromatic index (feasible in polynomial time with a LP solver and a maximum weighted matching algorithm at hand). This is checking whether your graph contains an overfull subgraph ( http://en.wikipedia.org/wiki/Overfull_graph )
For this, you can have a look at :
Daniel Ullman and Edward Scheinerman - Fractional Graph Theory
http://www.ams.jhu.edu/~ers/fgt/fgt.pdf
Nathann
Comment: Nathann, thanks for the answer. But, I am not looking for a sufficient and necessary condition, just a sufficient condition. Like, for instance, Dirac's theorem (or all its generalizations) for Hamiltonicity.
Answer: Perhaps you already know this, but every bipartite regular graph is 1-factorable (see e.g. these lecture notes).
Comment: Emil, yes. I was aware of that. Unfortunately, the graphs that I am working with are far from being bipartite...


SAT mathematics. Level 2. Trigonometry.

Question: The answer is 3 and 5. Explanation?
Comment: This is a triangle with three knowns which are in counter-clockwise order: Side-Side-Angle.  You should know that there are generally two possibilities (either in this case $\angle ABC >\frac{\pi}{2}$ or $\angle ABC<\frac{\pi}{2}$).  Check any elementary textbook on trigonometry or "algebra 2" (highschool algebra, not abstract algebra) or websites such as [this](https://www.mathsisfun.com/algebra/trig-solving-ssa-triangles.html) for how to solve for the remaining unknowns of a triangle.
Answer: Let $BC=x$. By the Law of Cosines:
$$7^2=8^2+x^2-2\cdot 8\cdot x\cdot \cos\frac{\pi}{3}$$
$\cos\frac{\pi}{3}=\frac{1}{2}$, so
$$\iff x^2-8x+15=0\iff (x-4)^2=1$$
$$\iff x-4=\pm 1\iff x\in\{3,5\}$$
Answer: For SAT2 math, you ought to memorize both the Law of Cosines and the Law of Sines. They're both useful to rapidly solve problems with non-right triangles. This one uses the Law of Cosines, where $a,b,c$ are sides of a triangle with opposing angles $A,B,C$.
$$c^2 = a^2 + b^2 -2ac\cos C$$
In your case,
$$7^2 = 8^2 + x^2 -2(8)(x)\cos \frac{\pi}{3}$$
You can either solve this as a quadratic equation (preferably) or substitute your answer choices to find the solution.
Answer: Draw perpendicular from point B to AC, you will get two right angle triangles.
I will leave rest of the work to consider self.

SAT mathematics. Level 2. Trigonometry.


Stream video from the server . {iPhone SDK}

Question: I'm trying to stream video with static IP : http://18.104.22.168/GemTVLink
via iPhone. Can you show me some information as to how I could implement this? I see an apple video stream app but it seems it can show only .mp4 movies? Am I right?
I want my app to load the HTTP address and play the movie, that's it.
This link works on media player.
Answer: The iPhone does not support all streaming video formats.
You should start by reading HTTP Live Streaming Overview
Answer: iOS native video player (AVPlayer, MPMoviePlayerViewController ...) can stream from http server in m3u8 format.
I looked at the link, that you mentioned(GemTVLink), it's an mms stream, iOS can not stream from microsoft streaming servers (mms), if you want to do that, you should use ffmpeg library, as this library can connect any streaming server (supporting rtsp, mms, tcp, udp ,rtmp ...) and then draw pictures to the screen.. (for drawing you can use opengles or uiimage also works)
First of all, use avformat_open_input to connect to your ip address then use avcodec_find_decoder & avcodec_open2 to find codecs and to open them (you should call them for both audio & video)
Then, in a while loop read packets from server by using av_read_frame method When you get frame, if it is audio then sent it to AudioUnit or AudioQueue, if it is video, then convert it from yuv to rgb format by using sws_scale method and draw the picture to the screen.
That's all.
look at this wrapper also (http://www.videostreamsdk.com), it's written on ffmpeg library and supports iOS


Problems with HLS with some versions of Plutus Apps: INFO hie-bios: error: cannot lock ref 'refs/remotes/origin/599'

Question: I need some help with this problem.
With some version of Plutus Apps, HLS and VCode works perfect.
But with some specific versions, like this one:
commit cbc2df9e5d47d60505c28f321d75187d9ea85b07 (HEAD)

When HLS server starts, it throw and error with git from the Plutus Apps:
2022-11-09 17:18:26.921893854 [ThreadId 13] INFO hls:   Started LSP server in 0.00s
Couldn't load cradle (CradleNone)
2022-11-09 17:18:26.926139924 [ThreadId 13] INFO hls:   Registering ide configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri 8157433327350195780 "file:///home/manuelpadilla/source/copyRepos/RATS-DAO/rats-dao-devs-staking-plutus-v2"], clientSettings = hashed Nothing}
2022-11-09 17:18:26.948609165 [ThreadId 69] INFO hls:   Consulting the cradle for "src/Validators/StakePlusV2/OffChain/EndPoints.hs"
2022-11-09 17:18:27.688350926 [ThreadId 111] INFO hie-bios: error: cannot lock ref 'refs/remotes/origin/599': 'refs/remotes/origin/599/marconi-cli-list-index' exists; cannot create 'refs/remotes/origin/599'
2022-11-09 17:18:27.689133924 [ThreadId 111] INFO hie-bios: From https://github.com/input-output-hk/plutus-apps
2022-11-09 17:18:27.68928638 [ThreadId 111] INFO hie-bios:   ! [new branch]          599        -> origin/599  (unable to update local ref)

Every else works fine, and I can build my project without problems.
But HLS is very helpful for coding and I appreciated a lot if I can use it.
This is a version of Plutus Apps that I can use reference scripts and Inline Datums.
I don't have this any of this issues with some previous versions neither.
Thank you so much!
Answer: Im editing this with something that fix that problem for me. I deleted the cache of hie-bios with:
cd $HOME/.cache/
sudo rm -R  hie-bios

Check more solutions here:
https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html


Thevenin Equivalent Voltage: why ignore the 3-kΩ resistor?

Question:
In order to find the Thevenin voltage here, why is it that the 3k Οhm resistor is ignored and no current goes through it? (hence \$V_{TH}=8mA \cdot 7kΩ = 56V\$)
Comment: The equivalent voltage Vth is the voltage obtained at terminals A-B of the network with terminals A-B open circuited. https://en.wikipedia.org/wiki/Th%C3%A9venin%27s_theorem
Comment: The Thev, Equiv cct. uses 3k + 7k=10k in series with 8m*7k=56V
Answer: Computing a Thevenin Equivalent requires two steps:

Obtain the Thevenin Impedance \$Z_{TH}\$
Obtain the Thevenin Voltage \$V_{TH}\$

In order to compute \$Z_{TH}\$ you have to "turn off" the independent current source. As it is a current generator you will need to place an open circuit there. This will "disconnect" the 4k resistor from the circuit, giving you \$Z_{TH} = 7k\Omega + 3k\Omega = 10k\Omega\$, as the resistors are in series.
In order to obtain \$V_{TH}\$ you need an open circuit between the terminals A and B. Having this open circuit will cause no current to flow through the 3k resistor, as it would violate Kirchhoff's First Law. That current would have no way to get "back" to the circuit, so you would be diminishing the electron count!
Another way to look at it is as if you had an infinite resistor between A and B. The air acts as an insulator, so given a real valued voltage drop in A and V \$V_{AB} = \alpha\$ you would get:
$$I = \lim_{R \to \infty}\frac{V_{AB}}{R} = \lim_{R \to \infty}\frac{\alpha}{R} = 0$$
No matter how you want to look at it, you have no current flowing there. This leaves the current flowing only in the left loop. Having no current in the 3k resistor means we will have no voltage drop there. Remember that we want to find \$V_{TH} = V_A - V_B\$. Following the circuit we see that the only drop involved is the one in the 7k resistor. By Ohm's Law, that drop will be \$V_{DROP} = I·R\$, so:
$$V_A = V_B - I·R \to V_A - V_B = V_{TH} = - I·R$$
Being I = 8mA and R = 7k\$\Omega\$.
This is the Thevenin Equivalent and why the 3k resistor doesn't play a role in the Thevenin Voltage.

simulate this circuit – Schematic created using CircuitLab
Comment: Nice answer, but please please the "k" of the prefix kilo should be lower case and Kirchhoff has two _h_'s ;-)
Comment: Thanks a lot for the corrections. Is it ok now? ;)
Answer: The Thévenin voltage is also known as the "open-circuit" voltage. In this case, the open circuit is between points A and B. Because it's an open circuit, no current flows through the 3k resistor, and thus there is no voltage drop across it.
Answer: The Thevenin voltage is when the output terminals are open-circuit so any series resistance (3K in this case) has no effect. We can also ignore the 4K resistor since it's in series with a current source, and the open-circuit voltage is \$8mA \cdot 7K\$ = 56V (A is negative wrt B).
When you go to calculate the equivalent series resistance from that voltage, the 3K will come into play. You can apply the current divider formula to find the current through the 3K (5.6mA) and thus the output resistance. Or just replace voltage sources with shorts and current sources with open circuits and look at the resistance looking in from the output.


Different normality of data in forecasting

Question: I would like to forecast volatility with GARCH. I have taken portfolio consisting of 2 stock indices. One is equity, another is fixed income. I have tested the returns of both indices and equity indice is normal (95% confidence level) in terms of simple return, whereas another is not. But, fixed income returns are normal in terms of log returns whilst equity returns are not. What should I do in this situation?
Comment: Perhaps you could come up with a more appropriate title. The current one does not seem to reflect your actual problem precisely.
Comment: I find it hard to believe that any return series are Gaussian. It's been shown over and over that the returns have fat tails.
Answer: If you intend to use a GARCH model, you should care about the distribution of standardized model residuals (i.e. residuals from the conditional mean model divided by fitted conditional standard deviations from the GARCH model) rather than the raw data -- because a GARCH model has distributional assumptions on standardized residuals rather than raw data.
If you fit a univariate GARCH model on a linear combination of the two series (the linear combination denoting portfolio returns) and the standardized residuals do not have the distribution that you have assumed, you have a problem. You then normally try other distributions as long as you find one that matches. But it is possible that you do not succeed in finding a matching distribution, which still leaves you another option: multivariate GARCH modelling. That is, you will model the two series separately.
There are many kinds of multivariate GARCH models, e.g. BEKK-GARCH, DCC-GARCH, GO-GARCH, etc; see Bauwens et al. "Multivariate GARCH models: a survey" (2006) or Silvennoinen & Terasvirta "Multivariate GARCH models" (2009). Again, your goal is to match the assumed distribution of standardized residuals with the resulting distribution that you get after having estimated the model. DCC is a flexible model allowing for different univariate distributions for the two series of standardized residuals. A DCC model works in two stages:

Build univariate GARCH models for each individual series (in your case, two univariate GARCH models). The individual models can differ in their form (e.g. one can be simple GARCH, another can be EGARCH) and distributional assumptions (e.g. one can be normal while the other can be Student(4)), which is giving you quite a lot of flexibility.
Put a GARCH-like structure on conditional correlations between the standardized residuals from the individual GARCH models. That makes it a DCC model.

Perhaps you could get away with the empirical distribution not matching the assumed distribution by invoking principles of quasi maximum likelihood estimation (QMLE) - see "Idea and intuition behind quasi maximum likelihood estimation (QMLE)".


Add column in observer for controller_action_postdispatch_adminhtml_permissions_user_roleGrid

Question: I've created observer for  controller_action_postdispatch_adminhtml_permissions_user_roleGrid event, that is called on AJAX when filtering permission user grid. Problem is that I can't add custom column (with renderer) - how to get grid object from Varien_Event_Observer $observer?
Answer: I am not sure about when using ajax but I think the event core_block_abstract_prepare_layout_before maybe a better option. This event will give you the block and then you can simply call add column directly to it.
You can then get the block and validate the type and then call add column.
$block = $observer->getBlock();
if (!isset($block)) {
    return $this;
}
if ($block->getType() == 'the_type/you_need') {
    $block->addColumnAfter('your_column', array(
        'header'    => 'Your Column',
        'type'      => 'text',
        'index'     => 'your_column',
    ), 'column_to_go_after');
}


Deleting a token from ledger

Question: =Can anyone tell me how to delete a token completely.  I want to start over and use the same token name and home directory, etc.   but I need to remove my original token first.  I have all tokens in the issueing account but that account is locked.   Help???
Answer: If you think the account is locked but it is not:

Unlock your account

If an account is not locked:

Transfer or burn all tokens except XLMs
Remove all trustlines
Use the merge operation to transfer the remaining XLMs into another account

If an account is locked:

Perform a 51% attack to manipulate the ledger or convince the stellar team and validators to implement an unlock operation.

Deleting a token from ledger


Can I power a single pole switch from the end of a 3 way?

Question: I've done the imaginable and forgot to run one more line to the gang box.  Is there any hope I can pull power from the other 3 way switch also in the box?  I've attached the diagram of how its currently wired and what I'm hoping can happen.
Answer: Unfortunately, no. You need access to the white wire (neutral) coming into the first box from the load center and continuing to the existing lights. Since that is not in the second box, you have nothing to connect to the return from the new light.
Comment: I was already resigned to that answer so I appreciate you confirming it.


What's the difference between "shrouded with" and "covered with"?

Question: What's the difference between "shrouded with" and "covered with"? Any different hues of meaning here?
Answer: The difference is largely one of connotation. The verb to shroud derives from the noun shroud, which typically refers to a sheet used to cover the dead for burial in some religious traditions. Because of this association, when you say that something is shrouded with or shrouded in, it connotes an atmosphere of mystery, gloom, or the numinous.
Shrouded in also lends itself more readily to metaphorical usages. You might say that "The castle was shrouded in mist", but it would sound odd to say that "The castle was covered in mist".
Comment: WOW!!! Thank you very much, JSBangs, for this insight! It really answers my question.
Comment: Additional note: becuase of the connotation of mystery, shrouded also frequently implies 'hidden by'.  I might say something was covered with a tarpaulin, but I would be likely to say 'shrouded with' only if it was a camouflage pattern.


what happen if I use EMI filter at more then specified current

Question: I want to use Gaia EMI filter. my load requirement is 1.7 A continuous and 3.5A Max. Voltage is 28 V. Because of the max current I have to use FGDS-10A-50V(load current can go up to 10A) but this size to too much for me. So my question is if I use FGDS-2A-50V(load current 2A) filter and when in some case my current will go 3.5 A what will happen with the filter? will it stop working and when my load will be again less the 2 A it will start filtering..? Or once the current will go high my 2 A filter will not be workable again.
Comment: It is likely to release the magic smoke.
Comment: I can only state that I have seen it happen. The datasheet may be informative; otherwise, contact the manufacturer.
Comment: @PeterSmith can You provide any proof for that? It will be helpful.
Comment: If you don't like to respect the parts specifications, you should use another part.
Answer: Inductance can saturate and drop sharply above the -10% threshold  used for DC rating.
Heat rise depends on DC or RMS Amps squared times resistance loss in filter.

Thus 5 times rated current means 25x temperature rise in the inductor above ambient.

Do not exceed the rating unless you know the consequence.
Comment: And even if thermally it is viable... The saturation of the magnetics will change the filter response THUS its rejection capability isn't the same
Answer: The current limit is based mainly on the inductors used inside the filter. If you exceed the peak current rating, two things can happen:

The inductor saturates, reducing its value significantly. This reduces the effectiveness of the filter, allowing a burst of EMI out of (or into) your product. Obviously, this is something you care about, or you wouldn't be using the filter in the first place.
The inductor overheats, potentially damaging it permanently, or at least reducing its useful lifetime. Again, something you no doubt want to avoid.


Promises made before hitting puberty

Question: I made a lot of promises to Allah before hitting puberty. I still remember some of those promises. Should I fulfill the promises I remember or do they not count since I wasn't baligh.
Comment: Isn't this question the same? https://islam.stackexchange.com/questions/62194/making-a-promise-to-allah-before-puberty
Answer: To be honest there is a major ikhtlaf on when a child begins to be accountable if you search it there are lots of fatwas and different opinions on the topic so just to be safe you should probably fulfil those promises if possible. However I will list one opinion here:
if a boy has a wet dream or a girl has her first period then they are baligh but if they don't then it's by age 15 years. (Radd al-mukhtar)
but plz note again of the major ikhtlaf there may be Other signs But may not be agreed upon in some cases so I just advise you should just make the promises up and also I'm not a scholar.

Promises made before hitting puberty


Sulfates and persulfates as accelerants in black powder?

Question: I saw there was a few black powder posts on here so I'd like to pose a question. Would sulfates or persulfates like the oxidixer soduim persulfate be a good replacement for some percentage of the nitrates or usual sulfer content of black powder? Pursulfates are used as an ingredient in flash powder for pyrotechnics and is a strong oxidizer to combustibles, so I assume it would make a good accelerant in some concentration. Would it perform under the pressures and speeds needed for an old fashioned firearm, or would it be too corrosive to be practically used?
Answer: Sulphates and persulphates cannot be considered as analogues to chlorates and perchlorates.

Perchlorates are frequently used in professional pyrotechnics, being more reactive than nitrates.
Chlorates are too reactive for safe use.
Sulphates are useless as not acting as oxidant.
Persulphates have limited oxidative oxygen content, compared to nitrates or perchlorates, but as chlorates are too reactive for safe operations.

As a general rule, you must know what you are doing. More reactive mixtures may not only lead to faster wearing of the guns, but also to a gun blowing into your face.
Sulphur cannot be replaced by sulphates/persulphates, as it has the opposite role than oxidants. It would be like if you wanted to replace oxygen for breathing by carbon dioxide, as both contain oxygen.

Gun powder

Chemical reaction
Gunpowder does not burn as a single reaction, so the byproducts are not easily predicted. One study showed that it produced (in order of descending quantities) 55.91% solid products:
   potassium carbonate, potassium sulfate, potassium sulfide, sulfur, potassium nitrate, potassium thiocyanate, carbon, ammonium carbonate and 42.98% gaseous products: carbon dioxide, nitrogen, carbon monoxide, hydrogen sulfide, hydrogen, methane, 1.11% water.
However, simplified equations have been cited.
A simple, commonly cited, chemical equation for the combustion of black powder is
  $$\ce{2 KNO3 + S + 3 C -> +K2S  + N2 + 3 CO2}$$
A balanced, but still simplified, equation is $$\ce{10 KNO3 + 3 S + 8 C -> 2 K2CO3 + 3 K2SO4 + 6  CO2 + 5N2}$$
Comment: Black powder is a mixture of three substances : saltpeter $\ce{KNO_3}$, sulfur and charcoal. The reaction taking place with black powder is :$$\ce{2 KNO_3 + 3 C + S ->  K_2S + N_2 + 3 CO_2}$$ It is a rather strange reaction, because two substances are acting as oxidant : Nitrogen from $\ce{KNO_3}$ and Sulfur. These two atoms are reduced, Sulfur from $ 0$ to $ -2$, and Nitrogen from $+5$ to $0$. The only element that is oxidized is Carbon. It also should be mentioned that as soon as $\ce{K_2S}$ is produced, it gets oxidized by $\ce{O_2}$ from the air into $\ce{K_2SO_4}$.
Comment: by nitrate as well. As there is not the only one equation describing the gunpowder burn.
Comment: Your general comment on persulfates is not likely accurate, in fact, with ammonium persulfate, it may be potentially a very dangerous energetic. See my answer and reference below.
Comment: I have written about available oxygen.
Answer: Per the Energetic Materials Section in ScienceMadness to quote:

anyone got anything on any high energy fuels for a high explosive flash powder? I know that ammonium persulfate and ferrocerium can be very explosive, and...

Here is a link to Ferrocerium for those interested.
So, please avoid the use of ammonium persulfate in select mixtures due to possible problematic/dangerous energetics per my readings (sorry no personal experience here).


System V IPC vs POSIX IPC

Question:
What are the differences between System V IPC and POSIX IPC ?
Why do we have two standards ?
How to decide which IPC functions to use ?
Comment: There was one reason i had which led for me to chose sysv message queues over posix. The possibility of delivering messages by mtype is not supported in posix message queue. I had [blogged](https://nyrahul.github.io/systems/engg/2018/04/01/sysv-msgq-vs-posix-msgq/) about it..
Comment: In the book titled **Linux Programming Unleashed 2nd Edition** by **Kurt Wall**, page 382, it said:  `System V IPC is well known and commonly used, but the Linux implementation of it is badly broken.`  I dunno if Linux improvements were made to address that issue, if somebody knows please tell. Today, i am too facing similar choice wither **Posix IPC** or **System V IPC** and my approach is to carefully understand the what type of IPC primitive is going to be used because there are advantages in one over the other. For example, a process can abruptly die and what then?
Answer: Both have the same basic tools -- semaphores, shared memory and message queues. They offer a slightly different interface to those tools, but the basic concepts are the same. One notable difference is that POSIX offers some notification features for message queues that Sys V does not. (See mq_notify().)
Sys V IPC has been around for longer which has a couple of practical implications --
First, POSIX IPC is less widely implemented. I wrote a Python wrapper for POSIX IPC and its documentation lists what I know about POSIX IPC implementations on various platforms.
On all of the platforms listed in that documentation, Sys V IPC is completely implemented AFAIK, whereas you can see the POSIX IPC is not.
The second implication of their relative age is that POSIX IPC was designed after Sys V IPC had been used for a while. Therefore, the designers of the POSIX API were able to learn from the strengths and weaknesses of the Sys V API. As a result the POSIX API is simpler
and easier to use IMO, and I recommend it over the Sys V API.
I should note that I've never run any performance tests to compare the two. I would think that the older API (Sys V) would have had more time
to be performance tuned, but that's just speculation which is of course no substitute for real-world testing.
As to why there are two standards -- POSIX created their standard because they thought it was an improvement on the Sys V standard. But if everyone agreed that POSIX IPC is better, many many many programs still use Sys V IPC and it would take years to port them all to POSIX IPC. In practice, it would not be worth the effort so even if all new code used POSIX IPC as of tomorrow, Sys V IPC would stick around for many years.
We can't tell you which you should use without knowing a lot more about what you intend to do, but the answers you have here should give you enough information to decide on your own.
Comment: There is one important difference that man-pages and other articles fail to highlight i.e. sysv message queues have a notion of delivering messages by mtype (posix msgq lacks this). In some cases, this could be an important design element and to quote my experience it turned out to be a show stopper. I had [blogged](https://nyrahul.github.io/systems/engg/2018/04/01/sysv-msgq-vs-posix-msgq/) about it.
Comment: After OpenGroup's documentation, SysV IPC was part of SUS since Issue 2 and the new interface, since issue 7. Indeed, one is there since more long, but both are part of SUS, so both are part of POSIX.
Answer:
I believe the major difference is that all POSIX IPC is thread-safe, while most SysV IPC is NOT [1].
Because of Unix wars [2]. The Single UNIX specification (SUS) [3], aka POSIX, was created to standardise interfaces on Unix-based systems.
You probably want POSIX. Depends exclusively on your requirements.
Answer: System V IPC is older and POSIX IPC is newer. However there are some differences for some aspects. Not always Posix is better than System V.

The semaphores, queues and shared memory for Posix have Ascii string names, while under System V these are given with integer number.
The System V semaphores allows to be automatically released if process dies (semop SEM_UNDO flag). There is no such thing for Posix.
On Linux and FreeBSD there is big advantage of posix queues, as handler given by mq_open are basically file descriptor which can be polled/epolled/selected/kqueued.
Comment: It seems, therefore then, that the choice depends on the type of **IPC primitive** one is going to use. There are some where Posix is great, and yet there are others also where System V is great. If a process dies abruptly, and no API in the world can intercept such event, then the **IPC primitives** would be dangling or its detection thereby. There are varying use cases whereby Posix is best, and then there are other use cases wherein System V handles the issue well.
Answer:
Systen V and POSIX IPC are two different, but related implementations of the same thing.

"Unix System V, commonly abbreviated SysV (and usually pronounced—though rarely written—as "System Five"), is one of the first commercial versions of the Unix operating system. It was originally developed by American Telephone & Telegraph (AT&T) and first released in 1983."

-Wikipedia

"POSIX or "Portable Operating System Interface [for Unix]" is the name of a family of related standards specified by the IEEE to define the application programming interface (API)"

-Wikipedia

Systm V was there earlier. POSIX evolved out of the standardization initiative by IEEE.
GNU/Linux is partially compliant with POSIX. Which one to use depends on which OS you are using this IPC. Most vendors are moving towards POSIX.

Unix Network Programming: Interprocess Communications v. 2 by Richard Stevens gives  a good look into both of these.
Comment: You don't discuss anything about Interprocess Communicaton as referenced in the questions.

System V IPC vs POSIX IPC


What is the line of light in galaxy cluster MACS J1206?

Question: I noticed this in a thread from world building, what is the continuous line of light in MACS J1206 slightly right of center in this picture? The only thing I could think of would be the side view of a galaxy, but it's much longer than any other galaxies pictured.
Comment: I suppose you are watching at a lensed galaxy, but to be sure of what you mean, you can modify the image and point at the exact object you want to know (with an arrow, or a circle...). Asking for a galaxy in an image full of galaxies is not the best...
Comment: Sadly, I'm getting an error on attempts to upload the modified file (500). I'll try again at home.
Comment: @Py-ser's absolutely correct. I've seen the image before - and look what [Wikipedia page](http://en.wikipedia.org/wiki/Gravitational_lens) it's on.
Answer: I have highlighted the feature I believe you are talking about. It looks like a galaxy that has been repeated (smaller green oval). There are several foreground objects that appear to be causing additional gravitational lensing (red arrows). Due to the shapes of the objects causing the lensing effect, the apparent image can be affected in many different ways, such a image duplication (multiple identical images of a galaxy, etc.), magnification, distortion, etc. The universe is massive and three-dimensional and we still don't understand that much of it yet.


NYC: Are any Skeptics users attending the NECSS Conference this year? (2014)

Question: Who's going to http://necss.org in NYC this year?
Is anyone in contact with the organizers?
Comment: StackExchange will support the community if you want swag to distribute for example...
Answer: Sadly I will not be able to go.  I had submitted to speak, but was not selected.  And then I got a paid speaking engagement someplace else that is on the 12th, so I ended up with a conflict.  I have emailed and corresponded with the folks there, and they are approachable and wonderful people.
I do recommend the conference. It's more intimate than something like TAM, and the workshops were fantastic last year.  If you are interested in trying to secure a sponsorship, check out this thread: How can I get Stack Exchange to send me to a conference?


Max of set in Isabelle

Question: How can I find the maximum element in a set of numbers (nat) in Isabelle. The max function doesn't work, as it is only defined to take the maximum of two elements. I have an idea of how I could implement it using a reduce like function, but I don't know how to pick one random element from a set.
Comment: Using sets if you really want to take about lists is pretty cumbersome and often makes the proofs longer.
Answer: The function you are looking for is called Max. If you are looking for basic constants the guide What's in Main from the official Isabelle documentation is often useful. There is also the find_consts command which can be used to search for functions by type.
Comment: Just to add to this: search for constants is also available from Isabelle/jEdit's query panel (see [3.4.2, p.30](https://isabelle.in.tum.de/dist/doc/jedit.pdf) in the Isabelle/jEdit manual). If you have an idea what your function's name—or a part of it—could be called you can write `name: ` to search for matching constants. Small caveat: the search is limited to the imported theories. In this case you would have to have theory `Lattices_Big` imported (which seems to be included transitively in `Main`).
Answer: If you follow the definition of Max to theory Big_Operators in the main HOL library, you will see that it is defined like this:
Max = fold1 max

The combinator fold1 is your "reduce like function" that works on finite sets.
See also theory Finite_Set and its locale folding for the mathematical background that is required here to fold over arbitrary sets, instead of concrete lists.

Max of set in Isabelle


Rules of motif forming

Question: I want to understand how a motif is present or not, can be deduced from a PDB file. Are there any rule of thumb for forming 3D motifs? Like a series of helices and sheets in some direction will lead to a particular 3D motif? Are there any such rules? If so, any resources that you can provide me with?

For example, beta-hairpin. What should be the sequence of amino acids or helix/sheet that would result in the formation of beta-hairpin motif?
Answer: A motif is a pattern that you discover in a structure by analysis. For example, common sequence motifs are short sequence fragments with parts similar to a regular expression. So, if you have a motif like "A*C" this matches to the sequences "AAC" and "ACC" but not to "ACA". You can reverse the process to discover the motif from the sequences.
Similarly with structural motifs in proteins. A beta-hairpin is :

The motif consists of two strands that are adjacent in primary
  structure, oriented in an antiparallel direction ... and linked by a
  short loop of two to five amino acids.

So first you have to determine where the strands and loops are, then how the strands are connected into sheets, and finally recognise the hairpins. It is the definition of the motif itself that determines how you discover it.
Some resources that might be helpful are:

Motivated proteins (Small h-bonded motifs)
The protein topology graph library (Larger motifs)
The protein geometry database (Not really motifs, but interesting)
PDBeMotif (define and search for motifs in the PDB)
Comment: How do I derive from PDB where the strands and loops are and how the strands are connected into sheets?
Comment: @Rishika That's a big topic. There are tools out there to do this, DSSP for example. In addition, the PDB file often has secondary structure information provided by the authors. Or you could even just view it in a structure viewer, which will generally show you the strands and loops. Jmol has a DSSP implemention. It depends what you want to do, exactly.

Rules of motif forming


The HTTP request to 'http:///xxx.svc' has exceeded the allotted timeout

Question: I am investigating the following TimeoutException exception. Has anyone encountered this before? Can anyone suggest a solution?
We have a clients that connect to a WCF service to upload a payload of data via HTTP. Recently the server is failing. Here are some exception details:

mscorlib threw TimeoutException The HTTP request to 'http:///xxx.svc'
  has exceeded the allotted timeout of 00:00:10. The time allotted to
  this operation may have been a portion of a longer timeout.
Server stack trace:     at
  System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
  at
  System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult
  result)    at
  System.ServiceModel.Channels.ServiceChannel.EndCall(String action,
  Object[] outs, IAsyncResult result)    at
  System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(IMethodCallMessage
  methodCall, ProxyOperationRuntime operation)    at
  System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage
  message)
Exception rethrown at [0]:     at
  System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
  reqMsg, IMessage retMsg)    at
  System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
  msgData, Int32 type

Please excuse my brevity. I am not a WCF expert. Any recommendations would be much appreciated.
Is there a timeout value I can increase?
Answer: You can increase the receiveTimeout property of your binding.
Here are a couple of links on MSDN:
General: Configuring Services Using Configuration Files
Bindings: Configuring Bindings for Windows Communication Foundation Services


Upper case a full string without using .upper function? PYTHON

Question: I was wondering how I could completely upper case a string without the use of any functions involving .upper()? Is there a way to possibly capitalize with the ord() function? I am in an exercise where I must refrain from using the .upper function.
Comment: Try `ord('a') - ord('A')` in IDLE.
Answer: ord("A") --> 65                  ord("B") --> 66            ...
ord("a") --> 97                  ord("b") --> 98            ...

So whenever you want to change lowercase character to uppercase without using upper() function, you can just find the ASCII value of lowercase using ord() function, subtract 32 (which is the difference between uppercase and lowercase) and then use chr() function to convert it back to char.
Answer: print ('Case changer(Capital to small ONLY)')
line1 = input ('Enter here: ')
g = ""
for ch in line1:
    if ord (ch) >= 65 and ord(ch) <= 90:
        x = ord(ch) + 32
        y = chr (x)
        g = g + y
print(g)

Comment: Although this code may be help to solve the problem,
providing additional context regarding _why_ and/or _how_ it
answers the question would significantly improve its
long-term value.  Please [edit] your answer to add some
explanation.


PIC18F26K80 ADC calibration using Bandgap

Question: The PIC18F26K80 errata sheet mentions that the ADC has an offset error as high as 25 bits and discusses one workaround copied from the errata here:
A/D Offset
The A/D may have high offset error, up to a maximum of ±25 LSBs; it can be used if the A/D is calibrated for the offset.
Work around
Calibrate for offset in Single-Ended mode by connecting A/D positive input to ground and taking the A/D reading. This will be the offset of the device and can be used to compensate for the subsequent A/D readings on the actual inputs.
I have an existing circuit where connecting the AD input to ground is going to be difficult - so I was looking for alternatives.
The ADC has provision for connecting the positive input to an internal bandgap voltage reference (Channel 31)
Pg 358 in datasheet
My Question:
Would measuring the bandgap voltage serve as a way of identifying the offset error also or would each channel have a different offset?
Answer: It should work for all channels, since they are all connected to the same ADC (it just switches between them)
You can confirm this by taking an offset reading on each channel to make sure they agree with each other.


How to Deploy a Token Using the ERC-3643 Standard

Question: I want to develop a smart contract using the ERC-3643 standard instead of ERC-20. Could you guide me on how to integrate this standard into my contract? Any assistance would be greatly appreciated. Thank you!
Answer: You've come to the right place, as one of the co-authors of the ERC-3643, I can guide you on how to get started.
First of all, the core contracts of ERC-3643 include the following:

Token
IdentityRegistry (IdentityRegistryStorage is optional)
ClaimIssuer
ClaimRegistry
Compliance.

Here's how you can proceed:

Official Repo of the T-REX (ERC-3643): at
https://github.com/TokenySolutions/T-REX for comprehensive
information on the ERC-3643 standard.

Decentralized Identity: ERC-3643 uses OnchainID (https://github.com/onchain-id) for decentralized identity management, which is a crucial part of the standard

Understanding Deployment Order: I recommend reading the test files in the T-REX repo to understand how the contracts are deployed and their order. It would be too lengthy to detail here, but examining the tests will give you a clear understanding of the process.

Continuous Updates: Remember that the ERC-3643 might have changed since its initial release, as Tokeny, the company behind the standard, continuously updates and refines it.

Here is a simple infographic explaining the T-Rex Standard (ERC-3643) from three years ago, Keep in mind that the core principles are still relevant, but some details may have changed or been updated since then:
Comment: Thanks! How can I verify the identity(addClaim) of the smart contract since I want to transfer the tokens into the smart contract ? Error is : Permissions: Sender does not have claim signer key
Comment: The issuer that has been added to the ClaimIssuer should add a claim to the Identity (sender) that requires the claim.
Answer: Can you please send some examples of erc3643 tokens deployed on the ethereum network with their corresponding addresses?
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


How do I activate a Stack Exchange login (user+pass, i.e. not OpenID)?

Question: I searched in the preferences but found nothing, so how do I create a user+password on Stack Exchange, on an account which I've been using with OpenID only?
Answer: The "Stack Exchange login" is, itself, just an OpenID service.
To create one, go to https://openid.stackexchange.com/account/register
Once done, you'll have an OpenID URL to use. (Go to your user profile, click "my logins", then "add more logins..." then "more login options". Then you'll have a field where you can put your Stack Exchange OpenID information.
Once that's set up, you can remove the other OpenID connection you no longer want to use.
Answer: You can link it to a google/facebook/etc account by removing your openid account. If you hit "my logins" at the top right of your profile. Other than that you can not make a site login with an existing account. It will still be linked to facebook google or any other authorization provider you choose


Do I need a UK airside transit visa, if I already have a UK visitor visa?

Question: I am an Indian citizen and I do not qualify for DATV concession. Going for a trip to UK and Europe, I am having Multiple entry valid Visitor visa for UK. While on my way back from Paris I will be transiting in Heathrow airport. Do I need to take a airside transit visa even though I have a multiple entry valid UK visitor visa?
Answer: No, you don't need additional visa. From UK Border Agency:

Multi-entry visas:
  Visas are valid for an unlimited number of journeys within the
  validity period of the visa.
People holding visit visas can only remain in the UK for a maximum of six months on any one visit, or
  until the visa expires if less than six months. This restriction is
  indicated on the visa by the entry '180' days after the 'Duration of
  stay' section.
Holders of long term visit visas must still meet the
  requirements of the Immigration Rules each time they enter the UK.
  They must not be using the route to live in the UK for extended
  periods. If it is apparent this is the case Border Force officers must
  refuse entry to the UK.

So you can see there is no restriction for minimum period of stay and you can use your visa for a transit.
Comment: Thank you for the reply. I believe everybody agrees with this reply.
Comment: The citation given here is out-of-date and has been archived by the government.  Check your link.
Answer: In addition to @Dirty-flow's answer, The general visitor visa is mandated for a land side transit which is greater than 48 hours and can be used for lesser than 48 hours landside or airside transits as well.
Additionally for reference the don'ts on the UK Gov website do not prohibit the use of the visa for such purpose either.


Do you need a ticket to ride with Västtågen between Gamlestaden and Gothenburg Central Station?

Question: Taking the Västtåg between the central station and Gamlestaden would be very practical for me. Do you have to get a ticket for that?
Answer: Yes, you need a ticket. Public transportation in Gothenburg is not free. You can purchase a ticket from a machine at the station, or a manned ticket booth. The machines only take credit/debit cards. A ticket for an adult costs 30 SEK and is valid for 90 minutes on all Västtrafik lines (so train, tram, and bus).
Comment: Did the trip today and indeed you need a ticket for that route just like on the tram.
Comment: @MikaelDúiBolinder Why is that surprising?
Comment: @Tor-EinarJarnbjo Arlanda Express offers free rides between the terminals of Arlanda so you never know


Identifying district boundaries outliers in QGIS

Question: I have a Nigeria shapefile that shows the district boundaries, I also have geocordinates of some health facilities, when I visualize on QGIS, I notice outliers ; some facilities are showing in a different district boundary. E.g a facility in 'Temi' district is showing on 'Tayo' boundary. how do I identify all the outliers at once, instead of filtering district by district on QGIS. Please note the health facilities is a delimited text layer with fields by name of facilities, states, districts.
Answer: Assuming your boundary layer has an attribute that shows the district name, and assuming your facilities layer also has an attribute that shows the district it is supposed to be in, use the Join Features by Location tool to populate the facilities data with the name of the district it falls in.  Compare the two columns of the resulting data table.  Any record that does not have matching district names is either in the wrong location (or your original data was not correct).   Here is a tutorial to get you started.