Future Computer Performance

Question: Moore's law has succesfully predicted up to now that integrated circuit transister density doubles every two years. However, computer performance is dependent on additional factors like architecture, chip design and software.
What physics-related factors will enhance or limit ultimate performance of future computers?
Comment: Moore's law was an observation, not a prediction; and the doubling period has varied in time from circa 18--30 months: it's a heuristic.
Comment: Fair enough. I understand that after Moore observed the trend, he predicted it would continue for 10 years, which it did. Also the time frame has indeed been revised.
Comment: I'd call it Moore's conjecture.
Comment: I would call it 'Moore trust agreement', which allows to earn money for the industry while not spending too much resources on R&D. 250nm tech is so simple & easy, that we might have been there in early 80-s.
Answer: Starting from 90nm tech processes we've started to see sad signs of stagnation:
1) Most of delay in logic circuits is in interconnect, not transistors
2) Most of energy dissipated is due to quantum tunneling, not transistor switching. By far.
3) As consequence of #2 - transistor gate width scaling has significantly slowed down, as well as dielectric width (it's already at 1.5nm, not much to reduce). We are near quantum limits already at transistor sizing.
Even if we can make 11nm transistors today, it would not make things 3 times faster and 9 smaller than we have now.
There are few way to significantly improve CPU technology:
1) superconductor interconnect - will improve CPU performance by a large margin, and will allow much larger CPU's. The problem here is that Physicists haven't yet discovered suitable superconductors, which could be patterned in 50-500nm lines and does not require some -100C. The one who will find a way to do such interconnect at room temperature would be extremely rich.
2) 3D transistor packing: i.e. instead 2D array of 1000x1000 transistors we would have 100x100x100 3D array - and interconnect length is 10 times shorter. This is actively being researched on, the problem is that some stages of manufacturing layer of modern high-performance transistors require temperatures of 1000C and higher, and this would destroy transistors on lower levels.
3) Optical interconnect: doing tiny LEDs & photo-diodes and transparent channels out of SiO2 would also allow for faster interconnect. This is also actively being worked on.

All these fancy things like graphene transistors, quantum dots and fancy HEMT structures indeed are abit faster (and ALOT more expensive or complex to manufacture), but does not solve problems with interconnect, which is major problem. Individual transistors at chips can switch much faster than 4Ghz, but we aren't really limited by transistor switching speed at the moment.
Comment: Lately its largely been power and heat removal that has become the limitation. Thats largely why CPU clock rates have stagnated, we can't cool them if we pushed them faster. 3D doesn't really help here, heat removal shows an area versus volume scaling, as does the transfer of data on/off chip. From a programmer/algorithm designer point of view the capability to manipulate bits in data residing within the chip is growing much faster than the capability to move bits on/off chip. So most applications become data transfer rate bound.
Comment: @Omega heat dissipation is not 'fixed' - it's always a compromise. You can run nearly any CPU at 10% of it's heat dissipation, for like 40-50% of speed. So as delays in 3D stacking are much lower, one can lower voltage, and get same performance at much lower power consumption. Agree on IO, but it's a marketing problem, not an engineering one - we could easily have 512-bit memory IO at the moment(like we do have in GPU's) - there is no technical obstacles here, only passion to keep costs low.
Comment: Yes you can play off speed versus power. The I/O problem is real however, there are only so many bits that can be communicated per unit time. Large transfer sizes may improve the efficiency, but the communications bottleneck is fundamental. Memory access even in general purpose CPUs is by cache lines already, so there are no magic communications silver bullets waiting in the wings.
Answer: The first thing that comes to mind is that the speed of light limits the rate at which different components of a computer, or even a single chip, can communicate with each other. For example, if you have, say, 10 cm of wire running between your motherboard and hard drive, it will necessarily take a minimum of about a third of a nanosecond to fetch data from the drive. Right now HDD access technology is nowhere near that fast, at least not for personal computers, but it's conceivable that at some point in the future, we could have some sort of super-fast drive access for which this limit becomes an issue.
You could make a similar argument for the CPU itself: if CPU features are sized on the order of 10s of nanometers, it takes a signal a minimum of about $10^{-17}\text{ s}$ to travel across them. So we will not be able to make a computer that runs faster than $10^{17}\text{ Hz}$ without exploiting either subatomic technology or advanced parallel processing ;-) Again, clearly we are nowhere close to this being a problem in PCs.
Large supercomputers do have to deal with these issues, though, since different parts of the system can be separated by several meters, which corresponds to tens of nanoseconds of signal travel time. This means that the supercomputer as a whole would be limited to operating frequencies on the order of hundreds of MHz. In practice, modern supercomputers operate as a large cluster of individual nodes each acting quasi-independently, so the light speed limits aren't an issue.
Comment: Good answer. To add to your point about light-speed delays, rapidly switching circuits can only run as fast as their slowest component, even within a single bus of parallel wires. This means that bus traces have to be the same length or else terminate in buffers, which leads to the curious meandering circuit traces now common on PCBs, where a wire is significantly longer than it strictly topologically needs to be to connect two components. Related to BarsMonster's second point, multilayer PCBs, allowing traces to pass over and under each other can ameliorate this design constraint somewhat.
Comment: @BarsMonster - Both points are very interesting, thanks for bringing them to my attention. Looks like I have some reading to do. Great site, btw!
Comment: @Richard Fortunately, this is no longer a requirements for many places - modern chips have tunable delay for each pin, so you can compensate some 10cm trace length difference. And in a chip crystal - speed is limited not by speed of light, but rather by RC constant - how long it would take to charge target capacitor over resistor (=trace resistance).
Answer: The other answers detailed addressed the physical part.
When the physical limits are an obstacle we will see a change of paradigm.
I will continue with other factors that may be important in the future.
I suspect that we are yet limited to a 2D (planar) design of chips and even 3D is a repackage of a 2D design.
Most of the work can be done in parallel: physical simulations, database operations, pattern recognition, datafile processing, etc...
AMD-ATI and Nvidia have done a great job with their high-end graphics cards. By now they have towsands  of parallel processors on a chip. The software has also progressed with OpenCL, and PyOpenCL, Nvidia CUDA and ATI-Brook+, NoSQL and CouchDb databases, map-reduce algorithms. Clusters of graphics cards behave as a supercomputer.
I think that in the future we will see 3D neuronal networks, implemented in hardware with on-the-fly programmable coefficients that will try to mimic the brain (the most efficient parallel computer - per watt,  and the only one that is really intelligent).
Heat removal is a major issue in any circumstance.
New technology will make the entrance, may be this one:
Superconducting Niobium Chip Smashes Silicon Power Consumption Standards A superconducting logic chip with a clock speed of 6 GHz beats silicon energy efficiency by two orders of magnitude.  arxiv-Ultra-Low-Power Superconductor Logic
(note: I'm playing around since chip 8080, and I saw a huge evolution and I'll see more, if I manage to keep alive ;)

Future Computer Performance


Public domain does it apply to any and all art work prior to 1920's?

Question: Can I use famous art work images that were created prior to 1900 in my book and sell the book legally? Are all artworks prior to 1900 Public domain? I want to use images of paintings made in 1800 to 1900 in my book and I need to understand if there are limits or restrictions to these artworks of this era?
Comment: Please beware that a big deal of the answer is country dependent.
Answer: Images can be tricky. If you went to a museum and took photographs of a 200 year old painting, you would be completely safe: the copyright on the painting has long since run out. But if you use a picture of that same painting that you found in a book, the photographer who took the photo can say that his photograph is an original composition.
I'd have to check the details, there was a court ruling a few years back that a photograph or other reproduction of an image cannot claim a copyright of its own if the photograph simply shows the original image. But if there are other elements in the photo, the photographer CAN claim copyright. Like if a photograph of the Mona Lisa showed people standing in front of it examining it, the photographer can say that these people and their poses, expressions, etc, are an essential element of the image, and his original composition.


Why is this a "Brilliant Move"?

Question: I don't understand why chess.com says this is a "Brilliant Move"? Can someone explain please?
Comment: Did you try clicking "**Show Moves**" ?
Answer: Whites bishop on g5 is hanging, after Bxg5 Nxg5 Qxg5 black is up a piece. However this would remove the defense of the c7 pawn allowing for Nxc7 by white forking the king and the rook on a1 leading to the winning of the exchange. Chess.com grants brilliancies when a move loses material but either maintains or creates an advantage.
Comment: That's a good analysis. But what if the knight lurking for forking on king is pushed away by `a6` first. Then both the knights hang and one will be lost.
Comment: @iammilind then you simply take with the bishop first, threatening the queen and then you can move the knight afterwards
Answer: The move 8. e3 moves the pawn from e2 and allows the queen a clearer path to black's (undefended) knight on h5.  Piggy-backing of Bansel's analysis 8... Bxg5 9. Nxg5 Qxg5, black is now open to the Nxc7 fork.  However, if black doesn't play 9... Qxg5, the knight on h5 is now hanging because the queen on d1 has a clear path to h5.  Even worse for black, That h5 knight has no square to retreat to, in part to the f4 square being defended by our hero pawn on e3.
In short, 8. e3 indirectly threatens the h5 knight and forces black to either concede it, or give up the fork/exchange.
Comment: Hmm. Yes, Black can't ignore the threats entirely. But what if Black, instead of taking the bishop and giving the White knight a free move, simply plays g6 to give the knight a square? If White plays Bxe7, then Qxe7 would still leave c7 protected by the queen. Or is that simply positionally bad?
Comment: After 8... g6 9. Bh6 the knight's escape square of g7 is covered and really makes it hard for black to ever castle kingside.

Why is this a “Brilliant Move”?


Detecting a drag operation from another application

Question: I have an application that runs elevated (yes, it has to be elevated) but it needs to detect when another application is dragging an object over it. My application doesn't care what the object is, it doesn't want to receive the object, it just needs to know if something is being dragged. In a normal application this isn't an issue, but because my application is elevated it doesn't receive any of the standard drag/drop events from lower privilege applications. Is there a programmatic way to detect whether the cursor is involved in a drag/drop operation?
Answer: To do "system wide" drag and drop, I think you have to go the OLE way.
Drag and Drop (OLE)
Also see the "Data Objects and Data Sources (OLE)" link at the bottom of the article.


Application with and without L'Hospital's rule differ

