Is Hanon's "Virtuoso Pianist" good for self-taught musician?

Question: I am a self-taught pianist (or keyboardist, whatever you prefer). Some time ago I came across The Virtuoso Pianist but, because I never played under the eye of a professional, I was turned away by the following comment on Wikipedia:

One pitfall is that practicing the Hanon exercises with imperfect technique will reinforce the technique errors via endless repetition.

Because of that I never went further than looking through the (pretty scary) sheet. On the other hand, I am not planning to play pieces like "Hungarian Rhapsody" or other impossible stuff, so I am wondering if I should care that much about perfect technique.
Nevertheless, is practising this set going to be fine for someone who had never undertaken any musical education? If you think this information might be useful for you, I've been playing for four years already (with quite a lot of long breaks) and I am capable of playing "Turkish March" (rarely without mistakes I am afraid) or Lost Painting (game music), and these two are more or less the full capacity of my skills.
Answer: This question has been answered fairly well already, but one or two things are missing. First, the purpose of Hanon, or Czerny, or any of the other "finger exercise" books, is not to train you for when you run into figurations that are similar to the exercises. As the preface states: "In this volume will be found the exercises necessary for the acquirement of agility, independence, strength and perfect evenness in the fingers, as well as suppleness of the wrists..." Could you acquire these things through study of musical compositions? To a degree, yes, but Hanon (and other technique books) give your fingers a sustained level of work to do, with each exercise focussed on strengthening a particular potential weakness (trilling with the 4th and 5th fingers, for example). I can personally attest that playing daily through book one of Hanon, as a warm-up to working on other musical tasks, has given me a level of finger agility and strength I would not have achieved by simply jumping straight into the repertoire.
It is true that, to gain the benefits of this type of exercise, and not to succumb to any potential downsides, you need to be aware of what good hand position is and continuously asses the level of tension in your hands, wrists and forearms. Clench your fist. Feel what happens to your flexors in your forearm? You don't want that feeling when you're playing. Now open your hand flat and hold your fingers out straight, working to extend your fingers like you were about to palm a basketball. Feel the tension level in your extensors? You don't want that either. Your hand, at the keyboard, should look as it does resting at your side, without any tension. The fingers are naturally curved. If you play through the Hanon exercises slowly, with your hand in this position, your wrist neither too high, nor too low, and continually ask yourself "is there tension in my playing apparatus?" You'll be fine. One other thing, use your forearm to rotate your hand in the direction of the figurations, instead of locking your hand in place and using just your fingers. Rotation is one of the great (and lesser known) keys to good, supported technique. Go slowly. Don't expect to feel massive improvements overnight, but if you do this every day for 15 minutes at the beginning of your practice, you will see big improvements in your finger strength and independence. Then, next year, play them in all of the keys and you'll feel another jump. After that, learn your major scales, then your minor scales, then arpeggios. There's a never ending well of tools to build and extend your technique.
There's a reason why musicians work diligently and with specific exercises to develop their technique. It's the same reason why a sprinter hits the weight room and works to strengthen his entire body, instead of just running on the track every workout. Building strength, suppleness, and independence in your fingers is very important and Hanon is a legitimate tool for that purpose.
Answer: There is another question here asking about Hanon's place in practice in a more general sense; those answers will give you a better understanding of what other pianists think of these exercises.
I don't think that the exercises will be particularly useful to you.  Hanon exercises are great for helping you isolate particular "riffs", if you will, that are difficult to play.  The idea being, if you repeat them ad naueseum, you'll be able to play them.  In the end, any given Hanon exercise will be useless unless you're playing music with figures that are similar to the exercise.  Hanon attempts to offset the specificity by making tons and tons and tons of the exercises. Regardless, I believe that going through the entire book is a waste of time.  It's much more rewarding for me to attempt to learn music instead of dry exercises.
In any case, the Wikipedia article is 100% correct; playing Hanon exercises with bad technique will reinforce that bad technique. Hanon is a little bit special because it ensures that your hand movements are repeated to the extent that if you have atrocious technique (your wrists dip below the keyboard, your forearms are tensed, you play with flat fingers), you will accelerate the development of RSI.  That being said, if you keep everything in moderation (don't suddenly go on a 4 hour Hanon binge), you'll probably be fine.
As a side note, that quote from Wikipedia is also somewhat misleading; playing AT ALL with bad technique will reinforce bad technique.  Hanon will just make it hurt, too!
Comment: What you say reminds me of this book - http://www.pianopractice.org/ Nevertheless I suppose this also works, and I love not wasting time on mindless practice, but I feel like my fingers could use some "straining" and training and I thought Hanon would be a fine choice.
Comment: Oh, it's perfect for that purpose.  But what's the point?  You can have the most supple fingers in the world, but if you're not playing music that requires it, the effort is for nothing.  And as soon as you stop, you'll begin to lose the suppleness.  I prefer training to play a piece, as opposed to training for training's sake. (This reasoning is similar to why I don't lift weights; it's conceivable that I'm just really good at rationalizing laziness :P)
Comment: haha, good one :). I think these arguments really strike my heart so I suppose I must be a good laziness rationalizer too ;).
Comment: Incidentally, I've been finding that good technique can drive out long-engrained bad if taught well. I'm self-taught and was guilty of all the things you mentioned till recently. Over two actual lessons, a teacher helped me correct posture and hand shape and gave me exercises that would be hard to do with e.g. flat fingers. So far it's -- I don't know how to put it -- "physically compelling". My hands are finding the new technique so much easier that I've been rapidly unlearning the old. :)
Answer: I think that until you get a good teacher you might not really know if you are using proper technique or not.
The purpose of teacher is not getting you through a piece so that you can manage to play it. Some people can do that on their own with enough time and dedication (like you have).
The teacher is there to make sure you have the correct posture and don't injure yourself, to notice from the outside things that you or others without the training might not, to teach you about technique, encourage, challenge, and lots of other stuff.
You can continue the way you are, but if you are worried about technique I suggest you consider getting a teacher. Whether it is a matter of that you simply don't want a teacher or a financial issue think about seeing one not necessarily weekly or even on a regular basis, but just to get an outside opinion on your technique.
When you feel a little bit more aware of any issues that you might have you might feel more confident with your technique, enough to be able to play those or other exercises without (or at least with less) fear of reinforcing bad habits.
Comment: It's a good plan. I meant to take one or two sessions with a teacher just to learn a bit about the proper techniques, but I never really had time/dedication to carry on with this. I will have to reconsider this someday though.
Answer: I have a 30 year old copy of Hanon, which I only worked right through about 3 years ago. I try to play the piano every day but only in the past week got the opportunity (and speed) to play through all 60 exercises every day.
Most of the criticisms of Hanon seem to be aimed at part one, the first 20 exercises, which are repetitive, but are meant to prepare you for the other two parts which include longer exercises, the major and minor scales (all one exercise), arpeggios, scales in thirds and some brilliant trill and tremolo exercises.
I play publicly in a church for worship and in a Jazz band. When I play Hanon I receive more compliments on my playing, both from the public and peers. It's as simple as that.
When I practise Hanon, I feel my playing is sharper, freer and that if I feel inspired to play something I am more likely to be able to play it and not as restricted by technical or physical limits.
I doubt you're going to rush to a teacher now, so I would recommend you start slowly, follow the written instructions and fingering, observe qualified pianists on Youtube etc to copy their technique.
Don't rush to play through all 60, but adopt Hanon as a habit, play for whatever time you can allot to them every day and impreove technique and speed naturally.
I describe Hanon exercises as "boot camp for piano". If you are attracted to them then go for it, but observe the same level of care as if you were going through an assault course. In return you will improve directly and collaterally, in technique, reading and facility in different keys. (incidentally, playing the exercises in different keys takes you up another league).
The advice below is exactly what I tell my pupils:
Play gently and carefully. I have two, one has been with me for 10 years, is learning for fun, has relatively little time to practise, but uses it diligently. For her, the Hanon's 60 is a useful repository of scales etc in one place, and I can call on specific exercises to tackle particular that arise with technique etc. Once a year or so I ask her to practice through the first 20 exercises just to cover the ground.
The other pupil started recently and wanted to progress as quickly as possible. He is diligent, practises for an hour or more at least 3 days per week, as work and voluntary activities allow. Using the 'boot camp' principle, After 9 months he can now play through the first 20 exercises in an hour if he so wished. He has been using a beginner's piano book to get the hang of playing tunes and is studying a music theory book alongside all this. He is about to begin learning his first Bach invention.
If I change my mind about using Hanon I'm not to proud to say so, but so far it's a useful tool, and like all tools needs to be used appropriately for the job.
I have just finished playing through all 60 exercises in 1 hour and 20 minutes. Last year as a result of playing the acoustic guitar for a 6 hour live gig on St Patrick's Day using poor technique and inadequate amplfication, I developed RSI in my left hand and a pain in the base of my thumb. When I practise Hanon every day the pain disappears. I'm not saying it's Hanon specifically that does that, but that it seems to be no more harmful than other approaches and readies me to play the improvisations I would like to play from my head.
Answer: I have played piano since I was 5 years old; I am now 62. I have played and studied classical and jazz. I have played in college stage band. I have taught conservatory piano, though I have mainly played (and earned my living by playing) pop and rock in various nightclub bands. I am now retired from performing and teaching, though I still practice daily.
I started playing Hanon when I was in my 20s and on the road. I learned about it through various recommendations in Keyboard magazine. It helped me enormously. I found that after practicing these exercises my hands and fingers were more supple and that I played everything with more dexterity and accuracy.
I do not buy the 'musicality' argument (rote repetition does nothing for musicianship) for one second. If you are musical you are musical. Your musicality will not be hindered one iota by playing these repetitious exercises. On the contrary, there is a very good chance it will improve due to your increased technical proficiency which will allow you to focus more on your musicianship.
Answer: I think that a more intermediate training book would be a good idea before starting Hanon.
"101 daily exercices for piano" opus 261 of Czerny could be a good start and would give you more agility and assurance in Mozart for instance. I think that some editions are in the public domain.
What the comment in Wikipedia refers to is: if you have a bad sitting position, bad habits with your arm, wrist and hands for instance, the more you play piano, even very good exercices, the more difficult it would be to correct them anyway.
Answer: Here is a quote about how to use such exercises from the great teacher Theodor Leschetizky. Most teachers have their students do some finger exercises, whether Hanon, Czerny, or Kullak, so they will help you as well. Here is his method:
"It is best to play all finger-exercises at first only with a light touch; after two or three days one may try to get more tone, always endeavoring to play evenly (with equal strength of tone) with all the fingers.....the [measurer] for the exertion of force at any given time is the ear. One must HEAR whether the tones finally sound equal in force. After some practice, the fingers will accustom themselves to the necessary degree of pressure."
Also worth noting that Beethoven wrote some exercises for his students that were similar to Hanon in some respects, but he never got the time to expand it to a full book.
(Note: the above quote can be found in the book, "Famous Pianists and their Technique p282).
Answer: I'm a professional piano player and I hope I will give my opinion as such. And please excuse my English if I make mistakes,  this is not my language.
The hanon can be very helpful to every piano player. But if you try to play it you must do it very slow. Slow and with more sound. And you mustn't play it faster if you feel any pressure. Playing technical exercises does not suppose to be hard. The thing you have to do is to find the most natural position of your hands. And the problem of the many of the self-taught pianists is not that they don't have piano teachers, is the amount of time, and the results that are expected. I have played piano for 17 years, hours and hours every single day, and until two years ago I wasn't able to play the Hungarian rhapsody 2 properly.
But back to the question one of the advantages that you have as a self-taught pianist is that you have the desire, you're not forced to play, and your hand is (I suppose) already grown, so the thing you have to do is to be very patient and play everything very slow, with lot of sound. That's the way to find the most natural and comfortable position of your hands. Every person is unique, so the most natural position for your hands will be unique too. And I can say from experience that sometimes the teachers are not helping, on the contrary they can do lot of harm.
And when the thing you are playing becomes comfortable, then is the time when you start playing it faster. Just don't skip the whole process, it is becoming faster in time
Answer: It's quite interesting to note that most critics of Hanon have never gone through the entire book, hence their ignorant utterance. I'm a self taught pianist. I started playing at the age of 28 and I went through the 60 exercises by Hanon for a year. If you can hear or  see me playing you would assume I started at a very early age due to my technique.  Thanks to hanon exercises I now play with the big boys in choir competitions and I am the most sought after pianist in my country.
Answer: Anyone who says Hanon isn't necessary has never really performed. I've played classical piano since I was five years old. But it's not my primary career. So available time is always an issue.  But Never am I better, and able to play complex pieces of music than when I have the time to devote at least a half hour daily to the Hanon exercises.
Comment: "Anyone who says Hanon isn't necessary has never really performed."  Far too categorical. Hanon's exercises were written after the end of Liszt's performing career, so you are saying Liszt never really performed.  The name of any celebrated performer since Hanon's time who never used his studies would also refute your statement.  For example, you are saying Arthur Rubinstein never really performed.


High Sqlservr.exe Memory Usage

Question: I have a problem with sqlservr.exe (version 2008). It use a more memory. I checked on windows taskbar manager, sqlservr.exe usage ( Mem usage - 8GB Ram). I dont know how can I fix it.Got the following metrics of the server using Perfmon:
<code> SQLServer:Buffer Manager
Buffer cache hit ratio
13
SQLServer:Buffer Manager
Page lookups/sec
46026128096
SQLServer:Buffer Manager
Free pages
129295
SQLServer:Buffer Manager
Total pages
997309
SQLServer:Buffer Manager
Target pages
1053560
SQLServer:Buffer Manager
Database pages
484117
SQLServer:Buffer Manager
Reserved pages
0
SQLServer:Buffer Manager
Stolen pages
383897
SQLServer:Buffer Manager
Lazy writes/sec
384369
SQLServer:Buffer Manager
Readahead pages/sec
69315446
SQLServer:Buffer Manager
Page reads/sec
71280353
SQLServer:Buffer Manager
Page writes/sec
12408371
SQLServer:Buffer Manager
Checkpoint pages/sec
7053801
SQLServer:Buffer Manager
Page life expectancy
735262
SQLServer:General Statistics
Active Temp Tables
161
SQLServer:General Statistics
Temp Tables Creation Rate
3131845
SQLServer:General Statistics
Logins/sec
2336011
SQLServer:General Statistics
Logouts/sec
2335984
SQLServer:General Statistics
User Connections
27
SQLServer:General Statistics
Transactions
0
SQLServer:Access Methods
Full Scans/sec
34422821
SQLServer:Access Methods
Range Scans/sec
2027247756
SQLServer:Access Methods
Workfiles Created/sec
49771600
SQLServer:Access Methods
Worktables Created/sec
28205828
SQLServer:Access Methods
Index Searches/sec
4890715219
SQLServer:Access Methods
FreeSpace Scans/sec
21178928
SQLServer:Access Methods
FreeSpace Page Fetches/sec
21226653
SQLServer:Access Methods
Pages Allocated/sec
41483279
SQLServer:Access Methods
Extents Allocated/sec
4743504
SQLServer:Access Methods
Extent Deallocations/sec
4806606
SQLServer:Access Methods
Page Deallocations/sec
41419137
SQLServer:Access Methods
Page Splits/sec
23834799
SQLServer:Memory Manager
SQL Cache Memory (KB)
29160
SQLServer:Memory Manager
Target Server Memory (KB)
8428480
SQLServer:Memory Manager
Total Server Memory (KB)
7978472
</code>
Some body could help me please.And I really want to know the cause for the above.
Answer: The counter "Target Server Memory", 8428480 KB is how much SQL Server would like to use
You only have 7978472KB allocated to the instance ("Total Server Memory")
I suggest you add more memory or move to x64 if you haven't already
However, if you PAE and AWE enabled you must set max server memory on 32 bit. Otherwise it grabs the lot except 256 MB.
Finally, SQL Server is designed to use memory. Another SF question about it
Comment: The configuration is already in X64 and AWE is not enabled.Am more concerned about the stolen pages value.can please help me out in this?
Answer: I'm assuming you've configured SQL to use AWE. If so, then it's normal for SQL to allocate all the memory and release memory to other processes as needed. This article explains how AWE and allocated memory work in SQL Server.
http://technet.microsoft.com/en-us/library/ms190673.aspx

High Sqlservr.exe Memory Usage


How do I create working tooltips in Angular2 with Angular techniques?

Question: I've searched a lot for an easy, simple, and most importantly Ng way to make tooltips, but I can't seem to find a uniform method for doing so. I've tried doing this using ngbToolTip following the documentation in ng-bootstrap, but it doesn't seem to work. Here is my HTML:

{{to.name}} should be done {{to.time}}

{{to.name}} should be done {{to.time}}

{{to.name}} should be done {{to.time}}

{{to.name}}

             Completed!

    <button class="btn btn-warning chkbx" (click)="onDelete(to.id)" ngbTooltip="tooltip">

    </button>
    <button *ngIf="to.importance != 'non'" class="btn btn-info chkbx" (click)="onCompleted(to.id)">

    </button>
    <button *ngIf="to.importance == 'non'" class="btn btn-info chkbx" disabled="true" (click)="onCompleted(to.id)">

    </button>

So I'm just adding one little tooltip on my delete button as a test, but it doesn't work.
Here is my app.module:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';

import { AppComponent } from './app.component';
import {TodoService } from './todo.service';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    ReactiveFormsModule,
    NgbModule.forRoot()
  ],
  providers: [TodoService],
  bootstrap: [AppComponent]
})
export class AppModule { }

