Logic gate counter on 7 segment display

Question: Using logic gates with general purpose transistors, I want to display numbers on a 7-segment display depending on the 2 pushbutton input. If both buttons are not pressed, I want it to say 0. If 1 is pressed, I want it to say 1, if the other one is pressed, I want it to say 2, and if both are pressed, I want it to say 3. I know how to do this with separate LEDs, ( 4 Different  LEDS are lit depending on the switches inputs) ,but I am having troubles figuring this out for a 7-segment display because of the overlapping digits on. I may have done a terrible job explaining this, but any info is helpful.
Comment: is this homwork?
Comment: Just write down a truth table... and we could help you understand if and where you're going wrong.
Answer: I'm not sure I can agree with Dean's answer; you can't answer the question "how can I make a BCD-to-7-segment decoder?" with "use a BCD-to-7-segment decoder". His truth table a good start, however. Cut away the bottom part so that you retain a table for the digits 0 to 3:

This shouldn't be too hard. What do we see?

First thing we notice is that segment \$b\$ is always on, so that's not a decoded output.
The codes for column \$g\$ are the same as the \$B\$ column.
Columns \$a\$ and \$d\$ are identical.
Columns \$a\$, \$c\$ and \$d\$ have one 0 and three 1s. That's what the truth table of an OR-gate has. Check which of the inputs you have to invert to make those outputs an OR-function of the (inverted) inputs.
Similar for column \$f\$: it has one 1 and three zeros, which an AND-gate  will give you. How do you have to change the inputs to use an AND-gate here?
Columns \$e\$ can be created from just one input. Which one?

If you can't see the relationships right away, then add two intermediate results, which you derive from the inputs: that's \$A\$ and \$B\$ inverted.
Your function table could look like this:

\$ a = \overline{A} + B \$
  \$ b = 1 \$
  \$ c = A + \overline{B} \$
  \$ d = \overline{A} + B \$
  \$ e = \overline{A} \$
  \$ f = \overline{A} \cdot \overline{B} \$
  \$ g = B \$

If you think I've done all the work for you, think again. The real work starts now: create a circuit from this using as few gates as possible.
Comment: stevenvh, fair enough.  I took the question to be asking for a BCD-to-7 segment decoder without knowing that such a device had a name or existed as a standalone IC.  Your answer does a much better job of answering the exact question asked.
Answer: I'd do this in 2 steps.  First make a circuit that has 4 outputs that correspond to your 0-3 codes.  You can test this by hooking common LEDs to the outputs.  I believe this is a common decoder circuit.
The second step is to connect the transistors to the LED segments. Place a transistor on each segment.  Put power on the collector appropriate for the type of LED.  Connect the emitter to a specific segment. The base should be connected to your decoder's outputs.
Say you have an 7-seg LED with segments numbered from 0 to 7. You decide segments 1 and 2 need to be lit for decoder output #0.  Connect #0 to the bases of the transistors responsible for segments 1 and 2.  Repeat for the other 3 outputs.  Where you have different outputs sharing a transistor base, you may need diodes to prevent current from flowing 'backwards' and lighting up segments unexpectedly.
Comment: said differently... the diodes joining to a given net collectively implement an "OR" function on the incoming nets (sort of) in TTL logic... if your decoder stage has 'open collector' outputs, and you use a weak pull-up resistor, you can skip the diodes and you end up with a 'wired-OR' configuration.
Answer: This can be done with a single BCD decoder IC like the 4511.  Connect one pushbutton to input A, and the other pushbutton to input B.  Leave C and D disconnected.  Reference the the sample circuit below.
Since this is likely homework, however, I'm guessing that you need to do it with discrete logic gates and transistors.  I'd start with the following truth table and design your gates from there.  I'm sure you can figure out how to drive the transistors so as to sink current out of a common anode display.
Answer: The design depends on your goal;

To learn logic design with Boolean Algebra perhaps with Karnaugh mapping to reduce the solution to simple logic equations... such as stevenh's good explanation
To implement the design with the fewest parts... such as Dean's solution or a CPLD with stevenh's
implement the design with easiest way ... depends on your desire to learn new skills, but Boolean Algebra is a must with de Morgan's Law and perhaps Karnaugh mapping are things you should know. It just looks hard at first, but then it becomes really easy to implement any complex requirement of logic once you learn these methods.  Firmware solutions with 1$ PICs become valuable tools for any logic as are CPLD chips. There is always a learning curve on new skills.
implement the design in the cheapest way for mass production, depends on your budget for time and parts, experience, creativity, tools
just finish an assignment.. nuf said.

The best answer depends on a well phrased question.

Logic gate counter on 7 segment display


Accessing "diff only" ZFS snapshot

Question: Is there a way to mount a virtual partition containing only the files specific to a snapshot? I know about the hidden zfs directory but it contains all files at the snapshot time.
My goal is to make diff backup faster...
Thanks in advance
greg
Answer: Although Andrew's suggestion of zfs send is the right way to work with differential snapshots, if you just want to see the differences and work with them in your own scripts or on other platforms without ZFS support, there also is zfs diff:
zfs diff [-FHt] snapshot snapshot|filesystem

Display the difference between a snapshot of a given filesystem
and another snapshot of that filesystem from a later time or
the current contents of the filesystem.  The first column is a
character indicating the type of change, the other columns
indicate pathname, new pathname (in case of rename), change in
link count, and optionally file type and/or change time.

The types of change are:
  -       The path has been removed
  +       The path has been created
  M       The path has been modified
  R       The path has been renamed

-F
    Display an indication of the type of file, in a manner
    similar to the -F option of ls(1).
      B       Block device
      C       Character device
      /       Directory
      >       Door
      |       Named pipe
      @       Symbolic link
      P       Event port
      =       Socket
      F       Regular file
-H
    Give more parsable tab-separated output, without header
    lines and without arrows.
-t
    Display the path's inode change time as the first column of
    output.

Note that the order of the two datasets must be chronological. You could parse the resulting list and only work with those filenames you are interested in.
Example output from the man page:
# zfs diff -F tank/test@before tank/test
M       /       /tank/test/
M       F       /tank/test/linked      (+1)
R       F       /tank/test/oldname -> /tank/test/newname
-       F       /tank/test/deleted
+       F       /tank/test/created
M       F       /tank/test/modified

Also, if you use Oracle Solaris 11.3, you also have the -r switch to recursively diff all children datasets.
Comment: Yes, I would suggest you use the `-H` option and then `awk` or `grep`. Example: `zfs diff fs@oldsnap fs@newsnap | awk '/^(R|M|\+).*/{print $2}'` gives you all changed files (except deleted ones).
Comment: Hum interesting... then I could feed that to rsync, couln't I?
Answer: There is no way to access differential data directly via "normal" file access, and there's no way to apply the data obtained from one even if you could get it.  How could you read just the differences from a file if only a block or two changed?  And if you could read just the differences, how would you know how to apply just the changed data to the file that changed?  If you're trying to speed up differential backups, that's a "patch" style of update that is likely to be extremely slow.
Simple, "normal" file access does not provide the information needed to do a differences-only backup.
To do a differential backup of ZFS, use an incremental zfs send ... command:
zfs send -i pool@snap1 pool@snap2 ...

That's what it's meant for, and there's really no way to do it faster, since the ZFS filesystem is designed from the ground up to know the differences.
Comment: Thanks for your answer. My idea was that zfs actually knows which files have changed, whereas scanning for changes can take several hours (even days).
Does the zfs send command creates a target with only the modified files?
Comment: Maybe I forgot to mention that my target backup host is not a zfs system, I use rclone to a regular filesystem.
Comment: ZFS does in fact "know" what the differences are, so the incremental `zfs send ...` command will send only the difference between the two snapshots.  The problem you're going to have is the only way to access the data in it is to use it as the input of a `zfs recv ...` command.  You can store the output from `zfs send ...` as a regular file and use it to restore if you need to, but you won't be able to access the data without doing that.

Accessing "diff only" ZFS snapshot


What's the purpose of a second dimension when we say that time is two-dimensional?