Question: I have the limit $\lim_{h\rightarrow0}\frac{f'(a+h)-f'(a-h)}{2h}$. Using the mean value theorem, we have $f''(c)$ for some $c\in[a-h,a+h]$. However, we can also use L'Hospital's rule, which reduces the limit to $\lim_{h\rightarrow0}\frac{f''(a+h)+f''(a-h)}{2}$, or $f''(a)$. I'm not sure why there is a discrepancy, and I'm almost completely certain I didn't make any careless mistakes. We can assume that the first and second derivatives are continuous.
Comment: For $h$ tends to zero, then $c$ tends to $a$
Answer: The mean value theorem does not say that the limit is $f''(c)$, only that there exists $c\in[a-h,a+h]$ with the expression equivalent to $f''(c)$. The resolution of the problem comes from noticing that $c$ and $f''(c)$ depend on $h$, and then $\lim_{h\to0}c=a$ by the squeeze theorem.
Answer: As $h\rightarrow0 , c\rightarrow a $ [By squeeze Theorem or Sandwich Theorem ]
So there is no discrepancy and they both point to the same thing ie
$$\lim_{h\rightarrow0}\frac{f'(a+h)-f'(a-h)}{2h} = f''(a) = f''(c)$$
Also there is a method 3 which can be employed ie
$$\lim_{h\rightarrow0}\frac{f'(a+h)-f'(a-h)}{2h} =$$
$$\lim_{h\rightarrow0}\frac{(f'(a+h)-f'(a))-(f'(a-h)-f'(a))}{2h} =$$
$$\frac{\lim_{h\rightarrow0}\frac{(f'(a+h)-f'(a))}{h} +\lim_{h\rightarrow0}\frac{(f'(a-h)-f'(a))}{-h}}{2}= $$
$$\frac{f''(a)+ f''(a)}{2}=f''(a)$$
As
$\lim_{h\rightarrow0}\frac{(f(a+h)-f(a))}{h} = f'(a)$
$\lim_{h\rightarrow0}\frac{(f(a-h)-f(a))}{-h} = f'(a)$


Dynamically display image in a Sharepoint 2010 list

Question: I want to display image dynamically in a list. I have two columns in a list. The first column contains some numerical values and other contains smiley icon.  My requirement is, if number in first column is greater than 50, I want happy smiley to be appear in a second column in a list, and sad smiley for less than 50 number. Currently I use hyperlink column to display image in a list. And I am adding image manualy.
I am looking forward, if it is possible to automatically display image based on first column number. Something like calculated columns. Lets say,
HyperLink/Picture Formula:
<code> column   =IF([someNumer]>50, "href = c:\Test\happySmiley.ico", "href= c:\Test\happySad.ico" )
</code>
I was wondering if we could do something like this, or any other suggestion is appreciated..
Answer: You are looking for KPI indicators.
You can also find great overview here:
How to create a SharePoint KPI column
And also check similar question on SPSE:
Make all KPI Status Icons in diamond shape


What site would be best to ask about Verifone customization?

Question: I have a question about Verifone terminal and swiper devices. I want to customize them but don't know how nor know where to ask in Stack Exchange. Help?
Answer: The configuration/maintenance of Verifone terminals sometimes falls under the IT department, so you may want to ask if such devices are on-topic on Server Fault's meta support.
Or maybe someone here can confirm or refute whether it's in scope.
Comment: from looking around that site, questions about credit card machines and terminals I doubt would be off topic. Thanks for your help
Comment: I asked it there, one person said that I should consult the Reference guide and that the question was off topic


Use menu in panels

Question: I have problem. I have panel page with 2 columns. On the left I have menu, and on the right I want to have a content from this menu, how can I have static menu on the left, and only change the content on right? Do you have any proposition or suggestions?
Comment: on the quick you'll maybe find something here http://drupal.org/node/443208
Answer: You can use block menu model this give you a dynamic menu but if you want a static menu you have to add a menu from(admin/structure/menu) after create the menu it will show on blocks(admin/structure/block) and put it on the specific region and you have  a region called content this is by default show the content on it
see that http://www.youtube.com/watch?v=lTZT_ucpYMQ
Answer: In general you can create a menu that calls a URL to a view and then use the View to provide the desired content.  You will find more on how to use Panels here and views here
Answer: Ashlar's answer is correct, but I would like to add some more background info.
Any menu item is linked to a specific callback in Drupal. A callback may or may not be handled by the Page manager and rendered through Panels. A callback rendered with Panels may or may not have your specific two column layout. There is no way to use Panels to "force" any specific piece of content to render in a specific Panel region, that's just not how it works.
You are responsible for ensuring that each link in the menu points to a page that is rendered with the two column layout. One common, and good, way of doing that is what Ashlar suggests. However, this will not necessarily work for all types of content.
Answer: Instead of using different module to perform the desired functionality you could simply make node template pages so that the menu remains the same and there is only a change in the content.
To Add node template pages you

Go to structure -> Pages -> Node template -> Enable and Edit
Add Variant on the top. Add as many variants that you need to add.
In the Selection rule select add the Node Bundle and select the Content type that that you want to display.
Select the type of layout from the Layout option.
In the content part click on Add Content and select what do you want to put there in the display.

Use menu in panels


SQL query to return all rows where one or more of the fields contains a certain value

Question: Is it possible to run a select on a table to quickly find out if any (one or more) of the fields contain a certain value?
Or would you have to write out all of the column names in the where clause?
Comment: I swear I saw this question yesterday, but I can't find it.
Comment: Give us more information. Expand your question, just click edit and do it. ;)
Answer: As others have said, you're likely going to have to write all the columns into your WHERE clause, either by hand or programatically.  SQL does not include functionality to do it directly.  A better question might be "why do you need to do this?".  Needing to use this type of query is possibly a good indicator that your database isn't properly normalized.  If you tell us your schema, we may be able to help with that problem too (if it's an actual problem).
Comment: +1 - I can imagine situations where you might have the same value in more than one column but you are right: it smells like bad design.  Of course, the risk of this is all the higher when the question is so basic.
Comment: Code smell here indicates what rmeador points out...Is your db structured for what you are doing with it?
Comment: I sometimes have to run queries against mainframe systems with tons of fields where the field names are random eight character strings.
Answer: I think you'd need to list all the columns in the where clause.  I'm far from a SQL wizard though...maybe someone else knows a way.
Answer: you will have to write it out
Answer: Of course you have to write out all columns you want to use as a criteria.
If you add what programming language you are using and in what type of environment you working we can give you a clue or solution of how to do it dynamically.
I think your question really was how to do this dynamically depending of what the user of your program fill in in the "search"-form.. Im right?
If not, then.. Give us more information. ;)
Answer: Dig this... It will search on all the tables in the db, but you can mod it down to just one table.
<code>/*This script will find any text value in the database*/
/*Output will be directed to the Messages window. Don't forget to look there!!!*/

SET NOCOUNT ON
DECLARE @valuetosearchfor varchar(128), @objectOwner varchar(64)
SET @valuetosearchfor = '%staff%' --should be formatted as a like search
SET @objectOwner = 'dbo'

DECLARE @potentialcolumns TABLE (id int IDENTITY, sql varchar(4000))