My single component has the same import at the top of the .ts file too.
The html itself needs cleanup too I know, but I'm not there yet.
Any suggestions on how to setup tooltips, or anywhere there is documentation?
Comment: I would suggest you to use [**ngPrime**](https://www.primefaces.org/primeng/#/tooltip) tooltip
Answer: Are you using SystemJS? Also remove  NgbModule.forRoot() from your component if you have. Post your component TS file.
You could also use  Bootstrap 4 tooltip or ngx-bootstrap tooltip
Comment: Thank you both of these solutions worked. Guess I was using ng-bootstrap instead of ng2-bootstrap.
Answer: The code and demos at https://ng-bootstrap.github.io/#/components/tooltip work when I run them or when I incorporate similar code into other programs.  The only problem I've found is that the tooltips appear immediately, with no evident way of adding a delay.


web scraping using vba without rerunning each input in given range

Question: I am solving the following issue: I want to scrape a title of website when link inserted in column A and put this value to relevant cell (next to it) in column B. The issue seems to be that once I paste the website in column A, the code reruns the entire list from column A2 to "last row" as defined in the code. Is there any way to only modify column B once a single column A is modified? I.e. if I paste a link in column A36 I get a title in B36, regardless of whether the cell is in the middle of the used range or at the very bottom (i.e. only that very cells gets affected..) I would like to use this without having to re-run multiple inputs as it currently stands; (i.e. the loop "for i =2 to last row")? Also, I would like to change the below from Modular macro i.e. sub to private sub reacting to change (i.e. intersect function) where the 'target' is any cell from A:A range. Many thanks!
enter code here
Sub get_title_header()

Dim wb As Object
Dim doc As Object
Dim sURL As String
Dim lastrow As Long
lastrow = Sheet1.Cells(Rows.Count, "A").End(xlUp).row

For i = 2 To lastrow
Set wb = CreateObject("internetExplorer.Application")
sURL = Cells(i, 1)

wb.navigate sURL
wb.Visible = False

While wb.Busy
DoEvents
Wend

''HTML document
Set doc = wb.document

Cells(i, 2) = doc.Title

On Error GoTo err_clear
Cells(i, 3) = doc.GetElementsByTagName("h1")(0).innerText
err_clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
wb.Quit
Range(Cells(i, 1), Cells(i, 3)).Columns.AutoFit
Next i

End Sub

Answer: Put the code in worksheet change event (Right-click on the sheet tab >> View Code >> Paste the code)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ie As Object, doc As Object, sURL As String
If Target.Cells.CountLarge > 1 Then Exit Sub
If Target.Column = 1 Then
    Set ie = CreateObject("internetExplorer.Application")
    sURL = Target.Value

    With ie
        .navigate sURL
        .Visible = False
        While .Busy: DoEvents: Wend
        Set doc = .document
    End With

    Target.Offset(, 1).Value = doc.Title
    On Error GoTo errClear
    Target.Offset(, 2).Value = doc.getElementsByTagName("h1")(0).innerText

errClear:
    If Err <> 0 Then Err.Clear: Resume Next
    ie.Quit
    Set ie = Nothing
    Application.Wait Now + TimeValue("00:00:03")
    Columns("A:C").AutoFit
End If
End Sub

Comment: Unfortunately it doesnt seem to work. Once I insert a value in any cell in column A, nothing happens :(
Comment: The code is in worksheet module not in standard module. Try to put a break point at the first line then make a change and follow the code lines to see the problem well.


Compact set / Multifunction

Question: Let $K(.)$ a multifunction defined on $\mathbb{R}$ defined as follows:
$$K(x):=\begin{cases} K=\{0\} \text{ if } x\neq0,\\
K=[-1,1] \text{ if } x=0.  \end{cases}$$
Can we deduce directly that for all $x\in \mathbb{R}$ $K(x)$ is a compact of $\mathbb{R}$ since $\{0\}$ and $[-1,1]$ are both compacts of $\mathbb{R}$?
Comment: Yes. Why do you doubt that?
Comment: I was just checking, in a more general case if $K$ is defined on a partition of $\mathbb{R}^n$, we only have to check that in every partition $U_i$ the set $K(x)$ is compact, hence $K(x)$ is compact.
Answer: $\{0\}$ and $[-1,1]$ are compact subsets of $ \mathbb R.$ Hence $K(x)$ is compact for each $x$.

Compact set / Multifunction


Add message with ShareLinkContent in Facebook sdk?

Question: Is there a way to add message to the ShareDialog when using ShareLinkContent in android application. Using Facebook sdk 4.0. I am using this code
<code>  ShareLinkContent linkContent = new ShareLinkContent.Builder()

                        .setContentTitle("XXXXX")
                        .setContentDescription(
                                "XXXXX in real time")
                        .setContentUrl(Uri.parse("http://play.google.com/store/apps/details?id=" + getApplicationContext().getPackageName()))
                        .build();

                shareDialog.show(linkContent);
</code>
Answer: Use:
<code>ShareLinkContent content = new ShareLinkContent.Builder()
 .setContentUrl(yourUrl)
 .build();

ShareApi shareApi = new ShareApi(content);
shareApi.setMessage(message);
shareApi.share(facebookCallback);
</code>
Answer: No, there's no message property on ShareLinkContent because it's supposed to represent the content itself (i.e. the link), and not what the user's message would be.
If you use the Graph API directly to post with publish_actions permissions, then you can attach a message to the ShareApi class.
If you use the ShareDialog class, then the user is prompted to type in a message, and you won't have the ability to set one.


Getting subchildren from FXG

Question: I've imported an FXG from illustrator from Adobe illustrator into flash builder 4.5 and have managed to get it on the stage, the problem I'm facing is accessing the children of the FXG.
Basic FXG that won't work:
<?xml version="1.0" encoding="utf-8" ?>
<Graphic xmlns="http://ns.adobe.com/fxg/2008" xmlns:ATE="http://ns.adobe.com/ate/2009" xmlns:ai="http://ns.adobe.com/ai/2009" xmlns:d="http://ns.adobe.com/fxg/2008/dt" xmlns:flm="http://ns.adobe.com/flame/2008">
    <Group id="subChild">
        <Group id="subSubChild" />
    </Group>
</Graphic>

I then try to access these children like so:
var fooObj:MyFxgObj = new MyFxgObj();
fooObj.getChildByName("subChild");

Which promptly greets me with a null error. I've searched google for the past 2 hours or so but to no avail, so any help would be appreciated.
Comment: I didn't think it was possible.  FXG elements exist at a different level than ActionScript objects or native flash objects.  I view an FXG file as a single asset; kind of like a JPG.  What do you want to do that you need to access children of an FXG?  Would using MXML Graphics be a better choice for you?
Comment: You're right, I exported everything in MXML and it works fine now. Thanks.
Comment: Great; I posted it as a formal answer, then.  Please select it as such at your earliest convenience.
Answer: Since you said my comment was your solution, here it is as a formal answer:
I didn't think accessing the children of an FXG graphic was possible.  I think FXG assets exist at a different level than ActionScript objects or native flash objects. I view an FXG file as a single asset; kind of like a JPG or PNG or embedded SWF.
If you need to access the children, using MXML graphics is the approach you should consider.
Answer: Accessing FXG children is possible and explained in the Adobe doc Using FXG.

Getting subchildren from FXG


JSF 2.x , ,  default selection

Question: I have a
 where you choose a level; that is populated with a list and when one of these <f:selectItems> are clicked then with
 I update my
 with another list, with Entries. I want it to default select the first element in that list of entries and mark it, that is not what happens.
What does happen is that, it takes the old value saved in the attribute submittedValue and uses the value stored in that attribute, this does not exists in current list and therefor, it is not marked.
selectOneMenu

           <f:selectItems
               value="#areaGroupSelection.getLevelsForHierarchy
                      (cc.attrs.agOptionObj,
                      cc.attrs.controller.model.periodSelectionOption,
                      cc.attrs.controller.reportName)}"
               var="levelOpt"
               itemLabel="#{levelOpt.text}"
               itemValue="#{levelOpt}"/>

selectManyMenu

            <f:selectItems
               value="#{areaGroupSelection.getHierarchyNodesAtLevel
                         (cc.attrs.agOptionObj,
                         cc.attrs.controller.model.periodSelectionOption)}"
               var="entryOpt" itemLabel="#{entryOpt.text}" itemValue="#
                           {entryOpt}"/>

