Making a chain of bones without bpy.ops

Question: While making mesh objects with Python, I felt encouraged by the community to avoid using bpy.ops, as it is less efficient.
I am now making armature objects.
I am making a kind of snake where the body will simply follow a curve, but the 'neck' will have a 2 stage IK rig with two control bones. This code makes one neck.
The def contains my effort so far, based on what I learned from meshes. I'm still working in 2.83 due to other code I have.
I have got this far with bpy.ops and could carry on, but I would like to know the bones better.
import bpy
from math import pi, radians

# Rig A
rot_x = radians(10)
rot_z = radians(-0.33)
xlate = -0.01
bpy.ops.object.armature_add(
    radius=0.0125,
    location=(-0.009134, 0.25, 0.0),
    rotation=(pi/2, 0.0, rot_z))
ob_a = bpy.data.objects.get('Armature')

# Make a chain of bones, including some pose angles while the
# extrude bone is selected
bpy.ops.object.mode_set(mode='EDIT')
for i in range(45):
    bpy.ops.armature.extrude_move(
        TRANSFORM_OT_translate={"value":(0, xlate, 0)})
    bpy.ops.transform.rotate(value=rot_z, orient_axis='Z')
    if i > 40:
        bpy.ops.transform.rotate(value=rot_x, orient_axis='X')

arm_a = bpy.data.armatures.get('Armature')
# deselect the last extruded bone's tail, works in edit mode!
bn = arm_a.edit_bones[-1]
bn.select_tail = False

# Make a copy of two bones for use as control bones later,
# one halfway along the chain, one near the end
control_neck = arm_a.edit_bones.get("Bone.020")
control_head = arm_a.edit_bones.get("Bone.044")

arm_a.edit_bones.active = control_neck
arm_a.edit_bones.active = control_head
control_neck.select = True
control_head.select = True

# must select tail in object mode
bpy.ops.object.mode_set(mode='OBJECT')
control_neck.select_tail = True
control_head.select_tail = True
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.armature.duplicate_move(
    TRANSFORM_OT_translate={"value":(0.0, 0.0, 0.02)})

bpy.ops.object.mode_set(mode='OBJECT')

I have tried without bpy.ops and come to a halt.
import bpy
from math import pi, radians
from mathutils import Matrix, Vector

def new_armature(name):
    arm = bpy.data.armatures.new(name)
    obj = bpy.data.objects.new(name, arm)
    bpy.context.collection.objects.link(obj)

    return obj

# Rig A
rot_x = radians(10)
rot_z = radians(-0.33)
xlate = -0.01

ob = new_armature('Armature')
ob.location = (-0.009134, 0.25, 0.0)
ob.rotation_euler = (pi/2, 0.0, rot_z)
ob.scale = (0.0125, 0.0125, 0.0125)
bpy.context.view_layer.objects.active = ob
ob.select_set(True)
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
edit_bones = ob.data.edit_bones
identity = Matrix()
for i in range(12):
    bone_name = 'b.0' if i < 10 else 'b.'
    b = edit_bones.new(bone_name + str(i))
    b.tail = (0.0, 0.0, 1.0)
    if i:
        b.transform(Matrix.Translation((0,0,1)))# just a stab in the dark
        b.parent = prev
        b.head = prev.tail
        b.tail[2] = prev.tail[2] + 1.0
        b.use_relative_parent = True
    prev = b
bpy.ops.object.mode_set(mode='OBJECT')
# Parenting looks ok in Outliner, but bones don't seem connected

I am obviously missing something, or need pointing to the next step. The bpy.ops bones are connected when grabbed (G) in edit mode, but the other code they are not.
My bpy.ops code works ok; note however that 'duplicate_move' only works if a bone AND its tail are selected, and the tail has to be selected in object mode.
Nevertheless I found this was easier than adding new single bones, and orienting/scaling them to the desired bone positions.
Answer: As far as I know, with running bpy.ops.armature.duplicate() the new bones are connected by default. Not so when using edit_bones.new(). So insert b.use_connect = True at the end of the if i: block to connect bones with parents.
Comment: Thank you! I had overlooked that property and it is False by default.

Making a chain of bones without bpy.ops


How can I change from app store Germany to App Store Spain

Question: Trying to download Pokerstars.es, but I always get German App Store and in Spain Pokerstars.eu can not be played.
Answer:
go to Setting and choose "iTunes Store and App Store"
Tap your
Apple ID and in the popup that appears tap "View Apple ID"
Insert your password
Tap Country/Region and again Contry/Region (if you have an active subscription as Apple Music, you cannot change the Country)
Choose the country from the list, and complete all the form that appears.
When you'll finish, you can use the Stores from that country.

P.S.
All your purchased are related to the country where you bought them, so you won't find any purchase in the dedicated section, when you'll come back to your country, you'll find all your purchases.
here's the official article Change your iTunes Store country or region


How to connect simultaneously to two internet sources of Wifi and Mobile?

Question: There is the application Speedify which tries to do that, but there is no Linux application at the moment so I started to think if it can be done yourself. I have NordVPN account.
The service connects to its VPN server.
I think it creates this way a second interface or something to enable the simultaneous access in two sources for internet.
Technical support answer to my question about the application VPN connection and its release in Linux

We use a VPN setup to make channel bonding possible. Without a server
  component, you can only load balance between multiple Internet
  connections, which means you can assign sockets to different Internet
  connections. Speedify does channel bonding, which allows you to split
  even single socket transfers, like video streaming, across multiple
  Internet connections.
We currently do not have a Linux client available, but we might
  consider offering on in the future.
Speedify is its own VPN service and is not compatible with other VPN
  clients or accounts. You cannot use NordVPN to connect to Speedify.

NordVPN answer because I would like to use my own VPN to with/without Speedify for the feature

Unfortunately we are not aware if it will be working, since if Speedify is only pinging/sending packets to other Wi-fi/mobile data servers then it will work. However if it is providing some kind of encryption, then it might cause issues if it is used with our app.
Also, this app might be switching between networks from time to time. This will require you to reconnect to a VPN server every time you switch a network.

Situation: if you use Speedify, you cannot use NordVPN. This is a big limitation so I want to know what it requires to have a simultaneous connection to two internet sources.
Proposal from NordVPN

It would not be possible as from the answer provided by Speedify it looks like in order to use both Wi-Fi and LTE connection you would require to set up a VPN-like service and thus you would no longer be able to connect to actual VPN.

So I think the interface of VPN must be changed to support both connections.
I think this is what Speedify has done.
OS: Debian 8.5
Answer: Our prayers have been answered and we didn't even know it. vtrunkd is an open source SD WAN daemon for linux (network link bonding/trunking/aggregation and multichannel VPN daemon).
This would be like using Speedify but you would be running the bonding VPN server. I haven't tried it yet but it's been around for 3 years now. I'd imagine that with some determination, one could get it to work.
Comment: Where is the documentation?
Comment: The "Support" link is dead and the last commit is 3 years old, so I'll pass.


Devise, CanCan and ActiveAdmin on Rails application

Question: I keep getting an error trying to use ActiveAdmin in my Rails application with Devise and CanCan. The error is:

CanCan::AuthorizationNotPerformed in Admin::FindingsController#index

This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
I've looked extensively and cannot find a solution that seems to work.
Answer: ActiveAdmin authorize the request in a different way, you can't use check_authorization with ActiveAdmin.


Undelete this question

Question: It has been the procedure of this SE to not delete questions but to leave them exist but on hold as to not have repetitive questions.  Please consider undeleting this useful but on hold question:
Was Catholicism the first denomination?
Comment: Your wish has been granted. :P
Comment: If you want to delete something, delete this one: http://christianity.stackexchange.com/questions/31389/bishops-have-no-free-will
Answer:
It has been the procedure of this SE to not delete questions but to leave them exist but on hold as to not have repetitive questions.

No it has not been, nor is it.
Questions being put on hold (for any reason other than duplicate) is the start of the pathway to deletion. We don't do it right away because we want to give people an oportunity to edit them and get them opened again. Deleted questions are hard to edit, but once it becomes apparent that a question isn't getting edited to be re-opened then the next step is deletion.
In a few very rare cases we've post-noticed question with a lock on all voting and commenting activity, but this is usually when a lot of duplicates have been closed with a reference to it or other cleanup needs to happen before the question is deleted.
Questions that are clearly out of scope for this site that get closed and no effort is made to fix them eventually get deleted.
Comment: It's not that common for old closed questions to be deleted though. Did someone flag this one? Was it being brought to the front page by edits?
Comment: @curiousdannii It's more common than most people realise. I've deleted hundreds and hundreds like that. I don't know how this one hit the radar as I wasn't the deleting mod.
Comment: Are we going to go back and delete all of the off topic questions?  What about the ones that are still open and off topic?  Should they be closed and deleted? http://christianity.stackexchange.com/questions/2087/what-are-some-of-the-benefits-of-going-to-church
Answer: For better or worse, one of the main ways this site gets traffic is through old, off-topic questions appearing in search engine results.  This is great because more people are exposed to the site.  At the same time, it's bad because these questions can give the wrong impression about what kind of site this is.
This particular question, Was Catholicism the first denomination?, is very much "primarily opinion based" and therefore off-topic here, as different traditions view this differently.  But Affable Geek's answer, summarizing centuries of church history in a few paragraphs, has probably been helpful to many.
Despite the value of Affable Geek's answer, I'm not convinced that it automatically warrants keeping the question around.  Remember, the associated cost is that everyone who views that question and answer can easily get the wrong idea about the type of questions that can be asked here.
On bigger sites, the issue of which old questions get deleted is handled by 10k+ users, but this site has very few 10k users who are active with their delete and undelete votes.  That means the deletion/undeletion decisions with these types of questions almost always fall to moderators, and it's always easier to question the judgment of one person rather than several.
So to me, especially in light of the general absence of 10k delete/undelete votes, this is a matter of the moderator's discretion.  Deleting the question helps prevent new users from getting the wrong idea about the site.  Not deleting the question allows the valuable content to remain visible.  A third option, applying a historical lock to the question, could also be used, as it retains the content while emphasizing to readers that the question should not be emulated.
One takeaway might be that 10k users should be more active in voting to delete and undelete.  But as far this particular question goes, to me the "right thing to do" isn't obvious or clear cut, so relying on the moderator's discretion is the best approach.
Comment: Right; only a moderator could reverse the deletion in this case.  My point is that this isn't a case of moderator abuse: this particular question isn't obviously in "must keep" or "must delete" territory, so accepting the moderator's discretion seems like the best approach.
Comment: In this case, I don't think it would matter as it was deleted by a mod.  When it's deleted by a mod, I don't think it can be changed.