INSERT INTO @potentialcolumns (sql)
SELECT
    ('if exists (select 1 from [' +
    [tabs].[table_schema] + '].[' +
    [tabs].[table_name] +
    '] (NOLOCK) where [' +
    [cols].[column_name] +
    '] like ''' + @valuetosearchfor + ''' ) print ''SELECT * FROM [' +
    [tabs].[table_schema] + '].[' +
    [tabs].[table_name] +
    '] (NOLOCK) WHERE [' +
    [cols].[column_name] +
    '] LIKE ''''' + @valuetosearchfor + '''''' +
    '''') as 'sql'
FROM information_schema.columns cols
    INNER JOIN information_schema.tables tabs
        ON cols.TABLE_CATALOG = tabs.TABLE_CATALOG
            AND cols.TABLE_SCHEMA = tabs.TABLE_SCHEMA
            AND cols.TABLE_NAME = tabs.TABLE_NAME
WHERE cols.data_type IN ('char', 'varchar', 'nvchar', 'nvarchar','text','ntext')
    AND tabs.table_schema = @objectOwner
    AND tabs.TABLE_TYPE = 'BASE TABLE'
ORDER BY tabs.table_catalog, tabs.table_name, cols.ordinal_position

DECLARE @count int
SET @count = (SELECT MAX(id) FROM @potentialcolumns)
PRINT 'Found ' + CAST(@count as varchar) + ' potential columns.'
PRINT 'Beginning scan...'
PRINT ''
PRINT 'These columns contain the values being searched for...'
PRINT ''
DECLARE @iterator int, @sql varchar(4000)
SET @iterator = 1
WHILE @iterator <= (SELECT Max(id) FROM @potentialcolumns)
BEGIN
    SET @sql = (SELECT [sql] FROM @potentialcolumns where [id] = @iterator)
    IF (@sql IS NOT NULL) and (RTRIM(LTRIM(@sql)) <> '')
    BEGIN
        --SELECT @sql --use when checking sql output
        EXEC (@sql)
    END
    SET @iterator = @iterator + 1
END

PRINT ''
PRINT 'Scan completed'
</code>


Custom Report Type - Production Environment

Question: Should i create a custom report type directly in production or would i need to first create in sandbox and transport to production? What is the best practice?
Answer: Your production org is your live Salesforce instance, and keeping it running like a champ is critical to your business and customers.  So it is always suggested to implement first in the sandbox and do thorough testing and later deploy to the production instance. Check more details on Pitfalls of developing in production here.
Thanks


Can I apply for a UK visa from outside home country?

Question: I'm Australian, but wanting to switch the Ancestry visa for the UK. Given the whole corona thing I'm struggling to get home without paying thousands as the airline messed up my original flight. My current visa expires in a few days so was hoping to go across to Germany or somewhere to switch visas as I need to have left the UK. I've called around but no one seems to be able to give me an answer.
Comment: As an aside, one of the conditions of eligibility is to be able to provide evidence that you're planning to work in the UK, for example job offers you've received or a business plan if you're self-employed. If you've not already addressed that requirement as part of your plan to apply, it might prove difficult in the current UK job market, especially if you're trying to do it from Australia https://www.gov.uk/ancestry-visa/documents-you-must-provide
Comment: @Traveller It's usually advised to submit CV and job applications, it's not necessary to already have a job offer. I don't think this is an impediment.
Comment: @MJeffryes You may be right, I quoted directly from the gov.uk page. Given the OP is days away from visa expiry and hadn't yet established from where such applications must be made, it seemed helpful to provide a link and other potentially relevant information.
Answer: Unfortunately, you can only apply for a limited list of UK visas outside your country of residence, which does not include the Ancestry visa.

You can make applications for a visit visa, a short-term study visa, an EEA family permit, Tier 5 (Creative and Sporting), Tier 5 (Youth Mobility Scheme) and Global Talent entry clearance in any visa application centre, British diplomatic mission or consular post overseas where entry clearance applications are accepted.

...

Applications for other types of entry clearance should be made in the country in which you are living.

A normal strategy for antipodeans in your situation is to apply for a working holiday visa in a European country which grants them to Australians, such as France or Ireland, and then apply for your UK visa from there. But if your UK visa expires in a few days, you don't really have enough time to do this, and most of these programmes seem to be suspended due to the pandemic anyway. Unfortunately returning to Australia is likely your only option.


what is the difference between I saw bus is coming vs I saw bus was coming?

Question: can someone explain to me?
it is right that I saw bus is coming
means I was standing and a bus is coming on the road?
Comment: Please remember that English uses articles before nouns. So it should be either 'I saw a bus coming' or I saw the bus comming'.
Answer: I saw a bus coming and I saw that a bus was coming are grammatical ways to say that, in the past, you saw that, in the past, a bus was approaching you but had not yet arrived at your location. You could be sitting or lying on the sidewalk when you made that observation. "See" does not imply your bodily orientation when you make a visual observation.
If you want to indicate your bodily orientation you should say I was standing when I saw the bus coming at me on the road.
Your first attempt is wrong in two respects. First, you need an indefinite article before "bus." Second. the sequence of tenses makes no sense: how could you have seen in the past something that is occurring in the present.
Your second attempt is perfectly grammatical, but technically your second example does not state the same thing as your first: a bus need not always drive on a road nor does seeing imply standing.
Answer: There are other grammatical problems with both statements, but let's just focus on the word common to both sentences "saw" and the difference between "is" and "was".
"Saw" is the past tense of see.
"is" is present tense.
"was" is past tense.
You should not mix tenses in the same sentence, so...

I saw (a) bus is coming

is wrong because you talk about the bus coming in the present tense when you saw it in the past.

I saw (a) bus was coming

is acceptable and you might hear it said, but it is still not 100% correct because there is no need to state the past tense twice.
As you have already established the past tense by the word "saw", you could simply say:

I saw a bus coming.


computing the galois group of a polynomial

Question: Compute the Galois group of the splitting field of the polynomial $t^4-3t^2+4$ over $\mathbb{Q}$.
I don't know how can I do this problem, the roots are very "ugly" maybe if I consider another basis (a more workable basis).
The roots of the polynomial are:
$$
 \pm \sqrt {\frac{1}
{2}3 - i\sqrt 7 } ,\qquad \pm \sqrt {\frac{1}
{2}3 + i\sqrt 7 }
$$
Comment: Related: https://math.stackexchange.com/questions/204709
Answer: There is a standard way to find Galois groups of degree 4 irreducible separable polynomials. Say your polynomial is
$f(x) = x^4+bx^3+cx^2+dx+e$
Call $x_1,x_2,x_3,x_4$ its (pairwise distinct) roots. Let
$\alpha := x_1x_2 + x_3x_4$
$\beta := x_1x_3 + x_2x_4$
$\gamma := x_1x_4 + x_2x_3$
The polynomial $g(x) := (x-\alpha)(x-\beta)(x-\gamma)$ is called the resolvent cubic of $f(x)$. Computation shows that
$g(x) = x^3 - cx^2 + (bd-4e)x - b^2e + 4ce - d^2$.
Call $K$ the field $\mathbb{Q}(\alpha,\beta,\gamma)$, the splitting field of $g(x)$ over $\mathbb{Q}$. Call $G$ the Galois group of $f(x)$. The natural action of $G$ on the four roots of $f$ gives an embedding of $G$ inside the symmetric group $S_4$ (identify $G$ with its image in $S_4$). $G$ is transitive in $S_4$ being $f(x)$ irreducible.
Call $V$ the Klein subgroup of $S_4$ (i.e. the subgroup consisting of the elements which are product of two disjoint transpositions). Note that the intermediate field $K$ corresponds (through the Galois correspondence) to the subgroup $G \cap V$ of $G$, therefore $G/G \cap V$ is isomorphic to the Galois group of $g(x)$.
With this information it is possible to detect $G$ among the transitive subgroups of $S_4$ (provided you can compute Galois groups of cubics, but that's easy: the Galois group of an irreducible separable degree 3 polynomial is $A_3$ if the discriminant is a square in the base field, it is $S_3$ otherwise).
In your case the cubic resolvent splits completely as $(x+3)(x+4)(x-4)$, so $K=\mathbb{Q}$ and $G=G \cap V$, in other words $G \subseteq V$. Having $V$ no proper transitive subgroup, it must be that $G=V$.
Answer: The roots are $\pm\sqrt{\frac{3\pm\sqrt{-7}}{2}}$.
We can obtain the root field (splitting field) by first adjoining $\sqrt{-7}$ to the rationals $Q$, then take appropriate square roots  to  get the root field  of the polynomial. So the degree of the extension for the splitting field is 4.
The root field has degree 4 so the Galois group has 4 elements. Hence the Galois group is either cyclic of order 4 or  $Z_2^2$. For the first case there is a unique quadratic subfield and for the second there are 3 quadratic subfields.
Consider the conjugate roots $a=\sqrt{(3+\sqrt{-7})/2}$, $b=\sqrt{(3-\sqrt{-7})/2}$; then $a+b=\sqrt{7}$, $a-b=\sqrt{-1}$, $a^2-b^2=\sqrt{-7}$
Since there are 3 quadratic subfields, the galois group is $Z_2^2$.
Comment: How are you getting $(9-7)/4=-1/2$?
Comment: @TheSubstitute Thanks, I made revisions.
Comment: @i.m.soloveichik could you please elaborate on this sentence "then take appropriate square roots to get the root field of the polynomial"? Do we have to make some sort of choice here? Is it clear that the splitting field for this polynomial is equal to $\mathbb{Q}(\sqrt{(3+\sqrt{-7})/2})$ (say)? Is it clear that $\sqrt{(3-\sqrt{-7})/2} \in \mathbb{Q}(\sqrt{(3+\sqrt{-7})/2})$?
Comment: @abc The field generated by $\sqrt{(3+\sqrt{-7})/2}$ is degree 4 over Q (any easy check shows  it doesn't satisfy a quadratic polynomial over Q).


how come hot bodies emit radiations of several wavelengths?

Question: Atoms in a rod of iron has discrete energy levels. When we heat it, its electrons after absorbing photons rise to next energy levels and then fall back emitting radiations. As all iron atoms are alike so radiations of same wavelength should be given off by iron atoms. Am I missing something?
Comment: Hi Rock. The light emitted by e.g. glowing iron comes from black body radiation not from electronic transitions like the ones in isolated atoms. I've linked a question that explains how this happens.
Answer: Iron atoms, as a dilute gas, have discrete energy levels.  An iron rod, however, has broad energy bands instead, has oxides and other scale compounds on its surface,
and at high temperatures, even Doppler shifts and internal vibrations
can significantly wash out the atomic spectrum features.
Impurities also give rise to extra energy levels.
One can expect a few gaps, but many features of the blackbody curve will
show up in the hot-solid-iron spectrum.   All the 'lines' of iron, all the
hybridized orbitals that bond the metal together (bands), all the spreading
of those lines due to pressure, shifts due to fields, and just plain randomness
of temperature, work against a sharp spectral-lines result.


How does the depth of a water bottle affect the water pressure (fluids)

Question: If you take a water bottle full of water, and make a hole near the bottom, water obviously spurts out a certain distance. How does the variance of the size of the hole made affect how far and how fast the water spurts out?
Comment: You are asking two different questions: One in the title and one in the text.
Comment: variance : The quality of being different, divergent, or inconsistent.  Do you speak about the size only? Size dependence?
Answer: The depth of water in the container determines the pressure at the bottom of the container. The speed with which the water spurts from a hole in the container under the action of this pressure is equal to the speed it would possess had it instead fallen freely through a vertical distance equal to the depth of the water at the location of the hole.
But since water has nonvanishing viscosity, the act of forcing it through a hole will slow it down. To first order and for small holes and low pressures, the effect is sufficient to cause the hole to dribble instead of form a jet. The larger the hole, the smaller this effect will be.
Hovever, when the diameter of the hole in the bottom of the container approximates the diameter of the container itself, the water instead tends to simply fall like a dropped weight under the influence of gravity.


cell.accessoryType is not visible and tableView:didSelectRowAtIndexPath: doesn't works

Question: I've a customized split view for iPad, on the left part I have the KalController (https://github.com/klazuka/Kal) the calendar component and the tableView with the events of the selected day on the Kal Date Picker.
On the other hand, I have another subview ont the right with an standard UITableView listing the next events.
When one of the rows is selected on the Kal tableView, the right TableView push the detail view of the event on the navigation Controller.
But, I don't know why, althought the rows of both UITableView has the same code, the second table view, (the right one) present two problems:
 - The cells has no cell.accessoryType
 - Althought the Controller has the delegate properly set, the method tableView:didSelectRowAtIndexPath: was never been raised ...
Anybody knows if there is any restriction of the number of TableViews to be displayed in the same View ... I believe should be posible ... but something doesn't works.
Of course, in The NIB the UITableView has properly set the dataSource and delegate...
Any suggestion?
Thank you,
Answer: Solved ...
the problem was the height of the rows.
In the test behaviour I had just one row, and this is the reason because it has been displayed perfectly.


Draw bitmap as fast as possible with (whole number) scaling

Question: I have a 640x480 RGB_565 format bitmap which I need to draw on a higher resolution display as fast as possible. It is not critical that the bitmap fills the entire screen so long as it fills most of it.
So, one idea I had was to draw a double sized bitmap 1280x960 so that each pixel in the original neatly maps to 4 pixels on screen. This, in theory, should be much faster than scaling to some awkward fraction. But I'm not sure exactly how to take advantage of this.
Would any of the possible canvas.drawBitmap functions notice the simple x2 calculation and do things faster? Should I perhaps make a double sized bitmap first and then draw the bigger bitmap without scaling? What would be the fastest way?
Comment: see drawBitmap with a Matrix param
Answer: Mick, From what I understood - this is my answer to help you.
I have had a similar problem too. After reading some posts on Bitmap operations - I understood doing any pixel-by-pixel operations on a Bitmap is really slow on android.
For your problem, bitmap can be scaled using inbuilt functions (which generally work faster than pixel by pixel operations). This is the way to use the inbuilt functions :
bitmapProcessed = Bitmap.createScaledBitmap(originalBitmap, NewWidth, NewHeight, true);

In your case,
NewWidth  = 2 * originalBitmap.getWidth();
NewHeight = 2 * originalBitmap.getHeight();

The image that results from this, is generally not very good. If you want to make it more clear, to match the higher resolution display - I would suggest doing a bicubic interpolation.
I hope this helps.
Comment: dont use Bitmap.createScaledBitmap it creates a new Bitmap instance, see my comment above how ro draw it bigger
Comment: @pskink - is it possible to bicubic interpolate the processed image, by setting a matrix param. Your approach looks more neat. :)


How do i display the first modified date instead of the Last Modified Date

Question: I want to a column to display when a record is first modified. SharePoint defaults the modified date to the last modified date. My goal is to also have a column when it was first modified so i can calculate Turn around Time.
Answer: SharePoint only stores "Created" and "Modified" dates. If not date created, what is your definition of first modified? If it is the first edit after the item was created, then create a workflow.

Triggers on change/update
Checks to see if a custom column named "First Modified" is blank, and if not stores the current date and time to "First Modified".


set body position lower than 30 cant be done

Question: i am using cocos2d,box2d and debugDraw to draw my bodies .
i can see that if i put a vertical line(portrait) his x position can start of 50. if i set it to be 30 , it disappear from screen(retina mode)
my PTM_RATIO is set to 32 .
i put the line with :
<code>const int buLX=30;
 const int buLY=10;
const int topLX=buLX;
 const int topLY=380;

//left vector
    theBox.SetAsEdge(b2Vec2(buLX/PTM_RATIO,buLY/PTM_RATIO), b2Vec2(topLX/PTM_RATIO,topLY/PTM_RATIO));
    boxBody->CreateFixture(&boxShapeDef);
....
</code>
the y coordinates are just fine, but the x has a margin from left AND from right, so i cant get to the screen edges because it disappear then.
any idea ?
thanks alot.
Answer: got it.
it most be a float not an integer.
because then 30/32 is 0.x which is =0 .


Trading Post version of Splendor

Question: When playing the Trading Post version of Splendor, are you required to have the 3 black bonuses power to get the 5 prestige points for having the 5 green bonuses and 1 noble tile power?
Answer: On this page on ultraboardgames.com they explain the rules for the different powers and how to get them.

Requirement: You must have 3 black bonuses.
Power: 1 prestige point for each of your coats of arms on the board.

Requirement: You must have 5 green bonuses and 1 noble tile.
Power: 5 prestige points.
For the 5 prestige points the only thing you need is the 5 green bonuses and 1 noble tile. For the prestige point for your coats of arms you only need to have the 3 black bonuses.
The bonuses are independent from each other so you can get any of them at the time you have the requirements.

Trading Post version of Splendor


Powershell Empire - Token Impersonation

Question: I have been struggling trying to get token impersonation to work in Empire 2.0.
I use the credentials/mimitokens module to list and elevate to use a specific users token - I see mimikatz' output saying the token is impersonated, but using info on the agent still shows my old user, and shell whoami also shows my old user.
If I then use the module /credentials/tokens and set WhoAmI to true it shows the impersonated user as the user which is good, but I have been struggling to get it to spawn a cmd.exe process to see if it uses the impersonated creds.
I have looked around a lot, and there doesn't seem to be too much explanation for the options here. Any help would be much appreciated! I can get the message "run as Domain\Chris" from steal_token - but again, I'm not sure what exactly is then running as Chris as shell whoami and info both still show the old user?
I was hoping that it would work like incognito in meterpreter and that the agent would now be running as the impersonated user, but this doesn't seem to be the case. Does it only use the creds for network commands?
From what I can tell of using the /credentials/mimikatz/command module and then setting the command to:
tokens::elevate /user:Chris

it impersonates the user, but as soon as the command is run it drops the process so I can't then use:
process::start cmd.exe

or anything to then use the impersonated credentials.
I may well be misunderstanding something here though.
Answer: process::start will start the process under the context of the process thread, try using token::run cmd.exe

Powershell Empire - Token Impersonation


Bayesian Forecast: Credible interval with predicted regressors

Question: I want to do a forecast of let's say orders with a Bayesian linear regression, where orders do not only depend on time but also on another regressor, let's say accounts at time t.
$$orders_{t} = \theta_{1}*t + \theta_{2}*accounts_{t} + \epsilon$$
So obviously, I do not have future values of accounts, so when predicting future values of order intake I use a prediction of accounts
$$accounts_{t} = \beta_{1}*t + \epsilon$$
Now, for predicted accounts I can construct a credible interval as it only depends on known and fixed values (time). For predicted orders, uncertainty around the account prediction carries over into the prediction, so a credible interval for the order prediction would need to take this uncertainty into account. How would I do that?
Answer: In Bayesian Inference the prediction step is done via the posterior predictive distribution, which is calculated as $$f(y_{new} | y_{(\underline{n})} ) = \int_{ \Theta} f(y | \theta ) \cdot \pi(\theta ) d \theta $$ (where $\pi(\theta)$ is the posterior distribution) which accounts for the uncertainty of and unobserved observation.


Why can't my contacts see photos I send via SMS?

Question: Trying to download SMS programs, tried a few, so to have better customizable color options as the new Samsung Galaxy sucks for that. Everything I have tried, whatsapp, GO SMS Pro, Viber, Hangouts, none of them let me send photos to my contacts unless they have the same SMS program. Why?  My basic SMS on the LG Android had all these basic properties and I never had issues.
Answer: Images are not actually sent via SMS, but instead use the MMS protocol. For this to work, you must have your MMS access point configured properly (this usually happens automatically):

Check with your contractors website for their MMS access point details. If they are not listed on their website, contact them.
Go to Settings -> Mobile Networks -> Access Point Names (or APNs on some devices) and add a
ProviderName MMS

where ProviderName is the name of your provider, e.g. Verizon.
Set all the values to what you got from Step 1. Some values might be missing, you can probably safely ignore them.


Which of the Konica I, II, III, S, SII, SIIII rangefinder variants have a lifesize (1:1) finder?

Question: I wonder whether anyone knows some historic fact about the konica rangefinder models that predate the auto S sites. As far as I know, the lifesize finder was introduced in the IIIa and IIIm models. Was it available after these models in the S series?
Answer: From
http://www.rangefinderforum.com/forums/archive/index.php/t-43028.html
I quote:

The Konica III, III A and III M
  (http://www.dantestella.com/technical/koni3.html) were superb fixed
  lens RF cameras with bright 1:1 viewfinders.

See the linked thread for a nice discussion about cameras with 1:1 viewfinders.
Answer: I can say that the SII does not have a lifesize finder as I have one. Also, I looked up the Konica S manual, and it states that thew viewfinder has 0.65 magnification. I believe this leaves the IIIa, and IIIm series as the only series with a 1:1 finder. The III does not have a 1:1 finder.
http://www.cameramanuals.org/konica/konica_s.pdf


Zelda Link's Awakening: missing key

Question: In the angler's dungeon, there is one room where you need to get a key to open a door in the lower levels, but the key chest does not appear.
To make the chest appear, you have to kill all the enemies in the room, but it never appears.
Answer: It seems your picture is not from Angler's Dungeon (number 4) but the Bottle Grotto (number 2).
If I recall correctly, this room is a puzzle in which you have to kill the enemies in a certain order.
A tablet somewhere in the dungeon could help you find out the order.
TABLET / CLUE SPOILER :

First, defeat the imprisoned Pols Voice,
Last, Stalfos...

Answer :
The order is

 Bunny, Bat, Blue Skelteon
Comment: It seems this puzzle is mostly designed to figure out who read the manual and knows that the rabbit looking enemy is called a Pols Voice.
Comment: Interestingly, this is not an issue in French where the monsters are not defined by their names but their features (a rabbit and a specter).

Zelda Link's Awakening: missing key


Why are Hermitian matrices called a generalization of real symmetric matrices?

Question: I frequently see people explaining Hermitian matrices as a generalization of real symmetric matrices e.g. Wikipedia, Math StackExchange. I understand that all real symmetric matrices are Hermitian matrices, but it seems like there's really two changes between real symmetric matrices and Hermitian matrices: (1) permit complex numbers, and (2) the transpose must equal the element-wise complex conjugate. Why was this second step included in the definition of Hermitian matrices? My guess would be that it has something to do with physicists wanting to ensure particular sequences of linear transformations produce real-valued outputs; is this correct?
Comment: Welcome to Mathematics Stack Exchange.  I think it's not just physics; e.g., taking the complex conjugate along with transposing a vector to get the dot product ensures that the length of a vector is a non-negative real number
Comment: You should look up what it means for a linear operator to be self-adjoint with respect to a bilinear form on a vector space. If you take $\mathbb{R}^n$ with the dot product, you find that a matrix is self-adjoint when it is equal to its transpose. Do the same thing with $\mathbb{C}^n$ with the standard inner product, and a self-adjoint matrix is one which is equal to its transpose conjugate. The fact that the notion of "self-adjoint" is defined not only for matrices, but for linear operators (ie does not depend on a choice of basis) may be surprising.
Answer: The "dot product" in $\Bbb R^n$ has the property that
$$
d(x) = \sqrt{x \cdot x} = \sqrt{x^t x}
$$
is a metric. In particular, $x \cdot x = \sum_i x_i^2$ is always a nonnegative real, so we can take a square root. You can fancy this up and look at
$$
\sqrt{x^t M x}
$$
for some matrix $M$, or (generalizing a little) look at a product defined by
$$
(x, y) \mapsto x^t M y.
$$
If you want that to be symmetric (which is a nice thing for generalized inner products), then $M$ has to be symmetric.
If you try to do the same thing for a complex vector $z$, with complex number entries $z_i$, and define
$$
z \cdot z = \sum_j z_j^2,
$$
then the resulting sum is usually not real. (Example: if each $z_j$ is $\sqrt{-1}$, then...)
But if you say that
$$
z \cdot z = \sum_j z_j \overline{z}_j,
$$
then you DO get something that's a nonnegative real, and can mimic all the stuff you did for $\Bbb R^n$. But when it comes to the matrix $M$, you need (to get symmetric of your generalized inner product) not that $M^t = M$,  but that $\overline{M}^t = M$...so that's where the generalization comes from.
Comment: So the goal is to preserve the concept of a distance that exists in real spaces?
Comment: The dot product (or inner product) is what gives us a concept of length and distance in $\mathbb{R}^n$ since the length of a vector is $|v| = \sqrt{v\cdot v}$ and the distance between $v, w$ is $|v-w|$. Therefore, we can translate much of our geometric intuition in $\mathbb{R}^n$ over to these inner product spaces (and so naturally they are very useful in physics). Hermitian matrices, and in general self-adjoint maps are those maps from the space to itself that satisfy a nice symmetry condition relative to the dot product as seen in my answer. This symmetry gives them their importance.
Answer: Yes; in physics, observables such as the position or momentum of a particle are modeled with linear operators on a Hilbert space (a vector space over $\mathbb{R}$ or $\mathbb{C}$ with a dot product and other nice properties). In order for this interpretation to make sense, the eigenvalues (which correspond to probabilities or measurements) must be real-valued.
Another way to see why this might be the correct definition is from looking at the dot-product between vectors $v$ and $w$. In $\mathbb{R}^n$, this is given by
$$v\cdot w = \sum_{i=1}^nv_iw_i $$ but in the complex vector space $\mathbb{C}^n$ it is given by $$v\cdot w = \sum_{i=1}^nv_i\overline{w_i}; $$ $A$ being Hermitian is equivalent to the property that
$$Av\cdot w = v\cdot Aw$$
for any vectors $v, w$.
The $A = \overline{A^T}$ definition guarantees this to be true, and the presence of the complex conjugate therefore comes from the dot product. For general linear operators (not just matrices), we say the function is self-adjoint or Hermitian (https://en.wikipedia.org/wiki/Self-adjoint_operator).
The reason we think of them as like the real numbers is we can think of the operation $A \mapsto \overline{A^T}$ as a type of inversion, just like complex conjugation is an inversion on the complex plane. The real numbers are exactly those that satisfy $\overline{x} = x$, i.e. they are equal to their image under the inversion. Hermitian matrices are exactly those that satisfy the same property for the adjoint inversion operation.
Comment: Thanks for the answer Andrew! I'm going to give the first responder credit for answering the question, but your answer was also a nice perspective!


Fargo S1 main character connected to the movie?

Question: Is there a connection between the character, Molly Solverson and any other character of the Fargo movie?
I wonder if there is a connection between Marge Gunderson and Molly Solverson, like heritage or something.
Comment: They are only connected out of universe - Molly is somewhat based on Marge. Whole 1st season is somewhat based on the movie. It's not a remake, but some characters are analogous.
Answer: No, Molly is not related to any character from the feature film but her dad, Lou Solverson, does connect with season 2's story that takes place earlier in the 1970s.
The only firm connection season 1 makes to the feature film, is how Stavros Milos (Oliver Platt's character) came up with the money to start his business, which was left behind by Carl Showalter (Steve Buscemi's character) from the events of the Fargo feature film.

"In a flashback, we learned that Stavros happened upon a suitcase full
of money buried in the snow on the side of the road after his car
broke down. He made the lucky find after glimpsing a red ice scraper
stuck in the snow by a nondescript fence. Stavros took the money for
himself and used it to start his company (which takes us up to the
"present day" of the show: 2006)."
Comment: @DanielV while I see what you are getting at and while that would make for a good theory, at this point it's "thematic", meaning that when Hawley took over the IP, he wanted to make sure some things were consistent to what the Coen Brothers have done in order to make it what he sees as 'Frago'. Marge and Molly are "similar" cop protagonists or Fargo archtypes. Season 2 for instance, also winks at No Country for Old Men and The Man who Wasn't There and makes a couple of connections to season 1. There is just no in-universe evidence to prove they are related so they are just thematically similar
Comment: yes, I see, it's just like Tarantino's universe
Comment: the thing is that this Molly character is so similar to Marge, clever, suspects about everything and makes intelligent connections and seems to have a great empathy as well, that must be something inherited, by the writter I guess.


Could anabolic steroids be used among colonists in a low gravity environment to prevent extreme atrophy?

Question: Is it conceivable that colonists/astronauts on a long term mission in a low gravity environment might use a low dose of an anabolic steroid (such as Equipoise) to prevent extreme atrophy in their musculature? It's a hypothetical for SF (2250 AD), and a black market dealer is running it out to the colonists on Ganymede and Europa.
Comment: This question might be better asked on [worldbuilding.se] where they often use speculative scenarios and real world science to help build your world.
Comment: I'm not flagging this, but is this really appropriate for WorldBuilding, rather than a medical stack/site? It would seem to require understanding the effects on the human body of the steroid, and whether that effect is truly a counter for the problems of reduced G.
Comment: Welcome to WorldBuilding *Mike*! If you have a moment please take the [tour] and visit the [help] to learn more about the site. Have fun!
Comment: I think this is a great question and apparently it does work to some extent, however you should know that research in those areas is sketchy at best. We do not have long-term data and the short-term data is always for a very small sample size and under very specific circumstances. I wouldn't trust it tbo. You can, however, always say that you have substance x241c that prevents all symptoms. In 230 years we could've figured out something like that. If you truly want 0-g spaceships and don't want to do this via exercise or FES or something, just make up your own "anabolic steroid"
Comment: without exercise steroids cause people to become overweight, so steroids would make them even less fit. Steroids just increase growth, without a stimulus to grow muscle the body grows fat instead.
Comment: John, this is what I remember of a study done twenty years ago (I'll try to find a link, but I read the study twenty years ago so I'm not sure if I'll find it): A control group on a three month time frame had their 1RM (max effortt) on the bench before and after. The other group was given  Sustanon 250 (testosterone) but didn't exercise with 1RM taken before and after. The nonsteroid group gained only a negligible amount more strength than the steroid group without exercise. Steroids cause weight gain, but even without exercise a reasonable amount of the weight gained is lean body mass.
Answer: Anabolic steroids cause more long term damage to the body's ability to regulate it's own hormones than the value gained in muscle growth. When on steroids your body ceases producing those hormones all together, the longer you are on them the longer it takes your body to begin producing those hormones on its own again. After long enough use your body's ability to regulate its hormone levels can be permanantly damaged. Anabolic steroids also cause damage to major organs like the liver, heart, and kidneys. To put it simply, steroids to combat micro gravity muscle atrophy is like drinking to cure depression.
Comment: I agree steroids aren't good for your health (elevated liver enzymes and so on) but maybe if the mission were only two or three years? One would have to think of the cost: benefit ratio. Pro bodybuilders abuse them for much longer periods, probably at the expense of shaving ten years off of their life. I'm considering the answer below, but one aspect of character/plot development for a semi major antagonist is his hope to earn a sizable income from this black market operation, so if the problem of atrophy is resolved without steroid smuggling, I'll have to juggle the plot around a bit.
Comment: I used to work as a fitness instructor and was around guys using "the sauce" quite a bit. Every single one of them were suffering some sort of severe health issue by the 18 month mark. Long term use of steroids is pretty much 6 months. At lifting and body building competitions you just see walls of muscle, you don't see the kidney and liver failure or the 6 separate breast removal surgeries those guys are hiding underneath. Not to mention psychological side effects that would get any prospective astronaut grounded permanently.
Answer: In the spirit of pure speculation, I would imagine that the side-effects of prolonged steroid use (even low dosage) would be less than ideal due to stress on other internal systems.  A better approach might be a form of electrical stimulation similar to what researchers have tried with coma patients. I imagine this tech would be built into clothing to both provide the electrical stimulation and perhaps a degree of resistance to challenge the muscles through natural motion. One might imagine that whatever nano connection these suits maintain with the body could fitted to dispense some form of directed steroid just as it might deliver some form of painkiller in times of stress.
For me, however, the bigger question is why would a drug that is essentially designed to prevent muscle atrophy be distributed as black market contraband?  I would imagine that between suits, diet and exercise routines the atrophy issue would be part of daily life (assuming wakefulness and not stasis / hibernation).  Black market items would be more about recreationals or something designed to overclock the body (regardless of long term effects).
Comment: Great idea, I may implement it!
Answer: As already  suggested by other users long use of steroids cause permanent harm to the body and its not worth, considering many pro bodybuilders die at age of 25 or so.
A better option would be increasing the nucleai in the muscle cells, this way your astronauts will have an easier time maintaing muscle with exercises.
Nucleus overload is permant and can be obtained either by overtraining muscles with incredibly low rest and high volume  at low intensity  for months or years or the faster option would be  using just one single dose of growth hormones(this is also why steroid users can never be considered natural again even after stoping the use of steroids).


How do I hit lower notes on my flute?

Question: I'm having a really hard time playing the lower notes on my flute. When they even come out, they sound really weak.
I can play high notes really well, so I usually adapt my sheet music to an octave higher.
Is there any advice you can offer?
Comment: Check that your flute isn't leaking around the joint.
Answer: I'm going to assume that you've already checked your flute to see if it needs repairs.  Here are a few tips I can give you to improve your output of low notes (I've been playing the flute for about 6 years, so I used to encounter these issues in the beginning too):

Practice the lower notes:

If you are adapting your sheet music to an octave higher, then you're avoiding the issue, not fixing it.  Lower notes can be tricky to hit, especially on the flute, so to get the rich tone you're looking for, practice makes perfect.
Try playing two octave scales that start above octave, and then work your way down.  After you practice this, challenge yourself by starting lower, and then working your way up.  This might be frustrating in the beginning, but actively addressing the issue is the key to fixing it.
Furthermore, try playing short pieces at slower tempos (without changing the octaves).  It's better to start on easier pieces and then work your way to harder ones.  This will let you concentrate more on your tone and clarity then on playing the piece correctly.  When you come across a low note that you can't get out, stop there and hold out the note until it sounds clear and steady.  As you practice, you should find that you will need to hold out the tricky notes less to get a clear sound (this is a sign of improvement).

Practice your tone:

Try to hit lower notes and hold them for a few beats.  Play with the tone until you hit richer notes.  Try to do this on a full breath, and play the note until you just run out of breath.  Try to maintain a steady tone during this process.  If you try this technique on the lowest notes you can play (if you have a B-foot on your flute, this could be especially challenging in the beginning), then working your way up will make other low notes easier to hit.  You can also try this exercises out on scales, or as mentioned above, on short pieces of music.

Embouchure:

I think that embouchure can be a big issue for many flute players.  When playing lower notes, you should be dropping the corners of your mouth more, and your mouth should have an ovular shape.  Remember, for lower notes, the breath has to be directed steeply downwards, so your embouchure has to accommodate this need.  You can practice this by holding high notes for a few beats, and then holding a low note for the same amount of beats (this is easier if you have a metronome).  Switch between the high and low notes.  Keep practicing this until you are used to the change in embouchure, and then try this out on two octave scales, and work way your way to longer pieces of music.  Remember, in the beginning this could be frustrating, but mastering these simple techniques is the key to better playing.

Keep the flute closer to your mouth:

I used to have a lot of trouble with lower notes, but a few years ago, my music instructor informed me that lower notes are easier to play if you bring the flute slightly closer to your mouth, and remember the above information about embouchure.  I found that after trying this technique, my low notes became much richer. Give this a try, and play with the tone.  Try to play steady, rich notes.
Good luck on your flute playing, and remember to practice.  That's the best way to ensure that your low notes will develop richer, clearer sound.
Comment: I once heard that, when playing lower notes on the flute, you should hold your embouchure as if you had water in your mouth and you were relaxing your jaw/lips so that the water would seep out of your mouth and down your chin.
Comment: I've heard that before too, actually.  I think that flute students psych themselves out over lower notes when really, it should come naturally after some practice.  Rich, low notes on the flute are so beautiful (in my opinion, at least).  After developing a good tone on low notes, I would suggest that students play with their vibratos on low notes.  That is definitely a challenging exercise, but it's so rewarding in the end.
Answer: How low are we talking?  Flute gets naturally weaker at the bottom, so this is pretty typical.  You need to blow the air lower and more gently.  Think "wide air stream".
Comment: I'm having trouble around middle C. :S
Answer: I play the flute too, so I DEFINITELY can relate to what you mean by how hard it is to play those low notes.
I still have trouble playing low notes, like the low C, but there are a couple simple tips I use when playing them.
1) Tilt the flute, preferably closer to you as you play each low note.
For me, it helps if I slightly tilt the flute closer to me. I'm not a professional, so I don't really know why, but for some reason, it definitely helps me as a flutist.
2) Close your eyes while practicing.
An odd tip, I know, but it does help. Playing low notes, in my opinion, is much harder than playing high notes because of how focused you have to be. You have to blow extremely carefully, not overblowing, but blowing enough that the note plays. When closing your eyes, you can easily concentrate on the note you're playing, blocking any distractions you could have. What helps me and could probably help you is pretending you're in a dark cave while closing your eyes...just a suggestion.
And 3) Take a LONG breath before playing the note.
When playing a low note, the note doesn't come out perfect at first. It gradually begins to be heard, not right away. Therefore, you might want to take a deep breath so you have enough air to sustain the note for as long as it has to be until you can hear it. I would say the lower the note, the more air you should breathe in before blowing out.
Hope this helped! Again, I'm not a professional, but I'm just adding my own feedback and suggestions from personal experience of playing the flute myself.
Answer: This fall I was playing a piece with a very large flute range. It would be up in the higher octave and then drop down lower very suddenly. My flute teacher told me to do this: when you get home each day, set your flute out and between whatever you are doing walk over and play your lower notes. The goal is to be able to play them consistently and with good tone quality. I played my low notes all the time, even when I was in the middle of practicing a piece I would quickly stop and just drop down and pay low notes. Honestly, it paid off a lot, low notes are no longer an issue for me and I can play them with a rich, gorgeous sound.
My advice to you is the following things. Firstly, try to loosen your embouchure. Often times as flute players, we get in the mindset of higher notes and think our embouchure should still be tight for the lower notes. This is not true at all, lower notes should be played with a more relaxed embouchure, while still being precise. My second suggestion is to take the advice that I stated in the first section. The method of playing low notes regularly and at random moments helped to mature my sound. My third suggestion is to avoid bringing your music an octave up. Rather than adapting to only your strengths, you should apply to both your strengths and your weaknesses in order to improve both. By letting one favor the other, your strengths can become weaknesses, or your weaknesses can become weaker. By keeping the low notes in your music, you are allowing you lower sound to mature and improve. Even the smallest amount of added practice can make you a better flutist.
Answer: Finger the low note you want to play, but leave the left hand ring finger up until you are ready to tongue the note.  As you tongue the note, slap the left hand ring finger down, and the note will pop out instantly with a clear attack.

How do I hit lower notes on my flute?


How does bubble sort compare to selection sort?

Question: Which sorting technique is faster: bubble or selection sort, and why? Are both equally efficient?
Comment: Are you on a mobile device in the middle of an exam or taking a take-home exam or something? Come on.
Comment: ...or both equally inefficient...
Comment: no..this question was asked to me in an interview.i said they are bubble sort.since in bubble sort consecutive elements are compared which are stored in contiguous memory location so it will take less time.Any opinion.
Comment: This is an awful interview question. It doesn't provide any information that a college transcript doesn't already provide (did you have a pulse during a basic CS course is all that can be gleaned from this question). Methinks that "Interviewing Programmers for Industry" should be a required college course for a CS degree.
Comment: This came out for my exam last semester.
Answer: Wikipedia says (emphasis added):

Among simple average-case Θ(n2)
  algorithms, selection sort almost
  always outperforms bubble sort and
  gnome sort, but is generally
  outperformed by insertion sort.
  Insertion sort is very similar in that
  after the kth iteration, the first k
  elements in the array are in sorted
  order. Insertion sort's advantage is
  that it only scans as many elements as
  it needs in order to place the k + 1st
  element, while selection sort must
  scan all remaining elements to find
  the k + 1st element.
Simple calculation shows that
  insertion sort will therefore usually
  perform about half as many comparisons
  as selection sort, although it can
  perform just as many or far fewer
  depending on the order the array was
  in prior to sorting. It can be seen as
  an advantage for some real-time
  applications that selection sort will
  perform identically regardless of the
  order of the array, while insertion
  sort's running time can vary
  considerably. However, this is more
  often an advantage for insertion sort
  in that it runs much more efficiently
  if the array is already sorted or
  "close to sorted."
While selection sort is preferable to
  insertion sort in terms of number of
  writes (Θ(n) swaps versus Ο(n2)
  swaps), it almost always far exceeds
  (and never beats) the number of writes
  that cycle sort makes, as cycle sort
  is theoretically optimal in the number
  of writes. This can be important if
  writes are significantly more
  expensive than reads, such as with
  EEPROM or Flash memory, where every
  write lessens the lifespan of the
  memory.
Finally, selection sort is greatly
  outperformed on larger arrays by Θ(n
  log n) divide-and-conquer algorithms
  such as mergesort. However, insertion
  sort or selection sort are both
  typically faster for small arrays
  (i.e. fewer than 10-20 elements). A
  useful optimization in practice for
  the recursive algorithms is to switch
  to insertion sort or selection sort
  for "small enough" sublists.

And, Wikipedia on bubble sort (emphasis added):

Bubble sort has worst-case and average
  complexity both О(n2), where n is the
  number of items being sorted. There
  exist many sorting algorithms with
  substantially better worst-case or
  average complexity of O(n log n). Even
  other О(n2) sorting algorithms, such
  as insertion sort, tend to have better
  performance than bubble sort.
  Therefore, bubble sort is not a
  practical sorting algorithm when n is
  large.
The only significant advantage that
  bubble sort has over most other
  implementations, even quicksort, but
  not insertion sort, is that the
  ability to detect that the list is
  sorted is efficiently built into the
  algorithm. Performance of bubble sort
  over an already-sorted list
  (best-case) is O(n). By contrast, most
  other algorithms, even those with
  better average-case complexity,
  perform their entire sorting process
  on the set and thus are more complex.
  However, not only does insertion sort
  have this mechanism too, but it also
  performs better on a list that is
  substantially sorted (having a small
  number of inversions).
Comment: The question did not mention Insertion Sort
Answer: Selection sort performs a smaller number of swaps compared to bubble sort; therefore, even though both sorting methods are of O(N2), selection sort performs faster and more efficiently!
Answer: while comparing these two algorithms we have to consider the two operations that are taking place in these algorithm
i)comparison
ii)swapping
on the basis of comparison operation both are equally efficient
but if you consider swapping operation you will find that selection sort is more efficient
consider a array of size 100 in descending and we have to sort them in ascending order
in this problem BUBBLE SORT will take 100*100=(10000)apprx swapping operations while in case of SELCTION SORT it will take only 100 swapping operations beacuse in selection sort at each iteration only one swapping take place
Answer: Bubble sort algorithm is considered to be the most simple and inefficient algorithm, but selection sort algorithm is efficient as compared to bubble sort. Bubble sort also consumes additional space for storing temporary variable and needs more swaps.
Comment: I take issue with the claim that bubble sort takes more space for a temporary variable. With selection sort, a temporary variable is used to hold the min or max value. Isn't that the same amount of space?
Comment: I also don't understand why Bubble sort consumes additional space for storing temporary variable?
Comment: I have issue with additional space claim as with clever programming you can go around additional space requirement
Answer: I can't seem to find a satisfying solution to this question here or elsewhere, though Senthil's link is headed in the right direction.
The question initially had me puzzled since bubble sort can be optimized by early termination of the outer loop after a sub-array (or linked list, etc) pass that fails to perform a value swap. Select sort can't be helped that way, so why would it outperform? Both are weak in general use - O(n^2) - so why isn't the one that can at least be marginally improved better?
The answer, based purely on examination of my own and other implementations, is that bubble sort does a value swap (read, write, write) on EVERY SINGLE COMPARISON HIT. Select sort just notes the new boundary value (min for an ascending sort, max for descending) and then swaps it out at the end of the pass.
<code>void swapInt(int *ptr1, int *ptr2) {
   int temp;

   temp = *ptr1;
   *ptr1 = *ptr2;
   *ptr2 = temp;
}

/* compare and swap over a shrinking sub-array */
void bubbleSortArray(int a[], const int aSize) {
   int unsorted, i, iMax = (aSize - 1);

   do {
      unsorted = 0;
      for (i = 0; i < iMax; i++) {
         if ( a[i] > a[i + 1] ) {
            unsorted = 1;
            /* swap every time comparison is true */
            swapInt(&a[i], &a[i + 1]);
         }
      }
      --iMax;
   } while (unsorted);
}

/* compare to find min value, write it before shrinking the sub-array */
void selectSortArray(int a[], const int aSize) {
   int i, j, mindex;

   for (i = 0; i < (aSize - 1); i++) {
      mindex = i;
      for (j = (i + 1); j < aSize; j++) {
         if ( a[j] < a[mindex] ) mindex = j;
      }
      /* swap after inner loop terminates */
      swapInt(&a[i], &a[mindex]);
   }
}
</code>
Answer: Even though both of them have comparable and bad, worst and average case complexities, there are certain points which show that selection sort is better than bubble sort.

The Selection sort spends most of its
  time trying to find the minimum
  element in the "unsorted" part of the
  array. It clearly shows the similarity
  between Selection sort and Bubble
  sort. Bubble sort "selects" the
  maximum remaining elements at each
  stage, but wastes some effort
  imparting some order to "unsorted"
  part of the array.
Answer: Bubble sort uses more swap times, while selection sort avoids this.
When using selecting sort it swaps n times at most. but when using bubble sort, it swaps almost n*(n-1). And obviously reading time is less than writing time even in memory. The compare time and other running time can be ignored. So swap times is the critical bottleneck of the problem.
Answer: In bubble sort we have more number of comparisons and swapping.
in an array of 10 elements we have 9 comparisons in first pass,8 in second 7,6 and so on. And in each 8 or 9 comparisons we are just able to swap just on element.
Where as in selection sort we first find minimum element of all and place it at 0 index of elements.
Complexity of both the algorithms is O(n2), but in worst case bubble sort has complexity O(n2) and selection has complexity of O(n2) and in best case bubble sort has complexity O(n) and selection sort has O(n2)


How soon is too soon to add something to a resume

Question: I have recently got a new job in September. How soon is to soon to add it to my resume?
Answer: Yes, you can add that job to your resume now.
It's never too soon to add anything that is valid and accurate to your resume.
General, people could add a new job to their resume as soon as they start the new job.
Answer: If by resume you also mean your LinkedIn and other online accounts, then this has been debated for a while.
Decades ago nobody saw your resume unless you were looking for a job, or if the current company wanted to use your resume to win new work. Now with the online resumes everybody can see them as soon as you update it. Even you current manager.
Do you enter the new job over the weekend between the jobs? Right after you start? After a few months. But if you wait too long to put something, the more worried your new manager gets. I have even know people who waited a year, to make sure the old company wouldn't know where they now work. The figured people would stop looking after a couple of months.
During those first few weeks/months your paragraph about the position will only be based on the job description, it will be short of details and accomplishments.
You have to balance what you need to advertise your skills and accomplishments, and making it easier for people to find you.


Hot Copy a vmware virtual machine

Question: I'm running workstation 7.1.3 and I was wondering if there was any way to copy a virtual machine while it's running. Can you just copy the files on the file system while it's running or are there risks to doing this?
Answer: I use VMWare Player and regularly suspend the VM, which snapshots and saves the running state. I then copy the entire folder off to a NAS backup drive. You can restore that VM later just fine.
Live copy while running is not possible in VMware Player or Workstation. Even using Windows VSS to snapshot the disk underneath a running VM is fraught with danger - you have copied the windows disk state for a running machine, but without the contents of RAM. This might later work, it would not resume where the snapshot was taken but it might boot. It is not a practice that I would rely on.
Answer: Vmware workstation is not capable of making a hot copy.
You could use the "save the state of the machine" method that bubu describes, but that will lead to more downtime than just a few minutes. My own windows-on-linux workstation is 14GB, and it only has absolutely required software. I think the downtime will be up to an hour.
Another solution may be using LVM (linux) or VSS (windows) to snapshot the filesystem and copying the virtual machine files. What operating system (linux/windows, what version/edition?) are you running on the host?
Comment: The suspend / resume of a VM is usually quite fast - about 1 minute should do it. The copy of the VMDK (virtualised disk) will be the slower part. If copying disk-disk in a machine, 14 GB should be done in under 15 minutes. If copying to somewhere on a LAN it may be slower - depending on all kinds of factors including but not limited to your network speed. A reasonable guess is about 15-30 minutes.
Answer: If you can tolerate a minute (or two) of downtime, you can consider "saving the state of machine" and then make a copy, then resume the machine, and voila you have a 'warm' copy.

Hot Copy a vmware virtual machine


Global p value in multiple linear regression in R

Question: I am using multiple linear regression to see association between length of hospital stay (Dependent Variable) and few predictors (Independent variables). All the predictors are categorical variables (factors). Some of the predictors have >2 subgroups.
The Regression analysis gives p values for each sub group comparing with the reference subgroup.
Is there a way to get a global p value for the predictor as a whole and not for each sub group?
Comment: This is *multiple* regression, not multivariate regression.
Answer: Deviance test (analysis of variance) is an option here, you can create two models to test the hypothesis of significance of including a predictor. The full model including the factor and a reduced model excluding the factor.
Then you can compare the log-likelihood and use deviance test (-2 * log-likelihood). By comparing the deviance of two models (using F statistic), you can know the significance of excluding this factor.
Answer: Have you plotted the distribution of your length of hospital stay variable? I think you will likely find that the distribution is skewed to the right (since some patients will have much longer hospital stays compared to all other patients). This skewness will likely be inherited by the regression model residuals - if that is the case, you will need to address it if it is very pronounced (especially if your sample size is small). To address it, you may have to use median regression instead of ordinary least squares regression, or perhaps transform length of hospital stay before analysing it via ordinary least squares regression (e.g., you can try a log transformation or a square root transformation).
To get a global p-value for testing the effect of a categorical predictor in your ordinary least squares regression model, you can use a so-called partial F-test. This test allows you to compare the following two models:
Null model: The model which DOES NOT include the dummy variables corresponding to the categorical predictor whose effect on the length of hospital stay you want to test (adjusting for the effects of the other categorical predictors in your model)
Alternative model: The model which DOES include those dummy variables
Note that the null model is considered to be nested within the alternative model, since it is obtained from the alternative model by setting the coefficients of the dummy variables of interest to zero. The null model is therefore simpler than the alternative model; conversely, the alternative model is more complex than the simpler model. The partial F-test will test whether the more complex model is better than the simpler model. (See slides 15 and 16 of http://www.statpower.net/Content/311/Lecture%20Notes/RegressionIntro.pdf for the formula involved in defining the partial F-square statistic and its numerator and denominator degrees of freedom.)
The p-value of the partial F-test will thus help you test these two hypotheses:
Ho: The categorical predictor of interest has no effect on length of hospital stay, after adjusting for the effects of the other categorical predictors present in the model
Ha: The categorical predictor of interest has an effect on length of hospital stay, after adjusting for the effects of the other categorical predictors present in the model
Your software should be able to perform partial F-tests - you just have to read the documentation to find the corresponding details.
Comment: Thanks for your reply. I have log transformed the Length of Hospital stay to achieve normal distribution and subsequently have run the multiple regression. Can i use Wald test (which gives a chi-squared test output)  to test significance of the categorical variable. I have used it in another analysis involving logistic regression. I am not sure if i can use the same for linear regression.
Answer: I believe what you're asking about is called MANOVA. This is just like ANOVA except the outcome is  multivariate. One common test is based on Wilkes $\lambda$, and gives an overall test of whether the mean vector of the multivariate distribution varies between groups. The problem is that it doesn't provide specificity on which element(s) of the mean vector are different. For that you could use post-hoc tests, or perhaps univariate ANOVAs.
Comment: I feel like MANOVA is for comparing two or more dependent variables rather than testing, where OP's situation only have 1 dependent variable. A simple ANOVA should just work here.
Comment: @YilunZhang, I was just reading the title :) Good point!


Why can't I renew my dynamic IP address?

Question: So, I'm going to explain this from the start.
I've started a project with a friend of mine which includes a webspider, that crawls through all pages on a site and stores them in a DB. Since I've never done this before, I didn't think about the amount of requests I was actually sending to the site, and after a day or two I finally got my IP blocked.
I need to be able to visit that site as it's very important to me. Not only for my project, but for other reasons too. (and if I'm able to renew my IP I'm going to set a delay on the crawler so I don't get blocked & DDOS the site)
I have a dynamic IP address, at least that's what my router settings say. I've tried ipconfig /flushdns, ipconfig /release, restart computer. No result. I end up with the same IP address. I've also tried renewing it from the router, however, I think it uses the same method which isn't working.
Is it possible that site has blocked my mac address? Can a site even access my mac address?
Answer:
I have a dynamic IP adress, at least that's what my router settings say. I've tried ipconfig /flushdns, ipconfig /release, restart computer. No result.. same IP adress. I've also tried renewing it from the router, however, i think it uses the same method which isn't working.

When you use ipconfig /renew on your computer, you are renewing your computer's internal address, which is handed out by your router and not visible to the outside.
When you tell your router to renew the address, you are asking the ISP for your external address.
Only the latter is ever visible by websites.
If your lease has not yet expired, you are likely going to get the same old address you had, even if you did /release before.

Is it possible that site has blocked my mac adress? Can a site even access my mac adress?

No. MAC addresses are only visible inside the network segment; your address is not visible beyond any router. (This is even smaller range than your internal IP address, which is only blocked by the router that links you to your ISP.)
Answer: ipconfig /flushdns only flushes your dns cache, it doesn't request a new IP from DHCP. The ipconfig /release and ipconfig /renew will ask the DHCP server for a new lease (and possibly a new IP), but it is up to the DHCP server to give the IP. In most cases this is your home router. If you're talking about renewing the IP that you use on the internet; this usually given to you by your ISP and there are only a few ways to request a new IP from your ISP.
You can try rebooting your ISP's network adapter (sometimes called a modem), but your ISP may have static IPs; if this is the case, you will not be able to get another IP.
Sometimes the ISP will give you an IP address and tie it to your device's MAC address - either your ISP's network adapter or your router. Sometimes you can go in to your home router's settings and change the MAC with a feature called MAC cloning. Updating this value and rebooting your ISP's network adapter should give you a new IP.
Why can't you setup your own web site locally, at home and crawl that? Sounds a bit like your trying to mirror or steal someone's site without permission.
Comment: depending on the ISP your account might be locked to one MAC address. If you clone another MAC and you can not connect to the internet then call your ISP to update your account.
Answer: If it's the router that's connected to the internet (as a router should be - you're not confusing a router and a modem are you?) then it's the router's IP address that you should be renewing.  Just rebooting the router usually does it for me.
Comment: Deleted my answer and voted you up.


Replace missing font with font of my choice in Photoshop CS5

Question: I'm using Photoshop CS5. How can I replace all instances of a missing font with a font of my choice?
Comment: Ive been sent a photoshop file which uses fonts that arnt on my computer. I need to choose a replacement font where its used.
Comment: There could still be licence limitations.
Comment: What? I'm afraid I (And apparently others), don't know what you mean. What missing fonts? And why would you want to replace them with a completely different font?
Comment: I see. Do you know that name of the font?
Comment: Lol. Sorry, I don't use Photoshop, so I didn't know of you could tell. Anyway, you want to replace the font with a different one? Because I'm sure you could download the missing font online.
Comment: Hmm, that is true. What font is it?
Answer: It's possible but not as a straight forward process
There's not particular command or menu option or anything directly related to this in Photoshop itself, but it's still possible to substitute missing fonts by doing the following:

Select all text layers with the same missing fonts (they display a yellow asterisk on them) by using Ctrl + click  technique
Open Character toolbar - if not visible, you can make it so by going to menu Window -> Character
Select appropriate font but don't change any other setting so layers will preserve all other font properties (size, weight, leading etc.)

That's it. Happy substituting.
Comment: This worked great, only annoyance is that you get a confirm box for each layer. For easier substituting it's also possible to place all layers with missing fonts into their own Group and simply perform one replacement on that group.
Comment: Unfortunately this doesn't retain the other settings for me.
Answer: This is not possible. Font substitution has always been horrible in Photoshop. It's a common feature request among the community, especially when Illustrator has a very good font substitution tool.
In a perfect world, every designer should include fonts with their psd.
Considering you already know the name of the font it shouldn't be too hard to find the exact font for which you can then install on your machine. Here are two of my favourite font websites.
Dafont,
Font Squirrel
If you don't find the exact font, try finding something similar then manually replace each occurrence. Selecting each layer in your layers menu then changing the font will help you to replace the font in one go.
Comment: Sorry, perhaps I should have worded it better. jdln knows the name of the font, so I gave two examples of where he/she could potentially find the same font.

Finding a "suitable replacement" i.e. a new font that looks similar, you would have to manually replace all occurrences.
Comment: Say I found a similarly looking font on *Dafont* or *Font Squirrel*, then what's the next step? How do I replace it for the original font, if "Font substitution has always been horrible in Photoshop"?
Answer: Photoshop will only let you pick replacement fonts from the list of fonts that already exist in the document.
Therefore, the easiest way to fix this is to create a new layer group called "My Fonts" or something similar.
Then, drop in a text layer for each of the fonts you want to use. I just type the name of the font on each layer so it's clear even from the layer panel what fonts I have added.
After this, go back to the replace fonts dialog on the Type menu and you should be able to use the fonts from your machine.
This is extremely helpful when trying to match fonts prepared on a Mac with the same font on a Windows machine, or vice versa when the names are different. (If you use OpenType fonts, this shouldn't be an issue.)
Comment: Thanks. Easiest solution for me, especially when the original designer mix/matches fonts in the same layer / text string


What's an object file in C?

Question: I am reading about libraries in C but I have not yet found an explanation on what an object file is. What's the real difference between any other compiled file and an object file?
I would be glad if someone could explain in human language.
Comment: object files aren't specific to C
Comment: A more active version of this: http://stackoverflow.com/questions/12122446/how-does-c-linking-work-in-practice
Comment: Also see [Assembly code vs Machine code vs Object code?](https://stackoverflow.com/questions/466790/assembly-code-vs-machine-code-vs-object-code)
Comment: @JobHunter69 what exactly do you mean?AFAIK,not every compiled language necessarily has object files.Object files are a common intermediate representation used by many compiled languages,but not all.Rust language generates "library crates" (.rlib files) instead of object files. These files contain compiled code,debug information, and other metadata, and are used by the Rust compiler and linker to build executable programs and libraries. Go generates object files in the ELF format, but they contain a different format of symbol information compared to object files generated by C compilers.
Answer: An object file is the real output from the compilation phase.  It's mostly machine code, but has info that allows a linker to see what symbols are in it as well as symbols it requires in order to work.  (For reference, "symbols" are basically names of global objects, functions, etc.)
A linker takes all these object files and combines them to form one executable (assuming that it can, i.e.: that there aren't any duplicate or undefined symbols).  A lot of compilers will do this for you (read: they run the linker on their own) if you don't tell them to "just compile" using command-line options.  (-c is a common "just compile; don't link" option.)
Comment: @ChrisDodd: That was often the case with older compilers.  These days, a compiler won't generate assembly code unless you ask it to, and often doesn't use it internally.  But either way, assembly would be a sub-phase of the compilation phase, so all that is moot.
Comment: can a single object file be executable?
Comment: @Honey: Generally, no. Even if the object file were in a format designed for execution (which it basically never is), that part about "symbols it requires in order to work" basically kills the deal. Even your standard "hello world" requires linking against a C runtime library.
Comment: Actually, with most compilers, the output from the compilation phase is assembly code, and the compiler then invokes the assembler to turn that into an object file.
Answer:
An Object file is the compiled file itself. There is no difference between the two.
An executable file is formed by linking the Object files.
Object file contains low level instructions which can be understood by the CPU. That is why it is also called machine code.
This low level machine code is the binary representation of the instructions which you can also write directly using assembly language and then process the assembly language code (represented in English)  into machine language (represented in Hex) using an assembler.

Here's a typical high level flow for this process for code in High Level Language such as C
--> goes through pre-processor
--> to give optimized code, still in C
--> goes through compiler
--> to give assembly code
--> goes through an assembler
--> to give code in machine language which is stored in OBJECT FILES
--> goes through Linker
--> to get an executable file.
This flow can have some variations for example most compilers can directly generate the machine language code, without going through an assembler. Similarly, they can do the  pre-processing for you. Still, it is nice to break up the constituents for a better understanding.
Comment: The optimized code isn't being generated at pre-processor stage nor immediately after it. Pre-processor only deals with its own language and that's it. Optimization happens at compilation and assembly stages.
Comment: Is the object file we get after compiling same as the executable file in machine language. I'm confused because, you said object file is created at second step from the last and last step is the executable file. So, the .0 file we get after compilation, is that the executable file?
Comment: can't a single object file also be executable?
Answer: There are 3 kind of object files.
1. Relocatable object files:
Contain machine code in a form that can be combined with other relocatable object files at link time, in order to form an executable object file.
If you have an a.c source file, to create its object file with GCC you should run:
gcc a.c -c
The full process would be:

preprocessor (cpp) would run over a.c
Its output (still source; cpp) will feed into the compiler (cc1).
Its output (assembly) will feed into the assembler (as)
assembler (as) will produce the relocatable object file.

That relocatable object file contains:

object code, and metadata for linking, and debugging (if -g was used)
it is not directly executable.

2. Shared object files:
Special type of relocatable object file that can be loaded dynamically, either at load time, or at run time.

Shared libraries are an example of these kinds of objects.

3. Executable object files:
Contain machine code that can be directly loaded into memory (by the loader, e.g execve) and subsequently executed.
The result of running the linker over multiple relocatable object files is an executable object file. The linker merges all the input object files from the command line, from left-to-right, by merging all the same-type input sections (e.g. .data) to the same-type output section. It uses symbol resolution and relocation.
Bonus read: Static vs Dynamic Libraries
When linking against a static library the functions that are referenced in the input objects are copied to the final executable.
With dynamic libraries a symbol table is created instead that will enable a dynamic linking with the library's functions/globals. Thus, the result is a partially executable object file, as it depends on the library. If the library doesn't exist, the file can no longer execute.
The linking process can be done as follows:
ld a.o -o myexecutable

The command: gcc a.c -o myexecutable will invoke all the commands mentioned at point 1 and at point 3 (cpp -> cc1 -> as -> ld1)
1: actually is collect2, which is a wrapper over ld.
Answer: An object file is just what you get when you compile one (or several) source file(s).
It can be either a fully completed executable or library, or intermediate files.
The object files typically contain native code, linker information, debugging symbols and so forth.
Answer: Object files are codes that are dependent on functions, symbols, and text to run the program. Just like old telex machines, which required teletyping to send signals to other telex machine.
In the same way processor's require binary code to run, object files are like binary code but not linked. Linking creates additional files so that the user does not have to have compile the C language themselves. Users can directly open the exe file once the object file is linked with some compiler like c language , or vb etc.

What's an object file in C?


I have a hunch about ten of the high reach accounts here are the same person

Question: I have a hunch about ten of the high reach accounts here are the same person. Am I right? They must be quite the polymath anyway, if so.
Comment: Nope, or they are also an IT specialist with 9 VPNs that are *always* linked to the same accounts.
Comment: @PhilipKlöcking [You could be in on it.](https://plato.stanford.edu/entries/other-minds/)
Answer: Curiously, it sounds like solipsism of sorts. There's just you and the bots on the Internet. You'll be happy to know that I, I mean we, have been noticed by the Internet writ large. See https://en.wikipedia.org/wiki/Dead_Internet_theory for more information.
If it helps, I vouch for my rabel-rousing existence independent of the moderators whom I hold in high esteem despite my penchant for prior rambling exhortations.