I have read and tried the following links:

https://stackoverflow.com/a/21789675/3430698
https://stackoverflow.com/a/13420257/3430698
https://stackoverflow.com/a/17755007/3430698
http://www.primefaces.org/showcase/ui/misc/resetInput.xhtml
http://blog.primefaces.org/?p=2745

I am unsure if, what I am looking for is the use of one of these:

http://www.primefaces.org/showcase/ui/misc/resetInput.xhtml
http://blog.primefaces.org/?p=2745

To clarify: I need to be able to choose from my
 and then populate my
 AND have the first element in
to be default selected.
If any further clarification is needed, please write - I will be monitoring this post like a hawk.
Comment: With those links, you mean to say that `` didn't work?
Comment: Is there a similar in primefaces ?
http://showcase.omnifaces.org/eventlisteners/ResetInputAjaxActionListener ?

@BalusC : will double check
Comment: @BalusC I tried it again , and this time it worked - at first I was experiencing some kind og gui glitch; can't reproduce it, so I do believe it is working.
Answer: This problem has the same grounds as already explained and answered here: How can I populate a text field using PrimeFaces AJAX after validation errors occur?
In your specific case, just use
. You only need to make sure that the
 covers the input components which need to be resetted, and that
 doesn't cover them.

JSF 2.x , ,  default selection


Reset column index in Pandas to 0,1,2,3...?