Question: What's the purpose of a second dimension when we say that time is two-dimensional? The first dimension refers to the passage of time along the x axis (past and future), but I am wondering what the y axis is for when we postulate that time has two-dimensions. What are some of the philosophical claims made about the possible 2nd dimension in time?
Comment: The wiki article [Imaginary Time](https://en.wikipedia.org/wiki/Imaginary_time) provides some useful background.
Comment: It depends on where "we" say it, if you encountered it somewhere in particular adding the reference would help. Wikipedia has a survey of [Multiple time dimensions](https://en.wikipedia.org/wiki/Multiple_time_dimensions).
Answer: As I see it, this is a physics question.
You might like this video which gives an introduction to two dimensions of time.
Key to thinking about dimensions, is to understand their relation to continuous symmetries, by Noether's theorem. The string model of 10 spatial dimensions & 1 of time has been elaborated here, which can help in an accessible way to picture the role of extra dimensions.
I follow the ideas of Rovelli & others that all dimensions are emergent, from something like a spin network. I would link the holographic principle and associated conservation of information, to understanding us as being on a 4D surface in 5D, with a fractional fractal dimension, as the surface expands in a regular way through quantum uncertainty (into Many Worlds). This can account for the arrow of time as an emergent directional symmetry.
Time is different from space in having a directional symmetry. An additional time dimension would have to also have such an assymetry, directionality, to make events in relation to it irreversible.
Answer: More information is needed here to determine what it is you wish.
To begin with, who asserts that time is two-dimensional? To a physicist, two-dimensional time represents a mathematical formalism that is useful for transforming certain physical phenomena between mathematical regimes, to make their interpretation more clear. On the other hand, to a philosopher, two-dimensional time means anything (s)he wants it to mean.
Having two dimensions of time in the physical realm would mean that in addition to being able to go forward and backward in time, you could also move sideways in time, a concept which would abolish causality as follows: from one's current position in space and time, one could move sideways in time onto a new world line, then forward or backward, and then sideways again to join up again with one's original world line, without having to experience the passage of that "missing block" of time on one's own world line.
This means that one's sudden appearance on a new world line would occur with no history on that world line, and one's disappearance from it would then result in no future on it either. Occupants of those other universes containing those alternate world lines would also be able to pop into and out of our universe as well.
In short, sideways time allows movement into and out of every possible world line in every possible universe, and in so doing it would provide philosophers with a new sandbox in which to entertain themselves.
One hopes that some means would exist for keeping cats out of that sandbox...
Answer: Think of the puzzle of musical emotion. What does musical notation look like? Among other things, points on a graph. Emotions are like temporal kinesthesia modulo our transit in 2d-time, which is why pure instrumental music can evoke feelings without semantic content expressing emotional events. Music "looks like" those feelings.
More classically, when theologians differentiate between sempiternity and eternity, they are subconsciously tracking the nature of dimensional perception whereby the eternal can see all the points on a given timeline at once, like how 3d-spatial perception allows all the 2d sides of a polygon to be seen at once.
In a Kantian vein, higher-dimensional time is "where" free will operates, free will being the principle of synthesis there just as causality is the principle of synthesis for linear succession. In an Arendtian vein, it is this dimensionality of the will that allows us to break moral timelines using the faculty of forgiveness, and to forge them by the faculty of promising.
Comment: None of that makes sense.
Comment: Iirc one of the Blackwell pop-culture-and-philosophy books included an argument/description of music much like the one I offered above, minus an explicit appeal to higher-dimensional time. The idea of an "eternal now" and the LDS doctrine of eternity support that understanding of the eternity/sempiternity distinction. As for the rest, eh, who knows?


Using first person pronouns in a statement of purpose

Question: I am writing a statement of purpose for Ph.D. applications in the US and Europe. In doing so, I have come across the idea that I should not use first-person pronouns in formal writing. Does this apply to statements of purpose? How do I describe my academic/research/other experiences in the statement then?
Answer: It's perfectly normal to use first person pronouns in your statement of purpose. I've never heard of anyone deliberately avoiding them, and frankly I'd imagine it would be pretty bizarre to read!
The statement of purpose is not exactly "formal writing", like an academic paper would be. It's not informal either, it should be written fluently and professionally, but this type of personal essay is perhaps is closer to formal speech (or maybe a formal email) than it is to academic writing.
I suspect your source was talking about using a passive voice and not an active voice (e.g. "X was increased" vs "I increased X). That was standard practice in academic papers and scientific reports in the 20th century. It's sometimes seen as old fashioned now, as the active voice is gradually becoming more common, but both styles have their advocates in academic publications.
In any case, that debate certainly doesn't apply to a personal essay. Use first person pronouns normally in your SOP.
Comment: Ah, the dreaded *the applicant has great interest in further pursuing X*. I would 10/10 read it, but preferably as satire, not an ordinary SOP...
Answer: This is more general advice than you ask for, but yes, use the first person as the answer of Gumbercules suggests.
However, you may have the wrong idea about SoP in general. It isn't a document praising yourself for past accomplishments or a recapitulation of your CV. It is a forward looking document giving your plans for the future, both in studies and beyond. It isn't at all about what you have done, but, instead, what you plan to do and how you want to go about it.
So, don't describe your "experiences" there. That is for the CV. And, don't use the SoP to try to explain any past failings.
If you have a subfield in mind or even a research direction you are interested in, put it in the SoP. If you are pointing toward a career in academia, say that. You don't need a formal research plan or topic for most such things though some specificity is helpful, especially if you hold a masters already.
The CV details the past. The SoP looks entirely forward.
Comment: I understand. I just have a section contextualizing some past research experience (which is mentioned on the CV) and how that has helped me figure out what I want to do and what I learned from it (which is not on the CV). I'm only including that because at least some of the universities I'm applying to ask for this to be mentioned in their 'About the SoP' on the application webpage.


Lord Krishna and Balarama

Question: How did Lord Krishna teach Balarama [his own brother] to get rid of his Ego? What was the plan he made that Balarama turned good after that incident?
Comment: This conversation has been [moved to chat](http://chat.stackexchange.com/rooms/45755/discussion-on-question-by-parthasarathy-raghavan-lord-krishna-and-balarama).
Answer: Lord Balarama is Lord Vishnu just like Lord Krishna is Lord Vishnu also. They both are the Supreme Lord who appeared in two forms as two brothers, Krishna and Balarama.
And what they did is something called "pastimes of the Lord", ie lila. And we should understand that when the Lord performs his pastimes or lilas, He is just like a player or like an actor playing in a theatrical drama. There are verses in the scriptures that say about the Lord like that, such as Bhagavatam 1.8.19, and such as this one from the Bhagavatam 1.3.37:
http://www.vedabase.com/en/sb/1/3/37

"The foolish with a poor fund of knowledge cannot know the
  transcendental nature of the forms, names and activities of the Lord,
  who is playing like an actor in a drama. Nor can they express such
  things, neither in their speculations nor in their words."

So when the Lord behaves to appear like he has an ego, or something else that looks like he is an ordinary human, we should understand that this is just to appear to be as such, just like when an actor is playing in a theatrical drama. Even in such circumstances the Lord is situated in his transcendental position that is above ordinary mundane affairs. And in reality He is not influenced by the ego, deluded mind, improper behavior, etc.
The same point as with the Lord who is playing like an actor in a theatrical drama we can see in the application of the word lila (līlayā) as referring to the pastimes of the Lord which he performs in his various incarnations (avataras) is explicitly mentioned in the Bhagavatam 1.1.17:
https://www.vedabase.com/en/sb/1/1/17

tasya karmāṇy udārāṇi
    parigītāni sūribhiḥ
  brūhi naḥ śraddadhānānāṁ
līlayā dadhataḥ kalāḥ
tasya — His; karmāṇi — transcendental acts; udārāṇi — magnanimous;
  parigītāni — broadcast; sūribhiḥ — by the great souls; brūhi — please
  speak; naḥ — unto us; śraddadhānānām — ready to receive with respect;
  līlayā — pastimes; dadhataḥ — advented; kalāḥ — incarnations.
"His transcendental acts are magnificent and gracious, and great
  learned sages like Nārada sing of them (parigītāni). Please, therefore, speak to
  us, who are eager to hear, about the adventures (or pastimes, ie
  līlayā) He performs in His various incarnations."

The word līlā is explained in the Monier Williams Sanskrit-English Dictionary:

līlā
  play , sport , diversion , amusement , pastime , mere sport or play

Thus, pastime or a lila is an activity that someone does regularly for his enjoyment or amusement, for his fun. Just like an actor who is playing in a theatrical drama for amusement, the same point is seen in the application of the word līlā (līlayā).
It would be wrong to assume that an actor who is playing on the stage in a theater for amusement is some poor or miserable soul under the negative influences that he has to play.
Lord Balarama is certainly not an ordinary living being, ie a jiva soul (jivatma), but is the Supreme Lord or Supreme Soul (paramatma), and thus He is that what Upanishads call Brahman or the Absolute. Thus we should understand his position according to the teaching of Vedanta as an entity which is not under the influence of ignorance, improper behavior, deluded mind and other negative influences such as sins, injustice, etc. And if some story describes him as if he was under such negative influences we should understand that to be just a lila (pastime) of the Lord.
People who do not understand that are lacking in proper understanding of the philosophy of Vedanta. They are advised to learn Vedanta first, to be able to properly understand those things, and then they will be not confused to understand properly the position of Lord Vishnu, or in this particular case Lord Balarama. We can see that those people who do not know Vedanta properly are often confused and misunderstand stories that are told in the Puranas and Itihasas. My favorite system of Vedanta is that one of the Gaudiya Vaishnavas.
Comment: @KeshavSrinivasan No, I don't. But why are you asking me this, you should ask that an asker of the question. However I tried to provide an answer that would satisfy any specific circumstance involved the possible affairs the Lord is participating in.
Comment: Even if it was just Lila (which I agree it would be), do you know what story is being referred to in the question?
Comment: @brahma jijnasa - here is the link. http://www.srimatham.com/uploads/5/5/4/9/5549439/prapanna_parijata.pdf
Comment: @@Keshav - Just FYI. Balaraama was an avesa avatara of Sriman Narayana with the sakti of Adisesh. Please refer to the link http://docslide.net/documents/qa-velkudi-krishnan.html, question no :394
Comment: @KeshavSrinivasan - Please refer to the following link Check this link for more information on AvESha: http://www.srimatham.con/uploads/5/5/4/9/5549439/prapanna_parijata.pdf. AvESha avatAra is described in page 25 of this PDF with quotes from the agamas.
Comment: @Krishna Your link to the prapanna_parijata.pdf doesn't work!
Answer: Balarama thought within himself that nobody can win him. Krishna sent Balarama to invite Hanuman. When Balarama said I am Balarama here  krishna sent me to invite you. Hanuman asked tell once more who are you--Balarama said Iam balarama. Hanuman slapped on his face and told are you powerful than my Rama? Bala is strength in Tamil. In a fury Balarama went and told Krishna and came with many soldiers. All the soldiers were killed by Hanuman. Again Balarama went to krishna and told the incidents. Krishna at pne saod hope by this time your ego was get rid off--hanuman is mightier then you.
Source  Kodayin paadhai  by Mukkur Lakshmi Narasimhachar
Answer: Balarama is a Jivatma but he did not live in samsara world. In Sri Sampradaya, he is a nitya Suri along with Garuda, Vishvaksena "the commander in Chief of Lord's Army".Also there are 500 fairies in Vaikuntha to decorate new jivamas who attain moksha with royal attire. Balarama or Sesa is Vishnu Tattva.

Lord Krishna and Balarama


Wiring a fan and recessed lighting to a double switch

Question: I currently have a single switch operating a ceiling fan. I'd like to add some recessed lighting to the room. Can I replace the single switch with a double switch to operate the ceiling fan and (4) recessed lights? Or, do I need to install a second switch and run all the wiring?
Comment: You won't be able to accomplish that without additional wiring, if that's the question.
Comment: Be careful of using recessed (or any kind) of lighting above a fan, even near it... Unless it's indirect lighting you won't like the moving shadows.
Answer: Possibly.  They do make gadgets designed to control a ceiling fan + light separately, using wiring meant for a light only (which is your case even though it's a fan only). They include a control module which goes behind the fan shroud, and an intelligent light switch.  The module doesn't care if the fan and light are separate items.
They also make lights designed to depart a ceiling box underneath a fan shroud.
By the way, that setup is currently not code.  Code requires every habitable room have a switch at one entry which works a light.   If it switches an overhead light, the light must work and not be only a fan.   The rule is designed to benefit house guests and first responders.
Speaking of that, not all ceiling boxes are rated to support ceiling fans.  There's a big difference both in weight and vibration.  So while you're up there, make sure your box is in fact labeled for a ceiling fan.  It will say right on it.


question on how to use sql server integrated service

Question: I have a table called book with, the attrbutes are booked_id, yearmon, and day_01....day_31. Now i need to unpivot the table and transform day_01...day_31 into rows, I have successed in doing that, but the problem is that my yearmon is a format of 200805 and i need to append a day to it based on day_01 or day_02 etc, so that i can create a new column with date information for example, if it is day_01, it looks like 20080501. Instead of writing huge query, does anyone how to use ssis to tranform it
Answer: You should be able to use the Unpivot component and the Derived Column component to do what you need. Look into those and post back if they don't seem to do what you need.


How display previous transcripts history(Live Agent) to a custom field

Question: We have a requirement to show previous transcripts history(from Live Agent) in a custom field .How I can achieve this.Or is there any other alternative to show transcript history in the object record.?
Answer: I've made trigger on LiveAgentTranscript object for that, no idea if there's a better way and if you're OK with having to code a bit yourself... I find Agent's documentation pretty scarce.
My rough flow goes like this:

Visitor fills in the prechat window with some basic stuff (First Name, Last Name, Email, optionally Case Number if it's "I'm contacting you with regards to Case X")
I'm trying to find that Case / raise new one and find / create new Contact.
Chat session with the CaseNumber__c field mapped with that Case's number is eventually accepted.
Chat finishes, transcript gets saved. My trigger fires.

trigger workaround on LiveChatTranscript (after insert) {

    Set<String> caseNumbers = new Set<String>();
    for(LiveChatTranscript lct : trigger.new){
        caseNumbers.add(lct.CaseNumber__c);
    }
    caseNumbers.remove(null);

    if(!caseNumbers.isEmpty()){
        Map<String, Case> cases = new Map<String, Case>();
        for(Case c : [SELECT Id, CaseNumber FROM Case WHERE CaseNumber IN :caseNumbers]){
            cases.put(c.CaseNumber, c);
        }

        List<Case> casesToUpdate = new List<Case>();
        List<CaseComment> comments = new List<CaseComment>();

        for(LiveChatTranscript lct : trigger.new){
            Case c = cases.get(lct.CaseNumber__c);
            if(c!= null){
                c.Live_Chat_Transcript__c = lct.Id;    // Fill in the lookup
                comments.add(new CaseComment(          // Add the transcript
                    ParentId = c.Id,
                    CommentBody = lct.Body.abbreviate(3500)
                ));
            }
        }
        if(!casesToUpdate.isEmpty()){
            Database.update(casesToUpdate, false);
            Database.insert(comments, false);
        }
    }
}

There might be better ways, I admit I've just force hacked my way through the Live Agent and it's just a prototype code...
For example you could save the Case Id directly on the Transcript so you don't have to query. I've tried to do that but found out that the Id then displays in the agent's window which looks bit rubbish; Case Number is more human-readable even if agent can't click it (I've opened the Case for him in one of the subtabs when he accepted the chat so whatever).
Comment is abbreviated to 3500 chars because even though the field's limit is 4000 I've been running into some problems there (UTF encoding probably? multi-byte characters?).
It's also a simple, butt-ugly dump of the HTML, you'll have to spend some time parsing it or try how it looks when dumped to RTF field...
Comment: As you explained ,I'm also working on the same scenario is 'trying to find that Case / raise new one and find / create new Contact' ...If you could provide 'Code' for this approach,getting stuff from visitor from prechat fields are First Name, Last Name, Email, Case Number..It would be great helpful for me.
Comment: Can you [search a bit around](http://salesforce.stackexchange.com/search?q=live+agent+pre+chat) (for example check http://salesforce.stackexchange.com/questions/23129/live-agent-pre-chat) and post this as separate question if you're still stuck? I'm even less sure whether I did that bit "the right way", there was lots of trial & error involved. It's likely somebody will see it and post a better answer or explain what misconceptions I had ;)
Comment: Peter Knolle wrote a great article on building a pre-chat form here: http://peterknolle.com/live-agent-pre-chat-api/

@eyescream - to answer your particular issue with the CaseId showing to the agent, Peter doesn't list it in his article, but you can use liveagent.prechat.findorcreate.displayToAgent in a similar fashion to saveToTranscript to hide the value from the agent.
Comment: Hi eyescream,I followed the code which you have suggested.But here I've some doubts,Is this field 'CaseNumber__c' has to create manually on 'Transcipts' objects ?
Comment: Yes, you'd have to create a custom fields and make sure it's populated it in the prechat mapping logic (either in the input fields or in the javascript function calls).


How to texture a beveled curve without stretching

Question: I would like to texture my trees without converting them to a mesh. I use the use UV for mapping option in the curve menu, but it is dependant on the distance between two "path points". How can I get a nice mapping without such stretching/squeezing :
Answer: The curve has same amount of edge loops between control points in the U direction of the curve (the setting you can set in the shape panel). UV space maps linearly to this, and changing this functionality would be hard if not impossible. Usually it's the desired functionality, preventing the textures sliding around if the curve is animated among other things.
You can however work around it by using two curves, one of which is just a straight line and holds the materials, textures, and resolution and bevel settings used for rendering. This curve then uses a curve modifier to copy the shape from another curve, which is used for just defining the shape of the final object. That way the rendered curve has uniform distribution of edge loops.
Comment: Thanks a lot, works perfect :) However, the workaround is not easy to use. Each Branch of the tree has too get it's own duo of curve : the "shape and texture" curve and the deformation curve. Is there a way to have only one "shape and texture curve" that would be automatically "arrayed" to fit the length of the deformation curve ?


In Photoshop, what is the difference between "Save As" and "Save for Web" for a .png?

Question: I've been wondering about the settings used for "Save As (.png)" option available in Photoshop. Does it save the highest quality, largest size as a default setting and how does it differ from PNG-24 and PNG-8 in "Save for Web"? Let me know if I can be more detailed in my question.
Answer: Save for Web removes all proprietary data from the file resulting in smaller file sizes. Simply saving as PNG will include hidden proprietary data, like meta data for the creation app, app version, time created, etc.
Save for web should always result in smaller file sizes.
Answer: Not really. Save for web let's you save multiple files at once. Let's say you have a web page. You can slice it and choose a different format and settings for each slice. Also you can see a comparison between jpg, gif, png and decide what format gives good quality and small file size for this slice. Sometimes size is drastically different while quality is almost the same. I always save with Save for web, because I see a preview.
Answer: .png images are mainly used to save images with transparent backgrounds. ex-logos.
Save for web advantage - We can choose lower file size without much quality difference from the original. The difference in quality can be viewed in the preview. It is good for websites, as lower file size takes less time to load. Png -8 has less size and low resolution, on the other hand png-24 has more size with high resolution. But these two formats are of less size than normal png file.
Hope it helps.


Are capacitors and inductors capable of absorbing positive power?

Question: A resistor is capable of absorbing positive power.
Why wouldn't this be true for capacitors and inductors?
Comment: As Shamtam says. It is true by basic definition of the component. One way to look at it is that energy  is the time summation of the vector product of voltage and current. In an ideal inductor or capacitor BY DEFINITION current and voltage are at exactly 90 degrees to each other so their vector product over time is zero. In real world components there are no ideal resistance component - this is the part that behaves "non ideally" as an L or C and ideally as a resistor :-).
Answer: An ideal resistor dissipates (converts into heat) electrical power. They are not capable of delivering power. Capacitors and inductors both are capable of absorbing and delivering (positive) power. When power is absorbed by an ideal capacitor, all of it is stored in the form of an electric field. Likewise, all of the power absorbed by an ideal inductor is stored in the form of a magnetic field. These devices can deliver this stored energy, but cannot produce energy.
Real capacitors and inductors, however, are not ideal, and will dissipate some power due to imperfections within the device (leakage within a capacitor, for example). This is why in simulations, capacitors and inductors will sometimes have very complex models to attempt to simulate real-world behavior (such as a leakage within a capacitor, which can be modeled simply with a high-resistance resistor in parallel with the capacitor).
Answer: In DC analysis:

Capacitor acts as an open-circuit (I=0 Amperes)
Inductor acts as a short-circuit (V=0 Volts)

If \$Power = Current \cdot Voltage\$,
therefore:

Power in capacitor is \$0 \cdot Voltage = 0 \; Watts\$
Power in inductor is  \$0 \cdot Current = 0 \; Watts\$
Comment: What about AC?!
Answer: By convention,Positive Power is the on that flows from source to load.Negative Power is the one that flows from load to source.
Yes,Capacitors and Inductors absorb positive power and store it in the electrostatic and magnetic field respectively.But as soon as power source is disconnected they release back the absorbed power to the circuit.In case there is no circuit available to provide path for power flow to source the energy remains trapped and this is how a capacitor retains charge.For inductor,the energy stored compenstaes(opposes) the change in current when source is disconnected.
In an ideal capacitor or Inductor Ohmic losses are zero.Thus power absorbed =power released and there is no net power dissipation.


Tiagra Rear Derailleur Compatibility

Question: I've just purchased a 2014 Wahoo Kickr with an 11-speed Shimano cassette on it and I'm having a bit of difficulty getting it to work properly with a Tiagra 10-speed rear-derailleur. Is this because the parts are incompatible? I'm still trying to get a sense of what are the finer details of cycling, so my apologies if I've neglected important or useful information. I will add it if so.
Answer:
Is this because the parts are incompatible?

Yes. As groupsets with greater number of sprockets in the cassette were developed, the sprockets were spaced closer together to fit them in the space available. 11 speed road cassettes are slightly wider than 10 speed but the sprockets are still closer.
The chains for 8, 9, 10 and 11 speed groupsets are also not interchangeable. The chains get progressively narrower to work with the closer sprocket spacing.
What you'll need to do is mount a 10 speed cassette on the trainer. A small spacer is needed to deal with the slightly narrower 10 speed cassette on an 11 speed compatible freehub body.
Comment: Is it possible to use the freehub and cassette on my rear wheel for the direct drive trainer?
Comment: @CanadianBagpiper you can take the cassette off the bike wheel and put it on the trainer, yes. FYI a 'free hub' is a type of hub and has a splined *freehub body* the cassette fits on.
Comment: Ah, thank you for the correction. If I'm placing a 10 speed cassette on an 11 speed freehub body, will I need a spacer on the freehub body?
Comment: @CanadianBagpiper yes , Although some larger 11 speed cassette will fit on a 10 speed free hub body and come with a spacer

Tiagra Rear Derailleur Compatibility


In a school library I have 30 iPads to set up for teachers to use in their classrooms.

Question: In a school library with 30 iPads on a cart.  Should one appleid be used for all 30 iPads?  I will be the only one adding the apps, and then the cart will be taken to classrooms.  The same apps will be on all iPads.  Would it be better to just create a genric appleid or an iCloud id, or what's the best way to do this?
Comment: look at [Apple Configurator](https://itunes.apple.com/us/app/apple-configurator/id434433123?mt=12)
Comment: This isn't a simple question--and it may be a debate.  Different institutions have different answers based on their requirements and licensing. Entire conference tracks have been devoted to this topic. You might find the writings of [Fraser Speirs] and [iPad Mike](http://ipadmike.tumblr.com/post/40535136879/ipad-apps-and-resources-for-teachers) to be helpful. There is also a lot of information about MDM at [JAMFnation](https://jamfnation.jamfsoftware.com/index.html)
Comment: Jason, you should expand on this a bit and make it an answer.
Comment: Forgot to add the link for [Fraser Speirs](http://speirs.org/)
Answer: Apple has a tool, Apple Configurator, designed to help manage multiple devices in exactly this kind of scenario.  I haven't personally used it, but it sound like what you need.
Answer: No - if you try to use one Apple ID on more than 10 devices without some sort of management software layer, you will end up getting that account locked. It's better to reach out to Apple (or a consultant) that does this to learn the benefits and drawbacks of managing a cart of devices.
If you wanted to ask a more specific follow on question or edit some details to make your situation a little more narrow (where in the world your deployment is based, what you've tried to solve the issue, etc..) it's hard to offer anything other than links to places to start doing research:

http://www.apple.com/education/resources/information-technology.html

The link above has videos explaining various enrollment strategies, how to use the configurator, white papers, volume purchase information (which means educational discounts) and more.
Answer: For our iPad distros we are using two accounts:one Volume Purchasing Program account and one regular apple ID and Apple Configurator.
Example: firstname.lastname@example.com buys the VPP app codes from apple and I download the excel sheet with the redemption codes. Then I would redeem one of the codes on email@example.com to download the .ipa file. That .ipa file gets loaded into Configurator along with the excel sheet with all the codes(their basic license mgmt) and allows you to apply the profile(Prefs and Apps) to managed devices.
Answer: why don't you try this..product
http://www.maas360.com/
MaaS360 provides a mobile device management solution and an enterprise appstore for managing apps
DISCLOSURE: This author is affiliated with this product.
Answer: You cannot use Apple ID in all those 30 devices. Instead, there are two ways in which you can achieve it.
The first method is using Apple Configurator. Apple Configurator is a tool that is available in Mac computers. With Apple Configurator, you can download apps from iTunes and can be deployed in devices if by hooking up the device with your Mac computer and deploying apps one by one.
If this sounds annoying, then there is a second option called Mobile Application Management (MAM). Enroll all the 30 devices in MAM and you can deploy apps remotely from another system.
Some Mobile Device Management (MDM) solutions, like Hexnode MDM, also comes with a built-in MAM. MDM provides more options of security like locking device and wiping it down, just in case you need it.


How can a Judo fight be won?

Question: I recently watched a Judo fight and I was confused about the scoring system. How exactly can a fight be won?
Answer: There are (as of 2018) four ways how a fight can be won:

Ippon - An Ippon ("full point") is awarded, when either the opponent is thrown on the back with force, control and speed or when the opponent is fixed in Osae-komi for 20 seconds or when the opponent surrenders after an arm lock or a strangulation. Every Ippon ends the fight immediately.

Waza-ari - If you perform a technique, that does not fully match the criterias for Ippon, you will be awarded an Waza-ari ("half point"). Two Waza-aris result in an Ippon ("Waza-ari-awasete-Ippon") and end the fight immediately. Also the fighter with more Waza-aris wins, when the fight time (usually 4 mins) is over.

Fight end - In case of a draw, the fight will continue in Golden Score-mode. The fighter that scores the first score will immediately end the fight and be declared winner.
Some smaller tournaments don't have Golden score but use a Hantei instead. In this case the referee decides who fought better and declares this Judoka the winner.

Hansoku-make - For major or repetitive rule breaks, actions against the spirit of Judo or the performance of techniques that put the fighters health in danger a Hansoku-Make can be given. This penalty is a disqualification and ends the fight immediately. The punished fighter may or may not (depending of the circumstances) continue to fight in the tournament.

More information can be seen in a video published by the IJF (international Judo federation) to inform about the 2018 rules:
https://www.youtube.com/watch?v=pgfKasoI5yc
Answer:

Win
Ways to achieve this

Ippon
- throw opponent flat on their back with skill, speed, and force  - submit opponent with armlock or strangle  - pin opponent for 20s

Waza-ari (half point) + time runs out
- throw opponent but they only land on one side of their back  - pin opponent for 10s

Waza-ari-awasete-ippon (two half points)
Score two waza-ari

One can also win (as in other sports) if the opponent is disqualified or must withdraw from the match:

Win
Ways to achieve this

Hansoku-gachi
- opponent gets 3 shido (minor penalties)  - opponent gets hansoku-make (major penalty)

Fusen-gachi
Opponent does not appear to match

Kiken-gachi
Opponent withdraws

Fuso-gachi
Opponent withdraws due to injury

How can a Judo fight be won?


Field of a Polarized Object

Question: In Griffith's Electrodynamics, in the section 4.2, just after the equation 4.9, he writes "sleight-of-hand casts this integral into a much more illuminating form"...
I have a doubt in that. If the Gradient (or differentiation if carried out) is with respect to primed coordinates, how can variable r be differentiated as r' ? It would be of great help if someone clarifies this point.
Answer: The point is that the 'scripty r' (i dont know how to write it here)  depends only on the difference between the coordinates; note that
($\frac{\partial}{\partial x}$) $f(x- x')$ = -($\frac{\partial}{\partial x'}$)$f(x- x')$. What i am trying to say is that the 'scripty r' is a vector joining the primed co-ordinates to the unprimed co-ordinates.....hence the gradient is taken wrt either of the co-ordinates....ie, gradient wrt unprimed is negative of gradient wrt primed co-ordinates
Comment: Sure. it was a little confusing to me too in the beginning.
Comment: But can you tell me why we shift from normal r to r' ? [read r as that that scripty r]
Comment: Because after some steps, you will see that he invoked a product rule where  $P$. $\triangledown '(\frac{1}{scripty r})$ = $\triangledown ' (\frac{P}{scripty r})$ - $\frac{1}{scripty r}(\triangledown'.P)$. For this to happen,  the $\triangledown'$ has to be applied to both P(which is a source co-ordinate..primed) and the scripty r (which is flexible)...which is why he shifted to the primed co-ordinates
Comment: The P is strictly a source co-ordinate...so we have to accomodate the $\frac{1}{scriptyr}$ in such a way that it can also be written as a function of source co-ordinates...which is why the shift from unprimed to prime
Answer: We need to shift from $\mathscr R$ to $r'$ because otherwise the coordinate system would keep changing as we integrate over the whole volume. Now, about that sleight of hand.
Gradient depends upon the coordinate system.
By simple definition of gradient we have :-
$dT= \nabla T.\boldsymbol{dl}$, where $\boldsymbol{dl}$ is the change in space of the coordinate system.
Since, $\mathscr R = \boldsymbol r - \boldsymbol r' $ it implies that $d\mathscr R = -d\boldsymbol r'$ as $\boldsymbol r$ is the constant position vector of the point of interest where we wish to calculate electric field by the polarized object, in the source coordinate system.
Now, $d \left( {\frac {1}{\mathscr R}} \right) = \nabla \left( {\frac {1}{\mathscr R}} \right).d\mathscr R = \nabla'\left( {\frac {1}{\mathscr R}} \right).d\boldsymbol r'$, as $d\mathscr R = -d\boldsymbol r'$ this implies
$\nabla' \left( {\frac {1}{\mathscr R}} \right)$ = $-\nabla \left( {\frac {1}{\mathscr R}} \right)$ which simply means that gradient in source coordinate system is just the negative  of the gradient in the coordinate system of that differential dipole in consideration, which is what Griffiths touched upon.
PS : When I was having trouble with this, I was incorrectly assuming $d|\mathscr R|  \hat{ \mathscr R} = -dr'  \hat{r'} $, this was incorrect because I was incorrectly assuming $d\hat{ \mathscr R} = d\hat{r'}= 0$

Field of a Polarized Object


Fourier transform of the energy

Question: If I have the time history of the energy, Does it make sense to do the fourier transform of this energy? or if I want to see the energy in frequency the PSD is the only tool? and Why
Comment: The field concerning itself with estimating the PSD is called "spectral estimation", and there's more ways than doing a Fourier transform of sampled data. You'll need to be **Way** more specific about where your data actually comes from, if possible with a mathematical model for the underlying phenomenon and the noise (but we can work together on that!), and a much more precise description of what you want to *do* with the PSD estimate.
Comment: See DSP as toolset: you'll need to know what you want to build out of which material to choose the right tool.
Comment: This really depends on what you want to do with the data and what the requirements of your application are. The spectrum of energy is a bit unusual. If your signal is a sine wave, the spectrum of the sine wave has a line at a single frequency. The spectrum of the energy (signal squared) has two lines: one at DC and one at twice the signal frequency. Is that what you want ?
Answer: It could makes sense to do a Fourier Transform for the kinetic energy vs time (or of any parameter vs time) for evaluation of the power spectral density when the process is wide-sense-stationary, or at least stationary over the block of time used in the FFT (which specifically is the FT of the autocorrelation function and can be estimated from the magnitude squared of the DFT, normalized by the resolution bandwidth). JasonR further explains this here.  For all other cases, the PSD does not exist and you will get a very different result for any shift in time or change in duration. (This is a motivation to instead use the STFT or wavelet transform to observe both time and frequency characteristics).
To assess if the process is sufficiently stationary, I recommend using the Allan Deviation which I detail in other posts such as here for that purpose.

Fourier transform of the energy


Powering a NEMA17 stepper motor (DRV8825 driver) with a mt3608 boost converter

Question: I'm encountering a very strange problem at the moment.
In the course of my school project I need to drive a NEMA17 stepper motor with a DRV8825 stepper driver, which is soldered with its breakout on my PCB-Prototype. For the power supply, I have three parallel Li-ion-batteries (around 4.2V when fully charged), with a MT3608 boost converter converting the voltage to 24V which directly goes to the Vmot pin of the DRV8825-driver.
Problem is the following: the stepper doesn't run smoothly, it changes direction and runs pretty random.
I'm already familiar with the typical symptoms of this (like wrong calibration of the current restriction or wrong wiring of the stepper coils). However, I already tried to fix these issues, without any success.
Now comes the interesting part: When I connect a separate board intended for the DRV8825 (DollaTek 3D Printer 42 Stepper Motor Driver Expansion Board 8825/A4988) and wire the male connection pins of the board with my female connection pins on my own PCB-Board, it works just fine.
Even after controlling all signals with an oscilloscope, I couldn't find any noise on the logic pins or the coil pins.
Even after soldering a decoupling capacitor between Vdd and Gnd of the DRV8825 pins, nothing has changed. A decoupling capacitor between Vmot and Gnd is already on the PCB Prototype.
I am running the stepper with the tone()-function, sending a rectangle-wave signal with a frequency of 1000Hz to the driver. I'm also of course setting the sleep pin to high, with a short delay after waking up the driver until the first step (as recommended on the datasheet). So no complicated software, which of course is already running smoothly on the separate Amazon-board.
It really is a mistery to me why this is not working, any ideas?
You can find the eagle layout below.
Answer: The answer to this problem was simply putting two 4700µF filtering capacitors across the boost converter (in- and output).


Is academic letter of recommendation necessary for MS admissions through GRE?

Question: Recently I have been thinking about doing MS. For most of the universities, the admission is based on GRE General score among other things. I think a few letters of recommendation are a must in admission in almost all of the universities. I have been in employment in corporate sector for a few years now and the mentors (two of them) under whom I had done my projects/research in the university have left the university now and moved somewhere else. Will I still be able to get admission in MS without an academic letter of recommendation or with an employer's/colleagues' letter of recommendation?
Comment: *mentors (two of them) under whom I had done my projects/research in the university have left the university* --- Have you tried contacting them to ask them? Do you think they would remember you sufficiently well to write a letter now? I've written several letters for former students after leaving where they were my students, including after leaving academia entirely, although I knew these fairly well (a former undergraduate T.A. for me, another my most promising student at a particular university, another who did an independent study course under me, etc.) and none more than 4 years later.
Comment: What country are you referring to?
Comment: @Buffy I was thinking about the US specifically. But you can answer for any university in general so I will get an idea.
Answer: I doubt that any place in the US with competitive admissions will admit a student based only on GRE general test scores. In fact, that is starting to disappear as a requirement (COVID among other things).
There are places that will accept nearly all applicants, but that may not be your goal. For the most part letters of recommendation rank fairly highly in the analysis of graduate applications in the US.
Admissions are generally broad based, with GPA, letters, your own statement of purpose, etc. being considered as a whole looking for indicators of success. If any piece is missing, the others become more important to the analysis unless the process requires the missing piece.
Academic letters are best for academic programs, of course, and you may be able to get one or two if you are remembered at your former university and/or by former mentors, or can re-establish contact there. Letters from employers might be fine, depending on the program and what your employment was.
But presenting no letters at all would probably indicate a weak application in most cases. Not having any academic letters is a negative, though perhaps not fatal if other things strongly indicate success.


Invalidated Prayer

Question: I was praying Asr and I had already done Salam and I was at the part where you pray and do dua. I burped and said "excuse me" is my prayer invalid?
Read
Comment: Ssalah finishes at salam. Anything you do after that will not effect the validity of your salah.
Answer: You can hardly invalidate a prayer which has ended.
And the prayer ends with the salam or tasleem:

The Prophet (ﷺ) said: The key of prayer is purification; takbir (saying "Allah is most great") makes (all acts which break prayer) unlawful and taslim (uttering the salutation) makes (all such acts) lawful.
(See for example in Sunan abi Dawod 1 & 2, Sunan ibn Majah 1 & 2, Musnad Ahmad and Jami' at-Tirmidhi 1 & 2)

Tahleel تحليل or making it lawful means, accomplishing it (and earning the rewards). So anything you've done after this has no impact on the prayer.  But one should consider repenting.

Invalidated Prayer


what are the main steps to build a swarm robots system and train it to achieve foraging task using deep Q network

Question: I studied reinforcement learning deeper and prepared myself to use Webots, and when I decided to build a swarm robots system and drive it by deep_Q_networks I feel too confused
how can I begin and is there any tutorial that can help that includes DQN,swarm,and Webots
Comment: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
Answer: Let's assume this foraging task is a continuous motion planning problem, i.e. you have dynamics accounted for (does not necessarily have to be the case, but should help convergence if it is) and your available actions are some movements relative to each robots current position. I would first advise ditching DQN. Learning how DQN's work is an important first step in reinforcement learning, but a more modern solution like SAC does not add much computational complexity while providing vast improvements (also it uses a continuous action space which tends to be a win in robotics). So, the next question is how do I use SAC? Pretty easy here, go to a repo like this https://github.com/denisyarats/pytorch_sac and clone it. You do not need to be an expert at all on the inner workings of these RL algorithms right away. Give yourself some time using them and build up an intuitive understanding of what is going on. It takes time to learn them as PyTorch and Tensorflow are complex libraries that do a lot under the hood.
Now, you have your RL code ready to go, how do you actually apply it to your problem? This is where the actual engineering/math comes in. First, you'll probably want to set up a simulation environment with all of your robots. You'll want a function that returns the state of all of your robots in a long vector, $\mathbf{s} \in \mathbb{R}^{e\cdot |s_i|\times 1}$ where $|s_i|$ represents the number of states of an individual robot and $e$ represents how many robots you have. You will also need an adequate reward function. This is the most important part of any RL algorithm. Your reward here would obviously be based on foraging performance, but I would imagine the swarm aspect of the problem means you are looking to maximize coverage over some space? Making this assumption, you could have a reward that is simply $r(\mathbf{s}) = f(\mathbf{s}) + A(\mathbf{s})$, where $f(\mathbf{s})$ denotes the foraging performance of the swarm and $A(\mathbf{s})$ represents the area they are covering. Keep in mind you may also want to include some statistics about foraging performance in your state then.
Now, you have a reward function and a state function - the final step is to make a step function. This will take you from your current state to another state given some action sampled from your network. So, we will need an action vector $\mathbf{a} \in \mathbb{R}^{e \cdot |a_i| \times 1}$, where $|a_i|$ represents the number of available actions per robot. So, the step function will look something like $(\mathbf{s}_{t+1}, r_{t}, d) = step(\mathbf{s}_t, \mathbf{a}_t)$, where $d \in \{0, 1\}$ indicates the termination status of your current run (not necessarily the whole simulation, just one of many runs needed to collect training data) and $t$ represents the current time step.
For convenience sake, most RL implementations are set up to be interfaced with OpenAI Gym environments. Thus, if you make the above functions, you can simply "inject" your own environment into many pre-existing RL implementation and get going in a relatively smooth manner. The Gym interface typically only requires a $step$ and $reset$ (just resets environment state to some default) function as well as perhaps some other values that should be apparent by any error messages ;) In my personal experience, the actual coding of the environment is much more tedious (albeit rewarding) than interfacing the environment with a prefab RL implementation.
Various sources to help in your journey:

Reward function crafting:

https://stats.stackexchange.com/questions/189067/how-to-make-a-reward-function-in-reinforcement-learning
https://www.mathworks.com/videos/reinforcement-learning-part-2-understanding-the-environment-and-rewards-1551976590603.html
https://people.eecs.berkeley.edu/~pabbeel/cs287-fa09/readings/NgHaradaRussell-shaping-ICML1999.pdf (this one is a little dense)

RL Code and Theory:

https://github.com/sweetice/Deep-reinforcement-learning-with-pytorch
https://github.com/aikorea/awesome-rl
https://github.com/nicklashansen/tdmpc (relatively "cutting-edge" here)


Why is the far point of human eye infinite?

Question: In my exams, the presence of this question, which unfortunately I couldn't answer, made me wonder why is the far point of an eye infinite?
First thing that came into my mind was that how come we can see till infinity?
Far point of eye is sometimes described as the farthest point from the eye at which images are clear. As stated here

There's obviously a limit to a distance where the eye can see. If there is, then why isn't that taken in consideration for accurate measurements?
Comment: If you place a sufficiently big and luminescent image of Andromeda at the distance that Andromeda is, we'll be able to see it in perfect detail. Definitely a Type-III civilization project though. At least.
Comment: Is there a limit? The stars? Messier galaxies?
Comment: But can we see them clearly? @Pieter as it happens, we can even see till Andromeda
Comment: I think the far point you speak of is "at infinity" in the same way that the rays of light are "coming in from infinity." This is due to the approximation made in classical optics https://en.wikipedia.org/wiki/Paraxial_approximation that all the wavefronts are parallel (a plane wave)
Answer: I think you are confusing the optical definition of infinity with the literal definition of it. In an optical system, including your eyes, infinity is that distance at which light entering the optical system is considered parallel. This site gives the defnition as:

In optics, it is the region from which a point on an object sends rays of light which are considered to be parallel onto an optical system. Consequently it forms a clear image in the focal plane of that system. In clinical optometry, 6 metres is usually regarded as infinity.
Answer: Seeing an object is equivalent to seeing the light reflecting off this object. Without outside interference, light traveling from a far away object is identical to light traveling from a close object.
Therefore the far point of the human eye isn't limited by distance, but by circumstances obscuring light beams from reaching us.
Comment: I suspect the OP wants to know more from the optical background.
Comment: Light rays from a close object enter the eyes at a different angle than that reflected off of a distant object (let's define distant as > 6 meters and close < 1 meter). This is why the muscles controlling your lens need to add curvature for near objects.
Answer: When you look at a nearby object like a little arrow, some of the light reflected from the tip enters your eye. The lens focuses all those rays to the same point on your retina. Thus that point on your retina is lit up with light from the arrow tip, and you see the tip.
The rays from the tip that enter your eye fill a cone. From the diagram, you can see the angle at the tip of the cone is a few degrees.
Likewise, light from the base of the arrow that enters your eye is focused to a point on your retina, and you see the base. And so on for all the other points. The rays from each of these points that enters your eye fills similar cones. The angles at the tip of each cone is pretty much the same.

If you look at an object farther away, muscles in your eye will stretch the lens to a more gentle curve, which give the lens a longer focal length. It adjusts to focus rays from the more distant object onto the retina.
Since this cone is longer and the base is the same, the angle at the tip of the cone is smaller. That means the rays in the cone are closer to parallel.
For a really distant object like a star, the cone is light-years long. But the base is still the size of the pupil of your eye. The rays in this cone are almost perfectly parallel. The angle at the tip is a tiny fraction of an arc second.
For an object truly an infinite distance away, the rays would be parallel.

As other answers point out, light that leaves a distant object in the direction of your eye will eventually get to your eye, unless something else is in the way. Light spreads out and gets dim as it travels. But light from a bright object like a star may still be bright enough for you to notice the light. If we ignore cosmological issues like the expansion of the universe, there is no distance too far too see.
Answer:
There's obviously a limit to a distance where the eye can see.

But such limits are not a function of the eye itself. For objects on earth the distance we can see depends on atmospheric conditions, curvature of the earth and size of the object.
For stars in the sky it ultimately comes down to brightness. Distant objects appear as points of light and the further away they are the dimmer they get, both because of inverse-square losses and because their spectrum gets redshifted. Eventually they become so dim the human eye can't see them.

why is the far point of an eye infinite?

Because as you get further from an object the rays from any given point on the object get closer to parallel and they are already near as damnit paralell at distances that are biologically relavent.
Lets say your lens has an apeture of 1cm (a bit bigger than a human eye) and your subject is 1m away. The angle between the rays is about 0.01 radians or about half a degree. At 1km away the angle between the rays is about 0.000001 radians or about 2 arcseconds.
The resolving power of the human eye is about 30 arcseconds. So from a focusing point of view the difference between an object 100m away and an object at infinite distance is negligable.


How do I add animation after rigid body physics has taken place?

Question: How do I add animation after rigid body physics has taken place? I've figure out how to animate an object and then have the physics take over, but I can't get the reverse to work.  Having a rigid body and then animate.  For example, I want a wall to roll and then get sucked up by a space ship.  Everything I've tried so far hasn't worked.
Comment: This might help -  https://blender.stackexchange.com/questions/189665/animating-active-object-in-physics-simulation/190246#190246
Comment: if you know the reverse, just DO the reverse ;) so to take the physics take over, i am pretty sure that you unchecked the "animated" checkbox in the rigid body settings. Just keyframe the unchecked checkbox, and one frame later (from where you want to animate) just check the "animated" checkbox and keyframe again -> done
Answer: The trick here isn't to get it back under control of the animation system-- that's as simple as keyframing the "animated" property.  I think where you may be having trouble is in getting it to continue in the way that the rigid body system animated it.  There are a few ways to handle this.  The first is to use a visual transform:

Bake your rigid body physics, in properties/scene/rigid body world/cache.
Keyframe your rigid body's initial loc/rot at the beginning of your timeline (ie, frame 1.)
Advance to the frame on which you want to take over control of your rigid body.  Use "apply visual transform" operation (from ctrl a menu for me), then keyframe loc/rot.  Enable the "animated" trait, in properties/physics/rigid body/settings and keyframe that trait.
Go back one frame.  Uncheck "animated" and keyframe it.

Now if you go through, you'll find that the rigid body system is in control up until you said, at which point there is no change in transformation from the rigid body system.
You cannot clear your physics bake.  Doing so will invalidate your transform.  Even if nothing changes, rigid body physics depend on unseeded random values (well, they're seeded, but we don't get control of the seed.)  Rigid body physics will not act exactly the same twice in a row.
The other option here is to use a "bake to keyframes" operation (which I access via the searchbar), which will write your existing rigid body animation into a keyframed action, making it so you no longer need rigid body physics whatsoever on the object.  As before, if you change anything in the sim, these baked keyframes will no longer be valid.  Once you have these keyframes, you can delete or replace any that you would like-- perhaps deleting all after a certain frame, so that you can animate it by hand after that point.
The final way to handle this is to not render your physics object.  Instead, disable rendering on your physics object and create a copy-- without rigid body physics, but enabled in renders-- that copies transforms from that physics object via a "copy transforms" constraint.  Now, you can animate that object however you'd like, including animating the influence of its constraint.  So long as the influence is 1.0, it will act under the control of physics (at least, apparently so); when the influence is 0.0, it will act under your control.   For in-between values, it will interpolate between the target of the constraint and its own keyframed transforms.  This last version involves the complexity of an extra proxy object, but allows you to continue with unbaked physics in case you wish to make further changes to the system.


Silverlight 3D XNA Error - The type or namespace does not exist

Question: I'm trying to follow some tutorials for building a Silverlight 3D XNA project.
I'm able to display the 3D surface but once I start using Vector3 or VertexPositionNormalTexture (or using any of the XNA helper entities) I get that the type or namespce does not exist.
I've got these includes:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

I've includeed the References in the Silverlight Project, namely:
Microsoft.Xna.Framework
Microsoft.Xna.Framework.Graphics
Microsoft.Xna.Framework.Graphics.Extensions
System.Windows.Xna

and a bunch of others I'm not sure are relevant. These were under the .NET tab, perhaps I need to get them elsewhere, and these aren't for Silverlight? I'm not sure.
I'm using Visual Studio 2010 Professional, Silverlight 5 and XNA 4
Answer: I've managed to get XNA working in Silverlight in separate projects, I am pretty confident I missed something. Just double-check everything is included.


ATM Style Input Fields for Currency

Question: I am looking for best practices around how to design a UI for currency fields. I have been looking into ATM-style fields. This is when if you type in your value, it fills in cents first until you've hit a full dollar amount. My question is, when should you use ATM-style fields vs just regular input fields with potentially some input masking, such as adding in commas as the dollar value goes up. Does anyone have insight around ATM inputs? I see this being used in various places but cannot find best practices or when specifically to use/not to use.
Comment: There are some specific aspects of ATMs themselves that differ from other monetary systems. Such as a)The currency is fixed. b)The amount to withdraw is an integer. c)The max amount to withdraw amount is below that where comma separators would be used (so, not 2,000.00). These (and other) specific criteria helps lend itself to a fixed input format that isn't necessarily appropriate for general currency input fields in, for instance, a personal banking app.
Comment: +1 for a very interesting question. Paypal uses ATM style for instance. Would love to hear about research or insights.
Answer: The answer to this question is pretty logically straight forward.
First of all, whenever you have a numeric field—especially one that involves decimal arithmetic calculations—you should preferably use a right-to-left input scheme.
Now with that aside, while ATMs might differ in how they operate, the ATMs you've been accessing use that specific input formatting for the following reason.
Computers are not very good at accurately representing and manipulating decimal numbers that we use for currency arithmetic, since every floating point number is stored as a 32-bit binary value in scientific notation in the following format:
significand * 2^exponent

Note that the base of the exponent is 2 (for binary)
instead of 10 as we would use in decimal arithmetic

Simply put, this would lead to inaccuracy in the results if currency values were to be stored and manipulated as floating points numerals (Check the Further Reading section for delving into this in greater detail).
In order to circumvent this scenario, currency values are stored and manipulated as integers in all digital financial service applications. And as a consequence, what you see on your ATM screens is simply masking—not just with respect to the commas that you see for large numbers but for the position of the decimal itself.

Further Reading
Lindydancer's answer to How are floating point numbers stored in memory?
zneak's answer to Why not use Double or Float to represent currency?

ATM Style Input Fields for Currency


In Anno 2070, what consumes wood?

Question: I understand that it's used to buy buildings, but for some reason my stockpile of wood is constantly emptying. Was not able to find any building that should be using it. (Missing 1 Act 3, if that helps at all)
Answer: For people who are interested: The ascension of Tier 2 eco houses to Tier 3 costs Wood. If you have it set to "Automatic Ascension" (Top right corner of the stat bar when selecting a city center) then you will constantly lose wood to this.
Hope that helps, and thank you!
Comment: Looks like you ended up with two accounts by accident. I merged them for you, but you might want to consider registering via the link from your profile so that this doesn't happen again and you remain in control of your questions and answers. :)
Comment: @DefaultChar If you were able to solve your own problem, you should accept your own answer.

In Anno 2070, what consumes wood?


I need to turn over my new Galaxy Note 7 for recall and cannot find a way to remove or log off my gmail accounts

Question: I have the new Note 7. I have a few g-mail accounts, and have linked them all with my Note 7. Now, I've learned that I need to turn over my phone for the massive Note 7 recall, but have yet find a way to log out my g-mails without deleting these account, which I want to keep. I have changed my passwords to each account, gone into each account and scrolled down to details to remove the accounts from all other web activities, but the phone has not yet been "hardware swapped" back to my old Sprint phone, and I can still see all of my g-mail account and each email within each account. I can click on any email to do whatever I desire, and I can also still send emails - all without ever having to log in with the new password. All I want to do is remove the g-mails from that (my Note 7) so I can hand it over for the recall. I am simply confused as to the g-mails that will remain on the phone. Can anyone offer up some advise to this old gal, who hasn't yet begun to understand how this works? Thank you!
Comment: I found a youtube video that explained it all so have it all under control now and no longer need assistance with this issue after-all. Thank you anyway!
Answer: Please go to Settings>Accounts>Google. You can find all your Gmail accounts here.
If you want to remove it, tap on the email>Menu(Three dots on top right or more)>Then remove account.
Comment: YOU NEED TO PRESS ON THE ACCOUNT A FEW TIMES BEFORE YOU GET THE REMOVE OPTION IN MENU
Comment: Thank you anyway, I really appreciate your help! I had stated in a comment to my own question, that I'd found a youtube video on this so was able to remove my gmails entirely. The Note 7 is just a little different than my other Note so removal wasn't as intuitive, yet, as on my  older Note, because there was more to it than that, but the removal was completed and the Note 7 has been returned for recall. Thanks!!


Why in pyqt5 should I use pyuic5 and not uic.loadUi("my.ui")?

Question: I've been experimenting with QT5 for Python, using pyqt5.  I've noticed that most tutorials recommend using pyuic5 to convert the XML UI to Python code.  I've also seen a couple of tutorials where instead they use uic.loadUi("myui.ui") to dynamical load the XML UI.  This seems like a cleaner, more modular solution to me, but it appears to be an unpopular option.  Is there a reason converting your code with pyuic5 is a sounder solution?
Comment: You could also just use straight pyqt5 to create your windows and steer completely clear of that UI generator and personally this works a whole lot better as you have full control over the code you create and you avoid that extremely ugly code the generator/designer creates.  Oh and its already in python no conversion necessary
Answer: Both solutions are good, they have advantages and disadvantages that have to be weighed with what you want to do, and many times it will depend on the taste of the programmer.
pyuic5:

Allows inheritance [+]

There is no additional load when running the application [+]

Convert the .ui to .py every time the file is modified [-]

uic.loadUi():

You do not have to modify anything when modifying the .ui [+]

Compilation extra time [-]

Does not allow inheritance (You could implement the inheritance using uic.loadUiType()) [-]

Does not allow the use of inspect [-].
Answer: The biggest reason to use pyuic5 is that IDEs (e.g. Visual Studio Code, PyCharm) do not understand .ui files, and therefore cannot provide code introspection (e.g. autocompletion of widget names) for your class unless you compile it to Python.
Comment: This is what I suspected.  Using Visual Studio Code, and just learning about Qt.  I don't really care how messy the code generated is - I'll never see it - but I do want intellisense to pop up.  Sadly, this means having to convert the UI to Python every time I make a change.
Comment: @AndyBrown if you really hate the manual compilation step, I guess you could rig your Python code to autocompile the .uic file whenever it has changed. This could be done e.g. by comparing the modification dates on the .uic and .py files - if the .uic is newer, then recompile to .py before import. Of course you would only do this during development, when the .ui is expected to change frequently.
Comment: See separate answer for my current thought processes!
Answer: Having looked into this more, for me dynamically loading the form generated by QT Designer is the way to go.  You can get round the problems of not having access to the underlying widgets with commands like this (assuming you have a label called bob_label in your form):
self.bob_label: QLabel = self.findChild(QtWidgets.QLabel, 'bob_label')

In PyCharm, at any rate, this will automatically enable Intellisense (so the IDE now knows that there's a label in the window class called bob_label).  In Visual Studio Code despite great effort I couldn't find a way to get this to work easily, although I did manage it eventually.


Hot and cold 1/2 pex, straight run for outdoor shower, pvc 1.25 is that too narrow for both runs.?

Question: Outdoor hot and cold faucets, idea was to attach 1/2 pex to  faucets and run through 1 1/2 pvc piping about 12" under ground for an Outdoor sbower, before pavers are installed.  Both pex lines fit in the 1 1/2 pvc, then arc upwards on each end until vertical. Due to supply chain issues, I could only find 1 1/2 pvc. Will it be too tight a fit to run both 1/2 pex together over the 30ft straight run? Or am I better separating hot and cold into 2 pvc runs or do I need a larger pvc pipe ( 2 inch or larger)?
Comment: You say it's a "straight run", then say "arc upwards". Will the PVC conduit be curved, or will the PEX "arc upwards" after leaving the PVC? I can't imagine that the 2 of them will be easy to pull through a PVC elbow, even a long-sweep elbow. Also, consider leaving the plumbing aisle and go look at PVC electrical conduit. You may find larger diameter Sch 40 down there. There's no difference between the two for _your_ intended purposes. (Note: You _must not_ run electrical in water PVC, but I don't see any reason you couldn't put PEX in electrical PVC.)
Comment: As a side question/concern...  If you're running both hot and cold pex lines in a common conduit/pipe for 30+ feet, I'd be concerned that what you get at the other end when you finally have your mixing valve is cold water that's no longer cold (picking up heat from the hot line) and hot water that's no longer hot (due to the cold water running next to it), in a confined space.  If possible, can you run them in separate pipes to keep the opposite temperature lines more separate from each other?
Answer: If you tested that both lines fit into the PVC, then both lines fit in the PVC. If the two bends were made with a heat so that they are super long sweeps, then they won't give you much problem either. If you are using store-bought bends, then you don't have a chance. However, if the ends are short and the pex is installed into the straight pipe first, then the bend can be installed over the pex and glued onto the pipe last for a much easier job. I have created a few impossible pulls using what I call the 'install the pipe over the wire' technique.
Wire pulling lubricant always helps a lot and is often the difference between possible and impossible.
I find it interesting the you are putting the pex into another pipe.
Comment: The "install the pipe over the wire" technique also doesn't meet NEC because you can create impossible pulls: https://diy.stackexchange.com/questions/215039/why-can-i-not-assemble-conduit-around-cable-but-must-pull-it-after-assembly
Comment: Unless you have a super puller, I broke code a few times. I'm glad for my old age because code is getting overly concerned about everything. If lube was needed to install, then how to back out after dry? Adding another wire is almost always impossible and you risk rubbing a hole in the insulation of another wire. No matter how I prepare, helpers manage to twist the feed. Once wires are installed in a pipe with bends then that's the install and that's that. And that's common sense in an imperfect world which code has forgotten all about. Cut the pipe to modify the run if that is what is needed.
Comment: @FreeMan I don't think the NEC  applies to installing PEX water lines... :-)
Comment: No, it doesn't, @JACK, but Paul stated that, "I have created a few impossible pulls using what I call the 'install the pipe over the **wire**' technique." and that's what I was referring to. _Emphasis added._


Are there intentional similarities between the lighthouse and the dark tower, from "BioShock Infinite" and "Dark Tower" series?

Question: Has anyone completed BioShock Infinite and the entire Dark Tower series? Has anyone read into the many similarities as how the dark tower and the lighthouse serve as linchpins to connecting many universes?
Comment: It's not exactly clear what you're asking here. Did _you_ notice any similarities? What were they? Would you like a confirmation that those similarities were intentional? I tried to edit your title to make it more of a question, but the body of your post could use more clarification, otherwise, I'm afraid, it might get closed as being primarily opinion-based. Take the [tour] and see the [ask] page to learn what type of questions are on-topic here.
Comment: I see what you're getting at, but I see a big difference. The Tower was literally the linchpin holding reality together. The lighthouse didn't seem to serve such a vital function. I doubt if you destroyed all the lighthouses that reality would end.
Answer: There are some similarities, and other people have made the connection too, as you can see by googling.
However, while BioShock's Creative Director Ken Levine is an "old school King fan", he never got into The Dark Tower, so any similarities are probably unintentional.
Levine does say in an interview that Stephen King's non-fiction book On Writing was an inspiration on how he wrote the game's story:

Gillen: I suppose what I was getting at was what books should people read if they want to follow your thinking?
  Levine: Have you read Stephen King's book On Writing?

He might have been aware of the ending to The Dark Tower through his love for King, but it doesn't seem to have been direct.


Why does my central heating unit continue to run after reaching its set temperature?

Question: Why will the central heating unit continue to run after reaching the set temperature?  It does not read that it is reaching a higher temperature, it just continues to run at the reached temperature set.
Answer: If this is a forced air system, the blower will continue to run for a specific amount of time after the unit stops producing heat. The unit will no longer be producing heat, but the blower will continue to run to spread the heat that was produced when the unit was full on.  If it didn't, a lot of the heat produced would be wasted.
Some units use a heat detection circuit to determine when the blower should turn off. Most however, simply keep the blower on for a predetermined amount of time.
Comment: Also true if s/forced air/pumped water/; s/blower/pump/; s/unit/boiler/; s/Leftpondia/Rightpondia/;
Comment: @RedGrittyBrick, what?
Comment: @alt: sorry, it's a software thing:  /search/replace/
Answer: There are also a set of switches in the unit that relay the thermostat demands to the unit. They control how long the blower runs after reaching the desired temp. Most units run for a set amount of time after reaching desired temp. In time, though, those switches (that look like little pieces of aluminum foil) will wear out and cause the unit to run for long periods of time because they won't tell the blower to turn off.
I suggest timing your unit. If it keeps running after the thermostat clicks off for more than 5 minutes then you would need to get the unit checked out. There is also a possibility it could be the thermostat, but that is not as likely.
Comment: Hello, and welcome to Home Improvement. Thanks for the answer; keep 'em coming. And, you should probably [take our tour](//diy.stackexchange.com/tour) so you'll know how best to contribute here.
Answer: Electronic thermostats will only display whole degrees, but most (this varies from one manufacturer to the next) will measure fractions of a degree and switch the relay that controls the HVAC perhaps after it reaches 72.5 for example if the target is 72 (in heat mode).  They may also vary in the target temperature in cool mode vs. heat mode.  The underlying explanation is that the electronic components are measuring fractions of a degree but only displaying whole degrees and operating according to the underlying programming that is opaque to the user unfortunately.
Answer: Thermostats have a temperature range around the target temperature. If you set it to 72, it may have a 2 degree range allowing the temperature to fluctuate from 71 to 73. Without this, the hvac would be constantly cycling on and off, shortening the life of the hvac and reducing your energy efficiency. On some thermostats, the range is adjustable.
Comment: Usually thermostats (at least modern ones), have a 2 degree swing **below** the set point.  The thermostat stops the heat/cool call at the set point, and starts the call 2 degrees above or below the set point.
Comment: The thermostats I've used have the set point in the middle of the swing range, not on the end, but maybe my thermostats are older. They will turn off/on immediately if I'm *changing the set point*, but otherwise they go above/below the target temp so that becomes an average temp. E.g. http://www.ritetemp-thermostats.com/60XX/Glossery/Swing.html and an unfortunately appropriate yahoo answers reference: http://answers.yahoo.com/question/index?qid=20091216085342AAjCL6R
Answer: It's like inertia, but with heat; just like a motor spins down after the power is off, furnaces still have some heat in them after the flame is shut down.
Thermostats have a feature called an anticipator. It will shut down the furnace when the ambient temperature gets close to the desired settings.  The system will then run the fan for the remainder of the cycle as the accumulated heat will be dissipated in the air flow.


Running Blender 2.8 and 2.7 on same PC

Question: I'm trying to run Blender 2.8 and 2.7 on same PC. When using the installer 2.8 will remove 2.7 and 2.7 won't install with 2.8 already on the PC. Any help greatly appreciated.
Answer:
If you want multiple blender versions (I have three) to play nicely together you have to download them as zips and then extract them instead of just running the installer.
Alternately you can put your older blender installations into zip files, run the installer, and then unzip the old versions again back to where they were. I have used this method myself in the past but it's so much easier to just get the zip for the latest version to start with.
I got this answer in part from here.
Answer: You need to Download zip file instead of (.msc file) and then unzip the file > Find The Blender.exe file > Run This File > Here You Go Using This Method You can Run Blender 2.79 On Your PC, While Blender 2.80 is Installed in Your Computer

Running Blender 2.8 and 2.7 on same PC


GUI app for converting floating point to binary

Question: Is there any desktop app for ubuntu that do floating point conversion to binary?
I've tried gnome calculator and I can't find the feature even in programming mode.
The closest I've found is this page. But it's online and web-based.
Answer: The dc (desk-calculator) command allows specifying both input and output bases:
$ echo  2 o  3.14159  p  |  dc
11.00100100001111110

Or:
$ dc
2 o
3.14159
p
11.00100100001111110
q

"2 o" says the output base is 2.
"3.14159" stacks the number.
"p" prints the value of the top of the stack.

It isn't quite GUI, but unless there is some essential reason for requiring GUI should be close enough.
Answer: The linux app "galculator" converts floating point to binary.
I use it on opensuse and it works on mate, kde, gnome desktop.
It was installed from the opensuse repos through software management.
Open galculator.  Go to view in menu.  Click on scientific mode.  Click on Calculator.  Select Number Bases. Select binary.
I assume galculator is available in ubuntu software repos.
tom kosvic


Finding address geographically?

Question: Is there a way to make Geocode or location address based on a shapefile streets, without using a web service and using QGIS or some open source software?
Comment: Hi Manoel welcome to GIS.StackExchange. I would recommend reading through the "How do I ask a good question?" FAQ first: http://gis.stackexchange.com/help/how-to-ask
Comment: What are you trying to do? You have an address and a shapefile of streets and you want to find where the address is given your shapefile? What attributes does your shapefile have (like streetname, etc)? What format is your address query? Is it always precisely house number, street name, town?
Answer: You can install PostgreSQL (opensource) and the PostGIS and TIGER extensions to load the US TIGER data.  This post has a lot of good info that I used to load the census data.
Then you can run SQL queries to get at the data or visualize it with QGIS.
I loaded all US Data into PostgreSQL on a Win 7 (64 bit) with 8 GB ram and a 230 GB hard-drive (with other apps installed)....  I am just about of of space though with the US data taking up around 100 GB.
For other countries, you'll probably need to search and see what others are doing.
Answer: The MMQGIS Plugin has a 'Geocode from Street Layer' tool that you can use to geocode locations against your streets data.
You can point to a CSV file of locations you want to geocode.
Then you set the parameters of the geocoding - really setting the fields in your source data that contain the street segment attributes needed to geocode.

Finding address geographically?


Harmonic's equations within Single Phase Full Bridge Inverter

Question: Is it possible to find the equations of certain number of harmonics (Ex : 3rd, 5th, ... 17th) in Single Phase Full Bridge Inverter theoretically, using the characteristics of the components of the circuit ? if yes, How?, i need some documentation about that.
Comment: What you're asking for is load dependent. Is the load invariant (i.e. not a microprocessor)?
Comment: Yes, of course.  The voltage harmonics are given by the chosen PWM pattern and its timing.  The current harmonics are dependent on the harmonic filter, the voltage harmonics, and also the load characteristics.
Comment: so how do i do it ?
Answer: I provided a link to a textbook chapter in my answer to your previous question. This question seems to require an answer with that kind of detail, not something that can be provided here. You may be able to find detailed material online the way I found the material for which I sent the link. Use the advanced search features of Google. To find academic material search ".edu" sites. Look at the material in Wikipedia. Note that Wikipedia articles have a lot of links to other Wikipedia articles and to material outside of Wikipedia.
Th documentation that I have is in three hard-copy textbooks from 1962, 1964 and 1994. There are certainly more recent books that can be found in libraries.
Answer: Determine the formula for the time-domain performance of the circuit and then do a Fourier transform
theoretically possible, probably not particularly practical without computer assistance.
many just simulate the circuit in spice and then ask for a spectrum analysis.
but that won't give you a formula, just a number.
Comment: could you give me some documentation that can show how to perform the time-domain analysis, please ?
Comment: use algebra to get a formula ro current versus time (or voltage versus time)
Comment: could you give more details ? please


Can the moons shadow be used to make a calendar?

Question: Can I use a gnomon (similar to that used in a sundial) to cast a shadow using the light of a full moon to create a calendar?   My idea was to build a gnomon and take measurements of the shadow cast by each full moon over a course of time.  I understand that the moon has elliptical an orbit and apsidal precession. My thought was to place stones on the end point of the shadow cast by the gnomon at each full moon, at the same lunar altitude, at a single site with known coordinates. My question is, would the points measured from the shadow cast repeat in a way useful for this particular calendar to function, e.g., in the next lunar year, or perhaps apsidal precession?  This calendar would only be used as functional art and not to relate to the traditional calendars. I am in the first year of measurements and am wondering if this will work.
Answer: Unlike the sun the moon is on an approximately 24 hour and 50 minute day. The moon takes, on average, about 29.5 days to repeat a visual phase. Furthermore, the moon's orbit around the earth takes about 27 1/3 days. This means the phases of the moon do not happen on the same days of the year, and moonrise and moonset happen at different times of a given day from year to year.
I believe there is too much variation and difference in the moon's phases and location to make any meaningful moondial. One issue not mentioned above, is that it would be inoperable during the day, but that might be precisely when the moon is over your marker.
As for a lunar calendar based on a lunar year, those exist in many different cultures, but they have issues with standardization of dates. Easter, for example, jumps around because it is calculated off of a lunar calendar.
Comment: Thanks Jake. I edited my question a bit to address my real intent.


How to make on/off switch for popcorn maker?

Question: I have a popcorn maker that when you plug it in it just starts working. Theres no on/off switch and it's kind of annoying. When you unplug it you always get a big blue spark which seems kind of dangerous to me, it might not be but it seems like it would be. It has a standard 2 prong AC power cable. How can I make an on/off switch for this without breaking it or shocking myself?
Comment: Two words:  Power Strip
Comment: The main thing in your popcorn makes is probably a headting element, which draws a substaial amount of current. Make sure the power strip or plug in switch is rated for the amount of current your gadget draws! (Can probably be found on the type plate.)
Answer: The easiest and safest method is to buy some form of switched outlet with a cord and plug. It would be possible to make one yourself but the cost will exceed that of a premade one and there are significant safety issues.
The spark on disconnection is not dangerous as long as there is not flammable  gas present - in which case the danger would be extreme even without the spark.
As long as you stay out of contact with the mains connections there should be no great danger  from the equipment.

Plug in switches like the one shown below are available from here. Allowable current not specified.

You can IR remote control appliances up to 10A current rating with items like this one from here for $US6.

More this one is a triple pack
Comment: You could also move to the UK ;-).  All our wall sockets have switches.  Unfortunately our 240V ac mains supply would probably fry your popcorn maker!
Comment: Thanks, thats a lot less screwing around than cutting wires and trying to safely put it in a box and whatnot, thanks for the answer!
Comment: Well, I was going to suggest a microswitch that triggered when the expanded popcorn rose to a certain level, but I guess that's more fun than the OP was looking for...


Origin of "don't have a coronary"?

Question: I'm assuming the entire phrase would be "don't have a coronary occlusion" meaning "don't have a heart attack." I haven't been able to find anything useful regarding when or where it might have originated.
Comment: Where have you looked? (This saves us wasting time and effort looking in the same places!)
Comment: In addition to what Trev asks (where you've looked for an answer) you could give us more about where the question originates - which is to say, where did you hear this?  Your assumption sounds reasonable, but this is not (specifically) a very common expression.   "Don't have a ___" *is* quite common, and I expect its origin is much older than this specific version.
Comment: I would guess it's a warmed-over version of "don't have a conniption/fit".  https://books.google.com/ngrams/graph?content=don%27t+have+a+conniption%2C+don%27t+have+a+fit&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Cdo%20not%20have%20a%20conniption%3B%2Cc0%3B.t1%3B%2Cdo%20not%20have%20a%20fit%3B%2Cc0
Answer: It has the same meaning as "Don't have a heart attack" and is used in a way to tell the other person to calm down and not get worked up.
The earliest examples I found are in snippets from 1982 books.
Immediate Release - Page 41 - William Mathewson - 1982 - Snippet view:

"Of course not, Stanley," said Lynette patiently. "Don't have a coronary."
"Stan," Tony said, "look, I got to get back to shore."
"Yeah, yeah," said Stanley.

Marva Collins' Way - Page 135 - Marva Collins, Civia Tamarkin - 1982 - Snippet view:

"Don't give me that 'I'm finished' business," she said. "We are never finished in life. We don't ever stand around idly or sit with our hands folded, acquiescing. God isn't finished with you and I'm not either."
"Okay, okay, don't have a coronary," Gary said, sitting down and holding up his palms in surrender.
Marva laughed. "I love your spunk. Don't ever let anyone break your will. Since you are finished, why don't you let us read your theme?"
Answer: Well, according to this google NGram, it seems to have appeared in 1960 and to have peaked in the early 70's. Perhaps it was popularized by a TV show of the time?

Origin of "don't have a coronary"?