How to zip an entire folder via gzip?

Question: I am trying to zip an entire folder. There's this -r command to zip a folder recursively. Now this is good to zip all the files in a folder, but my predicament is I want to zip the folder in it's entirety and not its contents individually. For instance, if I have a folder E:\foo which contains 2 files zoo and bar; I want to zip E:\foo, and have a zipped file E:\foo.gz created. Please help
Comment: This question is confusing.  The question's subject talks about "gzip", but then the question talks about "I  want to zip", and then talks about a file named "foo.gz".  Zipping is creating *.zip files, gzipping is creating *.gzip files.  It seems people are treating the word "zip" to be "compress", because that assumption is the only way to really make Ritesh's question make any sense.  If that assumption is wrong, then Retesh should re-phrase the question to clarify.  If that assumption is right, then the desired goal is not a feature of gzip, so afrazier's answer is clear and right.
Answer: You can't do what you what with gzip.  It's a single stream archiver, so it has no ability to handle multiple files.  If you really want to use gzip, you'll have to combine it with a second tool that can combine multiple files into a single stream that it can archive.  This is tar's purpose.
The tar command line in @Alex's answer should put you on the right path.  You should be able to get a Windows port of tar from the same place you got gzip.
Answer: If you're using Linux, you'll want to use tar to invoke the gzip command, because tar will create an archive of the folder (pack it all into one file), and then gzip will zip that folder archive that has been converted to a single file. This can be accomplished with a single command:
tar cvzf file.tgz /path/to/folder

c is the create flag (create an archive)
v is verbosity - shows files as they are being archived
z is to use gzip - (j can be used to use bzip2 instead for better compression)
f is for file - the filename of the archive you want to create should follow
Hope this helps!
Comment: Did you see the "Windows" tag in the question?
Comment: Please read the question again carefully. Your answer does **not** answer the original question.

How to zip an entire folder via gzip?


Diagonal mouse hover with 3-level deep jquery drop down menu

Question: First of all Everything that I am about to explain is demonstrated in this fiddle:
http://jsfiddle.net/rxaBH/3/
Consider a navigation tab that goes deep 3 levels; 1st level the tabs, 2nd level: the drop down list. 3rd level the 2nd drop down list that opens to the side. Here's a visual:

. The simplified HTML for it would looks something like this:

child 1

child 2

grand child 1

grand child 2

great grand child 1

great grand child 2

great grand child 3

I won't bother with putting the CSS code here, as it is too long but it can be found in the fiddle link.
Here's the jQuery code that displays/hides the menu based on mouse over:
$("ul#maintabs li").hover(function () {
    $('ul:eq(0)', this).stop(true, true).animate({
        height: 'show',
        opacity: 'show'
    }, 150);
}, function () {
    $('ul:eq(0)', this).animate({
        height: 'hide',
        opacity: 'hide'
    }, 150);
})

All of this works great, but the user interaction could improve for navigating to 3rd level items. Lets say you want navigate to Watermelon > Green > Really Dark Green. so you would hover over "Watermelon", then the drop down appears, then hover down to "green" then the side dropdown appears. THEN horizontally hover from "green" to "darker" and then hover down vertically to "really dark green". Here's a visul. Mouse movement is visualized by the red arrows:

But what if the user wants to diagonally go from "green" straight to "really dark green" without scrolling horizontally first? Here's a visual of the desired behavior:

This causes the mouse to leave "green" and as a result the menu collapses and disappears altogether. so how can this be fixed?
I tried increasing the timeout on mouseleave, but then another problem arises: If you wanted to go from green straight to "really dark green" on the way there you would hover over "red" and possibly "purple" too. What if "red" also had children? then mousing out of "green" and onto "red" will display the submenu for "red" as well and then you will have more than 1 3rd level menus open at the same time, which looks awful.
Hope all of that makes sense!
Thank you.
Answer: $(document).ready(function() {
    $("ul.nav li").hover(function() { //When trigger is hovered...
        $(this).children("ul.sub").stop(true).slideDown();
    }, function() {
        $(this).children("ul.sub").stop(true).slideUp();
    });
});

this solved my issue
Answer: have you considered using doormat instead? Using a multi-layer navigation is not a wise idea and it has many usability issues.
That's the ideal behavior that you want. Onmouseout, you want the element to disappear, otherwise it will persist in there.
Check the doormat menu on ibm website, I am sure you will love it.
http://www.ibm.com/us/en/
Comment: This is a completely different structure. I am mainly interested how to make what I put work.


Why Did Starship 3 launch with its Hypersonic Grid Fins fully deployed?

Question: Wouldn't having the grid fins extended from launch to booster separation just cause extra drag?
Comment: Starship doesn't have any grid fins. The Superheavy booster does, and those can't retract and aren't meant for hypersonic velocities.
Comment: I was talking about the ship as a whole. The Starship booster has much larger grid fins in the same location as a Falcon 9 boosters. Falcon 9 does not launch with them extended. Why would the Starship booster have them extended at launch and through the ascent? The drag through supersonic flight has got to be horrendous. Trying to understand why you would want all that extra drag.
Comment: @ErinAnne - a SpaceX commentator referred to them as hypersonic grid fins (T+6:20 in the broadcast). Possibly a holdover from Falcon 9 which often exceeds Mach 5 prior to MECO. Starship at MECO was going 5,700 km/h at 67 km which does sort of squeak in as hypersonic based on the speed of sound at that altitude (5,400 km/h according to one source that I looked at). Although it still seems a bit of a misnomer as neither Falcon 9 or Starship are actively using their grid fins during that phase of launch, they use them during descent at about half that speed.
Answer: The four grid fins on the Starship booster weigh 3 metric tons each (6,600 lbs), which is about twenty times heavier than the Falcon 9 grid fins, based on an estimate that I found of 140 kg for Falcon 9.

Starship grid fin (Starbase Tour with Elon Musk)
I don't think SpaceX has said why they don't deploy the grid fins on Starship like they do on Falcon 9, however the widely accepted explanation is that it is simpler and saves weight, as stated in this answer (to a different question) on Aviation Stack Exchange:

They originated on Falcon9, where they fold away on ascent and fold out on return. But on Starship they don't fold away, saving the mass of the folding mechanism AND incurring the drag of flat edges on the way up.

In the video linked above Elon Musk stated that the motor that rotates the grid fins is essentially a Model 3 motor.
The grid fins actually don't present that large of a cross section when flat, as seen in this photo of the recent Starship test flight:

Compared to the drag created when tilted:
Comment: Wow, the size of the fins is impressive.
Comment: Elon Musk mentioned they are very over-engineered. Or, in some sense, not engineered at all. They know how grid fins work from Falcon 9, so they decided to go with grid fins in order to accelerate development, and basically make them large and thick with the option to reduce or replace them later when they gather more data. He mentioned they could probably be made lighter, even staying with the same profile, but most likely, they could also be made smaller. You'd also only need three, not four, and the third one could be a lot smaller than the other two.
Comment: ...and by not folding, there is one less thing to go wrong.


Weird Printing Issue: Windows Shared Printers accessible/visible via Hostname but not via IP Address

Question: Since about 8-10 months ago we've been facing weird printer issues which culminated this month to a massive amount of errors that got most of the company involved, and that allowed us to identify the core issues: on some machines (~7-8%) sometimes after reboot something happens with the Print Spooler that makes it so that printers are not advertised/available via IP Address, only via hostname.
Specifically the issue presents itself in 3 ways:

When sending a print from a Linux server the server will get an error and the Event Log will have the following error "Automatic The Line Printer Daemon (LPD) service refused a print job from %LINUXSERVERIP% for printer \%WindowsIP%%PrinterName% because the specified printer does not exist on this computer."

When attempting to map a printer from Windows Explorer by going to the Windows machine with \%WindowsIP%\ in Windows Explorer the printer will be visible but trying to add it will result in error "Operation could not be completed (error 0x00000709)." which is generally associated with KBKB5006670, but that's not installed on our machines and the first instances of the aforementioned error are from December 2021/January 2022 so way before that patch was even released

When running the powershell command Get-Printer -Computername %WindowsIP%. If the command is run with the Hostname of the machine then the result is correct (a list of shared printers), if it's run with the IP Address of the machine then it throws the following error:
<code>  + CategoryInfo          : NotSpecified: (MSFT_Printer:ROOT/StandardCimv2/MSFT_Printer) [Get-Printer], CimException
  + FullyQualifiedErrorId : HRESULT 0x8007007b,Get-Printer
</code>

And the most annoying thing is: if you restart the Spooler Service the problem completely disappears until next reboot...
Research on Google hasn't resulted in much success, except for one lone unanswered message: https://hardforum.com/threads/weird-network-printing-problem.1635293/
There is an XKCD for everything, isn't there? https://xkcd.com/979/
Additional analysis has been performed with Procmon, Wireshark, Process Explorer, WinDbg and xbootmgr with the following results:

Procmon:

Analysis of spoolsv.exe during execution of Get-Printer %WindowsIP% from another computer shows no other actions other than the network communication
Analysis of spoolsv.exe during addition of shared printer through Windows Explorer shows the network connection and some RegQueryKey for HKU%SIDOFREMOTEACCOUNT% and HKU.DEFAULT\Printers\Connections,,%WINDOWSIP%,%PRINTERNAME% with result of "NAME NOT FOUND" but nothing else
Attempt at analysis of spoolsv.exe during boot through the Enable Boot Logging was successful but useless due to the problem not appearing when booting with that option enabled
Additional analysis has been attempted through the Stack Summary Function to trace the stack down from spoolsv.exe but the only noticeable difference in the thread that was common between the working and non-working procmon dump was the presence of an additional branch called EatAuthInfoFromPacket on the dump of the working service.

Wireshark:

Superficial analysis of the traffic flow while executing Get-Printer from a remote machine shows winspool_AsyncEnumPrinters request and winspool_AsyncEnumPrinters response with protocol IREMOTEWINSPOOL, but no additional information and the stub data appears encrypted so I'm unable to garner additional information from it

Process Explorer

Superficial analysis has been done on the spoolsv.exe process and its Threads and Stack and the only interesting point was that in the Strings of the spoolsv.exe process there was \machinehostname and \machinehostname.domain.com when it was broken and nothing when it wasn't. But I have to admit my knowledge of Windows Internals is insufficient to fully make heads and tails of it. OpenAI has been helping with the explanations though!

WinDbg

Debugger has been attached to the spoolsv.exe process and testing done with both Get-Printer from a remote machine and attempting to map the printer through Windows Explorer, but in both cases no messages Debug messages were visible during execution. Additionally, I've created a process dump from Process Explorer and fed it to WindDbg to run the !analyze command, but it only returned a breakpoint, no actual error.  Same as before, I'm new to this tool, so if you have any suggestions I'll be happy to take them!