Undelete this question


What programming environment and toolchain would best accommodate web developers with severe muscular disabilities?

Question: I have worked extensively in the area of accessible applications using TTS (Text to speech) and VR (Voice Recognition).  I have had occasion to use one handed keyboards for extended periods of time.  Traditional UNIX development (my nice little black box of joy) is losing market share to more modern technologies and development environments.  Complex GUIs are frustrating by themselves and adding additional hardships has made them intollerable.  Given the currently available choices Microsoft does seem to have the upper hand in enabling features in the environment to accommodate programmers with disabilities.  This question might simply boil down to which environment and tool chain best supports automation and the notion that everything the GUI can do I can do effectively from the command line?
Comment: Hm? For web development, if Unix/Linux works for you, why would you switch to anything else? Linux based hosting is generally cheaper than Windows, supports plenty of modern frameworks like Rails, Django, the whole Java stack, etc.
Comment: Rational Application Developer is what is in widespread use in our organization.  Some of the more dicey settings are nearly impossible to not interact with a GUI for.  As for why to branch out the aswer is to keep marketable and relevant skills.  I have not ventured into Rails or Django... yet.
Answer:
Traditional UNIX development (my nice little black box of joy) is losing market share to more modern technologies and development environments.

While there are certainly many great IDEs out there today with support for web development like Visual Studio, Eclipse, and Netbeans, many web developers find them unnecessary and continue to work entirely in standard text editor like vi and emacs.
The unix platform has a very rich selection of contemporary web development frameworks - Ruby on Rails, and Django are two of the most popular today. You could develop an application using one of these frameworks without the use of an IDE entirely from the command line. Both of these frameworks are open source, free, and run on a variety of Unix and non-unixy platforms.
The gnome desktop has several accessibility features that might aid you in your development. The section on mobility impairments in the GNOME desktop accessibility guide might be the most relevant for you. That would give you the best of both worlds in that you'd have a very rich commandline environment, but could also run GUI apps and IDEs such as Eclipse. MacOS X might give you a similar benefit.
If you find the benefit from the MS Accessibility features in Windows too great to abandon, perhaps consider installing and learning to use Powershell. My understanding of Powershell is that it allows you to execute many GUI based tasks entirely from the commandline (allowing you to interact with Windows in a more unix like manner).
Answer: I'm a Ruby on Rails developer, and have fallen in love with the little use of the mouse that our tools allow. Here's a quick recap of the our most common tools:
TextMate for the Mac OS X and its cloned version for Windows e-Text Editor are probably the most accessible for keyboard-only use. Their plugins (called bundles) allow for easy navigation between related files, they have a HUGE number of snippets and templates that are accessible through the keyboard, and many command-line-based scripts that you would execute on a separate command-line window, are accessible as keyboard shortcuts through the editors. The shortcuts  are easy to learn and use as they almost always correspond to what you would have typed, and they are extensible through the editor's "Bundle Editor" functionality.
Aptana RadRails is only as accessible as the Eclipse IDE, and I imagine you would not interested in it...the k-force is weak in this one.
I'm not sure what TextMate/e-Text Editor's counterparts are in *nix (emacs?). The only time I believe you'd absolutely need to use a mouse is when you're trying to select a different bundle or when you're trying to change tab sizes (both of which are accessible in e-text editor through a row at the bottom of the page.
And on a last note, I've heard vi and emacs are making a come-back in the Ruby and Ruby on Rails community. If you're used to the Unix development environment, that may put a bit of a smile on your face...I know it did for me :-)
The links
TextMate (for Max OS X only)
e-Text Editor (TextMate clone for Windows which accepts TextMate bundles)
Emacs mode for Rails


What does "ATS climb gradient" mean?

Question:
On a Jeppesen SID chart, the climb gradient is not standard, because it's greater than 3.3%. What specifically does the ATS (7.4%) climb gradient mean?
Answer:
Above is the same SID, but from the official chart (aerocivil.gov.co).
ATS means Air Traffic Services. That climb gradient is what the ATS requires. Versus PDG (procedure design gradients), the minimum to clear obstacles.

From the Colombian AIP GEN 2.2 Abbreviations used in AIS publications:

PDG = Gradiente del procedimiento de diseño
ATS = Servicio de tránsito aéreo

What does "ATS climb gradient" mean?


Is generating conformers necessary for molecular docking studies?

Question: I have seen some research papers on molecular docking studies using some conformer-generating softwares like CORINA, OMEGA, etc. and they used these softwares to generate conformers of a molecule and they used these conformers for the later docking. Is this really necessary? The docking programs will calculate and remodel the conformers again later though. I was thinking, perhaps, if we dock these conformers but the docking programs have to only fit (evaluate), not doing any change to the structure of the molecule. Can AutoDock or any other software be limited to perform this step only?
Answer: No, you don't need to generate a library of conformers before docking.
I personally advise again that, except if you have a chemical/biological justification to use your own library.
One of the strength that a package has is the method it uses to search for the complex best pose.
Software like GOLD used genetic algorithm to generate its library whereas GLIDE make use of systematic search, for example.
Answer: Autodock vina is a docking software that doesn't need to manually add every conformers of the ligand because they will be generated on the basis of rotable bonds of the ligand.
Answer: From my perspective, if you are new to this field, I agree with Camps. Softwares like Glide or GOLD already have builtin process which are more easy to follow than building your own libraries for docking.
If you are interested in speeding up your conformational searching process, and generating some more initial conformers with higher quality, as mentioned in Benchmarking Commercial Conformer Ensemble Generators, other softwares such as Omega, which focused on conformer generation can have better performance.


What is the reason for phase separation?

Question: I have seen phase separation as a phenomenon taking place. However I do not understand why this phenomenon occurs as a counter example to the natural laws of diffusion along the concentration gradient. During phase separation the richer side becomes richer with the atoms which it already has and becomes more and more deficient with the poorer atoms and vice-versa. Similar things will occur in the opposite case as well. How can phase separation be explained in detail, for example with factors like the chemical potential?How do you quantify whether 2 liquid interactions will be unfavorable or not?
Comment: What do you mean by "in detail?" That makes this question very broad and unspecific, and therefore unsuitable for the site. It would help if you could narrow down the question, perhaps by including in your post the last question in your comment, "how do you quantify whether 2 liquid interactions will be unfavourable or not? "
Comment: The 2 liquids' interactions are unfavourable, so they simply go for minimal contact policy.
Comment: @WilliamR.Ebenezer Yes but how do you quantify whether 2 liquid interactions will be unfavourable or not?
Comment: @BuckThorn edited
Answer: The change in Gibbs energy has to be negative for a process to happen (at constant pressure in the absence of work). Gibbs energy is a combination of entropy and enthalpy.

I do not understand why this phenomenon occurs as a counter example to the natural laws of diffusion along the concentration gradient.

Diffusion is driven by entropy changes, specifically the entropy of mixing (in an ideal solution, the enthalpy of mixing is zero, so the entropy term is the only consideration). The entropy goes up when a solute moves from high to low concentration.
Phase separation occurs when the enthalpy term dominates. If substances A and B are initially mixed and then undergo phase separation, some change occurred (change of temperature, added third component, etc.) so that now phase separation more exothermic (lower energy for [A to interact with A and B interact with B] than [A interacting with B]). Under these circumstances, phase separation can happen.
Comment: What will be the typical shape of the G vs X curve for a single phase two component system?
Comment: How will the G vs X curve look like in such circumstances?There is a typical "common tangent" method that we can apply to find out the equilibrium condition for a multi-phase system.Now that works pretty well when I have two concave upwards shapes.What if I had concave downwards?How would I find the minimum free energy?Common tangents could not be drawn then isn't it?
Comment: @user586228 See https://chemistry.stackexchange.com/a/113061/72973 for the equilibrium.
Comment: @user586228 http://web.mit.edu/hujuejun/www/Teaching/MSEG%20803/12%20--%20Solution%20Theory.pptx


ubuntu username not set during installation

Question: I installed an ubuntu server and somehow happend to skip the user accounts and time setup process.
Now the system loads up and asks username and password which I have none.
Is there a way to access the account setup facility or is there any default username and password for ubuntu?
Id thought of root and guest account but they're not active yet.
Comment: Can you add what Ubuntu server version you installed? Do you have physical access to the server or is the machine remote?
Comment: User `ubuntu` pass "blank"
Answer: Open recovery mode and chroot to the ubuntu installation. Then, try to add an user with useradd or set root password with passwd.


Spaces between characters is funky in linked or embedded documents in Word 2016 for Mac

Question: In Word 2016 for Mac, when I create two documents ("A" and "B"), the character spacing in both documents is good. But when I link or embed Document B into Document A, the spacing between characters in the linked/embedded text in Document A is bad, with either too much or too little space between characters.
Answer: Suggest disabling kerning in both of the documents.

Highlight the text in question.
  Pick the Tools option from the Font menu.
  In the Font dialog box which appears, make sure the Character Spacing tab is selected.
   Click off the Kerning for Fonts check box, then click OK.

Should that fail, enable it in both documents.


Plank dock applet

Question: Can anyone explain simply what is a dock applet? I installed Ubuntu Budgie on my laptop and realized that I have this app installed. It says that it is dock applet. But unfortunately I don't know what is a dock. I know that an applet is a small application but what "dock" means? What can I do with this applet? Purpose of this?
Answer: A dock is a row of icons that you can click to launch an application if it is not yet running, or switch to that app if it is already running. It was, I guess, Apple that first came up with the dock at the bottom of the screen. This has become a popular desktop accessory, since, replacing the more traditional window buttons to switch application, and separate launchers to start applications.
plank indeed is a dock application. It does not belong directly to the Budgie desktop: it is an independent application. However, the developpers of Ubuntu Budgie include it by default in their build of the Budgie desktop. It is placed at the left edge of the screen. Thus, if you did not yet modify your desktop, the application icons on the left of the screen are the plank dock.

Plank dock applet


LPC17xx: Check if RTC is running

Question: I am using NXP LPC17xx family microcontrollers (LPC1759 and LPC1768).
How can I determine if RTC is running for sure?
I am doing a test on
LPC_RTC->CCR & RTC_CCR_CLKEN

but it seems no much reliable.
I have seen values in year 3197 or so when turning on my device.
How can I tell if RTC is running and its value is not corrupt?