Question: How do I go about resetting the index of my dataframe columns to 0,1,2,3,4?
(How come doing df.reset_index() doesn't reset the column index?)
>>> data = data.drop(data.columns[[1,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]], axis=1)
>>> data = data.drop(data.index[[0,1]],axis = 0)
>>> print(data.head())
             0         2    3    4    20
2  500292014600       .00  .00  .00  NaN
3  500292014600    100.00  .00  .00  NaN
4  500292014600  11202.00  .00  .00  NaN
>>> data = data.reset_index(drop = True)
>>> print(data.head())
              0         2    3    4    20
 0  500292014600       .00  .00  .00  NaN
 1  500292014600    100.00  .00  .00  NaN
 2  500292014600  11202.00  .00  .00  NaN

Answer: Warning: This method has serious potential side effects and should probably not be used - see comments!
Try the following:
df = df.T.reset_index(drop=True).T

Comment: this sounds like a hack; the `reset_index` method should be possibly applied to column indexes as well
Comment: That's a nice way around the problem but is there a direct way to reset both row and column index?
Comment: Another downside that is not mentioned is that transposing messes up the dtypes. For example `df = pd.DataFrame({'A': [1,2,3], 'B': list('ABC')})` will have int64/object, but `df.T.T` will have all objects. Also, transposing can be expensive.
Answer: Try replacing the column names:
>>> import numpy as np
>>> import pandas as pd

>>> my_data = [[500292014600, .00, .00, .00, np.nan],
              [500292014600, 100.00, .00, .00, np.nan],
              [500292014600, 11202.00, .00, .00, np.nan]]
>>> df = pd.DataFrame(my_data, columns=[0,2,3,4,20])
>>> df
              0        2    3    4  20
0  500292014600      0.0  0.0  0.0 NaN
1  500292014600    100.0  0.0  0.0 NaN
2  500292014600  11202.0  0.0  0.0 NaN

>>> df.columns = range(df.columns.size)
>>> df
              0        1    2    3   4
0  500292014600      0.0  0.0  0.0 NaN
1  500292014600    100.0  0.0  0.0 NaN
2  500292014600  11202.0  0.0  0.0 NaN

Answer: In pandas, by index you essentially mean row index. As you can see in your data, the row index is reset after drop and reset_index().
For columns, you need to rename them, you can do something like
data.columns = [ 0,1,2,3,4]

Answer: I realize there is no answer that can easily be used in a pipeline/method chaining (except the double transpose, but this is a waste of computing in my opinion and has the downside of messing up the dtypes).
One can use set_axis:
df.set_axis(range(df.shape[1]), axis=1)

Used with pipe for method chaining:
df = (pd.DataFrame('x', columns=list('ABCD'), index=range(2))
        .pipe(lambda d: d.set_axis(range(d.shape[1]), axis=1))
     )

output:
   0  1  2  3
0  x  x  x  x
1  x  x  x  x

Answer: If you have numpy imported with import numpy as np
simply set the columns to zero based indexes with data.columns = [np.arange(0,data.shape[1])]
Answer: Pure Python Implementation
We enumerate the columns of the dataframe to create an array of items. Then we map the function reversed to each item in the array. Lastly, we create and input the dictionary as the parameter columns in the data frame object method rename.
columns = dict(map(reversed, enumerate(df.columns)))
df = df.rename(columns=columns)
df.head()

Results:
              0        1    2    3   4
0  500292014600      0.0  0.0  0.0 NaN
1  500292014600    100.0  0.0  0.0 NaN
2  500292014600  11202.0  0.0  0.0 NaN

Answer:
How come when i use df.reset_index the index of my columns is not reset?

The column "index" is really more of a column title. It's possible that someone may using the "index" as a meaningful title. For example, perhaps they represent "Trial 1", "Trial 2", etc., so you wouldn't want to re-index it automatically and lose the significance.

How do I go about resetting this index to 0,1,2,3,4?

To reset the column indexes:
df.columns = range(df.columns.size)


What's the potential best model to solve this classification problem?

Question: I'm facing a classification problem as follows:
the features: an array of floats. The relationship between features and target is not notable, so I'm not expecting a 90% accuracy or so. As long as it can solve the problem it is good for me.
the target: a float that could be positive or negative or zero.
the problem: predict the sign of the target (i.e. 0, +, or -) so that the sum of sign * target reaches maximum.
As comparison, I can predict with a brutal force guess using only one feature, for example, if feature>0, then predict +, otherwise -.
Currently I'm using a random forest with a metric f1_weighted and 5 fold CV, this does not give good test result compared with brutal force guess. While the training and CV results are close to theoretical maximum sum.
What could be the best approach to modify my current model/create a new model if necessary to get the test set result at least better than brutal force guess?
Answer: Firstly, you didn't say anything about how many objects or features you are working with -- which can be helpful for the optimal classifier choice.  Furthermore, a lot of analysts implement complex models before knowing how to perform microsurgery so that a meaningful description of class separation can be made.
It's always best to start by using straightforward multivariate linear regression first when the targets are -1, +1, such that you regress all the +/- variates on to the predictors.   Reason is, because you first need to know if the class separation between +/- is linearly separable.
If RF is breaking down, try LREG (multivariate linreg), followed by k-nearest neighbors, discriminant analysis, learning vector quantization, and then support vector machines with RBF kernel, and then neural networks.
With regard to the 5-fold CV, since you didn't provide your total sample size, you should evaluate 2-, 5-, 10-fold, and LOOCV CV approaches.
Comment: Thanks, I'd like to abandon this question because I cannot provide more info than this.


Finding the units of $\mathbb{Z}\left[\frac{1+\sqrt{-19}}{2}\right]$

Question: I was trying to comprehend a simple exercise from my elementary number theory class.

Let $\theta=\frac{1+\sqrt{-19}}{2}$, and let $R$ be the ring $\mathbb{Z}[\theta] .$ Show that the units of $R$ are $\pm 1$, and that 2,3, and $\theta$ are irreducible in $\mathbb{Z}[\theta]$.

The official solution:
If $z=a+b \theta$ is a unit of $\mathbb{Z}[\theta]$ then $z \bar{z}=1$, so we have $a^{2}+a b+5 b^{2}=1$ from which we conclude $a=\pm 1$, so the units are $\pm 1$. If $z=a+b \theta$ is a nonunit, non-associate divisor of 2 then $z \bar{z}=2$, but there are no solutions to $a^{2}+a b+5 b^{2}=2$. The arguments for 3 and $\theta$ are similar.
This solution is much too concise for me.

Firstly, why does  $z=a+b \theta$ being a unit of $\mathbb{Z}[\theta]$ imply $z \bar{z}=1$? At this point in time, the norm for $\mathbb{Z}[\theta]$ has not been defined, so cannot be used. I was hypothesizing that for $z_1,z_2 \in \mathbb{Z}[\theta]$, $z_1 z_2 \in \mathbb{Z}$ implied (by comparing imaginary parts) that $z_1 = \lambda \overline{z_2}$ for some $\lambda \in \mathbb{Q}$, but this also is not easy to prove. I even failed to brute force this, I couldn't continue the calculation.

Why does $z=a+b \theta$ being a nonunit, non-associate divisor of 2 imply that $z \bar{z}=2$?

Any partial answers (answering only one of the questions) are very welcome! I will upvote them too. If the above problem has other solutions, not necessarily following the same reasoning as the official solution, then those are also very welcome!
Comment: Well, do not consider it too algebraically. Just consider the simplest complex multiplication. $z$ is a complex number, $zw=1$ implies $|z||w| = 1,\,|z|^2|w|^2 = 1$. Since $|z|^2 = a^2 + ab + 5b^2$ is an integer and $|z|^2 \ge 0$, it implies $|z|^2 = z \bar{z} = 1$. Please note that this answer is nothing about the norm. It is just complex modulus.
Answer: Denote $z\bar z$ by $N(z)$. Then

$N(\alpha\beta)=N(\alpha)N(\beta)$ where $\alpha,\beta\in\Bbb Z[\theta]$.
$N(z)=a^2+ab+5b^2>0$ for all non-zero $z$. This is because $$4(a^2+ab+5b^2)\geq 0\\(2a+b)^2+19b^2\geq 0$$ Also $N(z)$ is a non-negative integer.

$z$ is a unit $\iff N(z)=1$

Proof:

If $z$ is a unit, then there is a $w\in\Bbb Z[\theta]$ such that $zw=1$. Then $N(z)N(w)=1$. So $N(z)=1$

If $N(z)=1$, then $z\bar z=1$, so $z$ is a unit.

The units in $\Bbb Z[\theta]$ satisfy $N(z)=1$. To find the units notice that $$a^2+ab+5b^2=1\\(2a+b)^2+19b^2=4$$ gives $b=0$, and so $a=\pm 1$. Therefore the units of $\Bbb Z[\theta]$ are $\pm 1$.
Let $z$ be a non-unit, and a non-associate divisor of $2$. Then $zw=2$, and so $N(z)N(w)=4$.

If $N(z)=1$, then $z$ is a unit, which is impossible.
If $N(z)=4$, then $N(w)=1$ so $w$ is a unit, and then $z$ is associate to $2$.

Therefore $N(z)=2$.
Answer:
Let $z \in \mathbb{Z}[\theta]$ be a unit, with inverse $u \in \mathbb{Z}[\theta]$. You can check by hand that $\zeta=z\overline{z},\upsilon=u \overline{u} \in \mathbb{Z}$, and since $zu=1$, you can deduce that $\zeta\upsilon=1$. Taking coordinates, you can see that $\zeta \geq 0$ so that $\zeta=1$, QED.

The proof is actually very similar to 1: let $z$ be a non-unit, non associate divisor of $2$, then write $2=uz$ with $u$ a non-unit. Then $(z\overline{z})(u\overline{u})=(zu)\overline{zu}=2\cdot 2=4$, and $\zeta=z\overline{z},\upsilon=u\overline{u}$ are positive integers. Moreover, if $\zeta=1$, this means that $z$ is a unit (since then $\overline{z}=z^{-1} \in \mathbb{Z}[\theta]$, which is assumed false. Similarly, if $\zeta=4$, then $\upsilon=1$ and $u$ is thus a unit so that $z$ and $2$ are associated, which we assumed was also false. Hence $\zeta=2$.
Answer: From a Galois-theory perspective, $\mathbb{Q}(\sqrt{-19})$ is an extension of degree $2$ of $\mathbb{Q}$, thus there are only $2$ linearly independent immersions of $\mathbb{Q}(\sqrt{-19})$ into the alebric closure $\overline{\mathbb{Q}}$ of $\mathbb{Q}$ in $\mathbb{C}$: the identity $\sigma_0$ and the one which changes the sign of $\sqrt{-19}$: $\sigma_1$. This happens because the minimal polynomial of $\sqrt{-19}$ has $\pm\sqrt{-19}$ as roots. Now you can define a norm:
$$N:\mathbb{Q}(\sqrt{-19})\longrightarrow \mathbb{Q}$$
by $N(\alpha)=\sigma_0(\alpha)\sigma_1(\alpha)$ which is basically the multiplication of $\alpha$ by its conjugate: $\bar{\alpha}$ (remember $\sigma_1$ changes the sign of $\sqrt{-19}$). As you can see $N$ is multiplicative and it can be restricted to the ring of integers of $\mathbb{Q}(\sqrt{-19})$: $\mathbb{Z}[\theta]$ as $-19\equiv1$ $mod\hspace{1mm} 4$. Notice that on such ring $N$ is integer valued: its image is in $\mathbb{N}$ and clearly $N(1)=1$. Thus for any unit $u$ it holds:
$$1=N(1)=N(uu^{-1})=N(u)N(u^{-1})$$
Hence $N(u)=1$. Since $N$ multiplies its arguments by their conjugate, $u\bar{u}=1$.
Answer: Here is an approach to finding the units that does not use complex conjugates or norms.
Suppose $z=a+b\theta$ where $a$ and $b$ are integers and $\theta$ is your generator $(1+\sqrt{-19})/2$.  By definition, if $z$ is a unit then there must be an inverse $z^{-1}=c+d\theta$ where $c$ and $d$ are also integers and $zz^{-1}=1$.
We may determine the required values of $c$ and $d$ in terms of $a$ and $b$.  To wit,
$zz^{-1}=ac+(bc+ad)\theta+bd\theta^2=1$
For $\theta=(1+\sqrt{-19})/2$ we have $\theta^2-\theta+5=0$, thus $\theta^2=\theta-5$.  Plugging that into the above yields
$(ac-5bd)+[bc+(a+b)d]\theta=1$
and thus a linear system of equations for $c$ and $d$:
$ac-5bd=1$
$bc+(a+b)d=0$
This may be solved for $c$ and $d$ by the usual methods for solving linear systems yielding the following:
$c=\dfrac{a+b}{a^2+ab+5b^2}=\dfrac{a+b}{(a+\frac12b)^2+\frac{19}4b^2}$
$d=-\dfrac{b}{a^2+ab+5b^2}=-\dfrac{b}{(a+\frac12b)^2+\frac{19}4b^2}$
where we complete the square in the $a^2+ab$ terms and thus render the common denominator as a sum of two nonnegative quantities.
In the field $\mathbb Q[\theta]$ this gives a well-defined inverse $z^{-1}=c+d\theta$ except for the case $(a,b)=(0,0)$ which corresponds to $z=0$. In the more limited domain $\mathbb Z[\theta]$ we require $c$ and $d$ to be integers.  But then if $b$ is nonzero (thus making $d$ also nonzero) we need
$b^2\ge(a+\frac12b)^2+\frac{19}4b^2\ge\frac{19}4b^2$
which is a contradiction for all nonzero $b$.  Thus $b$ must be $0$, forcing $a\not=0$ and then $c=1/a$.  The latter is then an integer only for $a=\pm1$ making those values the only units.
The contradiction that excludes all nonzero values of $b$ arose from the relatively large coefficient of $b^2$ in the denominator that emerged from the linear system, which in turn came from the relatively large absolute value $\sqrt{19}/2$ we chose for the imaginary part of $\theta$.  What if we tried an absolutely smaller imaginary part?  If we had chosen $\theta=(1+\sqrt{-3})/2$ instead of $\theta=(1+\sqrt{-19})/2$, then we would have found that $d$ could be an integer for $b=\pm1$ as well as $b=0$, thus giving $\mathbb Z[(1+\sqrt{-3})/2]$ its additional "primitive" or "nontrivial" units besides $\pm 1$.


How to disable/enable button when the iput field is empty or filled using state in react js?

Question: I am new in reactjs.

I was trying to build create-react-app with normal backend server. First i was trying to load the data from backend api using fetch using object itemId which depends on [item]. Now i want to disable the 'Add to Stock' button through 'increaseQuantity(itemId)}' event handler  when the (<input value={input} onInput={e => { setInput(e.target.value); }} type="text" name='text' placeholder='Restock The Item' />)input field is empty. Enable the 'Add to Stock' button through  'increaseQuantity(itemId)}' when the (<input value={input} onInput={e => { setInput(e.target.value); }} type="text" name='text' placeholder='Restock The Item' />)input field is filled.Then I update the value in the state using setInput and POST request to backend in the 'increaseQuantity(itemId)}' event handler.

      import React, { useEffect, useState } from 'react';
          import { Link, useParams } from 'react-router-dom';
          const ItemDetails = () => {
              const { itemId } = useParams();
              const [input, setInput] = useState('');
              const [item, setItem] = useState({});
              // const [agree, setAgree] = useState(false);

              useEffect(() => {
                  const url = `http://localhost:5000/item/${itemId}`;
                  fetch(url)
                      .then(res => res.json())
                      .then(data => setItem(data));

              }, [item]);

              const increaseQuantity = (id) => {
                  let quantity = item.quantity;
                  let num = parseInt(input);
                  quantity += num;
                  quantity = parseInt(quantity);
                  const updatedDetail = { quantity };
                  console.log(updatedDetail);
                  fetch(`http://localhost:5000/item/${itemId}`, {
                      method: 'PUT',
                      headers: {
                          'content-type': 'application/json',
                      },
                      body: JSON.stringify(updatedDetail),
                  })
                      .then(res => res.json())
                      .then(data => {
                          console.log(data);
                      })
              }

              return (

                      About To Book{itemId}

                          {item.name}
                          price: {item.price}
                          Quantity: {item.quantity}

                           { setInput(e.target.value); }} type="text" name='text' placeholder='Restock The Item' />

                           increaseQuantity(itemId)} className='btn btn-primary ms-4'>Add to Stock

              );
          };

          export default ItemDetails;

Comment: your code seems incomplete input html tag is missing, extra closing brackets...
Comment: I edited the context..I tried but input field is not showing before button..Thank you.
Answer:
! should not be double. If ! is double before input , then button is not working in filled input field.

this could do the job
<button disabled={!input}>Add to stock</button>

Comment: if you can share your code in codesanbox i can help.


Wix installer is blank or disabled on windows 10

Question: Wix installer .msi is totally disabled (blank) if i run it on windows 10, but on all other versions of windows it is working fine.
Is there anything that should be added in order to recognize Win 10, or some update...?

Answer: Just removed this condition while there version for windows 10 is different and it is working now....
<code><Condition Level="0">
        <![CDATA[NOT IISMAJORVERSION >= "#6"]]>
      </Condition>
</code>
Comment: Expanding on that....  Conditional Statement syntax in MSI evaluates from MSI and thinks that 10 is less then 6 because 1 is less then 6.  Your conditional expression needs to take this into account.
Comment: Thanks for clarifying it.


Yum can't add rpm repository via yum install command

Question: I have CentOS Linux release 7.4.1708 Linux distro.
I need to install some package. The first command to execute is to add repoistory:

yum install https://extras.getpagespeed.com/release-el7-latest.rpm

When I run it, command hangs and prints errors after some time. Full output from cli is below:

# yum install https://extras.getpagespeed.com/release-el7-latest.rpm
  Cannot open:
https://extras.getpagespeed.com/release-el7-latest.rpm. Skipping.
  Error: Nothing to do

P.S. I try to install Page Speed Nginx module
Update 1
Seems like my server can't download rpm file:

wget https://extras.getpagespeed.com/release-el7-latest.rpm

Server is connected to the Internet, wget and ping commands works ok on some random resources.
Update 2
I've downloaded file https://extras.getpagespeed.com/release-el7-latest.rpm  to my workstation via browser and uploaded it to home server folder.
Then I went to server home folder and executed command rpm -Uvh release-el7-latest.rpm.

#rpm -Uvh release-el7-latest.rpm
  warning: release-el7-latest.rpm:
  Header V4 RSA/SHA1 Signature, key ID 222b0e83: NOKEY
  Preparing...
  Updating / installing...
  1:getpagespeed-extras-7-3.el7.gps

Then I searched my package via yum search command. It gives me error, some parts of huge output are below.

yum search nginx-module
extras                                        | 3.4 kB  00:00:00
https://extras.getpagespeed.com/redhat/7/noarch/repodata/repomd.xml:
  [Errno 14] curl#7 - "Failed to connect to 2606:4700:30::6812:31e3:
  Network is unreachable" Trying other mirror.
https://extras.getpagespeed.com/redhat/7/noarch/repodata/repomd.xml:
  [Errno 14] curl#56 - "Callback aborted" Trying other mirror.

I figured out what there're some problems with IPv6 and added ip_resolve=4 setting to /etc/yum.conf file.
Errors changed:

yum search nginx-module
  extras                                        | 3.4 kB  00:00:00
https://extras.getpagespeed.com/redhat/7/noarch/repodata/repomd.xml:
  [Errno 14] curl#7 - "Failed connect to extras.getpagespeed.com:443; Operation now in progress"

Can problems be related to https connection problems?
Update 3
Error in Update 2 is related to file https://extras.getpagespeed.com/redhat/7/noarch/repodata/repomd.xml, it can't be downloaded.
Direct download from cli has no success too:

# curl --verbose https://extras.getpagespeed.com/redhat/7/noarch/repodata/repomd.xml
  * About to connect() to extras.getpagespeed.com port 443 (#0)
  *   Trying 126.96.36.199...
  * Connection timed out
  *   Trying 22.214.171.124...
  * After 86358ms connect time, move on!
  *   Trying 2606:4700:30::6812:31e3...
  * Failed to connect to 2606:4700:30::6812:31e3: Network is unreachable
  *   Trying 2606:4700:30::6812:30e3...
  * Failed to connect to 2606:4700:30::6812:30e3: Network is unreachable
  * Failed connect to extras.getpagespeed.com:443; Network is unreachable
  * Closing connection 0
  curl: (7) Failed to connect to 2606:4700:30::6812:31e3: Network is unreachable

I thought it's https problem on server, but curl https://www.google.com works perfectly. File is downloadable via browser from workstation.
Update 4
Iptables rules are below:

# iptables-save
  *filter
  :INPUT ACCEPT [71:19593]
  :FORWARD ACCEPT [0:0]
  :OUTPUT ACCEPT [81:64337]
  :MYSQL - [0:0]
  :MYSQL_WHITELIST - [0:0]
  -A INPUT -p tcp -m tcp --dport 3306 -j MYSQL
  -A MYSQL -j MYSQL_WHITELIST
  -A MYSQL -j ACCEPT
  -A MYSQL_WHITELIST -s 10.100.10.6/32 -j RETURN
  -A MYSQL_WHITELIST -j DROP
  COMMIT

Update 5
Traceroute output:

# traceroute extras.getpagespeed.com
  traceroute to extras.getpagespeed.com (18.104.22.168), 30 hops max, 60 byte packets
  1  * * *
  2  * * *
  3  * * *
  4  * * *
  ...
  30  * * *
Comment: You should try to traceroute to that IP address and show the results.
Comment: The firewall on your server side will not be an issue. **Off topic note:** You are filtering only MYSQL connection all the rest is just accepted as **default policy** on **INPUT** chain. Is it whole output - are you really opening the server for all ports ? Anyway for mySQL filtering you can remove **MYSQL** chain and jump directly to **MYSQL_WHITELIST** just instead of **RETURN** use **ACCEPT**. Last rule for mySQL is **DROP** "the rest" what is not passed for mySQL connection from whitelisted IP until reaching last rule in chain.
Comment: I agree with Kamil J. I successfully tested this ruleset on a centOS VM.
Answer: It looks like your web request is timing out when trying to reach extras.getpagespeed.com on port 443 for HTTPS. This host is actually load balanced using DNS between a couple different ip's so it's trying both, then trying ipv6 (which is unreachable because you likely don't have a default route for ipv6 configured in your routing table). You should be able to verify this by opening a tcp connection on 443 using telnet:
telnet extras.getpagespeed.com 443

if this times out, you likely have a firewall rule blocking your outbound web requests to the ip addresses that your are resolving for extras.getpagespeed.com
You can verify this by checking your firewall settings first on your host:
iptables-save

for iptables. If you are running firewalld you can also use:
systemctl status firewalld

to get the state, and then
firewall-cmd --list-all

if there isn't an active rule blocking outbound tcp connections to destination port 443 to 126.96.36.199 or 188.8.131.52 but your telnet is still timing out, the next step is to figure out which hop in your network is filtering HTTPS requests to those specific ip addresses. You should be able to pretty easily find the next hop in your network using:
traceroute extras.getpagespeed.com

my hunch is that your router, firewall (ACL's could be being applied from a firewall within your router that does double duty, or a dedicated firewall at the edge of your network, depending on your network topology) has a rule that is catching your HTTPS request and dropping the packets.
I don't think this is a routing issue because we are A- able to reach resolvers just fine, and resolve extras.getpagespeed.com, just fine, and B- we can get port 80 traffic to google, so your default route is working.
Comment: Thank's for response. Telnet command fails. I've added iptables rules into quetsion. Can they cause problems?
Comment: I don't actually think iptables is the problem. I tested from a centOS VM using the exact iptables rules you posted, and I'm still able to reach `extras.getpagespeed.com` via https.
Comment: Traceroute fails, I'll add output to question.
Comment: One more thing to try. Since it looks like trace route is failing, likely because your icmp packets are being filtered. You might try installing tcptraceroute and then doing a tcptraceroute on port 443:
`sudo tcptraceroute extras.getpagespeed.com 443`
Comment: Tcptraceroute gives me the same "stars" unfortunately, thanks for responses anyway.
Answer:
DNS recolving

DNS recoving seems to be working. You already changed yum config to use IPv4.

firewall rules on server

Next to check the firewall (make focus on OUTPUT / outgoing connection). You can try one of following :
iptables-save
iptables -S ; iptables -t nat -S

connection

You have mentioned that on workstation it is working. How are the server and the workstation connected? Is it located behind the same connection ? Are you using VLANs? Is there any ACL on router / firewall handling the connection (and / or VLAN routing) ? Is the default GW the same ? Where is the communication terminated (traceroute) - at least what ICMP show...
ip route show
ip address show
traceroute extras.getpagespeed.com

just in case... Isn't there any VPN session active on server / Workstation so the result may be impacted by it (it would be visible in output of previous commands)?

one more check

I have tried to reach it on http (port 80) and there can be seen at least redirect for https schema. Try to reach it on port 80. I would not help at the end but can help to trouble shoot if it is something related specifically to port 443.
    $ curl -4iv http://extras.getpagespeed.com/release-el7-latest.rpm >/dev/null

    * About to connect() to extras.getpagespeed.com port 80 (#0)
    *   Trying 220.127.116.11...
    * Connected to extras.getpagespeed.com (188.8.131.52) port 80 (#0)
    > GET /release-el7-latest.rpm HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: extras.getpagespeed.com
    > Accept: */*
    >
    < HTTP/1.1 301 Moved Permanently
    < Date: Wed, 12 Dec 2018 00:42:10 GMT
    < Content-Length: 0
    < Connection: keep-alive
    < Set-Cookie: __cfduid=d1db394ac95ecd334f0739681096b64ba1544575330; expires=Thu, 12-Dec-19 00:42:10 GMT; path=/; domain=.getpagespeed.com; HttpOnly
    < X-Varnish: 1149403
    < Location: https://extras.getpagespeed.com/release-el7-latest.rpm
    < CF-Cache-Status: MISS
    < Server: cloudflare
    < CF-RAY: 487c264520a7c274-FRA
    <
    * Connection #0 to host extras.getpagespeed.com left intact

Note: As it is located in CloudFlare there may be some limitation on connection in case it is recognized as potential attack - improper communication, rate of the requests, etc.
Comment: Based on your Update4 ````firewall rules on server```` would not be an issue. Anyway in theory there can be some blocking rule on firewall / router but the most probably it will not be a case... try other stuff I have mentioned also that **http** connection to see the header.
Comment: Hmm ok, it seems to me really like some kind ban on IP of your VPS server on CloudFlare side ... Try to open ssh with parameter ````ssh -R 12345:extras.getpagespeed.com:443 ...````. It will open remote port (on VPS) listeing on port 12345. Then add temporary record to /etc/hosts file pointing extras.getpagespeed.com to localhost and try to open the connection to port 12345 (https). In case the VPS ip would be really ban this would help (the connection will go through the ssh session you have created and "from" your client IP. In case of success connection you cannot do much on server side :-(.
Comment: I'm with you on the DNS resolution looking good and checking the firewall. I don't, however think that this is a cloudflare issue, since I can reach extras.getpagespeed.com via HTTPS request (on port 443) from multiple cloud providers and regions. (I tested ec2 us-east2, DO - Frankfurt, and DO - San Francisco.
Comment: Cloudflare as a service is ok. Thay are doing some online analysis and providing (at least some) security level as a service directly. The result may be than one source IP (or session as they are using also headers /cookies) may be limited on access while othe may work without any limitation. In case original server from the request has some communication history already it  may face other rule set then any other endpoint including your nodes you have tried... Interesting may be if mentioned workstation share connection / IP.
Comment: Begin from the end. `curl -4iv ... ` fails.Traceroute also fails, I'll add the output to the question.
Comment: Workstation is connected to server via ssh/sftp. It's leased VPS, not dedicated standalone host.


FBX Sdk Skeletal Animations

Question: I have successfully loaded and rendered a fbx model using fbx sdk and directx.
I'm now trying to implement skeletal animations. First  I'm trying to put my character on different poses by modifying bones matrices. (So I can achieve animations by setting different poses at times)
Here's my code of loading fbx and skinning information.
FBXLoader.h
#include <fbxsdk.h>
#include <vector>
#include <string>
#include <map>
#include <d3d11_1.h>
#include <DirectXMath.h>
#include "TextureLoader.h"

using namespace DirectX;

struct VERTEX
{
    XMFLOAT3 pos;
    XMFLOAT2 tex;
    XMFLOAT4 boneids;
    XMFLOAT4 weights;

    VERTEX()
    {
        boneids = { 0, 0, 0, 0 };
        weights = { 0, 0, 0, 0 };
    }
};

struct Keyframe {
    FbxLongLong mFrameNum;
    FbxAMatrix mGlobalTransform;
    Keyframe* mNext;

    Keyframe() : mNext(nullptr)
    {}
};

struct Joint {
int mParentIndex;
const char* mName;
FbxAMatrix mGlobalBindposeInverse;
Keyframe* mAnimation;
FbxNode *mNode;

Joint() :
    mNode(nullptr),
    mAnimation(nullptr)
{
    mGlobalBindposeInverse.SetIdentity();
    mParentIndex = -1;
}

~Joint()
{
    while (mAnimation)
    {
        Keyframe* temp = mAnimation->mNext;
        delete mAnimation;
        mAnimation = temp;
    }
}
};

struct Skeleton {
std::vector<Joint> mJoints;
};

class Mesh
{
public:
Mesh(ID3D11Device *dev, std::vector<VERTEX> vertices, ID3D11ShaderResourceView *texture)
{
    this->vertices = vertices;
    this->texture = texture;

    this->SetupMesh(dev);
}

void Draw(ID3D11DeviceContext *devcon)
{
    UINT stride = sizeof(VERTEX);
    UINT offset = 0;

    devcon->IASetVertexBuffers(0, 1, &vertexBuffer, &stride, &offset);

    if (this->texture != nullptr)
        devcon->PSSetShaderResources(0, 1, &texture);

    devcon->Draw(vertices.size(), 0);
}
private:
std::vector<VERTEX> vertices;
ID3D11ShaderResourceView *texture = nullptr;
ID3D11Buffer* vertexBuffer;

bool SetupMesh(ID3D11Device *dev)
{
    HRESULT hr;

    D3D11_BUFFER_DESC vbd;
    vbd.Usage = D3D11_USAGE_IMMUTABLE;
    vbd.ByteWidth = sizeof(VERTEX) * vertices.size();
    vbd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
    vbd.CPUAccessFlags = 0;
    vbd.MiscFlags = 0;

    D3D11_SUBRESOURCE_DATA initData;
    initData.pSysMem = &vertices[0];

    hr = dev->CreateBuffer(&vbd, &initData, &vertexBuffer);
    if (FAILED(hr))
        return false;
}
};

class FBXLoader
{
public:
FBXLoader();
~FBXLoader();

void LoadFBX(HWND hwnd, ID3D11Device *dev, ID3D11DeviceContext *devcon, const char* filename);

void Draw(ID3D11DeviceContext *devcon);

XMMATRIX GetAnimatedMatrix(int index);

Skeleton skeleton;

private:
FbxManager *fbxsdkManager = nullptr;
FbxScene *fbxScene;
std::map<int, int> controlpoints;
std::vector<Mesh> meshes;
HWND hwnd;

void ProcessNode(ID3D11Device *dev, ID3D11DeviceContext *devcon, FbxNode *node, FbxGeometryConverter *gConverter);

Mesh ProcessMesh(ID3D11Device* dev, ID3D11DeviceContext *devcon, FbxMesh *mesh);

void ProcessSkeletonHeirarchy(FbxNode* rootnode);

void ProcessSkeletonHeirarchyre(FbxNode* node, int depth, int index, int parentindex);

unsigned int FindJointIndex(const std::string& jointname);

ID3D11ShaderResourceView *LoadTexture(ID3D11Device *dev, ID3D11DeviceContext *devcon, const char* texturefilename);
};

FBXLoader.cpp
#include "FBXLoader.h"

FBXLoader::FBXLoader()
{
}

FBXLoader::~FBXLoader()
{
}

void FBXLoader::LoadFBX(HWND hwnd, ID3D11Device * dev, ID3D11DeviceContext *devcon, const char * filename)
{
if (fbxsdkManager == nullptr)
{
    fbxsdkManager = FbxManager::Create();

    FbxIOSettings* ioSettings = FbxIOSettings::Create(fbxsdkManager, IOSROOT);
    fbxsdkManager->SetIOSettings(ioSettings);
}

FbxImporter *importer = FbxImporter::Create(fbxsdkManager, "");
fbxScene = FbxScene::Create(fbxsdkManager, "");

FbxGeometryConverter gConverter(fbxsdkManager);

bool bSuccess = importer->Initialize(filename, -1, fbxsdkManager->GetIOSettings());

bSuccess = importer->Import(fbxScene);

importer->Destroy();

FbxNode *fbxRootNode = fbxScene->GetRootNode();

ProcessSkeletonHeirarchy(fbxRootNode);

this->hwnd = hwnd;

ProcessNode(dev, devcon, fbxRootNode, &gConverter);
}

void FBXLoader::Draw(ID3D11DeviceContext * devcon)
{
for (int i = 0; i < meshes.size(); i++)
{
    meshes[i].Draw(devcon);
}
}

XMMATRIX FBXLoader::GetAnimatedMatrix(int index)
{
XMMATRIX bonematxm;
FbxAMatrix bonemat = skeleton.mJoints[index].mGlobalBindposeInverse; //* skeleton.mJoints[0].mAnimation->mGlobalTransform;

bonematxm = XMMatrixTranslation(bonemat.GetT().mData[0], bonemat.GetT().mData[1], bonemat.GetT().mData[2]);
bonematxm *= XMMatrixRotationX(bonemat.GetR().mData[0]);
bonematxm *= XMMatrixRotationY(bonemat.GetR().mData[1]);
bonematxm *= XMMatrixRotationZ(bonemat.GetR().mData[2]);

return bonematxm;
}

void FBXLoader::ProcessNode(ID3D11Device * dev, ID3D11DeviceContext *devcon, FbxNode * node, FbxGeometryConverter * gConverter)
{
if (node)
{
    if (node->GetNodeAttribute() != nullptr)
    {
        FbxNodeAttribute::EType AttributeType = node->GetNodeAttribute()->GetAttributeType();

        if (AttributeType == FbxNodeAttribute::eMesh)
        {
            FbxMesh *mesh;

            mesh = (FbxMesh*)gConverter->Triangulate(node->GetNodeAttribute(), true);

            meshes.push_back(ProcessMesh(dev, devcon, mesh));
        }
    }

    for (int i = 0; i < node->GetChildCount(); i++)
    {
        ProcessNode(dev, devcon, node->GetChild(i), gConverter);
    }
}
}

Mesh FBXLoader::ProcessMesh(ID3D11Device * dev, ID3D11DeviceContext *devcon, FbxMesh * mesh)
{
std::vector<VERTEX> meshvertices;
ID3D11ShaderResourceView *meshtexture = nullptr;

FbxVector4 *vertices = mesh->GetControlPoints();

for (int j = 0; j < mesh->GetPolygonCount(); j++)
{
    int numVertices = mesh->GetPolygonSize(j);

    FbxLayerElementArrayTemplate<FbxVector2> *uvVertices = 0;
    mesh->GetTextureUV(&uvVertices, FbxLayerElement::eTextureDiffuse);

    for (int k = 0; k < numVertices; k++)
    {
        int controlPointIndex = mesh->GetPolygonVertex(j, k);

        VERTEX vertex;

        vertex.pos.x = (float)vertices[controlPointIndex].mData[0];
        vertex.pos.y = (float)vertices[controlPointIndex].mData[1];
        vertex.pos.z = (float)vertices[controlPointIndex].mData[2];

        vertex.tex.x = (float)uvVertices->GetAt(mesh->GetTextureUVIndex(j, k)).mData[0];
        vertex.tex.y = 1.0f - (float)uvVertices->GetAt(mesh->GetTextureUVIndex(j, k)).mData[1];

        controlpoints[controlPointIndex] = meshvertices.size();

        meshvertices.push_back(vertex);
    }
}

int materialcount = mesh->GetNode()->GetSrcObjectCount<FbxSurfaceMaterial>();

for (int i = 0; i < materialcount; i++)
{
    FbxSurfaceMaterial *material = (FbxSurfaceMaterial*)mesh->GetNode()->GetSrcObject<FbxSurfaceMaterial>(i);

    if (material)
    {
        FbxProperty prop = material->FindProperty(FbxSurfaceMaterial::sDiffuse);

        const FbxTexture* texture = FbxCast<FbxTexture>(prop.GetSrcObject<FbxTexture>(0));
        const FbxFileTexture* filetexture = FbxCast<FbxFileTexture>(texture);

        ID3D11ShaderResourceView *meshctexture = LoadTexture(dev, devcon, filetexture->GetFileName());

        meshtexture = meshctexture;
    }
}

const FbxVector4 lT = mesh->GetNode()->GetGeometricTranslation(FbxNode::eSourcePivot);
const FbxVector4 lR = mesh->GetNode()->GetGeometricRotation(FbxNode::eSourcePivot);
const FbxVector4 lS = mesh->GetNode()->GetGeometricScaling(FbxNode::eSourcePivot);

FbxAMatrix geometryTransform = FbxAMatrix(lT, lR, lS);

for (unsigned int deformerIndex = 0; deformerIndex < mesh->GetDeformerCount(); ++deformerIndex)
{
    FbxSkin* skin = reinterpret_cast<FbxSkin*>(mesh->GetDeformer(deformerIndex, FbxDeformer::eSkin));
    if (!skin)
        continue;

    for (unsigned int clusterIndex = 0; clusterIndex < skin->GetClusterCount(); ++clusterIndex)
    {
        FbxCluster* cluster = skin->GetCluster(clusterIndex);
        std::string jointname = cluster->GetLink()->GetName();
        unsigned int jointIndex = FindJointIndex(jointname);
        FbxAMatrix transformMatrix;
        FbxAMatrix transformLinkMatrix;
        FbxAMatrix globalBindposeInverseMatrix;

        cluster->GetTransformMatrix(transformMatrix);
        cluster->GetTransformLinkMatrix(transformLinkMatrix);
        globalBindposeInverseMatrix = transformLinkMatrix.Inverse() * transformMatrix * geometryTransform;

        skeleton.mJoints[jointIndex].mGlobalBindposeInverse = globalBindposeInverseMatrix;
        skeleton.mJoints[jointIndex].mNode = cluster->GetLink();

        for (unsigned int i = 0; i < cluster->GetControlPointIndicesCount(); ++i)
        {
            int vertexid = controlpoints[cluster->GetControlPointIndices()[i]];

            if (meshvertices[vertexid].boneids.x == 0) meshvertices[vertexid].boneids.x = jointIndex;
            if (meshvertices[vertexid].boneids.y == 0) meshvertices[vertexid].boneids.y = jointIndex;
            if (meshvertices[vertexid].boneids.z == 0) meshvertices[vertexid].boneids.z = jointIndex;
            if (meshvertices[vertexid].boneids.w == 0) meshvertices[vertexid].boneids.w = jointIndex;
            if (meshvertices[vertexid].weights.x == 0) meshvertices[vertexid].weights.x = cluster->GetControlPointWeights()[i];
            if (meshvertices[vertexid].weights.y == 0) meshvertices[vertexid].weights.y = cluster->GetControlPointWeights()[i];
            if (meshvertices[vertexid].weights.z == 0) meshvertices[vertexid].weights.z = cluster->GetControlPointWeights()[i];
            if (meshvertices[vertexid].weights.w == 0) meshvertices[vertexid].weights.w = cluster->GetControlPointWeights()[i];
        }

        FbxAnimStack* animstack = fbxScene->GetSrcObject<FbxAnimStack>(0);
        FbxString animstackname = animstack->GetName();
        FbxTakeInfo* takeinfo = fbxScene->GetTakeInfo(animstackname);
        FbxTime start = takeinfo->mLocalTimeSpan.GetStart();
        FbxTime end = takeinfo->mLocalTimeSpan.GetStop();
        FbxLongLong animationlength = end.GetFrameCount(FbxTime::eFrames30) - start.GetFrameCount(FbxTime::eFrames30) + 1;
        Keyframe** anim = &skeleton.mJoints[jointIndex].mAnimation;

        for (FbxLongLong i = start.GetFrameCount(FbxTime::eFrames30); i <= end.GetFrameCount(FbxTime::eFrames30); ++i)
        {
            FbxTime time;
            time.SetFrame(i, FbxTime::eFrames30);
            *anim = new Keyframe();
            (*anim)->mFrameNum = i;
            FbxAMatrix transformoffset = mesh->GetNode()->EvaluateGlobalTransform(1.0f) * geometryTransform;
            (*anim)->mGlobalTransform = transformoffset.Inverse() * cluster->GetLink()->EvaluateGlobalTransform(time);
            anim = &((*anim)->mNext);
        }
    }
}

return Mesh(dev, meshvertices, meshtexture);
}

void FBXLoader::ProcessSkeletonHeirarchy(FbxNode * rootnode)
{
for (int childindex = 0; childindex < rootnode->GetChildCount(); ++childindex)
{
    FbxNode *node = rootnode->GetChild(childindex);
    ProcessSkeletonHeirarchyre(node, 0, 0, -1);
}
}

void FBXLoader::ProcessSkeletonHeirarchyre(FbxNode * node, int depth, int index, int parentindex)
{
if (node->GetNodeAttribute() && node->GetNodeAttribute()->GetAttributeType() && node->GetNodeAttribute()->GetAttributeType() == FbxNodeAttribute::eSkeleton)
{
    Joint joint;
    joint.mParentIndex = parentindex;
    joint.mName = node->GetName();
    skeleton.mJoints.push_back(joint);
}
for (int i = 0; i < node->GetChildCount(); i++)
{
    ProcessSkeletonHeirarchyre(node->GetChild(i), depth + 1, skeleton.mJoints.size(), index);
}
}

unsigned int FBXLoader::FindJointIndex(const std::string & jointname)
{
for (unsigned int i = 0; i < skeleton.mJoints.size(); ++i)
{
    if (skeleton.mJoints[i].mName == jointname)
    {
        return i;
    }
}
}

ID3D11ShaderResourceView * FBXLoader::LoadTexture(ID3D11Device * dev, ID3D11DeviceContext * devcon, const char * texturefilename)
{
HRESULT hr;

ID3D11ShaderResourceView *texture;

std::string filenamestr(texturefilename);
std::string sl = "/";
size_t start_pos = filenamestr.find(sl);
filenamestr.replace(start_pos, sl.length(), "\\");
std::wstring filename = std::wstring(filenamestr.begin(), filenamestr.end());

hr = CreateWICTextureFromFile(dev, devcon, filename.c_str(), nullptr, &texture);
if (FAILED(hr))
    return nullptr;

return texture;
}

Here's my vertex shader
matrix bonetransform = mul(bones[boneids[0]], weights[0]);
bonetransform += mul(bones[boneids[1]], weights[1]);
bonetransform += mul(bones[boneids[2]], weights[2]);
bonetransform += mul(bones[boneids[3]], weights[3]);

float4 posl = mul(bonetransform, pos);

output.pos = mul(posl, World);

Here's my drawing code
cb.mWorld = XMMatrixTranspose(m_World);
cb.mView = XMMatrixTranspose(m_View);
cb.mProjection = XMMatrixTranspose(m_Projection);
for (int i = 0; i < jasper->skeleton.mJoints.size(); i++)
    cb.bones[i] = XMMatrixTranspose(XMMatrixIdentity());
devcon->UpdateSubresource(pConstantBuffer, 0, nullptr, &cb, 0, 0);

devcon->VSSetShader(pVS, 0, 0);
devcon->VSSetConstantBuffers(0, 1, &pConstantBuffer);
devcon->PSSetShader(pPS, 0, 0);
devcon->PSSetSamplers(0, 1, &TexSamplerState);
model->Draw(devcon);

And when I set all bones matrices in vertex shader to identity matrix this is what I get.

Shouldn't it be this when I use identity matrix?
Answer: Bumping this as I have the same question. Here is the lab document for an assignment similar. Hopefully this helps:
Getting Joint Animation Data From FBX
This process will allow us to get animation data from an FBX joint hierarchy. You must have the previous step of this process completed first ("Getting the Joint Transforms for a BindPose in FBX").

From your FbxScene instance, get the first FbxAnimStack
a. An FbxScene may have layers of animation, but we are focusing on just one
b. Helpful functions
i. FbxScene::GetCurrentAnimationStack()
Get the duration of the animation
a. Helpful functions
i. FbxAnimStack::GetLocalTimeSpan()
ii. FbxTime::GetDuration()
Get the number of frames in the animation for the desired time mode
a. Helpful functions
i. FbxTime::GetFrameCount(FbxTime::EMode) FbxTime::EMode::eFrames24 gives 24 frames per second, and is recommended
The remaining steps will reference your dynamic array of FbxNode*/parent index pairs
a. Ex: struct my_fbx_joint { FbxNode* node; int parent_index;};
b. Ex: std::vector< my_fbx_joint >;
You will need a keyframe type
a. Ex: struct keyframe { double time; std::vector joints; };
You will need an animation clip type
a. Ex: struct anim_clip { double duration; std::vector frames; };
Create an anim_clip to fill
For the number of frames (skipping the bind pose at frame number 0)
a. Create a keyframe object
b. Determine the FbxTime for this frame
i. FbxTime::SetFrame(FbxLongLong, FbxMode::EMode)
c. Store the key time in the current keyframe
d. For each FbxNode* in your joint array from part I
i. Get the node's evaluated global transform for this frame
Helpful function
a. FbxNode::EvaluateGlobalTransform(FbxTime)
ii. Add this transform to the keyframe's joints
Keep index locations consistent. Joints should have the same index in a keyframe as they do in a bind pose
e. Add the keyframe to the anim_clip

Edit:: I would also add (depending on what topology you are using) to check if the mesh you are using is triangulated as that has fixed issues like this in the past for me.
Answer: try drawing only your skeleton with lines first...  that might help
after draw both, the skeleton & the character!
Answer: The reason of the incorrect render is that control points are shared between vertices, but in the above code only one vertex is assigned per controlpoint. The same control point can connect up to 8 vertices. One solution would be to change controlpoints to std::map<int, std::vector<int>> and then in the processMesh method instead of
controlpoints[controlPointIndex] = meshvertices.size();

you could do
controlpoints[controlPointIndex].push_back(meshvertices.size())

and when you are looping through the skins you can do something like this:
auto vertexids = controlpoints[cluster->GetControlPointIndices()[i]];

for (auto& vertexid : vertexids) {
...
}

I know this question is more than 5 years old, but I still think my answer could be useful for someone else, as it would have been for me.

FBX Sdk Skeletal Animations


Role of Dirac function in particle filters

Question: Particle approximations to probability densities are often introduced as a weighted sum of Dirac functions
$$p(x) \approx \sum_{i=1}^N \omega^i \delta(x-x^i)$$
with the weights
$$\omega^i \propto \frac{p(x^i)}{q(x^i)}$$
normalized such that they sum to unity; where $q(\cdot)$ is the importance density. I understand that the Dirac function becomes infinitely large at a point $p$, that is $\delta(p) = \infty$ and that it is zero elsewhere, that is $\delta(x) = 0 ~\forall x \neq p$. Also, I understand that the Dirac function integrated over the mass point takes the value of unity.
My questions are:

What is the relationship between the support of the particle approximation and the Dirac function?
Why is a summation sign used when evaluating $\delta$ can only ever yield a value of 0 or infinity? Shouldn't this be an integral instead?
How can the notion of the support of a function be extended to a set of points (e.g., $x_t^{(i)}$), which isn't itself a function?
How can a representation of a probability density function arise from a weighted sum of $\delta(\cdot)$s that themselves take only values of either zero or infinity?

Thank you for any clarifications you may be able to provide.
Comment: The related thread at http://stats.stackexchange.com/questions/73623 might shed some light on these questions.  (It concerns exactly the same situation but with uniform weights.)
Answer: @user20160 has already given you nice answer to your (1)-(3) questions, but the last one seems to be not yet fully answered.

How can a representation of a probability density function arise from a weighted sum of $\delta(\cdot)$s that themselves take only
  values of either zero or infinity?

Let me start with quoting Wikipedia as it provides a pretty clear description in this case (notice the bolds I added):

The Dirac delta can be loosely thought of as a function on the real
  line which is zero everywhere except at the origin, where it is
  infinite,
$$\delta(x) = \begin{cases} +\infty, & x = 0 \\ 0, & x \ne 0
 \end{cases}$$
and which is also constrained to satisfy the identity
$$\int_{-\infty}^\infty \delta(x) \, dx = 1$$
This is merely a heuristic characterization. The Dirac delta is not a
  function in the traditional sense as no function defined on the real
  numbers has these properties. The Dirac delta function can be
  rigorously defined either as a distribution or as a measure.

Further on, Wikipedia provides more formal definition and lots of worked examples, so I'd recommend you go through the whole article. Let me quote one example from it:

In probability theory and statistics, the Dirac delta function is
  often used to represent a discrete distribution, or a partially
  discrete, partially continuous distribution, using a probability
  density function (which is normally used to represent fully continuous
  distributions).  For example, the probability density function $f(x)$
  of a discrete distribution consisting of points $x = \{x_1, \dots,
 x_n\}$, with corresponding probabilities $p_1, \dots, p_n$, can be
  written as
$$ f(x) = \sum_{i=1}^n p_i \delta(x-x_i) $$

What this equation is saying is that we take sum over $n$ continuous distributions $\delta_{x_i} = \delta(x-x_i)$ that have all their mass around $x_i$'s. If you'd try to imagine $\delta_{x_i}$ distributions in terms of cumulative distribution functions, it needs to be
$$
F_{x_i}(x) =
\begin{cases}
0 & \text{if } x < x_i \\
1 & \text{if } x \ge x_i
\end{cases}
$$
So we can re-write previous density to cumulative distribution function
$$ F(x) = \sum_{i=1}^n p_i F_{x_i}(x) = \sum_{i=1}^n p_i \mathbf{1}_{x \ge x_i} $$
where $\mathbf{1}_{x \ge x_i}$ is an indicator function pointing at $x_i$. Notice that this basically is a categorical distribution in disguise. Moreover, you can define Dirac delta in terms of arbitrary function
$$ \int_{-\infty}^\infty f(x) \delta(x-x_i) dx = f(x_i) $$
so it "works" as continuous version of indicator function.
The take-away message is that Dirac delta is not a standard function. It's also not equal to infinity at zero -- if it was, it would be useless because infinity is not a number, so we couldn't perform any arithmetic operations over it. You can think of Dirac delta simply as an indicator function pointing at some $x_i$ that is continuous and integrates to unity. No black magic involved, it is just a way to hack the calculus to deal with discrete values.
Comment: Not sure about the black magic part, but your answer was quite helpful. What's the advantage of thinking about the Dirac delta as a distribution vs a measure?
Comment: @merch if you are in a probabilistic setting, you need it as a distribution.
Answer:
What is the relationship between the support of the particle approximation and the Dirac function?

The distribution is approximated as a weighted sum of delta functions. So, the support of the approximation is the the union of the support of the delta functions. Each delta function is zero everywhere except for a single point ($x_t^{(i)}$), where its value is infinite. So, the support of each delta function is that single point, and the support of the approximating distribution is the set of points $\left \{ x_t^{(i)} \right \}_{i=1}^N$

Why is a summation sign used when evaluating $\delta$ can only ever yield a value of 0 or infinity? Shouldn't this be an integral instead?

The sum is there to express the distribution as a weighted sum of delta functions. This is just saying: "place a delta function at each point $x_t^{(i)}$, and scale its amplitude by $\pi_t^{(i)}$." The distribution is continuous, so its value at each point is the probability density, not the probability. We'd integrate the density over some region to get the associated probability. The integral of each scaled delta function will be $\pi_t^{(i)}$. This means the probability of each point $x_t^{(i)}$ is $\pi_t{(i)}$, and the probability of any other value is 0.
Here's an example of approximating a continuous distribution using delta functions. The distribution $g$ is a Gaussian distribution. $g$ is approximated using distribution $f$, which is a sum of 50 scaled delta functions. The locations of the delta functions are sampled from $g$.

By eye, the PDFs don't look very similar because $f$ doesn't have a nice shape that we can see. But, the delta functions are packed closer together in regions where $g$ has higher density. Once we start taking integrals, the similarity becomes more apparent. For example, the CDFs are noticeably similar. The mean, variance, etc. will also be similar. The quality of the approximation will improve as the number of samples/delta functions increases.

How can the notion of the support of a function be extended to a set of points (e.g., $x^{(i)}_t$), which isn't itself a function?

Support is a concept defined for functions, not sets. The support of a function is the set of inputs for which the output is nonzero. As above, if we define a function as a sum of delta functions located at each point in a set $S$, the support of that function is $S$. We can also consider the indicator function of $S$. Say $S$ is a subset of some larger set $L$ (e.g. the real numbers). The indicator function $I_S(x)$ is defined on $L$. It takes a value of $1$ if $x \in S$, otherwise $0$. So, the support of the indicator function is $S$.
Comment: This is because we are approximating a continuous distribution with a discrete one.
Comment: @tintinthong This is the 'empirical CDF', obtained by integrating the PDF composed of delta functions. Its value at each point $x$ is just the fraction of delta functions whose locations are $\le x$. https://en.wikipedia.org/wiki/Empirical_distribution_function
Comment: Thank you for the clarifications. What I still do not understand is how a representation of a probability density function can arise from a weighted sum of δ(⋅)s that themselves take only values of either zero or infinity.
Comment: @user20160 how did you compute the approximate CDF?
Comment: @Constantin This reply is a little late. The reason you can approximate a continuous distribution this way is because the delta functions are packed more densely in regions where the true density is high
Comment: This is exactly what we're doing when we sample data in the context of experiments, statistics, machine learning, etc.: We sample a finite collection of points from some underlying 'true' distribution, then use our samples to make inferences about the underlying distribution. One way to think about this is that we're approximating the underlying distribution with the 'empirical distribution' of our samples. The empirical distribution is composed of delta functions located at the sampled data points: en.wikipedia.org/wiki/Empirical_distribution_function
Answer:
How can a representation of a probability density function arise from
  a weighted sum of δ(⋅)s that themselves take only values of either
  zero or infinity?

Think of Dirac's delta function as a bridge between discrete and continuous values. Dirac came up with them to simplify his math by applying continuous math tools to discrete quantities. I think of Dirac's delta in precisely the same situations when it's too cumbersome to deal with discrete values.
So, in your example someone wanted to have the probability density function. Great! But the trouble is that your inputs are discrete observations. So, this dude knew about Dirac's function, and plugged it in:
$$p(x) \approx \sum_{i=1}^N \omega^i \delta(x-x^i)$$
To understand this expression bear in mind how Dirac's delta is defined:
$$\int f(x)\delta(x-x_0)dx=f(x_0)$$
$$\delta(x)\equiv 0, \forall x\ne 0 $$
Notice, that it's not defined the way you described it:

Dirac function becomes infinitely large at a point pp, that is
  δ(p)=∞ and that it is zero elsewhere,

This is not the right way to think of a Dirac function. Always think of it as an integral above whose purpose is to link discrete value at $x_0$ to continuous expression (integral) $\int \dots dx$.
Now, apply an integral to your equation:
$$\int p(x) dx \approx \int \left(\sum_{i=1}^N \omega^i \delta(x-x^i)\right) dx=
\sum_i\omega_i$$
If you didn't have the Dirac' delta and applied the integral to a sum you'd get an undefined integral:
$$\int \left(\sum_{i=1}^N \omega^i \right) dx=\infty$$
Summarizing, Dirac's delta purpose is bring discrete quantities into continuous space, and you definition of $p(x)$ demonstrates just that. It constructs the continuous density function out of $N$ discrete values.
Again, it is misleading to think of Dirac function as "infinity at $x_0$ and zero everywhere". This description does not bring anything useful in terms of intuition. Drop it.
Here's how Diract himself defined his function in "The Principles of Quantum Mechanics" :

This is how he describes the purpose of the function, notice how he keeps repeating the word "integrand" and emphasizes "convenience":
Answer: I think your confusions are all a result of thinking of the Dirac delta as a function.  It is not (see wikipedia article https://en.wikipedia.org/wiki/Dirac_delta_function).

The delta function only makes sense as a mathematical object when it
  appears inside an integral. From this perspective the Dirac delta can
  usually be manipulated as though it were a function.

As @Tim quoted, the Dirac delta function can be rigorously defined either as a distribution or as a measure.

This is merely a heuristic characterization. The Dirac delta is not a
  function in the traditional sense as no function defined on the real
  numbers has these properties. The Dirac delta function can be
  rigorously defined either as a distribution or as a measure.

I think its easier to think of it as a measure ( ie essentially something you integrate against). So given a function f,
$\mu(f):= \int_{-\infty}^{\infty} f(x) \ d\mu(x)$
if you have a density p(x) then this induces a measure $P$:
$P(f)= \int_{-\infty}^{\infty} f (x)\ p(x)dx$
and the delta function induces a measure $\nu$ such that
$\nu(f)=f(0)$
So the function notation just helps with eg adding measures together (Q2).
ie what it's really saying is :
$\mu(f):= \sum_{i=1}^{n} \nu_{x_i}(f)$ where
$\nu_{x_i}(f)=f(x_i)$
This viewpoint clarifies the support question too. the support is defined using arbitrary functions: all functions f without support at zero will have $\mu(f)$ = 0
Support of a distribution
As mentioned in the wikipedia article, the delta function can be viewed constructively as a limit of measures induced by Gaussians with mean  at zero and vanishing standard deviation ($\sigma$) ( denoting Gaussian pdf as $g(x;\mu;\sigma)$ )
$\nu(f) = \lim_{\sigma\rightarrow 0} \int ^\infty _{-\infty} f(x) g(x;0,\sigma) dx$
Comment: So if a paper denotes the Monte Carlo representaton of a distribution as $1/N \sum \delta(x)$, that is formally incorrect?
Comment: I would say so, but it always helps to see the the statement in context


Ensure my profit margin, discounts provided, markup asked.

Question: My mathematical problem :
I would like to know the Mark Up percentage that I need to add based on the below data.
Given :

Turnover  = 100€
Profit Margin (desired) = 20%
Discount 1 = 30%
100% of my turnover get 30% discount
Discount 2 = 5%
30% of my turnover get 5% discount (Group A)
Discount 3 = 6%
50% of my turnover get 6% discount (Group B)
Discount 4 = 5%
20% of my turnover get 5% discount (Group C)

Discount Policy :
A 30% discount set to all of my clients, 6% discount if someone belongs to Group A, 5% discount if someone belongs to Group B and 6% discount if someone belongs to Group C. Note that someone could belong to more than one groups.
Desiderata :
Mark up (%) = ?
Answer: Your words in policy disagree with the bullets, assuming policy wording is correct.
You have to explain if the discounts are additive or multiplicative, i.e. a person from group A gets $30\%$ and $6\%$ so is it $36\%$ total discount or he pays $0.7 \cdot 0.95 = 0.665$, a $33.5\%$ discount. Once you get it, do the following:

For each group, compute the fraction $f_a,f_b,f_c$ they would pay for your product
If turnover percent per group is $t_a, t_b, t_c$, the total return from group $A$ is $f_a \cdot t_a$. What is the total return from the entire policy?
Since you want $20\%$ profit from $100$, how much gross sales do you want to actually make after all sales are finished?
Finally, markup percentage $m$ is used to make the total generated sales equal the desired sales gross amount. Can you write down a linear equation for $m$ and solve it?


How can I make a whole number be a decimal number with two decimal places in javascript?

Question: I have a variable with a type of number. If the number is 0 or a whole number, it should return as a string with two decimal numbers like "##.00". For example:

18: number -> "18.00"
18.1: number -> "18.10"
18.11: number -> "18.11"
Comment: What did you try and what went wrong? You might find these helpful: [JavaScript displaying a float to 2 decimal places](https://stackoverflow.com/questions/3163070/javascript-displaying-a-float-to-2-decimal-places) and [Format number to always show 2 decimal places](https://stackoverflow.com/questions/6134039/format-number-to-always-show-2-decimal-places)
Answer: You can use val.toFixed(2) to get two decimal points:

let x = 18;
let y = 18.1;
let z = 18.11;

console.log(x.toFixed(2));    // 18.00
console.log(y.toFixed(2));    // 18.10
console.log(z.toFixed(2));    // 18.11

Relevant doc for .toFixed().
Note: .toFixed() creates a string with the requested number of digits after the decimal point in the string since the numeric value itself doesn't have formatting.  So, pretty much by definition, creating any format will create a string from your number that displays in that format.
The default .toString() string conversion shows just the significant digits before and after the decimal point with no extra trailing zeroes at the end.
Answer: JavaScript toFixed() method formats a number using fixed-point notation.
Example.
let a = [18, 18.1, 18.11, 18.111, 18.445];
for(v of a){
    console.log(v.toFixed(2));
}

The above Code Prints..
18.00
18.10
18.11
18.11
18.45

Please note, The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length.
Comment: FYI, you should never use `for/in` with arrays as it enumerates all enumerable properties on the object, not necessarily just the array elements.  Use `for/of` instead which will use the object's iterator which (for an array) iterates only the array elements, even if the object has other properties.
Comment: Ok. Thanks for the input. I hope there is no problem to use it for an Example
Comment: Why don't you edit your example to show it the way it should be coded?  It would take 5 seconds of editing to show the proper way.
Comment: @jfriend00 Changed. Thanks for Your Inputs.


How to horizontally align columns within a div

Question: I have three
 tags and I want to align them horizontally within my container div. I tried the method with float left, right and margin auto but didn't work. What should I do?

* {
  margin: 0;
  padding: 0;
}
.container {
  width: 100%;
}
.col {
  width: 33.33%;
  float: left;
}

CodePen
Comment: Seems fine to me, or do you want them all together?
Comment: @jaunt +1. GSG, What exactly you want? What problem you are facing?
Comment: @GSG I have posted the answer, i think it might help you.
Comment: They are not horizontally aligned. They should have the same margin distance both in right and in the left(right now there isn't a left margin).
Answer: You just need is overflow:auto; for your container class.
Posted the solution to both your code and the updated see the difference. For instance added the border:1px solid red; to see the difference.
Solution

* {
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  border:1px solid red;
  overflow:auto; /*added*/
}

.col {
    width: 33.33%;
    float: left;
}

CODEPEN
Your Code Snippet

* {
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  border:2px solid red;
}

.col {
    width: 33.33%;
    float: left;
}

Answer: To center the images within your div, try this:
img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

And here's your amended codepen: http://codepen.io/anon/pen/xwwdmP