xbootmgr

xbootmgr -trace boot -traceflags dispatcher+latency -stackwalk readythread+threadcreate+profile+cswitch has been run to debug the service during boot but, same as Procmon, when the machine reboots with this tracing on the problem doesn't present itself so the output is fairly useless

And thus this is the summary. I'm a bit lost, and neither Google nor OpenAI appear to have any idea of what's happening here, so I'd appreciate any insights you might provide on additional troubleshooting for this issue or perhaps a resolution if you've faced it before.
Answer: If someone else has the issue, here is the answer from Microsoft:

The Cause (back story) is multi-tiered. This is the basic rundown.
Service Startup There have been many changes in WIndows to improve
service startup times at boot. This allows some services to start
earlier than they did in the past. A service may fail to start if it
has a network dependency and times out before DAD is complete and the
interface and IP are ready for use. Hardware Improvements in computer
hardware is a major factor. All modern processors have multiple
cores/threads, allowing parallel processing of operating system tasks.
The speed of processors has also increased dramatically. These changes
allow an operating system like Windows to perform multiple tasks
faster and in parallel, and thus dramatically improve service start
time. The amount of available RAM has increased quickly. This means
less paging to disk, also improving startup time. The most significant
improvement has been to storage. Storage is now primarily flash-based
(SSD), and commonly uses a high speed NVMe interconnect. Even storage
backends, like a NAS or SAN, are all-flash based these days. IO,
latency, and throughput improvements between old spinny disks (HDD)
and NVMe SSDs is in an order of magnitude of about 150+ times faster.
This change happened in a time span of less than 10 years. The Result
Prior to the improvements it took double-digit seconds for services to
start on boot. Back when DAD was first added to Windows it could take
minutes before all the services were ready.    Compensating for DAD
was not necessary, so most code simply ignored the IP address state.
The combined change of service startup behaviour and recent hardware
improvements have allowed service startup to take single-digit
seconds. Well before an IP address is ready to use, based on Windows
behavior and RFC requirement. Simply changing the DAD transmit default
for IPv4 to 1 is not a long-term solution. As hardware and service
continue to improve it is feasible that even a single second's delay
will be enough to cause a service failure at boot. Services
experiencing the issue must be changed to monitor the IP address state
prior to attempting a network connection or binding to an IP. Known
Issues This is a list of common issues that CSS may face related to
DAD and service startup. Service Using a Domain Account Fails to Start
Services using a domain account have a special dependency on the
network being ready and accessible to perform authentication with the
domain controller. The service will not start without being
authenticated. When the service starts and times out faster than it
takes for the network to be ready, which is typically related to
waiting on DAD to complete, then the service will not start. This is
commonly seen with SQL Server, but it can happen to any service using
a domain account for logon.
This issue can worked around by reducing the number of DAD transmits,
disabling DAD, or setting the Recovery option on the service to
restart. See the workaround:
Service Cannot Bind to an IP Address on Start This issue happens when
the service tries to bind a service to an IP address but times out or
errors out before the network is ready. Again, this typically happens
because of the DAD wait. The network stack cannot bind a service to an
IP address that is not in a Preferred state. This issue is seen often
with the spooler (Print Server) service. Issues like this can be
worked around by disabling DAD or setting the service startup to
"Automatic (Delayed Start)". Other workarounds may not work when the
service doesn't fail/stop, it simply continues without a service
binding to an IP address. IPv6 Addresses Disappear from DNS Server on
Reboot The DHCP client may request DNS registration before IPv6 DAD is
complete. When this happens the IPv6 address is deleted/disappears
from the DNS server during Dynamic DNS updating by the DNS client.
I hope this will help you and I would like to draw your attention to
the fact that at the moment there is no final solution found.


TIGER Geocoder / PostGIS - get county from point

Question: Looking for some help with getting the county for a lat/lon. I have PostGIS / TIGER Geocoder installed and can reverse look up a point and get the addresses. I would like to get the county the addresses are in.
I have...
<code>geocoder=# SELECT pprint_addy(r.addy[1]) As st1, pprint_addy(r.addy[2]) As st2, pprint_addy(r.addy[3]) As st3,
    array_to_string(r.street, ',') As cross_streets
    FROM reverse_geocode(ST_GeomFromText('POINT(-77.03 38.90)',4269),false) As r;
            st1                 |            st2             | st3 |   cross_streets
------------------------------------+----------------------------+-----+--------------------
New York Ave, Washington, DC 20005 | H St, Washington, DC 20005 |     | H St NW,13th St NW
</code>
(1 row)
And would now like to get the county for that point.
Answer: Silly me...
select * from geocoder.tiger_data.county_all ca where ST_Contains(the_geom, ST_GeomFromText('POINT(-77.03 38.90)',4269))


If $h(s)$ is an admissible heuristic, is $\sqrt{h(s)}$ admissible?

Question: I was thinking yes because $0 \leq \sqrt{h(s)} < h(s)$ but I'm not entirely sure.
Answer: Yes, the basic condition for a heuristic being admissible is that it is always less than the actual cost, and the rest follows by the transitivity of the less-than-or-equal-to relation.
See the all-knowing wiki for the background. I'll steal the notation from there for some measure of consistency.
Or, in a rather unnecessary mathematical formulation, if $\forall s, h(s) \leq h^{\ast}(s)$, where $h^{*}(s)$ is the actual cost then $h$ is admissible.
Assuming $x \in \mathbb{R}^{\geq 0}$ and (thanks Yuval) $x\geq 1$ (i.e. we don't have some weird situation where $\leq$ breaks, etc.), $\sqrt{x} \leq x$.
So
$$\forall s, h(s) \leq h^{\ast}(s) \Rightarrow \forall s, \sqrt{h(s)} \leq h(s) \leq h^{\ast}(s) \Rightarrow \forall s, \sqrt{h(s)} \leq h^{\ast}(s)$$
therefore $\sqrt{h(s)}$ is admissible.
If $0\leq h(s) < 1$, then $\sqrt{h(s)} \geq h(s)$, and is not necessarily admissible (it may still happen to be, but there's no guarantee).
Comment: Note that $\sqrt{x} \leq x$ iff $x \geq 1$.
Comment: @YuvalFilmus  ... $\lor x=0$ :-P This corner case can be convenient since when we are working with $x\in\mathbb{N}$ then $\sqrt{x}\leq x$ becomes always true.


Duplicate Group Box

Question: How can I Duplicate a Groupbox in C# window application ,
the group box contain 30 textbox and i need to duplicate it on a special event and I don't know the maximum number of needed groupbox
Comment: Create a user control that contains the group box and all of the textboxes, and then use that instead. (This is currently a comment because I don't think your question includes enough details for me to write a sufficiently comprehensive answer.)
Comment: (Cody Gray) What details you miss to provide you with it ?
Answer: If you are using winforms, possible solutions:

Put a groupbox on form, customize it, copy the generated code (from ..designer.cs file) and put it to a method. When you event occurs you just call the method that will create new control.
Using reflection create a new object of the same type and any writable property will get their values copied, use this method:
private object CloneObject(object o)
{
    Type t = o.GetType();
    PropertyInfo[] properties = t.GetProperties();

Object p = t.InvokeMember("", System.Reflection.
    BindingFlags.CreateInstance, null, o, null);

foreach (PropertyInfo pi in properties)
{
    if (pi.CanWrite)
    {
        pi.SetValue(p, pi.GetValue(o, null), null);
    }
}
return p;

}

Use it like:
private void button1_Click(object sender, EventArgs e)
{
GroupBox g = (GroupBox)CloneObject(groupBox1);
}

Both methods are described here

Duplicate Group Box


Parameter objects placeholder?

Question: If a method has too many parameters, the suggestion is to convert them into a parameter object. Where to place such parameter objects? in domain/entity classes package? or if I have a separate package for DTO's, should I place there?
Comment: I usually have'em in separated packages. DTOs may or may not be directly related to the domain model. It's closer to mid/upper layers than core.
Answer: In layman's terms:
I'd suggest you put it in the same package as the class whose method, having initially such a long signature, originated the need for such a paramter object.
Parameter classes are classes nonetheless are they belong to the package where the rest of related classes are located. It doesn't matter whether or not they have behavior whichm by the way, they could end up having down the road.
Answer: First thing I try to do is to somehow conceptualize the parameters into one or more cohesive classes. Let's say we have method like this:
<code>public void sendEmail(String firstName, String lastName, String email, String subject, Map<String, String> headers, String body)
</code>
I can see two cohesive groups of parameters. It makes sense to create kind of "concepts" from these - User and EmailMessage. These concepts (classes) seem quite reusable (they might even already exist!) so I put these into dto package.
Of course, this example is trivial, reality is more complex, but it is often possible to create meaningful and cohesive concepts after some thinking.
If you can't find reasonable concepts in the parameters, it might be sign of code smell. Method is trying to do too much etc.
But let's say the design is good but you still have a lot of parameters. These cases happen. You create parameter class, it's used only in one of your methods signatures. In that case I often put this class as inner static class near its usage in the method's signature (in class or interface) - e.g. directly above it.
Alternatively you can also put this into a dto package. In my opinion, these cases should be rather rare and it's kind of OK either way. You won't find single definite solution unfortunately.

Parameter objects placeholder?


What is the music played during the fight between Juuzou and the Owl in episode 11 of Tokyo Ghoul Root A?

Question: What is the name of the music played at 11:50 in Tokyo Ghoul Root A, episode 11 when Juuzou and the other Ghoul investigators are fighting the Owl? I like that pretty much.
Answer: What I've found out is it's called "Tokyo Ghoul - Yukata Yamada"


php site root fundamentals on local server and online servers

Question: so after spending a lot of time in figuring out site root i have decided to ask this question
my site has the following directory structure:
includes     //(contains db and other includes files)
public_html  //(this is the web -appication)

what i want is the path to this dir that contains these two folders and not the path inside these folders.
so inside the includes dir i have a file called initialize.php:
 defined('SITE_ROOT') ? null : define('SITE_ROOT',dirname(__FILE__));

this gives the following output on wamp:
  C:\wamp\www\Mysite\includes\

on the server i get:
/home/a4554444/includes

what i want is this:
  C:\wamp\www\MySite\

i want to remove the \includes folder which is being listed at the end so i can use the path to access the public_html folder and use it on other paths as well
how can i do that?
please also mention it this way the "correct" way of getting the site root. if not mention the correct way to do so.
Answer: Maybe you looking for something like:
define('serverpath', $_SERVER['DOCUMENT_ROOT']. '/');


Change Entity State

Question: I currently have an entity model with a bunch of deleted items, the state is deleted. Is there a way to "undelete" them? I know which Items I want to undelete, but I don't know how to undelete the items. Ideally I'd like to get it back to an unchanged state.
Answer: after you call
objectContext.DeleteObject(x),
you can simulate undelete of object x with
objectContext.Detach(x); objectContext.Attach(x)
Answer: Do you have the option of just not committing the connection context?  - dispose the ObjectContext without calling objectContext.SaveChanges();  Of course, if you have certain changes that you do wan't saved, they will not persist either.
If you called objectContext.DeleteObject(x) you can't undelete it and still save changes.
ObjectStateEntry objectStateEntry = objectContext.ObjectStateManager.GetObjectStateEntry(x);

// objectStateEntry.State is not setable

ObjectStateEntry does have the OriginalValues property so you could, in theory, painstakingly recreate a collection that represents the original changes, minus the unwanted ones, exit the objectContext, open a new one and rebuild those changes minus the unwanted ones there.  Probably not worth the hassle, but there is no documented way to unmark something for deletion at this time.
Comment: That's too bad. I had a feeling there is no way. Unfortunately we can't just clear out the context, so that's not really an option. Right now I have implemented a list of objects that are to be modified before being removed. It's actually a really big hassle and it's too bad that something can't be marked as unchanged.
Comment: Entity Framework Design blog http://blogs.msdn.com/efdesign/ says:

"...self-tracking entities architecture that will ship along side of VisualStudio 2010 and .NET Framework 4.0."
"...
There are conveience methods on each self-tracking entity to change this state if needed (Delete() and SetUnchanged())."

So it looks like this ability will be available in EF2
Answer: you can implement RejectChanges method for your Context, ObjectSet or EntityObject.
Now I write VB Code of these methods:
Extension method for RejectChanges in Context:
<Extension()>
Sub RejectChanges(ByVal Context As ObjectContext)
    Dim Collectin As IEnumerable(Of Object) = From e In Context.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Modified Or System.Data.EntityState.Deleted) Select e.Entity
    Context.Refresh(RefreshMode.StoreWins, Collectin)

    Dim AddedCollection As IEnumerable(Of Object) = From e In Context.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added) Select e.Entity
    For Each addedEntity As Object In AddedCollection
        Context.Detach(addedEntity)
    Next
End Sub

Extension mehod for implementing RejectChanges in ObjectSet:
<Extension()>
Sub RejectChanges(Of T As MyEntity)(ByVal Lst As ObjectSet(Of T))
    Dim collection As IEnumerable(Of T) = From o In Lst.AsEnumerable() Where o.EntityState = EntityState.Modified Or o.EntityState = EntityState.Deleted Select o
    Lst.Context.Refresh(RefreshMode.StoreWins, collection)

    Dim AddedCollection As IEnumerable(Of T) = (From e In Lst.Context.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added) Select e.Entity).ToList().OfType(Of T)()
    For Each entity As T In AddedCollection
        Lst.Context.Detach(entity)
    Next