EDIT:
I ended up adding a simple sanity check in RTC values:
bool        DateTime::validate( const RTC_TIME_Type &time_info )
{
       if ( time_info.YEAR > 2100
               || time_info.DOY > 366
               || time_info.MONTH > 12
               || time_info.DOM > 31
               || time_info.HOUR > 23
               || time_info.MIN > 59
               || time_info.SEC > 59 )
               return        false;

       return        true;
}

It is run during my POST, as suggested bellow.
Answer: I battled with the RTC on that chip's grandfather (LPC2148) about 5 years ago.  If you look on the Yahoo LPC2000 group (it also covers the LPC1000 chips) you'll see the RTC & its issues come up a lot.
Anyway, I'm going from memory here, but I think I concluded that reading the status register wasn't reliable enough.  Maybe the issue was that when power was removed, if the battery backup was absent, things would get scrambled...
So what I recall I did was the following, during the boot phase:
(1) Enable RTC peripheral
(2) Read ALL RTC registers. In firmware, have "out of bounds" min & max values for each field (e.g. year must be at least 2005, and no larger than 2030)
(3) If any value is out of range, reset date & time to some hard-coded value (e.g. Jan. 1, 2005) (product would let user adjust time/date once booted)
(4) Take snapshot of registers; wait AT LEAST one second (use timer peripheral to measure time), then make sure the value changed.  I might have gone so far during boot-up as to set the values so that a 1-second tick would/should cause everything to roll over (probably 1 second before midnight, Dec. 31), ensure everything changes, then write back the original value + 1 second. (You would want to do this right as the value changes to avoid slipping seconds)
I will try to dig up the code and see if there was something more.  I just recall finally concluding I had to run the damn thing & watch it work before I passed the P.O.S.T. for that peripheral.
(I kind of mentioned it in passing, but just to re-iterate... if your values seem corrupted on power-on, make sure your battery back-up circuitry is rock solid - even a basic circuit with a pair of diodes normally suffices.  Could be that the clock is running when the product is running, but that when power is removed, its brains get scrambled.)
Answer: Also confronted with temperamental rtc's here....
I don't think a really reliable test is possible, you could store the last recorded time somewhere in non volatile memory, and check that the clock hasn't moved to a past date, and you can also test that the delta between two checks is not too big.  That would catch something like the year 3000, but you cannot reduce the tested time lapse to say 1 month - you want the thing to wake up even if it was shelved for say a year.
Do you have the possibility to consult a time source at startup?  Eg an ntp server or some other device that your controller speaks with that can be considered synchronized with a reliable time source?
Comment: I have no reliable source to check time against. My device is stand alone, unfortunately...
Answer: You can route the RTC clock to an external pin and watch it on an oscilloscope or a logic analyzer.
IIRC I did just that for LPC1766/1768 (I have two identical boards populated with different processors).

LPC17xx: Check if RTC is running


Taking Hadiyah after Taraweeh is permitted?

Question: In our mosque, Imam had been ill for a few days in Ramadan. Then the mosque committee selected me as Imam for only the Taraweeh prayer. No contract were dealt there about money. I just agreed to be a Taraweeh Imam in that mosque. After 27th Taraweeh, afer finishing Quran in Taraweeh prayer, the mosque committee wanted to give me Hadiya. Now Is taking this hadiya like taking money by reciting Quran in Taraweeh prayer(so it is Haram to take) or this can be treated as general/common/usual hadiya(so it is Halal to take and use)?
Comment: I suppose you can estimate it better than anybody. I don't know how anyone else than you can qualify the Hadiya ... I mean whether it was such or a payment.
Answer: Since it was the Sunnah of the prophet () to accept gifts and refuse sadaqh, there's no harm in accepting a gift from anybody.
The rule of thumb in Islam is that anybody can accept a gift as long as he didn't ask for it, be it an Imam, a teacher, a qari' teaching Qur'an etc..


pulsed current with 200 kHz squarewave signal

Question: I use this circuit  to obtain pulses as close as possible to the input signal pulses on the 1.5 Ohms resistor. The MOSFET is FPQ50N06 and the transistor is BC239. The circuit gives good results on 25 kHz, 4.8 Vpp and 1.5 V offset. However, I need 200 kHz, 4.8 Vpp and 1.5 V offset. How can I make it work when the signal is 200kHz? (I connect oscilloscope probes shown on the scheme and I exactly need on channel2 (CH2) the pulses shown on the other image which is an oscilloscope screen.)
Comment: Offset?? Please try to be more precise in describing your problem
Comment: Looks like too weak gate drive. What does the datasheet tell you about switching times?
Comment: Mark, Have you tried just swapping out the NFET with an NPN BJT and using a DC blocking capacitor in series with your source resistor? I think it should work fine at 200 kHz.
Answer: You have a massive power MOSFET with a lot of capacitance. If you reduce the size of the MOSFET you can go faster, or change the type to a different technology than silicon.
A cheap one that should show a lot (like 5 or 10:1) improvement is the FDD1600N10ALZ.
They're cheap enough, but you can run some simulations to see what the predicted performance is. You can also try reducing the 600\$\Omega\$ if that's not enough improvement.
Answer: It seems to me like you could just use an emitter follower circuit. If you do this with the NPN transistor then the output voltage would just be Vout=Vd-0.6
If you need a current then just scale the output resistor accordingly.
If this answer isn't enough then you need to restate the problem in a more complete way.
Answer: There are a few problems with your layout , I can imagine from your resonance.
The 10:1 probe 10pF to 15pF causes Drain resonance with your wire jumper inductance from Vcc low ESR 5V Cap to Drain @ 10nH /cm. Solution add 50 OHm series near drain for a test pin
The inductance in the power to drain increases the resonant gain which can be reduced by using at least hal the length of a few cm in the Source to Rs resistor to ground.
Eliminate 600R  gate resistance to drive with 50 Ohm gen. ~ 0 to 10V .
Summary:  to decrease Q of resonance; Add  series 50R to Drain for probe capacitance and add wire inductance between source and Rs to gnd.  Also increase  base load to 1k with 1k pullup to gate to Drain for negative feedback.
With these loads it draws 14W peak from the 5V supply and >5W peak in  the FET when driven properly as below draws 0.25W Avg or < 2%.
Answer: Basically, in a FET, lower RdsON means a bigger chip which means higher Qg, higher capacitance, ie a slower FET and higher gate drive current if required to switch fast.
RdsOn i sonly relevant if you use the FET as a switch, ie fully turned on. Since your circuit uses the FET in linear mode, RdsON is not a relevant selection criteria for your FET. There will be about 3V across the FET when it is ON. So using a very low RdsON FET results in high capacitance which only makes it slower, but it does not lower dissipation since the FET is never used as a switch.
You need a FET with a lower capacitance, and a driver capable of pushing more current into the gate. I simply added a push-pull driver and the simulator thinks it will work:

Note I picked a random one from the simulator library, so don't use that reference, instead please carefully select the FET, something like:
Vds > 10V
Id > 5A (depends on your current)
RdsOn about 100-200 mOhms at Vgs=4.5V -- This is mostly to make sure it will be well into linear mode at Vds=3V and 0.6A. Check the Id vs Vgs graph in the datasheet (graph below), green operating point is OK, red is not OK as the FET behaves as a resistor so it will need much larger gate voltage swing to control the load, which means it will take more time to charge/discharge the gate.

Qg as low as possible ; be aware that Qg spec depends a lot on the Vds at which is is specified...
SOA should not be violated when the FET is ON in linear mode, so you need a FET that is usable in linear mode, not just switching, so probably not a TrenchFET.

You could try FQP13N06 or FQP10N20 (above graphs are from FQP10N20). Spehro's FDD1600N10 looks even better.
You can also use a BJT, for example D44H11 which should be a good fit. However you will need to adjust your signal generator to add a bit of negative offset voltage, the low level part of the waveform should be about -0.5V to make sure Q2 really brings the power transistor's base down to almost 0V to fully turn it off when it needs to. Or use a more complicated driver circuit.
Answer: Ignoring the ringing (Which might just be poor scope probe technique) you see basically straight line rise and fall, which says to me that the mosfet capacitance is introducing a slew rate limit.
Pick a mosfet with much smaller gate capacitance's or lower the 600R resistor (or both).
Or go with a BJT in place of the mosfet, will need a little base current but should be faster.


Windows 10 sdk offline installer?

Question: Isn't there any offline installer available for the Windows 10 sdk? All I can found is 1.2 MB sized sdksetup.exe file which requires an Internet connection to install. If there available, please provide the link.
Comment: is the question answered?
Comment: can any pls use the official installer and select "installation on a seperate machine" option. So that all the files are downloaded. Then upload the complete installer and share its link. because the official installer doesnt seam to be working for we, it gets stuck in the downloadings saying missmatch hash, tried 10 times atleast and on 2 michines i have
Comment: @Gkills I'm willing to bet that Microsoft prohibits that somewhere in their license agreement.
Answer: There is no offline installer/ISO since Windows 8. Go to a PC with a fast unlimited download, run the Installer and select Download the SDK - Windows 10 10586 for installation on a separate computer

This downloads all files and you can use tools like Folder2Iso to create an ISO based on the folder to use it on different PCs.
Comment: I suppose the download size is **722.4 MB**.
Answer: Windows 10 SDK offline installer is available from this link.