End Sub

and finally implementing RejectChanges for EntityObject:
<Extension()>
Sub RejectChanges(ByVal entity As EntityObject, ByVal Context As ObjectContext)
    If entity.EntityState = EntityState.Modified OrElse entity.EntityState = EntityState.Deleted Then
        Context.Refresh(RefreshMode.StoreWins, entity)
    ElseIf entity.EntityState = EntityState.Added Then
        Context.Detach(entity)
    End If
End Sub

bye.
[Iman Shabanzade]

Change Entity State


What are the days when fast is haram or makruh?

Question: Can people clear me what are the days when fast is haram or makruh for men and women?
Answer: here I mentioned Haram&Makruh Day's Based On Ayatollah Sistani oponion{1}:
Makruh:

When you are not sure the day is Arafe (عرفه) or it is Qurban (قربان)

Haraam

Day Of Fetr (عید فطر)
Day Of Qurban (عید قربان)
When you are not sure the day is 1'st of Ramazan or 30's of Shaban, and you fast with intent of 1'st ramazan (This is Haram)
In Mustahab Fast, if your parents deny you. or if they dont deny but you know your fast is hard to them and put them in pain.

5.when you give a high probability that fasting have a serious bad infect on your body.
there are some other days which fasting in them is Haram. but they are rare and I did not find and mentioned them here.
Reference:
1.https://www.sistani.org/persian/book/50/72/
Answer: The fast is haram in eiddain(eid ul fitar& eid ul azha).The fast is also haram in case of manses for ladies.
Answer: On which days is fasting forbidden or makrooh?
Fasting on Eid al-Adha and Eid al-Fitr, the days of Tashreeq, is haram for one who is in Mina, as well as the day when a person doubts that it is the end of Sha'ban or the beginning of Ramadan, which is haram if he fasts with the first intention of Ramadan.
Just fasting on Sunday or Ashura without Tasua, Nowruz, fasting a woman without her husband's permission are all makrooh. Fasting is makrooh these days.
Ref;https://www.aftabir.com/articles/view/religion/ahkam/c7_1527754733p1.php/%D8%B1%D9%88%D8%B2%D9%87-%D8%AF%D8%B1-%DA%86%D9%87-%D8%B1%D9%88%D8%B2%D9%87%D8%A7%DB%8C%DB%8C-%D8%AD%D8%B1%D8%A7%D9%85-%D8%A7%D8%B3%D8%AA


Restore gmail account to Android

Question: I just got a new Motorola Droid Turbo 2, Android 5.1.1 I have 2 gmail accounts & 1 just disappeared (it was there as of yesterday), altho I can access it from any computer. I have tried to add the acct by doing the obvious: "Add Account" on my gmail page, and "Add an Acct" in Android settings w/no luck. Both seem to be treating it like I'm trying to establish a new acct not an existing one.
Answer: Storing this for future reference and to help others.
Summary

2 (multiple) gmail accounts
desktop computers fine
android mobile phone

1 gmail account accessible the other not
had removed google authenticator 4 months ago on previous mobile

new mobile 1 month ago

everything syncing and accessible till recent google account password change

Actions

tried cache apps deletes, reboot
tried google resync
then tried android mobile google account remove of non-accessable gmail account
successfully installed google authenticator on mobile by switching to working google acount via desktop computer
then tried disable 2 step authentication
then tried changing google account via lastpass (wanted one common password for both google accounts) which failed
changed google account password successfully via google account. Rebooted mobile. Waited 1/2 hour for servers synching.
Now able to logon to both accounts on mobile.

Notes

only using lastpass on desktop and not mobile device
google server synching most likely much quicker than 30 minutes
I have not tried individual google account passwords yet
I have turned google account 2 step verification back on
I have not setup google authenticator app yet

Restore gmail account to Android


Does deleting an original asset but keeping the transform folder asset make Craft replace the original file with the biggest transform?

Question: I have a client who has uploaded many giant images to the CMS (8mb+). I'd like to free up that space now that those image have been transformed to more web-friendly sizes. Is it safe for me to delete the original files stored on the server or does Craft require those to create new transforms?
Answer:
Does deleting an original asset but keeping the transform folder asset make Craft replace the original file with the biggest transform?

No - Craft will always use the originally uploaded asset as the "source of truth" for generating new transforms.
You can, however, replace the originally uploaded 8mb+ file with a smaller one, and it'll be used as the source of truth for generating new transforms.
Comment: The last time I tried anything like that, I automated it in Photoshop.
Comment: Thanks Brad! A bit outside the scope of this forum's focus but is there a batch image downsizer you could recommend?


Sub panel grounding conductor "splicing" with main panel grounding conductor at electrode