You can download the ISO and use it for offline installation. Its size is 643MB.
Comment: ISO is not available now. User has to be use the online installer.
Comment: It is curious that [Russian version](https://developer.microsoft.com/ru-ru/windows/downloads/windows-10-sdk) of this page has a [working link to ISO file](https://go.microsoft.com/fwlink/?linkid=859887). The interface language is still English.
Comment: https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/
Answer: Want UWP Tools and Windows 10 SDK Offline
First Download Windows 10 SDK from: -
Windows 10 SDK
Windows 10 SDK offline installer that will download 700 MB of files and we can use those files to intall Windows 10 SDK to another PC.
After installing Windows 10 SDK we need to install UWP tools for Windows 10.
From this link we will get UWP Tools offline: -
UWP tools installer
After downloading you find windows_vstools.exe.
Go to the directory where you save UWP Tools installer i.e. windows_vstools.exe.
Now Shift Key + Right Click and select open command window here
CMD will open.
And type: -
windows_vstools.exe /Layout and press Enter.
After that installer will ask you for download Location i.e. Where to save UWP Tools files.
Then click download.
After downloading finish you can install UWP tools on multiple PCs.
Comment: Please read the question again carefully. Your answer does **not** answer the original question. OP is looking for an offline installer that works **without an internet connection**.

Windows 10 sdk offline installer?


What is difference between compensate and recompense?

Question: As far as I know from dictionary that both words compensate and recompense are same in meaning .But are those actually same or is there any precise difference?
Answer: No, they are not the same, although in some cases they may be interchangeable.
If you recompense something, you pay back expenses that have been incurred. So I paid for something, and you pay me back for it. This is a for of compensation!
To compensate for something (notice also the difference in use!), you may recompense expenses. But there are many other options.
Someone may compensate for a lack of knowledge with a great ability to look things up.
I may compensate for your expenses by giving you time off.


Simple software to show and modify GPS tracks

Question: I have GPS tracks (in gpx format) that I usually use to geotag photos. Is there a simple software to view these tracks (i.e.: not use Google Earth)? A bonus would be simple modification, like deleting waypoints. TangoGPS seems to offer GPS track import only in connection with geotagging for pictures.
Answer: Try Viking - you can download and edit your tracks, and also add OpenStreetMaps, Terraserver or DEM layers. It also allows to have georeferenced map layers and some other features.
Comment: Viking is still a bit too complex for my taste (having layers etc.) but it certainly can do everything I want and is fairly simple to use. Thanks
Answer: Instead of installing software I used the free online GPX Studio which suited my purposes just fine (combining 3 GPX files and deleting a few waypoints). For the record I have no affiliation to the software, just a happy user.
Answer: I've found Merkaartor (in the repos) to be the simplest. But JOSM is the most used and widespread, it's a PITA to find the right version to use.
I'd say give Merkaartor a shot :)
Comment: Josm allows upload into openstreetmap
Comment: Thanks, merkaartor (there was an "r" missing) looks powerful (as does JOSM which I tried a while ago), but is not the kind of "simple" software I had in mind. I'd love to have something like tangoGPS or the emerillon map viewer, but simply with the additional feature to show gps tracks...
Answer: I would recommend GPSPrune. It is a Java application and support multiple platforms. I used it in Ubuntu, Windows and MacOS.
Myself don't like multiple workflow and prefer sticking to same app where ever PC available to process and upload to OSM.


Extract specific columns from delimited file using Awk

Question: Sorry if this is too basic. I have a csv file where the columns have a header row  (v1, v2, etc.). I understand that to extract columns 1 and 2, I have to do: awk -F "," '{print $1 "," $2}' infile.csv > outfile.csv. But what if I have to extract, say, columns 1 to 10, 20 to 25, and 30, 33? As an addendum, is there any way to extract directly with the header names rather than with column numbers?
Answer: I don't know if it's possible to do ranges in awk. You could do a for loop, but you would have to add handling to filter out the columns you don't want. It's probably easier to do this:
awk -F, '{OFS=",";print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$20,$21,$22,$23,$24,$25,$30,$33}' infile.csv > outfile.csv

something else to consider - and this faster and more concise:
cut -d "," -f1-10,20-25,30-33 infile.csv > outfile.csv

As to the second part of your question, I would probably write a script in perl that knows how to handle header rows, parsing the columns names from stdin or a file and then doing the filtering. It's probably a tool I would want to have for other things. I am not sure about doing in a one liner, although I am sure it can be done.
Comment: Note that in the general case of a CSV file with quoted strings, you can have non-delimiting commas in the data fields, which will cause the cut & awk solutions to fail.
Comment: Many thanks. Cut is what I need, I guess. This wouldn't work with the headers, by any chance?
Comment: I was just about to suggest `cut`, but Cliff got here first.
Answer: As mentioned by @Tom, the cut and awk approaches actually don't work for CSVs with quoted strings. An alternative is a module for python that provides the command line tool csvfilter. It works like cut, but properly handles CSV column quoting:
csvfilter -f 1,3,5 in.csv > out.csv

If you have python (and you should), you can install it simply like this:
pip install csvfilter

Please take note that the column indexing in csvfilter starts with 0 (unlike awk, which starts with $1). More info at https://github.com/codeinthehole/csvfilter/
Answer: Other languages have short cuts for ranges of field numbers, but not awk, you'll  have to write your code as your fear ;-)
awk -F, 'BEGIN {OFS=","} { print $1, $2, $3, $4 ..... $30, $33}' infile.csv > outfile.csv

There is no direct function in awk to use field names as column specifiers.
I hope this helps.
Comment: It does indeed. Thanks for the confirmation :-(
Answer: You can use a for-loop to address a field with $i:
ls -l | awk '{for(i=3 ; i<8 ; i++) {printf("%s\t", $i)} print ""}'

Answer: Others have answered your earlier question. For this:

As an addendum, is there any way to extract directly with the header names rather than with column numbers?

I haven't tried it, but you could store each header's index in a hash and then use that hash to get its index later on.
for(i=0;i<$NF;i++){
    hash[$i] = i;
}

Then later on, use it:
j = hash["header1"];
print $j;

Answer: Tabulator is a set of unix command line tools to work with csv files that have header lines. Here is an example to extract columns by name from a file test.csv:
name,sex,house_nr,height,shoe_size
arthur,m,42,181,11.5
berta,f,101,163,8.5
chris,m,1333,175,10
don,m,77,185,12.5
elisa,f,204,166,7

Then tblmap -k name,height test.csv produces
name,height
arthur,181
berta,163
chris,175
don,185
elisa,166

Answer: If Perl is an option:
perl -F, -lane 'print join ",",@F[0,1,2,3,4,5,6,7,8,9,19,20,21,22,23,24,29,32]'
-a autosplits line into @F fields array.  Indices start at 0 (not 1 as in awk)
-F, field separator is ,
If your CSV file contains commas within quotes, fully fledged CSV parsers such as Perl's Text::CSV_XS are purpose-built to handle that kind of weirdness.
perl -MText::CSV_XS -lne 'BEGIN{$csv=Text::CSV_XS->new()} if($csv->parse($_)){@f=$csv->fields();print (join ",",@f[0,1,2,3,4,5,6,7,8,9,19,20,21,22,23,24,29,32])}'
I provided more explanation within my answer here:  parse csv file using gawk
Answer: Not using awk but the simplest way I was able to get this done was to just use csvtool. I had other use cases as well to use csvtool and it can handle the quotes or delimiters appropriately if they appear within the column data itself.
csvtool format '%(2)\n' input.csv
csvtool format '%(2),%(3),%(4)\n' input.csv

Replacing 2 with the column number will effectively extract the column data you are looking for.


Is there a financial benefit for buyers from using community currencies?

Question: My city is introducing its own local currency, so I've been reading about similar established projects like the Brixton Pound. I understand that local businesses will benefit from it thanks to the local multiplier effect, but what about me personally? Should I expect any personal benefits from using it (e.g. more advantageous prices), or am I supposed to use it by a voluntary choice without any financial incentive?
Comment: I imagine that depends on the program, doesn't it?  But I can't imagine why anyone would be willing to use it unless it had some advantage (such as better prices or at least some sort of points/rewards program).
Comment: @Joe I don't know. Fair trade incentive for example doesn't offer anything to the consumer: you simply chose to support farmers from developing countries by buying their products.
Answer: Short answer: NO, there is no financial benefits for you to expect in a local currency even if some might give tiny discounts on local sales.
Local currencies are attractive for small business or communities, they are perfectly legal and starting to be popular in a lot of places. Local currencies encourage individuals and businesses to exchange goods and services locally.
Using them is like investing in your community. It could give you the feeling of doing something good for your community. Check this article for a discussion on the subject.
They should not be considered investments. Local currencies do not offer the same financial security and some could be like monopoly money, but that would be another subject or question to debate.
So, to summarize: no money to be made for your personal use, but some real social and financial benefits for your community. Would'nt that be a kind of personal benefit for you ?


Django: how to make a link on main page to sub-pages

Question: I have had successfully deployed some pages which are in urls.py and could be reached with no problems.
There is also default page should have links to 127.0.0.1/page1 and 127.0.0.1/page2.
How could that be achieved? sitename is in settings.py
I have tried the following in index.html:

This is the URL for "page1":  Click here

> django.urls.exceptions.NoReverseMatch: 'sitename' is not a registered namespace

This is the URL for "page1":  Click here

> Reverse for 'exp.html' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

Comment: Post the urls and views, makes it easier to help.
Answer: I advice you first read this link for understanding django url structure
https://docs.djangoproject.com/en/1.10/topics/http/urls/#url-namespaces
The Solution will be like that:

This is the URL for "page1":  Click here

This is the URL for "page2":  Click here

and you must define this urls in urls.py
Answer: It looks like you're trying to pass template name to url template tag. What you should actually do is to define url name in your urls.py, so it would look similiar to this:
url(r'^page1/$', YourView.as_view(), name="page1")

and then in template:
Page 1

You should rather avoid hardcoding urls doing something like this:
Page 1

because when in future you'd like to change the url you'll have to do it in two places: in urls.py and in template(s), while when using {% url %} template urls.py will be the only place to do it.


ffmpeg record video tape with audio

Question: I'm trying to record video tapes to digital, using this command:
ffmpeg -f v4l2 -video_size 720x480 -i /dev/video2 -channel_layout stereo -f alsa -i hw:1,0 -c:v libx264 -pix_fmt yuv420p -b:v 2M -crf 23 -c:a aac -b:a 128K -to 00:00:30 -preset fast -report tape1.mkv
I get this error:
[alsa @ 0x55ede20aa9e0] cannot open audio device hw:1,0 (Device or resource busy)
hw:1,0: Input/output error
My VCR is plugged into a USB Recording Device.
arecord -l produces this:
**** List of CAPTURE Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: CS4206 Analog [CS4206 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: USB20 [AV TO USB2.0], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I'm not committed to using alsa. I just don't know what else to use to get this to work.
fuser -fv /dev/snd/* /dev/dsp*
Produces this:
Specified filename /dev/dsp* does not exist.
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  matt      30999 F.... pulseaudio
/dev/snd/controlC1:  matt      30999 F.... pulseaudio

VLC can stream the input with audio if I pass this to it:
v4l2:// :input-slave=alsa:// :v4l2-standard=0
But I couldn't figure out how to pass that to ffmpeg.
I could possibly record these videotapes using VLC. But I would prefer to use ffmpeg to do the job.
Answer: Try defining the audio device as just hw1.
You can also try suspending Pulse:
pasuspender -- ffmpeg -f v4l2 -video_size 720x480 -i /dev/video0 -channel_layout stereo -f alsa -i hw:1 -c:v libx264 -pix_fmt yuv420p -b:v 2M -crf 23 -c:a aac -b:a 128K -to 00:00:30 -preset fast -report tape1.mkv

ffmpeg record video tape with audio


How do I flip a mesh inside-out and still have the object be the same just so the faces are now facing out-words instead of inside the object?

Question: I'm making fuzzy boots for a game and everything was going well until I tried to add the fuzz and I discovered that the whole thing was literally inside out and the fuzz (hair) would go inside the boot instead of outside the boot. I need to know if there is a way to not change anything about the topology of the boot but make it so the hair/fuzz goes on the outside instead of the inside. (please help)
Comment: Usually, the answer is "recalculate normals", and if that doesn't do what you want, enable "inside" on the operator panel.  There are potential situations where that won't work; but those potential situations indicate something other than/additional to normals are wrong, and you should fix that other wrong thing.  The other way around this is to just change whatever the fuzz object is, making it point the other way.
Answer: This is called "flipping the face normals". A Normal is basically the front direction of a geometry element, like vertices, edges, or faces. To see if your faces are oriented the right way, you can use some Overlay options in the viewport, both in Object Mode and in Edit Mode:
  Left: Enabling "Face Orientation" in Object Mode Right: Enabling "Face Orientation" and "Face Normals" in Edit Mode
Then in Edit Mode, you can select your faces and Recalculate Normals by pressing Shift + N. There are also other operations available in the Mesh > Normals menu (Alt + N), as explained in the manual:
Answer: I just went to view port overlays and turned on face orientation which showed which Normals were the wrong way and I selected any wrong-facing Normals and flipped them by going to Mesh > Normals > Flip


SharePoint Windows Explorer not Working

Question: I am the administrator for one the SharePoint site and when I am trying to open the library via windows explorer.Can any one help me how can I over come from this issue
Comment: Try this checklist: https://expectedexception.wordpress.com/2012/02/06/sharepoint-open-with-windows-explorer-problems/
Answer: I had the same issue, in my case it was resolved by adding the url of the SharePoint site to the Local Intranet sites (or Trusted sites) of the browser.
Answer:
Check if you have sufficient permission on the document library and its documents.
If permission is all correct, then the problem looks like in your file name. Check your File Name, Length, and Invalid Character Restrictions and Recommendations.

For your reference: http://www.sysadminsblog.com/microsoft/file-name-length-and-character-restrictions-for-sharepoint/
Answer: If the Startup Type for the WebClient service is set to Disabled, the Open with Explorer button doesn't function correctly, and you cannot start the service. To enable the service, go to the WebClient Properties dialog box, select the list option for the Startup type setting, and then select either Manual or Automatic.
Hope You Find This Useful.

SharePoint Windows Explorer not Working


Is "Laudatio omnibus Dei" grammatically correct, or simply inane?

Question: Is "Laudatio omnibus Dei" grammatically correct?
Comment: It looks like "praise for all (people) of god." Depending on how it's intended to be used (aka as a command or a declarative statement) it could be correct or incorrect.
Comment: Hi, and welcome to Latin.SE! Techinically it could be correct, though it sounds odd.What meaning do you have in mind exactly?
Comment: Welcome to the site! It depends on what it should mean. Where does it come from? Is it a translation attempt of something? Please edit your question to add more details so you can get a useful answer.
Answer: Yes. Without more context, it is grammatically correct.
It would mean "praise for God [is] for all" (obj. gen.) or "God's praise [is] for all." (subj. gen.). It could even carry an implicit sense of responsibility, like "praise for God [is an obligation] for all."
I want, however, to question the use of laudatio instead of laus, laudis. Laus is the go-to Classical word for "commendation, glory, fame, renown, esteem," and even "praiseworthy things/deeds." Laus, laudis lexicon entry
Laudatio on the other hand is it's more abstract cousin. Laudatio means "praise" as a completed action, like "a praising." It lends itself, therefore, to meaning "a eulogy," "a panegyric," or even "favorable character testimony" in court. Laudatio lexicon entry
So unless you're talking about a specific prayer, you may want to consider changing laudatio to laus.


Android Automated Script Pause for Emulator Load Time

Question: I've been tasked with creating a completely automated script that will allow the user to create a new sd card, emulator, start said emulator, build a debug apk, and finally install said apk on the emulator just created.
So far, I've accomplished this through the use of Windows batch files, which has worked completely fine, aside from one problem I can't seem to figure out a workaround for.  That is, after the...
<code>emulator -avd %emuName%
</code>
...command has been run, the batch file will immediately begin building the debug .apk file, and then begin installing it once built.  The problem occurs when the debug .apk file build process finishes prior to the emulator fully loading.  To temporarily solve this, I have added in a pause which calls for the user to press enter once the emulator is fully loaded; however, I would like to remove this.
One way I've thought to solve this is to add a predetermined length pause into the script, however, the build times range anywhere from 50 seconds to as high as 95 seconds at times, so this isn't a very effective way of handling the issue.
Is there any way I can force the batch script to wait until the emulator is fully loaded prior to attempting to install the apk to the emulator?  If not, what may be some other ways to achieve this?
Answer: Use
<code>  adb wait-for-device          - block until device is online
</code>
to wait for the AVD.


Why do we lift our feet when we walk?

Question: I'm not sure if this is a good question for here- albeit if I asked it somewhere else I'd want the physical argument. Why do we lift our feet when we walk, as opposed to doing something like shuffling? Does it consume more energy to shuffle our feet? I ask because I realized that in Kendo the participants slide their feet. I would assume that this required more energy, but then I don't know why it would be done.
Comment: Well, the *physics* is that it's more energy-efficient to walk at most speeds in most terrain, the *biophysics* is that it's less wear-and-tear-inducing to walk in such circumstances, and the *biology* is that we didn't evolve adapted to moving on ice sheets. Take your pick which avenue you want. I personally don't think this has to move; just realize physics only has part of the answer, and you may want a bio perspective.
Comment: I thought so. I'll flag it for a move then?
Comment: I've checked and it seems likely this would be off topic on [biology.SE].
Comment: This question has more to do with biology and evolution than it does with physics. There are evolutionary reasons why we lift our legs, and these have little to do with physics.
Comment: Perhaps if you transfer ths question to the biologys stack exchange, then a more detailed answer dealing with th eevolutionary reasons can be given.
Comment: Is biophysics just studying how the physics shapes the biology then? (I know that sounds really obvious, but had you asked me the biophysical reason, I would have given you the physical reason you mentioned.)
Comment: This is a question you should ask of the designers of [Asimov](https://www.youtube.com/watch?v=eU93VmFyZbg).
Answer: All the answers point out the evolutionary advantage in rough terrains. A rough terrain means that a shuffler would continually meet obstructions in shuffling which would require enormous energy to shift by the feet, and much less in lifting the feet.
As far as energy consumption goes one should compare in flat terrains, like deserts and ice.
Ice skating and skiing show that with the right footwear, (as small a friction constant as possible,)  shuffling is advantageous energetically. Lifting of feet while sliding would expend a bit  more energy, unnecessarily.
In deserts or on flat cement sidewalks , where there is high friction , lifting the feet alternately through air needs much less energy then shuffling(in sand there is sinking to be considered also).
Comment: I always get excited when I see your name next to an answer, Anna! Always great.
Answer: Our ancestors evolved in rather rough terrain - it's a bit hard to shuffle through tall grass, mud, marshland, rocks, hills etc. and unless you have hooves it's rather more wear and tear on the feet. In geo-biological timescales pavement is a rather recent arrival. And then there's all that time our evolutionary branch spent in the trees.
Snakes shuffle along, but I think it's unreasonable to compare such a different form of locomotion.
Answer: I might not be interpreting your question correctly, but I feel that there is a component to your question that requires more than friction and work to understand: why Kendo practitioners, renowned for efficiency of action, shuffle their feet.
I am not a Kendo practitioner myself, but from what I understand, the shuffling serves the same purpose as the fighting stance - maintaining a stable base. A stable base serves two important purposes: It distributes your weight and the forces from your opponents strikes evenly so as to avoid being thrown off balance, and it provides a solid 'foundation' for your attacks, so that you are 'pushing off the ground' when your strike hits your opponent, partially resisting the "equal and opposite reaction" of impact and in turn facilitating what you might hear people call 'punching through' your opponent, or extending the blow beyond the point of impact.
The shuffling, then, is best seen as a way of remaining in an optimal stance. Lifting your feet to step would shift your weight off-centre, leaving you vulnerable to a sweep, and with reduced capacity to attack effectively until your feet are planted again.
Comment: And yes, there are ways of striking that are based more on momentum or maximum kinetic energy, where you would not be stable at the moment of impact; the most stereotypical example of this would be a jumping kick. Stability comes into play more in the techniques like the famous 'one inch punch', where the practitioner uses as many muscle groups as possible in 'harmony' to punch without any 'wind up' or momentum.
Comment: Answer to the title: 'cause knees, yo. Answer to the question: This.
Answer: Lift Your Feet for Energy Efficiency!
I'm late to the party here, but let me offer a distinctly different explanation.  Think of walking as simply using your legs like pendulums. Due to the fact that your legs are close enough to the same length, you need raise one so it can more freely swing. Thus, you raise one foot to move it forward, taking advantage of this pendulum motion. This is supported by the fact that your hips move while you walk, in a manner more closely associated with this theory.
You may also take advantage of the springy-ness of your bones/muscles (like a kangaroo does to the extreme) to "spring" into the next step. This reduces the energy needed for the next step, which is an advantage in the survivability of a creature. Even though we do not hop like kangaroos, this effect still happens in our bodies, especially while running.
The wikipedia article on walking has a good description of both of these rationales. It makes the claim that the pendulum movement allows 60% of your energy from one step to transfer to the next one. This is a big energy saving per step, so of course evolution smiles upon this mode of locomotion.
A possibly unrelated note: As a HEMA practitioner, I can tell shuffling happens in European Traditions, but not to the exclusion of other methods of movement. In the real world European Traditions, fighters have a dire need to move with speed, and likely over uneven terrain. (It should be further noted that European Traditions do emphasize strong footwork to be able to withstand or deflect blows!) Kendo is also descended from kenjutsu, and this is the basis by which people call kendo a sport instead of  a martial art. Perhaps this odd shuffling was introduced during this transition, the "sportifying" of Japanese swordsmanship?
Answer: I think that the friction involved in shuffling would be much more energy-consuming than the energy involved in lifting our feet. Would we would here now if our ancestors shuffled away from predators? You could easily test it: shuffle a given distance, then later walk it, and compare how tired you are.
Answer: This is probably not so much of a physics question as a biological one.  Shuffling might consume less energy depending on the roughness of the terrain etc.  My intuition is that it would but I don't know how to show that.  It also depends on your definition of shuffling either being dragging feet (great amount of friction) or barely lifting your feet (probably more efficient.
However, most terrain is not shuffle-able.  You need to lift your feet in order to traverse it.  If evolution is going to form humans to be good at either shuffling or lifting feet to walk the latter is far preferable, even if it requires a little more energy.

Why do we lift our feet when we walk?


Maximum number of additional attributes can be added using 'ext' in Sitecore CDP?

Question: I'm exploring Sitecore CDP capabilities and want to know about the maximum number of recommended values for additional attributes that can be added using 'ext' as key-value pair in Sitecore CDP.
Answer: As per Sitecore documents - https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/send-additional-event-data-to-sitecore-cdp.html
below is a list of guidelines for using the events data extension:

Only one data extension per event type is supported.

The name of the event data extension must be ext.

The key of the event data extensions must be default.

The attribute name must be alphanumeric [A-Z,a-z,0-9] as per the json rfc7159 spec.

The attribute name of the event data extension must be written in camelCase.

The attribute name must be unique within the entire event type.

The attribute name of the event data extension must be meaningful. Consider using the friendlyID.

If grouping is required, use common prefixes.

An event data extension has a maximum of 50 attributes.
Answer: From your JSON example it looks like you are trying to add extension attributes to the guest data model. If that's the case then the maximum number of attributes is 100.
Sitecore CDP supports data extension attributes for guests, events and orders data models, and they have different limits:

guest data extension can have a maximum of 100 attributes (link)
event data extension can have a maximum of 50 attributes (link)
order data extension can have a maximum of 50 attributes (link)

UPDATE: I changed documentation links above to point to the new Engage library documentation because the old links no longer work.
Comment: Thank you Anna for your answer with further details on guest/order data extension. it is also accepted with Mahendra's answer.


My Minecraft world has just disappeared and it isn't in the saves folder either

Question: I've been playing on a Minecraft world (1.15.2 Java edition) for quite a while and one day I tried to open that world but just after the chunks loaded, my laptop crashed. I went back on to Minecraft and my world wasn't in the world list. I looked this up on Google and everyone said to check my saves folder. I did this but my world wasn't there. I haven't ever made a backup of the world because I didn't think a problem like this was likely. I've spent hours on this world. Can someone please help?
Comment: @pppery According to the OP, the world is no longer in the saves folder.
Answer: That happens when the chunks don't load fully and it corrupts your save due to lag and the fact that there may be large parts of the world missing, so Minecraft deletes it or your computer deletes it.


At what age was John the baptist when He was beheaded

Question: John the baptist died at what age (Matthew 14, Mark 6)? I have tried to research with no possible conclusion
Kindly assist
Comment: Welcome to BH. Please take the Tour (see below) and you will see that the site does not debate and discuss biblical topics but rather we examine the text of scripture hermeneutically. Without a specific text we cannot do that so your question may be voted for closure for being off-topic.
Comment: Not the most researched question I've ever seen, but off-topic?
Answer: According to Luke 1:26, John was conceived 6 months before Jesus, so Jesus and John were about the same age. And according to Luke 3:23, Jesus was about 30 years old after his baptism. Since presumably John was imprisoned after Jesus' baptism, that would make him about 30 or older when he was imprisoned and killed. And since he died before Jesus, he would have been younger than Jesus' age at death. Modern estimates of Jesus' age at death are from 34-42 (see Chronology of Jesus); assuming Luke's idea of his age wasn't far from that, Luke's version would have John older than about 30 and younger than 42 when he died.
Answer: TL;DR = About 31 years 6 to 8 months old.
In Luke 1 we learn that Mary Jesus' mother visited Elizabeth John's mother (and Mary's cousin) when Elizabeth was between 5 and 6 months along in her pregnancy.  Mary was also pregnant at that time and the unborn baby John "leaped" in the womb when Mary arrived.  Mary stayed 3 months and departed just before John was born.  This places John and Jesus close to 6 months apart in age with John older.
Luke 3 tells us that Jesus was "about thirty years old" when he was baptized by John.  (Side note, John was a priest, being the son of a priest, and priests entered service at age 25 [Numbers 8:24, Ezra 3:8] but the first 5 years of service are under guidance, like an apprenticeship [Numbers 4:3].  So John became a fully practicing priest at age 30.  This is likely why Jesus was not baptized by him until that time.)
John's gospel says the wedding at Cana was on "the third day" (the first day being when the Pharisees challenge John at the river and the second day being when Jesus was actually baptized).  Matthew, Mark and Luke all tell of Jesus being tempted in the wilderness after fasting for 40 days, but John does not.  This implies the time in the wilderness followed the wedding at Cana.  The next major feast mentioned that required travel to Jerusalem is Passover, in John's gospel.  On that trip to Jerusalem is when Nicodemus visits Jesus.
All this places Jesus' baptism, and therefore his approximate thirtieth birthday, a minimum of something like two months before Passover.  This means that John was 30 years 8 to 9 months old, possibly a little older, at Passover that year.
This very detailed chronology claims that the Messenger visited Zakarya in the Temple during Sukkot, placing his conception in early October and his birthday sometime in July.  Without making a judgement whether the exact date is calculated correctly in this chronology, the "whole multitude" being gathered outside the Temple (Luke 1:10) does point to John being conceived after Zakarya returned home after service in the Temple at one of the Great Feasts (Passover, Pentecost, Sukkot).
If John was conceived after Sukkot and born in mid-summer, that would indicate that he began baptizing in the river Jordan pretty much immediately after turning 30 years old and becoming a full-fledged priest.  And that Yeshua came to be baptized very quickly after turning 30 himself.  Let us make this plausible assumption in order to estimate the time of year of Jesus' baptism.  It seems to have been after Hannukah and before Purim.
Jesus was crucified on the third Passover after Jesus was baptized by John.  The Gospel of John documents three distinct Passover feasts between the baptism and crucifixion and clearly states in chapter 3 that John the Baptist had not yet been arrested after Jesus returned to Galilee from Passover, the first Passover after being baptized in the Jordan.  (John 3:23-24)
The subsequent narrative in John has Jesus traveling after this:

To the Judean countryside baptizing
Back to Galilee via Samaria
Within Galilee, at Cana and Capernaum (Luke and Matthew say he visited many villages)
(Matthew 13 specifically mentions returning to his home town Nazareth during this time, but performing no miracles there in contrast to other places)
Back to Jerusalem for "one of the feasts" (probably Purim because John's gospel tends to name all the Great Feasts in his narrative)
Back to the Sea of Galilee and the feeding of five thousand - John says Passover "was near" at that time - we can suppose perhaps two weeks away given the travel time necessary to reach Jerusalem from Bethsaida

The last we hear from John's disciples is related in Luke 7:18-23 when they were sent by John, who by this time was arrested, to ask, "Do we look for another?"  (Side note, this is not to be interpreted as doubt.  Instead, John was asking whether there was to be one or two Messiahs.  This question continues even into modern times in mainstream Judaism.)
Between this event and the feeding of five thousand, Luke does not call attention to feast days, but he does describe Jesus travelling to "one town and village after another" (Luke 8:1) in Galilee, including taking a boat across the Sea of Galilee (Luke 8:26) and back again (Luke 8:40).  This was all before he sent out the Twelve.  And the Twelve went "from village to village" (Luke 9:6).
All of this travel and activity, by Jesus with his disciples, and then with the Twelve travelling around Galilee in six pairs, must have consumed a number of months.
Matthew 11:1-2 confirms that after Jesus sent out the Twelve, John sends his disciples from prison to ask their questions.  This narrows the timeline somewhat because Jesus sent out the Twelve only after returning to Galilee when he started to openly perform many miracles.  This would be before Purim that year.  This also implies that John was arrested at approximately the same time Jesus returned to Galilee.
Matthew 14:12-15 implies that John was beheaded shortly before the feeding of five thousand.  "John's disciples came and took his body and buried it. Then they went and told Jesus."  Jesus withdraws to be alone in response to the news, but the crowds follow, and the feeding of five thousand is a direct result.
Back to Luke now.  Luke 9 describes the feeding of five thousand occurring at Bethsaida but does not mention news of John's execution reaching Jesus.  Luke says this was just after Jesus had sent out the Twelve and they had returned.  This phase of the ministry generated a lot of discussion in Galilee, prompting Herod to ask, "I beheaded John, so who is this I keep hearing about?" (Luke 9:9)
All of this together allows us to arrive at a fairly narrow estimate of when John was executed.  Combine with the gospel narratives the report of Josephus that John was imprisoned, and therefore presumably executed, at Machaerus which is on the east shore of the Dead Sea.

Jesus had at least enough time to reach Jerusalem for Passover, several days' journey, after the feeding of five thousand.  But Passover "was near" then.  Purim would have already passed.
The feeding of five thousand is prompted by the arrival of news of John's execution at Machaerus.  John's disciples first buried the body.  This implies not only that some of John's disciples were visiting him at Machaerus, so that they could take possession of the body and bury it quickly, but also that those disciples then traveled from Machaerus up to Bethsaida to deliver the news (presumably having to search a bit after Jesus).  Again, several days' journey, but presumably with no unnecessary delays after the execution itself.
The order to execute John could have been relayed relatively quickly but the head was brought back and delivered into Salome's possession (perhaps by a courier on horseback) in time for Herod to be perplexed upon hearing of miracles being performed in his kingdom.  This would again be several days after the execution.

All considered, we might tentatively guess that John was beheaded roughly three weeks before Passover, the second Passover after baptizing Jesus in the Jordan.  This guess seems to be consistent with the gospel narratives and Josephus, and considerations of travel time for the events to have happened as reported.
This would make John about 31 years 6 to 8 months old at the time of his death (depending on whether there was a Be'Adar month that year).


How do I get XDG icons in Dolphin?

Question: In KDE, Dolphin does not show the XDG icons for the user directories in my home folder, e.g., Music, Downloads, Documents, etc. It shows the generic folder icon for all directories. How can I make Dolphin show the standard icons from the current icon theme?
Answer: Sadly, you cannot do this with Dolphin and Oxygen.
IIRC, Dolphin does not support showing special icons for these folders. It does support previews and tags however, but that's probably all you will get.
Comment: Thank you for the answer. If this is true, that is sad indeed. I do have a different icon theme installed as well which is supposed to contain the icons but it still does not work.
Comment: @SauravSengupta: if this answered your question, you can mark the question as answered by clicking the tick next to the answer.
Comment: Yes, I know. I was waiting to see if anyone had any more ideas. Anyway, I will mark it now. Thank you.
Answer: The KDE can use whatever picture (*.png *.xpm *.svg *.svgz) as a directory icon.
With the KDE file manager (Dolphin): Right click the icon > Properties > Left click the Icon (General tab) > Select Icon.

The setting are save to the .directory file.
KDE .directory file:
The .directory file is a KDE folder view properties file. It contains the folder viewing settings for a directory in KDE. It includes settings such as icon positions and view mode (icon, list, etc.). Automatically created when the view settings of a folder are modified. Hidden by default.

How do I get XDG icons in Dolphin?


set of integers modulo an integer q in lattice

Question: Some literature about lattices set $\mathbb{Z}_{q}$ in $[-\frac{q}{2}, \frac{q}{2})\cap \mathbb{Z}$ but not $[0,q-1]$ such as "lattice signatures without trapdoors" and "lattice based  blind signatures", I don't know the reason. Thank you for explain the reason for me if you know it.
Answer: Well, these lattice schemes need to define a 'small vector' $\epsilon$ in such a way that the multiplication of two small vector elements $\epsilon_0 \times \epsilon_1$ is still small; that is, for a random element $A$, we still have $A \approx A + \epsilon_0 \times \epsilon_1$
One way to do this is to define a 'small vector' as one whose elements all have small absolute values; if you define 'small absolute value' tightly enough, then the elements of $\epsilon_0 \times \epsilon_1$ (ignoring the modulus operation) will still probably [1] have terms with absolute values less that $q/k$ (which is 'close enough' - the original schemes had $k=4$).
Of course, you might ask "why don't they define small vectors to have elements with small nonnegative terms?".  Well, if they defined the ring over $x^n+1$ (for example), then something strange happens.  Element $i$ of $A \times B$ can be expressed as
$$A_iB_0 + A_{i-1}B_1 + … + A_0B_i - A_{n-1}B_{i+1} - A_{n-2} B{i+2} - … - A_{i+1} B_{n-1}$$
Specifically, there are $n-i$ terms which are added to the final product, and $i$ terms which are subtracted from the final product.
For small $i$, there are a large number of added terms; if $A, B$ consists of small nonnegative elements, then the result will be strongly weighted toward the positive.  For large $i$ (just a bit smaller than $n$), the result will be strongly weighted toward the negative.  Hence, the result will have a distinct slant, and that's harder to reason with.
In contrast, if with generate $A, B$ with small absolute values (with no bias between positive and negative), no such bias exists; the distribution of the elements of the result is independent of the position within the vector.

[1]: This is where the probability of decryption failure comes in; most systems don't define the error terms small enough that decryption failure can't happen
Answer: A slightly different perspective on the matter is that often a lattice $\Lambda\subseteq\mathbb{Z}^n$ is used  for its error-correction properties.
Lattices are infinite objects, but for efficiency we often assume they're periodic mod some integer (not necessarily prime, despite the choice of variable) $q$, which is known as being $q$-ary.
This gets us a finite size representation of the lattice, but it's know that any lattice is $\det(\Lambda)^2$-ary, so such a representation always exists (although generally $q$-ary lattices assume $q$ to be smaller than $\det(\Lambda)^2$).
The condition of being $q$-ary can be algebraically stated as $q\mathbb{Z}^n\subseteq\Lambda$.
We can consider the operation $\Lambda\bmod q\mathbb{Z}^n$, which has codomain $[-q/2,\dots q/2]^n\cap \mathbb{Z}^n$ (and for the lattice $q\mathbb{Z}^n$, corresponds to reducing each coordinate of $\Lambda$ mod $q$ independently).
This is a geometric answer for why $[-q/2,\dots, q/2]$ is used rather than $[0, q-1]$.
While they can both be seen as ways to represent $\mathbb{Z}/q\mathbb{Z}$ within $\mathbb{Z}$, the former is the fundamental Voronoi cell of the lattice $q\mathbb{Z}^n$ (alternatively, the set of elements closer to $0$ than any other point in $q\mathbb{Z}^n$).


Storing Lua function for later use in C++

Question: I am using lua-intf to integrate lua into my project. I want to setup a lua function that takes in a function as an argument and that then gets stored in C++ and called at a later time.
This would be the lua code for example where I would store both of these functions in C++:
foo(bar)
foo(function() print("bar") end)

I have tried using LuaRef as an argument but couldn't get it to work, I have also tried setting the argument as a lua_Cfunction.
Comment: Please show a [mre] of what you've tried and what problems you encountered
Comment: Why did your attempts fail? What errors did you encounter?
Answer: Using the Lua registry is probably the easiest way. For more on the registry, see this page.
As an example, here is a C function called lua_foo that shows how to store a reference in the registry:
int lua_foo(lua_State* L) {
    // Make sure a function has been passed.
    luaL_checktype(L, 1, LUA_TFUNCTION);
    // Make sure that the function is at the top of the stack.
    lua_pushvalue(L, 1);
    // Create a reference to the function using the Lua registry.
    int ref = luaL_ref(L, LUA_REGISTRYINDEX);
    // FIXME: do something with the reference or store it for later use.
    return 0;
}

In order to store the function passed to lua_foo for later use, see luaL_ref; and, for the freeing of such a resource held by the Lua registry, see luaL_unref.
From within your C function, use luaL_ref to create a reference, which is an integer, for later use. The function, whose reference key is returned by luaL_ref, can be retrieved using lua_geti. Once retrieved, the function is pushed onto the Lua stack and can be called.
Alternatively, you can dump the function--as you would with a call to string.dump--and store the string result for later loading and use. Admittedly, this approach is a little more involved.


What does "small way" mean?

Question: I want to ask the meaning of this passage:

He was falling, landing heavily on the rocks of the creek bed. He lay there, gulping in the sweet air among the rocks. He must carry on down, even a small way. Anything to escape the suffocating darkness. He drew in more air, then picked himself up and set off a stumbling path over the broken ground.

It's a scene about a forest fire.
In that sentence, what does small way mean? Does it mean small distance or small road?
Answer: In this context, "a small way" means "a short distance".
Comment: The driveby downvoter strikes again. What's the problem here? The answer is correct.

What does “small way” mean?


Why do Woocommerce templates use hooks rather than get_template_part

Question: Why does Woocommerce use hooks rather than including template parts?
I'm in the process of creating my first Woocommerce theme, and it seems that deactivating the current hooks and then readding them to change the order of a section real overkill. To me, it makes more sense that you just include each of the template parts using get_template_part().
What am I missing / what's the benefit of doing it their way?!
Answer: I'm not familiar with Woocommerce, but in short, get_template_part() only look for template parts in parent and child themes, not in plugins.
If you look at the source code, get_template_part() uses locate_template which have the following source code (which is where the actual template part is searched for)
function locate_template($template_names, $load = false, $require_once = true ) {
    $located = '';
    foreach ( (array) $template_names as $template_name ) {
        if ( !$template_name )
            continue;
        if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
            $located = STYLESHEETPATH . '/' . $template_name;
            break;
        } elseif ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
            $located = TEMPLATEPATH . '/' . $template_name;
            break;
        }
    }

    if ( $load && '' != $located )
        load_template( $located, $require_once );

    return $located;
}

As you can see, locate_template only look for templates in parent and child themes
That is why you cannot use get_template_part() in a plugin or use it to call template parts into a theme from a plugin.
EDIT from comments from @MarkKaplun
Apart from just the general way in which get_template_part() works in retrieving template parts, Mark has also pointed out a valid point in comments about the use of Woocommerce

I would say it differently - since WC is a plugin it can not have any assumptions about which themes are using it and what parts do they have without limiting its adoption, and WC is meant to work with any theme.
Comment: I would say it differently - since WC is a plugin it can not have any assumptions about which themes are using it and what parts do they have without limiting its adoption, and WC is meant to work with any theme.
Answer: /**
 * @since 1.2.0
 *
 */
function add_action(...) {
    /* ... */
}

.
/**
 * @since 3.0.0
 *
 */
function get_template_part(...) {
    /* ... */
}

WooCommerce was launched in September 2011. However, it wasn't coded in a day, they must have started a few months earlier.
At the time, WP was just post 3.0 (huge update, btw) and nothing about updating WP, themes or plugins was working as smooth as now.
Besides, add_action() and add_filter() are the foundation behind WP concept. You can be sure they will never become obsolete. It's the way to go when you code something as large as WooCommerce.
As you probably know, WC provides a templating system.
Comment: It does not matter when `get_template_part()` was introduced, the fact still stand that it only searches themes for template parts, not plugins, which does make a lot of sense in a way. So it is unusable (*out-of-the-box at least*) in plugins, and even through the filters supplied in `get_template_part()`, I suspect that it would still be quite a messy route to go down and explore


Why database snapshot creation is faster than normal database backups?

Question: Could you tell me any reason why creation of database snapshot is faster than database normal database backups in MS SQL server
Answer: Mostly because a snapshot isn't really a backup.
As explained in How database snapshots work

The snapshot uses one or more
  sparse files. Initially, a sparse file is an essentially empty file
  that contains no user data and has not yet been allocated disk space
  for user data. As more and more pages are updated in the source
  database, the size of the file grows. When a snapshot is taken, the
  sparse file takes up little disk space.

A snapshot doesn't actually contain any data until you start making changes to the original database.  Basically any time you change a page in the database that original page gets written to the snapshot.  If you then make another change to the same page nothing needs to happen since the original already exists in the snapshot. Because of this the size of the snapshot will be from 0 to the size of the database at the time of the snapshot.
So when you restore back to the snapshot it just writes back those changed pages.
A backup (a full one at least) is a copy of the database written to a file.
When you restore from backup it writes ALL of the pages, not just changes (again assuming a full backup).
That's why creating/recovering from a snapshot is so much faster.
Here is some further reading:
Database Snapshots
Answer: Their cannot be a comparison drawn as Snapshot is "photo copy" of data file. The difference lies in amount of activity both does and consistency of product arising out of both the operations. Full backup "Is Always" more reliable than snapshot backup
Full backup includes all committed and uncommitted transaction when full backup has finished. Read more about this in Understanding SQL Server Backups full backup also includes few amount of transaction log, if required, this is not the case with snapshot backups. Backing of transaction log is required so that recovery can run successfully when backup is restored.
Read about Database snapshot
A database snapshot provides a read-only, static view of a source database as it existed at snapshot creation, minus any uncommitted transactions. Uncommitted transactions are rolled back in a newly created database snapshot because the Database Engine runs recovery after the snapshot has been created (transactions in the database are not affected).

The snapshot stores the original page, preserving the data records as
  they existed when the snapshot was created. Subsequent updates to
  records in a modified page do not affect the contents of the snapshot.
  The same process is repeated for every page that is being modified for
  the first time. In this way, the snapshot preserves the original pages
  for all data records that have ever been modified since the snapshot
  was taken.


What will happen if input is larger than required in a NFA

Question:
This is my first time in the field of TOC so I am not able to provide any self-approach while asking .In the above example what will happen if input string is "1001" or "1111"?The state q4 can be reached with the first 3 inputs only ,so what will happen after that ?
Answer: An NFA accepts a string $w$ if it has an accepting computation. An accepting computation is an expression of the form
$$
q_0 \stackrel{x_1}{\to} q_1 \stackrel{x_2}{\to} q_2 \to \cdots \to \stackrel{x_m}{\to} q_m
$$
where:

Each $x_i$ is either a single letter or $\epsilon$.
$x_1 x_2 \ldots x_m = w$.
For every $1 \leq i \leq m$, $q_i \in \delta(q_{i-1}, x_i)$.
$q_0$ is the initial state, and $q_m$ is an accepting state.

If there are no accepting computations for $w$, then the NFA doesn't accept $w$.
The string $1001$ has no accepting computation. In contrast, the string $1111$ does have an accepting computation:
$$
q_1 \stackrel1\to q_1 \stackrel1\to q_2 \stackrel1\to q_3 \stackrel1\to q_4
$$
Therefore the NFA does accept $1111$.

Another way to define the language accepted by an NFA is through the possible states function. We define $\delta(q,x)$ to be the set of possible states that the NFA is in when it reads the word $x$. You can define $\delta(q,x)$ inductively. The NFA accepts $x$ if $\delta(q_0,x)$ contains an accepting state, where $q_0$ is the initial state. For example, in the case of $1001$,

$\delta(q_1, \epsilon) = \{ q_1 \}$.
$\delta(q_1, 1) = \{ q_1, q_2 \}$.
$\delta(q_1, 10) = \{ q_1, q_3 \}$.
$\delta(q_1, 100) = \{ q_1, q_4 \}$.
$\delta(q_1, 1001) = \{ q_1, q_2 \}$.

Since neither $q_1$ nor $q_2$ are accepting states, the NFA doesn't accept $1001$. In contrast, for the word $1111$ we have:

$\delta(q_1, \epsilon) = \{ q_1 \}$.
$\delta(q_1, 1) = \{ q_1, q_2 \}$.
$\delta(q_1, 11) = \{ q_1, q_2, q_3 \}$.
$\delta(q_1, 111) = \{ q_1, q_2, q_3, q_4 \}$.
$\delta(q_1, 1111) = \{ q_1, q_2, q_3, q_4 \}$.

Since $q_4$ is an accepting state, the NFA accepts $1111$.
Comment: And if transition functions delta(q1,0)=q1 and delta(q1,1)=q1 were not there in the above machine ,then "1111" will not be accepted because there is not transition function delta(q4,1) i.e it does not have any accepting computation. right?
Comment: Right, in that case the NFA accepts the language $1(0+1)(0+1)$.


Mobile (TabS3 Samsung) apps to digital drawing: I need to draw book/ebook covers in 300dpi

Question: I want to produce ebook covers and printable covers. So, which apps can I use to draw, without any doubts, in 300dpi or higher using my tablet?
Comment: There are literally dozens (if not hundreds) of applications capable of producing 300ppi or resolution independent images. You need to do some research yourself as to what may or may not be available for your specific tablet model.
Answer: You don't need 300dpi images for print. This is a myth perpetuated by those who don't understand digital image resolution. For more detailed information read The Myth of DPI.
What you really need is an image of sufficient pixel dimensions so that when printed at 300dpi, at a specific physical size, it will be of sufficient quality. You don't need a special app to achieve this. Almost any digital painting/drawing software that allows you to set up a custom size document can be used.
Let's say you have a book cover which is 11" x 7", and this is the size of print you need.
Multiply each dimension by 300dpi. This will give you the number of pixels for each dimension. In the example case, that will be 3300px x 2100px. Then set up a new document in your favourite painting/drawing app, with those pixel dimensions.
The drawing/painting you make will now be of sufficient quality for printing at 300dpi. The actual DPI setting itself is irrelevant. You'll understand why after reading the linked article above. The DPI setting can be easily changed in almost any decent image editing software.


Continuous between participant factors

Question: for my doctorate thesis, I would like to test the effect of behavioural inhibition (continuous variable) on stress reactivity in two different groups that will be separated on their past stressful life events. So I have two independent variable of which one is categorical stress condition and other continuous behavioural inhibition. Also, I have 3 times measurement. Is General Linear Model for Repeated Measures suitable for my purpose? Adding a continuous variable in the between-subject factor not only seems weird but also how to interpret this is confusing. In short, I want to see the effect of behavioural inhibition on stress reactivity in different two groups.
Comment: Is your response variable stress reactivity continuous or categorical?
Comment: Continuous variable; I am going measure skin conductance and PANAS
Answer: Let $Y$ be the response variable stress reactivity, $X_1$ be behavioural inhibition, $X_2$ be past stressful life events with 1 indicate yes and 0 for no, $X_3$ be time of measurement. $i$ be subject ID.
The data will be like:
<code>     i      Y        X1     X2     X3
  -------------------------------------------
     1                              1
     1                              2
     1                              3
    ...   ...        ...    ...    ...
  --------------------------------------------
</code>
Maybe the linear mixed model is the best choice:
$$Y_{ij}= \beta_0 + \beta_1X_1 +\beta_2X_2 +\beta_3X_1X_2 +\gamma_i +\epsilon_{ij}$$
where $i$ is subject ID, $j$ is j-th measurement from subject i. $\gamma_i \sim N(0,\sigma_b^2)$ is random intercept for subject i, and  $\epsilon_{ij} \sim N(0,\sigma^2)$ is error term.
If necessary, $X_3$, order of measurement, can be added in to fixed effect.
The effect of behavioural inhibition on stress reactivity in group without past stressful life events ($X_2=0$) is $\beta_1$. The effect of behavioural inhibition on stress reactivity in group with past stressful life events ($X_2=1$) is $\beta_1 + \beta_3$.
When you fit the data, need to check if the data meet the assumptions. It is possible some kind of data transformation is needed.
Comment: Dear user158565, is there any simple way to calculate sample size for a medium effect size in the linear mixed model. In my study 2 group (high and low stress) and behavioural inhibition and activation are the predictor variables and I have 3 affective and 3 cognitive; total 6 outcome variables. How many subjects do I need approximately to detect medium effect size? Thank you in advence for your help.
Comment: Dear user158565, thanks so much for your response and interest. It is now more clear in my mind. In my research, there is also another continuous independent variable other than behavioural inhibition that is behavioural activation. It was assumed that behavioural activation would alleviate the effects of stress. Is it possible to include behavioural activation in the same model with behavioural inhibition and to handle it as moderator variable?
Comment: Of course, you can add other covariates into the model.

Continuous between participant factors


Electric field due to a short dipole at a point $A$ on the axis

Question:
There is a short dipole $ X,Y$ of charge $+q$ and $-q$ placed along the x-axis and then we consider the point at $A$ which is far away from the dipole and lies on the x-axis. The electric field $E_\text{net}$ experienced at that point will be $E_\text{net}=E_\text{XA}+E_\text{YA}$ where the $E_{ij}$ are vectors. The dipole charges also interact with each other. Why are we only considering the interaction between the dipole and the unit postive test charge at the point $A$?
Would it be the same if we did the following? Keep a positive charge $+q$ at the origin and another positive charge at a distance far away on the x-axis. After that, introduce a negative charge $-q$ near to the origin. Will this result in the same configuration (in terms of electric fields) as in the previous case?
Answer:
If you want to know the electric field strength at point A due to the point charges at X and Y, you do not need to know the strength of the electric force between the charges X and Y because this interaction does not affect the strength of the interaction which each of X and Y have at A. The charge at X exerts the same force on A regardless of where Y is placed. It is not weakened by interacting with the charge at Y.

Electric field is not like the flow of water from a tap. Assuming the tap cannot be opened further to increase the flow (litres per second), if more water flows from X to Y then there is less available to flow from X to A. If you remove the connection to Y then all of the water can flow to A, making this flow "stronger" (more litres per second).

Yes the force on A would be exactly the same if the charges at X, Y and A are put into position in the order X, A then Y or A, Y then X, etc. The electric field does not have a memory of what happened previously. It only depends on the final configuration.

Both observations are summarised by the Principle of Superposition which applies in all linear systems. This says that the effect of a combination of 2 things X and Y is the sum of the effect of each of X and Y acting separately, as though the other were not there at all. Their effect on other objects is not changed at all by their effect on each other.


VMWare : How to Trace the Running Process Instructions at Guest OS?

Question: If we assume we have only the binary, we can use windbg to drop into assembly and see what's going on. Since windows guests run in fully emulated mode, it should be straightforward to trace in the guest.
If we want to trace what is happening in the virtualization layer, i.e.  hypervisor, it will be a bit difficult. It depends on what kind of machine we are running on. These days all machines are 64 bit with VMX enabled which allow the hypervisor to intercept guest instructions on the fly, since processor virtualization is implemented in hardware.
Since it is just a trap by which the guest drops into hypervisor it is almost impossible to tell when the guest has entered the hypervisor and when its back. However we probably will not achieve much by tracing any code in the hypervisor.
In a VMX enabled machine only page table write changes and IOPL changes will go to hypervisor. Everything else is handled in the guest itself.
For all practical application debugging windbg should be fine.

Can we Trace the running Process(.exe) & its Instructions at guest OS using WinDbg??

Please help on this...
Im really appreciating your time on this ..
Thank you .. :)
Answer: I'm not entirely sure what you're asking, but if you're asking if you can run windbg on a virtualized machine, then yes, it works just like it does on a physical machine.
If you want to attach to the process that is running the virtual machine itself, but look at a process that is inside of the guest os, then the answer is no.