Question: I've looked through the sections in the Nec on grounding conductors how they can splice and placement and attachment of electrodes . I'm installing a meter socket disconnect combo making my main load center inside a sub panel. What is unclear to me is if I can run my sub panel grounding conductor to the same grounding electrode as my service disconnect is being attached effectively making a grounding " splice" ( I know it's not a splice) between the sub and main conductors instead of running my sub conductor into the main and right back out onto the grounding electrode. Would it be a problem if in a ground fault situation the energy is getting sent to ground potentially instead of back to neutral or would it bypass the electrode anyway to seek the neutral path.
Comment: What are you using for the feeder wiring between the meter-main and the sub-panel?
Comment: I suggest embellishing "grounding conductor" to be either "ground" or what its momma calls it when it's in trouble, **equipment grounding conductor**.  That way you avoid confusion with "groundED conductor" which is the lawyer name for neutral (WTH right?) .
Answer: The feed from the new main panel / meter to the inside sub panel is 4 wire from the main panel. Inside the sub the neutral is isolated from ground.  Are you thinking that the sub ground comes directly from the ground electrode? I think this would be a code violation for a new system as 4 wire feeders have been code since 99. Since the sub is in the same building a separate ground electrode is not required and if a grounding electrode conductor is added would create a parallel path.
Now if you want to sink a new grounding electrode at the panel and connect it to the sub that would be code compliant. But your feed from the main is required to be 4 wire and a parallel grounding conductor would violate code.
Comment: I was asking if you were to take the grounding wire from the sub to the main and connect your ground rod in the center of that wire would it still be considered a unbroken connection between the sub grounding and ground/neutral bus . I was trying to kill two birds with one stone but wasn't sure on the legitimacy of doing so for reasons such as the grounding wire from sub to main would have a grounding rod in the middle and if there was a preferred travel path weather it be to earth(through ground rod )or nuetral/ground bus
Comment: I understand but I know that would not meet code in my jurisdiction as this can set up a differential voltage from the neutral to ground. yours may allow it. A grounding electrode conductor can be spliced with irreversible compression splices that are listed see exhibit 250.27
Answer: No, the Equipment Grounding Conductor from the required 4 wire feeder to a 120/240v subpanel must be connected to the ground bus in the panel feeding it.
In all panels fed downstream from the service you will need remove any bonding jumper and separate Grounded Conductors (neutrals) and Equipment Grounding Conductors.
You need to re-connect all grounding electrodes (building steel, metal water piping, encased rebar, pipes, and rods) to the new service, connections need to "continuous" [per 250.64(C)].
The existing grounding electrode connections to the Grounded Conductor (neutral) must be disconnected in sub-panels, those connections could be could be completely removed, but I think you could leave them connected to the ground bus. I could be convinced otherwise, but to me I don't see any difference specified in the code between a panel mounted on building steel that is an electrode, or  connections to any other type of electrode.
Comment: Thanks that answered my question, I wasn't sure if the connection between the sub and main ground could be completed through the grounding electrode instead of sub to main then back to earth because the sub ground has to pass the grounding electrode on it's way to the main panel. Is there a reason for this or is it just because that would count as an unacceptable connection to the main grounding system even though they would be bonded together through the grounding electrode (just curious)
Comment: @Cc365 -- I'm still not clear as to what you're planning to use/using for a wiring method between the main panel and the subpanel...
Comment: 4/0 seu with #4 stranded bare on ground ran through 2" conduit to main outside of the house  . I'm not sure what my question conveyed to you but there was no bonding of the neutrals to ground in the sub panel I was merely inquiring if the ground rod could be installed on the ground conductor from sub to main so I wouldn't have to run a separate #4 from the main to the ground rod . The sub ground would still be directly connected to the main neutral bus by continuous unbroken ground cable and the main could still reach earth through the same continuous cable
Comment: @Cc365 -- wait...what *type* of conduit did you put in here? What you did seems wrong on several levels...


Animation only renders one frame

Question: I am trying to render an animation but it only renders one frame and stops right before its done rendering the second frame. It always stops with two tiles remaining. My frame range is 1 to 140 and 24fps. My step is also set to 1. Preview range is turned of and my file format is ffmpeg video  with mpeg-4 as the container.I am using my gpu to render and am using cycles. I have tried Reinstalling and repairing blender but that didn't fix it.Any help would be really appreciated.
Here is the render Properties.

Here is the output properties
Comment: can you add an image of the render properties and output properties
Comment: There you go pal
Answer: I figured it out. My samples were just too high. Putting it below fifty fixed it.

Animation only renders one frame


How to show logout link in drupal

Question: I have created a user account. Then signed out of admin and logged in with the new user account. But the new account does not have a logout link, So how can i show it to the other users ?
Answer: Create a link to user/logout. It can be a menu item or an HTML link in a block.
Answer: The logout link is included in the user menu that is standard to drupal.
Make sure the equivalent user menu block is active in an appropriate region and you will have your logout link
Answer: Step by step instructions:
In the view that you want to add 'logout' link

Add new field
Select 'Global: Custom Text'
Uncheck 'Create a label'
In textarea put: 'Logout'
Click 'Rewrite Results'
Check 'Output this field as a link'
Link path: 'user/logout'
Save

That's it.
Answer: For this you have to follow the following Steps:
--Login with Admin
--Go to the option of People
--Now you have to click on "permissions" option
--Here a list of various permissions is open
--Now search "Toolbar" where you have to tick on the option of "Use the administration toolbar" for authenticated user
--Just save it and it done.

How to show logout link in drupal


Rewrapping PPPoE to PPTP

Question: It is my understanding that PPPoE is just PPP wrapped in Ethernet packets.  PPTP is PPP tunneled over GRE/IP.  So, my question is, is it possible to take incoming PPPoE packets and easily rewrap the PPP inside as PPTP?  What I want is for a PPPoE-aware device (such as most home routers) to be able to speak PPTP transparently through another device which "translates".
Answer: I've not seen conversion done between PPPoE and PPTP, but things along that line are doable -- I've seen a setup where we had an L2TP tunnel to another ISP, where they proxied the PPP(oATM, I think?) from their customers over the L2TP tunnel, which terminated the PPP session on our RAS.

Rewrapping PPPoE to PPTP


Ionic + Capacitor 3 + Android shows distorted splash image briefly

Question: If you are using the @capacitor/splash-screen API to show a splash screen in your Ionic Android app with Capacitor 3 you might run into this issue:
Problem
For a fraction of a second the splash image will be shown distorted until it is shown in the correct aspect ratio. That means that it also "jumps" a bit on the screen This will especially be noticeable if you launch the app while the device is in landscape orientation or if you your device has stretched or fat display aspect ratio.
Background Info
It happens because AppTheme.NoActionBarLaunch that is used on app launch for MainActivity is set up to have the splash image as the background image, but the "real" splash image is initialized a couple of milliseconds later in the SplasScreen.buildViews() method of the plugin.
Solution
To fix it, you can change the following in your styles.xml file under /android/app/src/main/values:
Old:

New (no background):

Or set the background color of your splash screen:

This will prevent the showing of the splash image as a background image before the actual ImageView is added to the view hierarchy. The ImageView will have the correct scaleType as defined in androidScaleType of the plugin configuration.
Tested with the following versions:

@capacitor/android: 3.0.0-rc.0
@capacitor/splash-screen: 0.3.6
@ionic/angular: 5.6.3

The following configuration is used:
const config: CapacitorConfig = {
    // ...
    plugins: {
        SplashScreen: {
            launchShowDuration: 3000,
            launchAutoHide: false,
            backgroundColor: '#ffffffff',
            androidSplashResourceName: 'splash',
            androidScaleType: 'CENTER_CROP',
            showSpinner: false,
            splashFullScreen: false,
            splashImmersive: false,
        },
    },
    // ...
};

Note: No need to call SplashScreen.show() in the TypeScript (Ionic) code, it will automatically be shown. Just call SplashScreen.hide() in your TypeScript code once you want to hide the SplashScreen.
Comment: While this works, the app shows a blank screen first, then the splashscreen. Better than a distorted image for sure but I am puzzled I never had this issue with Cordova.
Comment: You are right, this is not ideal.
Answer: The above workaround does not work with the community barcode scanner which require transparent background.
My workaround (the drawback with blank white screen still exist there but it work):


How long would it take an iron key to rust away

Question: I'm writing a fantasy story where an iron key was thrown down a deep well. The key needs to rust away completely in order to reform in another place. So how long would it take for an 8 cm ornate wrought iron key to rust away completely in the bottom of a well that still has water? Edit: This is taking into account that the magic in the key would want to make it rust about four times faster in order to appear in a different place sooner. The cross section of the key is 44 mm.
Comment: As log or as quick as your story needs. Adjusting the water, the salinity, the ph, the manufacture and composition of the key itself, feasibly make for any time period required.
Comment: How thick is the iron? How well crafted the key? What quality is the iron? How much surface area does the key have? Basically, you're asking a straight up chemistry question which really isn't a good fit for this forum. I'm voting to close on the basis that this is not a worldbuilding question.
Comment: Length doesn't matter too much, cross sectional area does. that is how thick is it?
Comment: You didn't offend anyone, least of all me! I understand that you need to know the answer, but please also understand how SE works! Wait! Stop the presses! Dude. Adding magic to the mix is something you should be telling us in your question, not in a comment! If your world has magic that would affect the rate of rusting, ***that*** becomes a question of worldbuilding! I shall happily retract my close vote if you edit your question accordingly.
Comment: @elemtilas I'm sorry if I offended you. The question was asked here because it was essential for me to know the timeframe of the dissolution of an iron key in water in order to create a significant part of the story timeline on which I am working. I was just asking for an approximate measurement, because then magic would be added to the mix
Answer: The answer very much depends on the chemistry of your well and key. The nature of the water in the well is also important. A high oxygen content would accelerate the corrosion process as could many other mineral impurities that might be found in small quantities in drinking water.
Another factor is the way the key was made. If the intention was to make the key susceptible to corrosion by introducing flaw, laminations or micropores of some sort then disintegration could be rapid.
I suggest the key could be gone in a few years to a few decades
Comment: Don't forget the pH of the water.
Comment: Looking around some, it seems that 1-2 mm per year is certainly possible. If the water is soft or Ph less than 4 (acidic) the corrosion rates are higher. A lot has to to do with how the corrosion starts and how much, oxygen is present. Even  microbes can help cause corrosion. Of the flip side in some conditions a protective film can build up that limits the corrosion.
Answer: The key is eaten by an eel.

https://paperspast.natlib.govt.nz/periodicals/NZT19070411.2.45
Your well has a resident eel.  Eels can live in wells, sometimes for decades.  Or longer.
https://www.smithsonianmag.com/smart-news/rip-worlds-oldest-eel-180952306/

In 1962, Tomas Kjellman's family bought a cottage in southern Sweden,
knowing very well that the property was still occupied by another
long-term resident. A eel nearly a century old lived in the property's
well, The Local reports. Young Tomas and his family took to their
slippery new friend, dubbing him Åle ("eel" in Swedish) and often
introducing him to family friends that visited.

The key would last a very long time in the pure water at the bottom of a well.  But not so long in the belly of an eel.  Plus an ancient eel trapped in a well seems more fitting for a fantasy, because it is fantastic.
Answer: I have seen of half inch iron (bolts, rebar) lasting decades on coastal beaches. That is iron exposed to wave action, and tides. Some parts were rusted away others not, very non uniform. But still, more then a decade to several decades in what most would consider ideal place to rust away iron.
Many factors to consider:

Has the key been rust protected in some form(ie beeswax near last quench)
What is the cross sectional area, the larger this is the longer it will take to rust.
Depends on how it was made, source materials. The iron pillar of Delhi is over 1500 years old.
What pH is the well, unless dug in the 'wrong' spot will have pH close to 7 so won't have big affect. If in very hard water the iron itself can start to dissolve.
What is ambient temperature, warmer implies faster reactions
Moving water or still? Moving water would help move rust and expose it to more oxygen then still water.
Is the key full submerged or fully in air? a fully submerge piece of iron will last longer then one fully exposed to air. both will last longer then one that is periodically submerged.
How rusted must if be to be rusted away? Chunks of hard rust could easy outlast any still metallic iron.

If the water in the well is somewhat soft/alkaline and the key always submerged, still water. I would expect the Key to last many decades to centuries.
If the key is in very hard water well(eg rotten egg smell of H2S). Alternatively above and below water over course of the year. water flowing to some degree. Then perhaps less then a decade or two.


Remove electrical-engineering tag from all questions

Question: Questions with the electrical-engineering tag presently (9/2011) don't benefit by the tag; it doesn't tell me anything new. I expect we will wish to blacklist it, but think we should try this first. Related disucssion on disallowing such general tags here.
Answer: OK, this is done -- note that you can use the <code>[tag:tagname]</code> syntax as documented in https://electronics.stackexchange.com/editing-help#tags


How do you derive Lagrange's equation of motion from a Routhian?

Question:
Given a Routhian $R(r,\dot{r},\phi,p_{\phi})$, how do you derive Lagrange's equation for $r$? Do you just solve the following for $r$?
$$\frac{d}{dt}\frac{∂R}{∂\dot{r}}-\frac{∂R}{∂r}=0.$$
And as a related question, what is the motivation for using a Routhian?
Answer: No. The coordinate $r$ stil follows the Euler-Lagrange equation, but $\phi$ and $p_\phi$ follow the Hamilton equations. But these are trivial, which is the whole point of the Routhian. The motivation is that the Routhian isn't really $R(r, \dot r, \phi, p_\phi)$ but just $R(r, \dot r)$ with a constant parameter $p_\phi$. $\phi$ isn't a coordinate because by definition, it was a cyclic coordinate in the Lagrangian and so it doesn't appear in the Routhian either. The momentum $p_\phi$, meanwhile, is conserved so it's really just some constant. With both of these conditions, we can simply take them both out, call $p_\phi$ a constant, and we wind up with a problem with 1 fewer effective dimensions. The same would be true using the complete Hamiltonian, but sometimes Lagrangians are easier to work with for the "hard" part of the problem (the non-cyclic coordinates), and the Routhian lets you stay "Lagrangian" for the hard part.
Here is a concrete example. Take the Lagrangian describing a harmonic potential in polar coordinates:
$$
\mathcal L = \frac{1}{2} m \left( \dot r^2 + r^2 \dot \phi^2 \right) - \frac{1}{2} k r^2
$$
Since $\phi$ does not appear in the Lagrangian, it is a cyclic coordinate. From the Euler-Lagrange equation
$$
\frac{d}{dt} \frac{\partial \mathcal L}{\partial \dot \phi} = \frac{\partial \mathcal L}{\partial \phi} = 0
$$
it follows that
$$
p_{\varphi} =\frac{\partial \mathcal L}{\partial \dot \phi} = m r^2 \, \dot \phi
$$
is a conserved quantity. It would be nice to take $\dot\phi$ out of the set of coordinates and just replace it with the constant $p_\phi$. Then we'd essentially have a Lagrangian whose only coordinates are $r$ and $\dot r$, just with a constant parameter $p_\phi$. The way to do this correctly is to make the Routhian
$$
\mathcal R = \mathcal L - p_\phi \dot \phi = \frac{1}{2} m \dot r^2   - \frac{1}{2} k r^2- \frac{p_\phi^2}{2 mr^2}
$$
(Aside: Try solving $\dot \phi$ in terms of $p_\phi$ and substitute into the Lagrangian. You'll get something very different that will lead to very wrong results. If you want to remove the cyclic coordinate, you must do a Legendre transform w.r.t. that coordinate.).
Since the Legendre transform has been done w.r.t. $\theta$ and $\phi$, these coordinates follow Hamilton's equations (with an appropriate change of sign). But these is trivial:
$$
\dot \phi = - \frac{\partial \mathcal R}{\partial p_\phi} = \frac{p_\phi}{mr^2}, \quad \dot p_\phi = \frac{\partial \mathcal R}{\partial \phi} = 0
$$
What we've achieved here is essentially separation of variables. $\phi$ has its own equation of motion, which involves $r$, but the equation of motion of $r$ is independent of $\phi$. We can solve the equation of motion of $r$, which is an effectively one-dimensional problem, and then go back to find out how $\phi$ evolves.
The effective one-dimensional problem has an effective potential
$$
V(r) = \frac{1}{2} k r^2 + \frac{p_\phi^2}{2mr^2}
$$
This extra term, which blows up at small $r$, is called the centrifugal barrier, and accounts for the fact that angular momentum conservation makes it harder / impossible for the particle in question to reach the origin. The coordinates $r$ and $\dot r$ didn't have a Legendre transform applied, so they still follow the Euler-Lagrange equation
$$
\frac{d}{dt} \frac{\partial \mathcal R}{\partial \dot r} = \frac{\partial \mathcal R}{\partial r} \Rightarrow m \ddot r = -kr + \frac{p_\phi^2}{3mr^3}
$$
A follow up question might be "Yes, its convenient to not stay with a full Lagrangian, but why not just go full Hamiltonian?" The answer here probably depends on the context of the specific problem. With the Routhian, we have a 2nd order differential equation to solve, and then an integral to find the e.o.m. of $\phi$. With a full Hamiltonian, we'd have a system of two 1st order differential equations, followed by the same integral. One might be easier to solve, or better computationally, etc.
Answer:
Setting. Imagine that the configuration space consists of, say, both small & capital generalized positions $q^j$ and $Q^J$, with corresponding velocities $v^j$ and $V^J$, and momenta $p_j$ and $P_J$, respectively.

Routhian. The Routhian
$$\begin{align}R(q,Q,v,P,t)
~=~&V^JP_J-L(q,Q,v,V,t)\cr
~=~& H(q,Q,p,P,t)-v^jp_j \end{align} \tag{R}$$
is a hybrid between [and a partial velocity-momentum Legendre transformation away from] the Lagrangian
$$L(q,Q,v,V,t)\tag{L}$$
and the Hamiltonian
$$H(q,Q,p,P,t),\tag{H}$$
such that the small velocity variables $v^j$ and the capital momentum variables $P_J$ are kept.

Action principle. The Routhian equations are the Euler-Lagrange (EL) equations for the Routhian action
$$S_R[q,Q,v,P]~=~\int \! dt~L_R(q,Q,\dot{q},\dot{Q},P,t), \tag{SR}$$
with Routhian Lagrangian
$$ L_R (q,Q,\dot{q},\dot{Q},P,t)
~:=~\dot{Q}^JP_J-R(q,Q,\dot{q},P,t) ,\tag{LR}$$
which leads to Lagrange equations for the small variables and Hamilton's equations for the capital variables.

The motivation is to harvest the usual benefits from both the Lagrangian and Hamiltonian sides. Examples:

If the capital position variables $Q^J$ are cyclic variables [which means that $L$, $R$ and $H$ do not depend on $Q^J$], then the capital momentum variables $P_J$ are constants of motion. We can therefore demote the dynamical variables $(Q^J,P_K)$ to external parameters of the model. An action principle for the remaining dynamical variables (i.e. the small variables) is then given by the time integral of (minus) the Routhian
$$-\int \! dt~R(q,\dot{q},t). $$
For a simple application, see e.g. this Phys.SE post.

If the Lagrangian $L$ depends affinely on $v^j$ and non-affinely on $V^J$, the Faddeev-Jackiw method to first-order formulations yields the Routhian action $S_R$.
Comment: Notes for later: In case of cyclic variables $Q_J$, we might want to impose BC $P_f=P_i={\rm const}$, and therefore change the Lagrangian $L\to L-\frac{d(P_J Q^J)}{dt}$, and action $S\to S-P_J (Q_f^J-Q_i^J)$. Similarly for the Hamiltonian Lagrangian $L_H\to L_H-\frac{d(P_J Q^J)}{dt}=-\dot{P}_J Q^J-H$, and Hamiltonian action $S_H\to S_H-P_J (Q_f^J-Q_i^J)=\int (p_j\mathrm{d}q^j-Q^J\mathrm{d}P_J-H\mathrm{d}t)$.


Can elephants trumpet when they have water in their trunks?

Question: I am writing a fun story about elephants and want to know if elephants can trumpet or at least, make noises when they have water in their trunks, like when they are drinking water. Thanks for your help!
Answer: I think no. Because the elephant uses its trunk to make noise and if the trunk is filled with water then there is no chance the voice would come out.


Make sure all users in network use my DNS server

Question: I'm running a router with DNS server and I would like to make sure that everybody in my network is actually using my DNS. What are the necessary iptables (?) to redirect all DNS-related traffic to my local DNS server?
Comment: So you are setting up a DNS server with recursion enabled ? Before going any further, read this urgently : http://serverfault.com/questions/634793/how-do-i-set-up-a-secure-open-resolver/634794
Comment: This is somewhat of a lost cause. If your users don't want to use your DNS, there are plenty of ways they can tunnel around you.
Answer: You probably mean a kind of transparent forwarding, something which iptables calls Destination NAT:
ethL=eth0     # internal network NIC
dnsip=126.96.36.199 # IP of your DNS
iptables -t nat -A PREROUTING -p udp --dport 53 -i $ethL -j DNAT --to $dnsip

However, there are potential problems with this approach to consider:

this is a variant of NAT with all the associated costs (pass-through performance, kernel memory &c);
this will only work for packets which cross the router - clients who speak to a DNS server on their local IP network will continue to.
Comment: This is the answer that addresses the actual question: using iptables to force outbound queries onto the local network's DNS server.
Answer: You'll want to block any outbound DNS traffic from your users except to your local DNS server, so something like this can get you started:
local_network=X.X.X.X/24 # IP address/subnet-mask of local network
dns_server=Y.Y.Y.Y # IP address of DNS server

iptables -A INPUT -s $local_network -d $dns_server -p udp --dport 53 -j ACCEPT
iptables -A INPUT -s $local_network ! -d $dns_server -p udp --dport 53 -j DROP
iptables -A OUTPUT -s $dns_server -d $local_network -p udp --sport 53 -j ACCEPT

If your DNS server is a caching/recursive DNS server, then you'll need to allow it to do external lookups as well:
iptables -A INPUT -d $dns_server -p udp --sport 53 -j ACCEPT
iptables -A OUTPUT -s $dns_server -p udp --dport 53 -j ACCEPT

Answer: You need to allow only DNS traffic from you DNS server and deny all other requests
# Allow DNS from your ip
iptables -A INPUT -p udp --dport 53 -s <source IP> -j ACCEPT
iptables -A INPUT -p tcp --dport 53 -s <source IP> -j ACCEPT

# Deny all other requests
iptables -A INPUT -p udp --dport 53 -j DROP
iptables -A INPUT -p tcp --dport 53 -j DROP

Check the Answer here
 Block all incoming DNS requests EXCEPT from IPs x,y,


What can and should be done about cross-posting?

Question: I've seen a couple of posts where people cross-posted their questions to another stack exchange, in both cases  stats.stackexchange.com . What should we do? Close them if they are verbatim or near-verbatim posts and tolerate them if they are customized enough to be distinct but related questions?
Answer: Related: Is cross-posting a question on multiple Stack Exchange sites permitted if the question is on-topic for each site?

The consensus there seems to be this cross-posting should be discouraged, and that the better approach is to ask on one site, but have the question migrated if it turns out to be a better fit for another. We should probably add this to our FAQ.
As for what we should do ex post when someone cross-posts: my suggestion would be to add a comment explaining that this behaviour is not encouraged (we could write a template for this here: List of comment templates). We could then monitor the situation and close the question here if the cross-posted version seems to be getting more/better answers.


Does an Ana boosted Mech deal more damage during self-destruct?

Question: What happens if Ana boosted D.va just before she uses her ultimate? Can the boosted mech destroy shields and kill tanks?
Comment: Wow, following the "This question already has an answer link" leads to a  horrendous circular loop of questions which are marked as duplicates, or they aren't, but they're downvoted. Can the mods clean this mess up so that at least duplicate questions are redirected to a question which is a good question?
Answer: D.Va's ultimate does 1000 damage to any targets within the 20m radius. The downside to having such a high damage AoE ability is that other players can block the damage by placing themselves behind a barrier of some kind. Typically this is something like a wall or a car, but Reinhardt/Orisa/Winston shields also work (and take no damage from the explosion), as does Mei's Ice Wall.
Ana's ult gives the affected player 50% damage amplification. If you use it on the D.Va mech and the D.Va ults afterward, the mech retains the damage boost and yes, it will do a total of 1500 damage. However, it does not gain any other properties - it is still blocked by map obstacles and player-made barriers. The only advantage of nanoboosting a D.Va mech is if the enemy has a Roadhog - when he uses his Take A Breather (E), he gains 50% damage reduction for the duration, meaning that if he's at full health he can theoretically tank through a regular mech explosion, but a nanoboosted explosion will kill him regardless. However, this is an extremely niche use, and I would not recommend using the nano-mech explosion in most cases. It's just a waste of an Ana ult.
Comment: You missed Brigitte in the shields list... granted, her shield's small size means you effectively have to line up behind her
Comment: It's worth noting that an allied Mei using Ice Block can also be hidden behind.  Granted, I'd hope Mei would just use her Ice Wall instead.
Comment: There's a couple others I missed, such as Zarya shields (even standing behind someone who has a shield on will work) or Symettra's photon shield. I decided not to list them all, since I'm sure there's others I missed, plus I don't want to update every time a new champ releases :)


Fireball alternative for a demon heavy campaign?

Question: What are some good AOE spells (5th level or lower) for a wizard to get rid of hordes of weak to medium demons?
Comment: Btw, Avernus is in hell. So you'll likely face a lot of devils, not demons. This will make Elemental Adept a lot less useful, as most devils are outright immune to fire damage.
Comment: @ThomasMarkov So far I've only found Sickening Radiance and Vitriolic Sphere, but I'd like to see the suggestions others come up with so I'd be grateful if the post was kept up.
Comment: Does this even need the Baldur's Gate tag? The question isn't specific to Baldur's Gate, and could easily apply to a variety of campaigns.

@GroodytheHobgoblin rot13 for spoilers:  gur jne orgjrra qrzbaf naq qrivyf vf n sbphf bs gur pnzcnvta (ng yrnfg ubj zl TZ ena vg), fb lbh trg n ybg bs qrzbaf nf jryy
Answer: A feat may solve the resistance problem: Elemental Adept
While you won't be able to deal with immune-to-fire enemies, any resistant enemies will no longer be resistant to fire.

Prerequisite: The ability to cast at least one spell
When you gain this feat, choose one of the following damage types: acid, cold, fire, lightning, or thunder. Spells you cast ignore resistance to damage of the chosen type.  In addition, when you roll damage for a spell you cast that deals damage of that type, you can treat any 1 on a damage die as a 2.  You can select this feat multiple times.  Each time you do so, you must choose a different damage type. (PHB, Ch 6). {bolding mine}

Beyond that, Shatter (2nd level) and Cone of Cold (5th level) use Thunder and Cold damage respectively, while Sickening Radiance (4th) applies radiant damage, and Ice Storm (4th lvl) does a mix of damage that isn't fire.

A creature takes 2d8 bludgeoning damage and 4d6 cold damage on a
failed save, or half as much damage on a successful one.  Hailstones
turn the storm's area of effect into difficult terrain until the end
of your next turn.

Since you didn't specify what level your characters are, I offered a range of spell levels there as examples.  There are others that get around the fire resistance problem.  Consult your local spell list, and you may find spells like synaptic static (4th) (psychic damage) or dawn (5th) (radiant damage) useful.
May I suggest Sorcerer as your PC class?
(This is for other readers, as the OP noted in a comment that they are a Bladesinger Wizard).
A simple one that gets you what you need at level 1 is a (Variant) Human Sorcerer. Choose Shadow Magic for both long range vision in the dark and a chance to get up when knocked to 0 HP, as well as the Elemental Adept (Fire) feat, and then select spells from a variety of elemental choices. You'll want to take a good hard look at the spell list before you choose since there is a spell limitation for Sorcerers that Wizards do not have.
Order of the Scribes
If your table uses Tasha's Cauldron of Everything material, then this second level feature may provide more ability to change damage type:

When you cast a wizard spell with a spell slot, you can temporarily
replace its damage type with a type that appears in another spell in
your spellbook, which magically alters the spell's formula for this
casting only. The latter spell must be of the same level as the spell
slot you expend.

This will depend on what spells you have in your spell book, and for the OP (who is playing a Bladesinger wizard) is a choice that would have to have been made at level 2 when the school/arcane origin was chosen.   (Unless the optional rule for retraining a sub class is used from Tasha's(thanks @nick012000)).
Comment: I'm not sure this answer is actually good. Elemental Adept only works against *resistance*, not *immunity*. If you're up against demons, cool.  If it's any other fiends, you stand a good chance of being useless again. Blasting magic at fiends tends to be a crapshoot. And suggesting cold spells is bad advice, demons resist those just as well as fire.
Comment: Technically, there are rules for retraining your subclass to a different subclass in Tasha's Cauldron of Everything. It's not too late for a Spellsinger Wizard to retrain as an Order of Scribes Wizard.
Comment: most demons are resistant to fire, cold and lightning, I'm playing a bladesinger, we're currntly at level 12.
Comment: Then you may want to take the feat twice: it's the only feat that you can take twice.
Comment: It's potentially worth including the Order of the Scribes Wizard as an option for other readers as it has a feature (gained at second level) explicitly able to replace the damage type of wizard spells to another type (subject to certain conditions)
Comment: @Muhammadhiari Next time you ask a question, please include  more detail; level and class is kind of important, as a detail, when asking questions for how to "get a best result" in a given situation.
Comment: @illustro OK, not a bad idea to add that, thanks.
Comment: @DarthPseudonym I mentioned that in the opening paragraph.  Your complaint that spells versus fiends is a chump's game is irrelevant to the question as asked, but you might make a Great Frame Challenge out of that as an answer.   With legendary saves and such, a variety of spells end up not working as you scale the CR ladder IME, which leaves some kind of enchanted blade on your martial ally as you attempt various de-buffs as a more reliable damage dealer.
Answer: Steel Wind Strike (XGtE)
The problem with most AoE spells is that even if you can lay down a damage type to which the demon is not resistant, a lot of your targets are going to have Magic Resistance, meaning they get advantage on their saves and will end up taking half damage anyway.  Rather than a spell which gives them a save, a spell that lets you make attack rolls is preferable against anything with magic resistance.
Steel Wind Strike is not technically an AoE spell since it doesn't affect a literal area, but by targeting up to 5 creatures within 30 feet it is effectively the same thing, and you don't have to have sculpt spells to protect your teammates from friendly fire; you can use it safely if one of your allies is getting pinned down or as a follow-up to finish off things damaged earlier in melee.  It yields force damage which means the damage itself will likely not be resisted, and will do an average of 33 points per target (more if you include up to five chances to crit).  After your attack, it can provide you with up to 35 feet of movement (provided it lands you next to one of your targets) which might be useful to set yourself up for bladesinger melee on the next round or if you used your movement before casting to get yourself in position.
It is expensive at 5th level, but has enough advantages that you might effectively employ it against large numbers of lesser demons.  At 12th level, you don't have Song of Victory yet, but unfortunately it will not interact with that when you do get it, since these are spell, not melee, attacks.
Comment: +1 for mentioning SWS, a great spell. I use it for exactly the sitch you're describing, and the ability to name the targets and to use a melee spell attack are nice. Yeah, you're blowing at 5th level slot, but play it right and every one of those 30 d10s are going to do some good.  Also, you don't **have** to teleport afterward, although up to DM interpretation.  The spell says "You **can** then teleport" (emphasis added), not "you teleport" or "you MUST teleport".
Comment: @Jack Thanks, I have never actually used or had the spell used in a game, so it is reassuring that it works as I surmised, except for the teleport part which I will edit.
Answer: Sorry to hear about your demon problems. Once they start bothering you they can be really hard to get rid of. And of course, that pesky cold, fire, and lightning resistance can make the old stand-bys of cone of cold, fireball, and lightning bolt really feel less than effective.
Some good alternatives, all, unfortunately, situational. There's no magic bullet, as it were.
Summon Draconic Spirit (5th)
You get at 2 rend attacks and a breath weapon every turn, if you can possibly upcast to 6th you get a 3rd rend attack.
Rend attack is your spell attack modifier to hit, so your mileage may vary depending on how good your SAM is.
Breath weapon is 30 foot cone, you get to choose the damage type.
The rends and the breath weapon aren't a LOT of damage, but if you can keep your concentration up, you get additional damage on subsequent rounds for free.
Steel Wind Strike (5th)
Hit up to 5 creatures with a melee spell attack, bypassing pesky saves, each hit takes 6d10 force. Resist that, fiend-spawn.
Black Tentacles (4th)
Situationally useful if you can pin (or pen) them, and maybe they'll take 3d6 bludgeoning for as long as you can concentrate.
Charm Monster (4th)
Pick the right monster, especially if you can somehow disadvantage them on the save, and with some luck they'll fight for you, act on your behalf, or at least not attack.
Tidal Wave (3rd)
A bit iffy, but in the right circumstance, 30x10 area they all make dex saves, and if they fail, they take bludgeoning, and they're prone, and they take half if they save.
Fear (3rd)
I know you want damage spells, but don't completely dismiss control spells.
30 foot cone, Wis save; on a failure drop what they're holding and become frightened.  With some luck you can get some of them to disarm themselves and take themselves out of the battle, so you can deal with them later.
Web (2nd)
If you can restrain some of them for a round or two that might help with divide and conquer.
Comment: I would also add [Erupting Earth](https://www.dndbeyond.com/spells/erupting-earth) as a good AOE. 3d12 bludgeoning damage (more with upcasting). Most fiends are only resistant to bludgeoning damage from a non-magical source. This is magical, so it will get through. It also creates difficult terrain so they'll have a harder time getting to the party. I also like it's younger brother [Earth Tremor](https://www.dndbeyond.com/spells/earth-tremor) as it causes the prone condition.
Comment: _Black tentacles_ (and _web_, the non-damaging version) is interesting in that the initial roll is a _save_, so magic resistance applies, but if they fail then subsequent rolls are _checks_, so magic resistance doesn't apply.  My druid saves _tidal wave_ for flying demons, so that when they are knocked prone they also take falling damage.
Comment: I have never used either!  So many spells, so little time....
Comment: Charm Monster isn't Dominate Monster. This may vary depending on your DM, but at my table, I can't see any scenario where casting Charm Monster on a hostile monster would result in them fighting for you. At best I would have them stop fighting entirely, though at the RAWest they would only stop targetting you specifically.
Comment: @DunBaloo Sure, it's going to be very situational.  But it says "The charmed creature is friendly to you". From there, attacking your enemies should be possible, or at least act on your behalf.  I'll modify the language a bit.
Answer: There are a number of options, if you are looking just for spells and not other approaches like spending a feat on it, or having to pick a specific subclass of Wizard (if you are an Scribes wizard as suggested, switching out damage types is the cleanest solution).
The issue you have is that most demons have resistance to multiple damage types, normally cold, fire, lightning. Which excludes many of the other area effect damage spells.
The second issue is that you are going to Avernus, a layer of hell, so you'll face devils too. Most devils are immune to fire and poison, and resistant to cold. Elemental Adept will do you no good against them.
Third, most demons or devils have magic resistance graning advantage on their saves, which in many cases halves the damage. This makes area damage spells with saves less powerful against them, even if they are not immune or resistant.
In the PHB, useful options are

Magic Missile, spell level one, force damage. Not technically area damage, but can hit multiple demons, and does not suffer from resistance or magic resistance, it just hits. It can be upcast, likely not enough to take down a demon, though. Can often be picked up from NPC mages.

Shatter - spell level two, thunder damage. It does not scale that well to the amount of hit points most demons with energy resistances have, and it only has a small area of effect. The upside is that you may have this already, because early on, this is surprisingly effective as an ersatz-fireball against goblins, wolves and the like. Also nice against structures.

Lightning Bolt, level three, lightning damage. The other original area damage spell in the game unfortunately has a line area of effect that's a lot less attractive than fireball, but otherwise deals just as much damage. No better against Demons, but Devils are not resistant to it. As many NPC mages have this, you again might already have picked this up adventuring.

If you allow for Xanathar's guide to everything, or other splat books, there are a lot of other options, among them

Erupting Earth, spell level 3, "Earthcube", magical bludgeoning damage. Only deals about 70% of the expected damage of Fireball to a smaller area, so the upgrade over resistance is minor.

Vitriolic Sphere, spell level four, "Acidball", acid damage over two turns. Overall slightly higher damage than fireball, too, but waiting for half of it for a turn has the downside of the monsters possibly surviving the first turn and getting one more round of attacks and actions in.

Sickening Radiance, spell level four, radiant damage. Radiant is nice, but Constitution save-or-none means only half of basic Fireball expected damage, so nothing gained. Most opponents will be able to move out and disadvantage on skill checks and giving away invisibility is pretty situational.

Synaptic Static, spell level five, "Psyball", psychic damage. Largely resistance free and against a typically weak save, combines combat quenching abilities with the damage too, but will not hit insects, oozes, constructs. Should work fine vs Demons and Devils though.

Dawn, spell level five, radiant damage. One of the area spells with the highest damage output in the game, but also stretching it over time. The light is sunlight, for a nice pick-up benefit against various undead.

Steel Wind Strike, spell level 5, force damage. Technically not an an area spell, it effectively works like one against to up to five targets. Next to nothing resists force, and as a spell attack it circumvents magic resistance that many devils and demons have.

If I had to level pick one to learn, it would likely be Steel Wind Strike, second pick Synaptic Static.
Comment: I think Sickening Radiance is bad, as it is save or nothing against Con, a typically strong save, so the expected damage is going to be only about half of Fireball, the same you get from Fireball after resistance, so not worth blowing the cash on it. I can add it if you want
Comment: Maybe you want to mention that most tougher demons and devils also have magic resistance, so even their weaker saves will be at advantage.
Comment: Thanks for your answer, but isn't Sickening Radiance basically a better version of Dawn while using a lower level spell slot, honestly the only thing Dawn does better is that you can move it with a bonus action.
Comment: I would second _Synaptic Static_. The situational limitation on it is often a non-issue for a well prepared caster (because you _should_ have other options for when you can't use it), and even factoring in the limitations it's a pretty strong spell for it's level.
Comment: @Marq I wouldn't say "tougher". I think only the manes, lemures, and dretches *lack* Magic Resistance. Even the super-weak Imps and Quasits have it.
Answer: Using area spells on fiends is usually a losing game
I cannot emphasize enough that you are going to have a bad time even if you get a "correct" answer to this question.
Even if you find an element that the fiends you're dealing with are not resistant or immune to, or you decide to use disabling spells instead of direct damage, most of these guys still have the Magic Resistance trait to get advantage on their saves. That make them very difficult for wizards and sorcerers to deal with, as a general rule -- hope you like dealing half damage.
Only the very lowest class of fiends (the fractional-CR Manes, Lemures, and Dretches) lack this Magic Resistance. If you're above level 10, their resistances won't matter anyway -- you should be able to easily wipe out large groups of them even if you use a damage type they can resist.
What to do instead
You can use direct attack spells (the ones that use attack rolls instead of saves) that use the less "elemental" types (like force or necrotic damage) to decent effect, but that tends to be more in the way of taking out the big guy instead of laying down the fireball-style area damage you're used to. There's not much of a way around that, honestly. Fiends are just hard to do Crowd Control on.
Another strong choice can be what is sometimes referred to as "casting fighter at them", using your spell slots to buff the weapon-users in the group. Spells like magic weapon, haste, or stoneskin can be great ways to help your party out without directly dealing HP damage. The downside is this is only part of a strategy, because most of those buff spells are Concentration, so you're probably only accounting for one round of each fight and you'll need to figure out what to do next.
If switching classes is an option, a warlock focused on eldritch blast is a good spellcaster choice; since you're mostly dealing force damage with attack rolls, you can avoid most of the fiendish defenses while using your slots to throw down buffs on your allies.
Comment: This appears to be the frame challenge that I was hoping for (per the comments) so bravo for posting it. +1.


Is it still recommended to inline above the fold CSS with the adoption of http/2?

Question: For awhile now I've been following Google's recommendation here (https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery) to inline critical above the fold CSS for faster load times. I was wondering, is this still going to be necessary with the adoption of http2 getting higher and higher? My reasoning is the way I understand it http2 allows for parallel requests across one connection so the CSS could start downloading right away? Someone please correct me if my understanding of how http2 works is wrong is wrong...
Answer: You are correct about the need to no longer inline CSS with the adoption of HTTP/2. As a matter of fact, HTTP/2 best practices suggest the opposite of inlining. The question that lingers for you and any reader of this post is, when is the right time to make this switch?
A change from inlining to no longer inlining (and the same would be true for image sprites) should really only be made after carefully assessing your users' browser/client capabilities to accept HTTP/2. Using analytics to inform your decision takes the guesswork out if this.
Over time I would not be surprised to see modifications to apache, mod_pagespeed, nginx, vanish and others to auto inline only for HTTP/1 clients/browsers. So, stay tuned to the version updates for major web servers to help automate this change.
For more information on HTTP/2, l highly recommend the changelog.com podcast about HTTP/2 with Ilya Grigorieva, the primary architect behind Google's http/2 efforts: listen to the interview here
Answer: The idea behind inlining for above-the-fold is still a good one because requests for CSS still take the same amount of time and pages are still blocked while the CSS file is being downloaded. HTTP/2 does not speed up downloads. It allows concurrent downloading. This way, images and other files are not tied up waiting their place in line but, again, it takes just as much time to download and execute or install them as before HTTP/2.
Comment: Say you have a page with one css file and one image. The image is a larger file size than the css.

If they are concurrently downloaded, wouldn't it not matter whether the css was inlined or not because the download time will take as long as the longest resource anyways, in this case, the image?
Comment: @jetyet47 My point was that the OP thought HTTP/2 speeds up downloading. It does not. Note that CSS blocks first paint until it's downloaded and the CSS object model is created.


Is there a decent icon editor for OS X capable of editing .icns files?

Question: The software for editing icons needs to run on OSX Lion.
Comment: I strongly suggest people to look at [this answer](http://stackoverflow.com/a/13127142/1011366) (it gives information on how to access the images embedded inside an ICNS file) or [this one](http://stackoverflow.com/a/20703594/1011366) (which is a script that generates an ICNS from a single image)
Comment: I found a windows application claiming to do *.icns file, but it would be really humiliating to revert to Windows to edit Mac icon files because no software is available for mac that I could find.
Answer: In 10.5+, Apple's built-in Preview.app lets you do edit .icns files!
(Preview used to be pretty bare-bones back in 10.2 days, but with every OS release it has gotten more and more powerful.)
After opening the file, use the up/down arrow keys to switch between the different sized icon and bitmask images contained in the .icns file.
Then with each image you can:

Cut/Copy/Paste
Annotate (draw rectangles, add text, lines, arrows, ...)
Change transparency
Scale
Adjust color (saturation, tint, sharpness, etc)
Comment: I can't figure out how to Paste a single image over an icns file opened in Preview on 10.9.2. Paste is never enabled. Does that still work for you?
Comment: You can cut (clear) and paste. But before hitting cmd+X or cmd+V, you need to select an area with the rectangular selection tool, to act as a "target" of the clipboard operation. If you select an area alrger than the icon size, it will automatically clip to its bounds (e.g., 1024 x 1024).
Comment: This info was really helpful for visually distinguishing an app I use two versions of on the same machine. I created a desaturated icon for the legacy version.
Answer: EDIT: This answer is now out of date. Apple recommends using "Asset Libraries" instead of creating icns files.
Apple provides Icon Composer as part of their free developer tools.
This is the only officially sanctioned way to create icns files. Most other editors don't support all the possible features.
The idea is you create a png file for each size you want, then create an icns file in Icon Composer, and import your various png files into it.
Comment: Note: per Apple, Icon Composer doesn't handle @2x icons: "Note: Don't use Icon Composer—it can't create high-resolution icns files."
Comment: As of XCode 8.2, Icon Composer is no longer available in Additional Tools, as it cannot create high resolution icons.
Comment: That being the case, what does Apple recommend for such delicate work? what do THEY use for designing their icons?
Comment: @MottiShneor Icon Composer has been replaced with the xcassets system which is just a json file listing various png files and Xcode has a nice GUI to generate the json code. Any image editor that can create png files will work fine and individual employees at Apple would have their personal favourite, but Sketch has to be as close to "the" standard as you can get. In particular it has great tools for dealing with all the different pixel resolutions required for icons.
Answer: Is depends on the kind of editing you need to do. icns Editor is on the App Store. Maybe this one too?
Comment: Both of those are dead links now. Any idea where they can be found these days?
Answer: I would think that the program Opacity would be a good place to start for designing icon art as well as all manner of math and code drawing options.
It was designed from the ground up to do vector drawing and output many sizes of a master drawing as needed for icons to work well. Due to both limited resolutions for small icons as well as beefy artwork scaled up for resolution independence, the layers and tools work well.
The free trial should let you know if the tutorials and help on building icons is suitable for your skill level and needs.
Answer: Use web tools:
1. Create: http://www.xiconeditor.com/
2. Convert: http://iconverticons.com/online/


Why is Worf in Nemesis?

Question: Worf is one of my favorite Star Trek characters. A defining moment in his character arc is at the end of Star Trek: Deep Space Nine when the Federation appoints him ambassador to the Klingon Empire. However, in his appearance in Star Trek: Nemesis, he is not an ambassador, and is back serving aboard the Enterprise-E. In-universe, what is the reason behind this? Is he no longer an ambassador?
Comment: https://scifi.stackexchange.com/questions/116622/did-worf-resume-his-role-as-tactical-officer-in-star-trek-nemesis
Comment: The duplicate specifically addresses this point. He stopped being an ambassador and went back to his duties, at least in the EU
Answer: In A Time for War, A Time for Peace:

Worf decided after various events had occurred, that he was not of the right temperament to be the Federation ambassador and although the new Federation president disagreed, she accepted his resignation. Worf then nominated his son Alexander, to be his replacement as ambassador. Worf decided that after serving the Klingon Empire and the Federation and always doing what was expected of him that the time had come for him to be selfish and he wanted to go back to Starfleet, where he felt the most fulfilled. Admiral Ross immediately reinstated his rank of lt. commander and assigned him to be first officer on the Titan under Captain Riker. Worf was filling in at the tactical station during the events of Star Trek Nemesis as the Enterprise's chief of security, Christine Vale, had taken shore leave on Earth and the second in command of security had recently resigned.

I don't believe there was an explanation in the show as to why he changed the job. Oddly enough, in Star Trek Online, "Worf has remained ambassador to Qo'noS and remains one of the few pro-Federation voices in the Empire after the breakdown of the Khitomer Accords," which suggests events there operated differently.

Why is Worf in Nemesis?


Search Text Messages

Question: I would like to search my past text messages.  I often forget which person I was talking to about the different issues and global search is helpful.  Here is a picture of the equivalent functionality on the iPhone.
Answer: Not sure if you are looking for this functionality in the default message app. If not ChompSMS is an option. This app seems to provide this function.
Answer: This SMS Organizer app has advanced search capabitilies.
It can search for any keyword, in the message content and also in the sender's name.

While you can search for all the messages in the "All Conversations" view, you can also arrange messages into folders, which can make searching and locating sms-es a lot easier.
For example, you can create a folder for all messages from a particular contact, so later you have to search in only that folder.

Search Text Messages


Strange entry point for an old Mac OS X x86 32 bit binary

Question: I wanted to reverse engineer an old game for Mac OS X, but I can't figure out how the entry point jumps to other code. The binary is an x86 Macho-O executable and, according to Detect it Easy, it was compiled with the Mac OS SDK 10.5.8. I included screenshots of the relevant disassembly from Ghidra.
The entry point seems to be looping, however the the instruction at 0xa747 does an unaligned jump back up to the previous instructions which I find weird in a user space binary like this. Seeing an ARPL is also weird in this context. And what is really weird is that there are no JMPs or CALLs outside of this initial block. I would expect some dynamic linker shenanigans, however the entry point is contained in .__TEXT,.__text which is read and execute only, so modifying anything directly in that section is also very non standard an probably not possible.
The beginning seems to match start.s from the Apple Csu used in Mac OS X 10.5.8 (https://opensource.apple.com/source/Csu/Csu-75/start.s.auto.html) up until the first call in the source file and 0xa730 in my binary .
Perhaps someone who is familiar with Mac OS X can recognize this pattern or give ideas on how a binary like this could execute?
                             LAB_0000a704                                    XREF[1]:     entry:0000a739(j)
        0000a704 da 8f 9c        FIMUL      dword ptr [EDI + 0xcc33f09c]
                 f0 33 cc
        0000a70a 63 c6           ARPL       SI,param_1
        0000a70c ff              ??         FFh
        0000a70d 90              ??         90h
        0000a70e 90              ??         90h
        0000a70f 90              ??         90h
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             undefined __regparm3 entry(void)
             undefined         AL:1           <RETURN>
             undefined4        Stack[0x0]:4   local_res0                              XREF[1]:     0000a71a(R)
             undefined4        Stack[-0x1c]:4 local_1c                                XREF[1]:     0000a724(W)
             undefined4        Stack[-0x20]:4 local_20                                XREF[1]:     0000a71d(*)
                             entry                                           XREF[1]:     Entry Point(*)
        0000a710 6a 00           PUSH       0x0
        0000a712 89 e5           MOV        EBP,ESP
        0000a714 83 e4 f0        AND        ESP,0xfffffff0
        0000a717 83 ec 10        SUB        ESP,0x10
                             LAB_0000a71a+1                                  XREF[0,1]:   0000a747(j)
        0000a71a 8b 5d 04        MOV        EBX,dword ptr [EBP + local_res0]
        0000a71d 89 5c 24 00     MOV        dword ptr [ESP]=>local_20,EBX
        0000a721 8d 4d 08        LEA        ECX=>Stack[0x4],[EBP + 0x8]
        0000a724 89 4c 24 04     MOV        dword ptr [ESP + local_1c],ECX
        0000a728 83 c3 01        ADD        EBX,0x1
        0000a72b c1 e3 02        SHL        EBX,0x2
        0000a72e 01 cb           ADD        EBX,ECX
        0000a730 53              PUSH       EBX
        0000a731 d3 b8 31        SAR        dword ptr [EAX + 0x9c8e3231],CL
                 32 8e 9c
        0000a737 39 da           CMP        EDX,EBX
        0000a739 7b c9           JNP        LAB_0000a704
        0000a73b b0 3f           MOV        AL,0x3f
        0000a73d d8 ca           FMUL       ST2
        0000a73f 6a 59           PUSH       0x59
        0000a741 63 b0 b2        ARPL       word ptr [EAX + 0x1783afb2],SI
                 af 83 17
        0000a747 7c d2           JL         LAB_0000a71a+1
        0000a749 04 c1           ADD        AL,0xc1
        0000a74b 29 53 ba        SUB        dword ptr [EBX + -0x46],EDX
        0000a74e f4              HLT

Comment: it's best to paste code snippets as text, not images (use code formatting)
Comment: @IgorSkochinsky thank you for telling me. Added the disassembly as text.
Answer: It seems the call __start from start.s is not being disassembled correctly. Possibly Ghidra does not handle some relocation/fixup info. I would suggest verifying with another disassembler and/or filing a bug report.


Can cat6 be used as a 1:1 replacement for telephone cable?

Question: Can cat6 be used as a 1:1 replacement for telephone cable ? Ive seen it done multiple times and its worked fine, but can it be considered a 1:1 replacement or are there some downsides of doing it ?
Answer: A higher category cable can be used for a lower category cable. Ordinary telephone cable is Category-3 cable.
The downside is that simply replacing one category cable for another can be very misleading. Simply having cable at a category is meaningless. All the cable components (connectors, patch panels, etc.) must all be the same category, and they must pass the category test suite after installation to be considered in that category. Installation can be challenging for higher category cables, and I have seen experienced installers frustrated with Category-6 cable installation (getting it to pass the Category-6 test suite).
You can also have problems because the cable and wire diameters can be larger in the higher cable categories. This can present problems with the cable path, and cause poor connections if lower category connectors are used.
When a cable vendor installs cabling, you need to get each cable tested for its category suite, and a complete report should be supplied to you after installation.
Comment: In the U.S. and some other countries, ANSI/TIA/EIA cable categories are used. In other countries, the ISO/IEC cable classes are used. The relationship is pretty close to 1:1, but ISO/IEC has things like Class F, that many people call Category-7, but it doesn't actually exist in the ANSI/TIA/EIA categories.
Comment: Thanks @ron Maupin , do you happen to know if telephone cable is the same in all regions of the world ? In the UK where im based suppliers often call telephone cable 'BT cable' rather than cat3 (BT being a large ISP that was previously government owned and had a monopoly over data / telecoms (that has now been privatised and broken up)) but the majority of suppliers still call it 'BT cable' ill get in touch with the suppliers also, but wondered if you'd happen to know ?


Getting yellow UIBarButtonItem button like Photos app?

Question: I'm currently working on an UI to crop an image inside my app, and I'd like it to feel as native as possible. I looked to the iPad's built in Photos app for some ideas, and noticed that when you crop an image, instead of a blue "Done" button, it has a yellow tinted button that has "Crop" on it, like so:

Does anyone know how to replicate this? I recall that the UIKit framework had a bunch of artwork stored inside of it in some custom file format and an iOS app existed that was able to read this and save you the individual PNGs, but I do not remember what this app is called. Conveniently enough for me, the thing I remember is that this yellow button graphic was among those contained. Anyone got any ideas how I can replicate the button nevertheless?
(Although if anyone knows that utility, that'd be great.)
Comment: Try this:[UIBarbutton with color.][1]

  [1]: http://stackoverflow.com/questions/664930/uibarbuttonitem-with-color
Answer: Try this:http://www.raywenderlich.com/4344/user-interface-customization-in-ios-5


record Audio on iOS, and auto save audio every minute

Question: I want to record audio on iOS, and auto save audio every minute.
the main purpose is not losing the audio after 1 hour record on crash.
Comment: Did you ever solve the auto saving of audio files while recording?
Answer: There is a lot of code to post here  to show you how to record the audio, but there are many examples on GitHub. Here are a couple.
To autosave recordings, I would suggest adding a notification timer. Here is an example.
I hope this helps get you started.
Answer: Sounds like audio queues are your best friends are. Read through the doc, it is pretty lucid.


What does Atala Prism use ADA and the Cardano network for?

Question: Can Atala Prism operate or be useful without performing transactions that require ADA?
Answer: No. If Atala Prism is going to record its information on the Cardano blockchain (as IOG have said on numerous occasions), then it will have to do so with transactions that pay transaction fees in ADA.
For example, that means that the 5 million Ethiopian high schoolers enrolled in Atala will be driving some transaction volume into the Cardano blockchain.
Answer: Some more information you can find on youtube.
Atala can store x-thousand DID´s in 1 Cardano-Block.
Therefore to create 5 mio ID´s it will not need to creade 5 Mio transactions.
https://youtu.be/8AbgzvOeb6w
Answer: Atala Prism use the public key infrastracture from Cardano.
I think this means that the key to the ID is on the Blockchain but for daily use the ID owner and the institution have not to connect to it because the information is on the users phone and only if the owner make a new degree it will connect to the Blockchain. I am not sure.
Hopefully this will be more clear in future.