Cannot find out which files were not copied with rsync

Question: I copied files using rsync with:
rsync -trvh "/media/user/HDD/Arch/" "/media/user/my_drv/Arch/" && rsync -trvhc "/media/user/HDD/Arch/" "/media/user/my_drv/Arch/"

After rsync completed its run, the last lines of output were:
sent 218.26G bytes  received 1.37M bytes  5.48M bytes/sec
total size is 218.20G  speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]

After checking which files were not copied, I ran:
rsync -trnqhc "/media/user/HDD/Arch/" "/media/user/my_drv/Arch/"

and I did not get any output.
I checked the properties of both folders.
For /media/user/my_drv/Arch/ (destination folder) I got:
Files: 65697, folders: 19812
For /media/user/HDD/Arch/ (source folder) I got:
Files: 65700, folders: 19815
If the source folder has fewer files than the destination folder,
then why does the rsync -trnqhc command give me no output
(I expect output with files that were not copied)?
How can find out which files were not copied from source to destination?
Comment: You're using `-q` (`--quiet`) to suppress messages from the destination part of the transfer process
Comment: @ChrisDavies Thank you. I checked and you are right. Without `-q` my code gives the list of folder and files that were not copied.
Answer: You're using -q (--quiet) to suppress messages from the destination part of the transfer process. Remove this flag


How do I solve the clock room?

Question: There's a room with a huge clock in the temple/science warp zone. I think I just have to wait until something appears, but how long should I wait?
Answer: There are four anticubes in the clock puzzle. Each will show when one of the clock's four hands hit the top. There is a limited window for catching the anticube before it disappears. The times differ between consoles, but the hands' speeds are the same:

Red cycles every minute.
Blue cycles hourly.
Green cycles daily (24 hours).
Gray cycles every week (7 days).

You'll need to check your clock and figure when it'll hit the top. Either check back then or change your 360's time from the system settings (you'll need to disconnect from the Internet).
E.g., my blue always hit at :15 past the hour, my green always hit at 7 p.m. (once a day), and my gray hit at 4 a.m. with a rather large window (since it moves slowly).
Comment: Interestingly, my grey hit at Jan 6th, 8:12 am.  I thought this was based on another clue, but I guess it was coincidence?
Comment: For me it hits: 3rd June 2020, 6:00 pm (London timezone)
Answer: Some people on other forums are saying the grey/white is every 48 hours. It's definitely more than that!
These:

...are a difference of sixteen to twenty hours between each. By my own estimates based off each quarter of the clock being roughly 40 hours, that means a total of roughly 160 hours give or take a dozen or so, meaning the 7-day estimate appears to be correct.
Maybe it's different between the PC and the XBox versions, I don't know.
Note: If you change your PC's time, you have to exit Fez and then start it back up. You'll still be in the clock-tower room, but you'd be at the bottom of the tower.
Unlike the Xbox, you don't need to disable your internet connection on your PC if you are adjusting your PC's clock.
Supposedly, on the PS4, you can just go to your time settings and use the 'Change Manually' option; when you go back to Fez the hands will have moved the correct amount. You don't need to quit out just use the PS button to go to the menu then back again. I'm not sure if this is true though.
Comment: I got the green cube around 6pm I think, and the white hand was pointing down, but a little to the right. I expected the white cube to be at 6pm as well, but I got it quite a bit earlier in the day; I think it was about three days later. So I'm not entirely convinced that 7 days is exactly right either... unless the white cube has a much bigger window of opportunity to grab it. Still, it does seem to be at least close to 7 days.
Comment: Regarding PS4, yes this is true... just tried it :-)
Answer: For the clock room you just have to wait until each hand reaches the 12:00  postition on their perspective. From what I've seen they move at different speeds. From fastest to slowest is: Red, being the seconds hand. Blue, most likely minutes hand. Green, I am guessing hour hand. White, I have no clue, but I hope it isn't a days hand.
Answer: The white hand of the clock creates an anticube around 12:00 noon, so try setting your 360's clock to a few minutes before that (after disconnecting from Xbox Live). As far as I know it activates at noon regardless of how often you've visited the clock or when you started the game.
Answer: I am thinking,considering that I have solved the half the puzzle so far,
Red=Minutely
Blue=Hourly
Green=Daily(12:00 a.m./12:00 p.m.
White=Possibly every 12 days

How do I solve the clock room?


HTML parser to word doc

Question: I need to parse multiple HTML files and only pick up few tags from the file and save them in a word(.docx) file with certain formatting(certain words need to be bolded/indented etc.). Are there any pre built tools that I can use for the same? Or are there any external libraries that I can use to write the code for the same?
Answer: You have to use PHP, it's impossible to do this in clear HTML. Check for example: HTML parse

HTML parser to word doc


MySQL database configuration for fastening the select and insert queries

Question: There are several DBEngines are available for MySQL DB. Currently I'm using InnoDB. My actual problem is, I have a table that consist of millions of data. Therefore the select queries that given to this table is extremely slow. I need to know which configuration should I use to make the select query faster, that doesn't affects the speed of insertion.
Answer: Your problem is not the DB Engine, but the lack of the indices. Indices make possible for your database to find things (records) much faster. You had to make some.
I suggest to read an sql indexing tutorial (google is your friend), and then come back with a new question, if you have yet one.
Extension after you gave your query: in this case there is two problem. First, LIMIT isn't really simple to make faster with indices. But it is not a big problem, because in your query is it visible, what is the cause of the sloooow query. It is the multiple inequality conditions in the WHERE. I didn't give a medal for the liferay programmers for this sh... sometimes-maybe-not-really-useful solution.
The greatest problem is, that such indices can't be make faster by indices easily. On big tables they should be avoided, if we want to develop high-quality software.
The solution - indexing a table for multiple inequality search term - isn't known currently also for me, thus I opened a new question for you, what can be done in MySQL in your problem. Maybe we get some interesting answer and in this case I will be able to extend also this question.
Comment: my query is "select * from school_liferay.trip_parameters where speed>5 and lattitude<100 limit 10;"  it takes 265.9541s . Now i created an index with column speed and latitude but it is also taking the same time to query data.
Comment: In general `>` and `<` are not so fast as `=` or `<>` because such selects produce large or even huge temporary tables that sometimes can't fit into memory and placed on disk by mysql engine. That's the main cause of poor performance.
Comment: @Kondybas There is an alternative problem as well. If there is two non-equality term in a search condition, it can't be indexed with simple record-trees.


How to identify unused PPAs?

Question: Let's say I want to verify if some PPAs aren't being used so I can minimize conflicts or whatever else could happen. Is it possible to verify which PPAs are no longer in use?
Answer: One method is to use Ubuntu Software Center. Open it and use the arrow down next to "installed". It will list (from bottom up) PPA's installed:

When you click on a PPA (TLP as an example) it will list the software included in this PPA. A green 'tick' means the software is installed. If none are the PPA is unused.

How to identify unused PPAs?


is infinite connected components still true

Question: my assignment has this question, given a topological space X with finite many connected components, a function $f:X\rightarrow Y$ is continuous if and only if it is continuous on each components. Is it still true if X has infinitely many components. The first is okay but the reverse makes me confused, so how can I prove the reverse? Moreover, if $X$ has infinite connected components, I know it is not true but I can't find an example.
Anyone help?
Answer: Consider the set $X=\{1/n\mid n\in\mathbb N\}\cup\{0\}$ and the map $f:X\to\mathbb R$, $f(0)=1$, $f(1/n)=0$. Then $f$ is clearly continuous on each component since the components are just the elements of $X$. But $f$ is not continuous on $X$. The reason is that a set is not open if its intersection with each component is open, i.e. $X$ is not the topological sum of its components. It would work if all components were open, though. This is the case if there are only finitely many, but also if the space is locally connected.
Edit: If a space $X$ has the property you mention, then a map $f$ from $X$ to an arbitrary space is continuous if and only if its composition with each inclusion map $i_C:C\hookrightarrow X$ is continuous for each component $C$. Then the space has the so-called final topology with respect to all those maps. It can be shown that the topology then consists of all sets $U$ such that $i_C^{-1}(U)$ is open in $C$ for each $i_C$. Since the preimage of a component is either the component itself or empty, thus open in every component, so it must be open.
If you are not familiar yet with final topologies and the universal property, then there is also a more direct proof, which uses the idea of the counterexample above. The characteristic map $\chi_C$ of a component $C$ is constant on each component, hence it must be continuous on all of $X$. But this implies that $C=\chi_C^{-1}(1)$ is open. So $X$ has this special property iff each component is open.
Comment: I learned that connected component is both open and closed, so I still don't get your idea "The reason is that a set is not open if its intersection with each component is open"
Comment: @hungtran: But that's wrong. The components are always closed. They are open if there are finitely many because then a component is the complement of a finite union of closed components, thus open. They are also open if $X$ is locally connected.


m_BoneMapping is undefined in OpenGL Step By Step Skeletal Animation Tutorial

Question: I am new to this website I was following this specific tutorial on skeletal animation and I have a good idea on what it is, but when I was following his implementation he used a variable called "m_BoneMapping" and which is undefined to me. What am I suppose to do?
Comment: I'm voting to close this question as off-topic because it is about debugging tutorial code.
Answer: It looks like that tutorial doesn't include all of the source code but I did find a link to it on the main page, here: http://ogldev.atspace.co.uk/
The Mesh class appears to have an m_BoneMapping member, which the tutorial describes as the following:

The m_BoneMapping array maps a node name to the index that we generate
  and we use that index to as an entry into the m_BoneInfo array where
  the final transformations are stored.

The tutorial describes the m_BoneMapping as an array, but the source code suggests otherwise. It appears to be a std::map<std::string, unsigned> which maps a name (string) to an index (unsigned).
It is populated in the void Mesh::LoadBones(uint MeshIndex, const aiMesh* pMesh, vector& Bones) method, and used in void Mesh::ReadNodeHeirarchy(float AnimationTime, const aiNode* pNode, const Matrix4f& ParentTransform)
If you add that to your Mesh class it looks like it should all work out.


Sell Put Strike Price and Share Price

Question: I have a sell put Strike @ $100. At expiry yesterday, share price is @ $100.32. Will I be exercise?
Answer: The probability of you being assigned is very low. The strike Kp doesn't exceed the MVPS, so automatic exercise isn't happening.
However, if the option was ITM by a certain threshold (normally $0.01), the OCC will by default offer the buyer the ability to ask for sellers of the contract series to be assigned. This is known as "exercise by exception"; in the absence of contrary instruction from a clearing member, the OCC will assign a seller, and the transaction will proceed.
On the other hand, it's still possible (theoretically) for a market participant holding / long on that same option series that you sold to exercise before 4:30pm CT the Friday that it expires even if the option is OTM. They have the right but not the obligation to exercise the option, regardless of the market price of the underlying relative to the strike.
So there's no guarantee that you won't be assigned, but the practice of exercising an OTM option is rare.
Comment: Hypothetical question.  It's expiration and (A) is long the entire call open interest in stock ABC at strike $100 and (B) is short that entire position.  No other players exist at that strike.  This $100 call ends slightly ITM.  (A) informs the OCC via his broker not to auto exercise.  Does that mean that (B) gets a free pass even though his short calls expired ITM? I'd assume so ... but?

Sell Put Strike Price and Share Price


Laravel - how do you access App object in a custom class?

Question: I have a custom class in app/libraries/data/Data.php where i want to return a connection to a database.
The problem is i need to dynamically load a database that doesn't(and can't) exist in the config file.
I found a nice solution, and to be honest it was exactly what i was hoping for, but it seems i cant access the App object from there.
<?php
namespace libraries\data;
use DB;

class Data
{

    public function db($name, $firma = false)
    {

        if ($name == 'firma') {

            $config = App::make('config');
            $connections = $config->get('database.connections');

            $newConnection = $connections[$config->get('database.firma_%s')];

            $name = sprintf('firma_%s', $firma);
            $newConnection['database'] = $name;

            App::make('config')->set('database.connections.'.$name, $newConnection);
        }

        return DB::connection($name);
    }
}
?>

Update: of course i tried "use App;" (d`oh) and of course it didn't work. And of course it works now.
Answer: You could also use the app() helper function which returns the application instance. And $config = app('config'); to get the config object.
Answer: Your are in the namespace libraries\data. Either you add use App; or you call the App methods with \App::.
Answer: Since you define a custom namespace libraries\data , the application will try to find the App class in the libraries\data namespace.
If you want to use the laravel App class you need to write this:
 $config = \App::make('config');

Or add use App; at the top of your file like you did with the DB class.


Excel 2019 opens any document in Read-Only mode on a terminal server

Question: We have a terminal server (Server 2012 R2) used by ~10 people.
When any user (including Administrator) opens an Excel  file (xls / xlsx), it will open in read-only mode. This could be a file within a share that has full permissions for all users, or you could create a new Excel file on the desktop, open it, and immediately it is read only. Right clicking on the file and opening Properties will show that "Read only" is not checked. Users can open these files, edit them and save them to a new location without issue,
We've tried the following:

Set it to read only, and then changed it back, still opened in read only
Checked hidden files for lock files, there are none
Opening multiple different Excel files from multiple locations (file server / local directories)
Checked share permissions, not the issue
Checked open files on the file server, the files weren't locked
Tested Word and Powerpoint files, the issue doesn't apply to these
Asked all users to close Office applications, and checked for stuck processes, there were none
Asked all uses to sign out, then performed an online repair this didn't help
Restarted the server, still same issue.
Checked Excel Trust Centre and ensured there are no blocks on any files
Checked Event Viewer - No related errors reported.

We're at a bit of a dead end, any help would be appreciated.
EDIT: Sage was updated on the server recently, and I've just got a DLL missing error when launching Sage which points to C:\Windows\SysWow64\sgxladdin.dll which is a Sage Excel reporting module. So this is certainly related.
Answer: The issue turned out to be caused by Sage Accounts 27.1 which adds a plugin to Excel, but doesn't actually include the file in the installer it seems.
Removing the plugin from Excel fixed the issue.


Is person accounts available in Service Cloud?

Question: for a project, I need to enable person accounts feature in Service Cloud but I can't find any response in the Salesforce documentation.
Do you have a link that says if it is possible or not?
Comment: I do not know any issue to use Person Account. Would you like to open a Case for example? What feature are you talking about?
Answer: Yes it is possible to use PersonAccounts in Service Cloud. The documentation states that the Service Cloud Cases are compatible with PersonAccounts:

On cases, person accounts can be entered in the Account Name field, the Contact Name field, or both.(Source: Considerations for Using Person Accounts)

Steps should be the same as in the Sales Cloud documentation:

Make sure you meet the following prerequisites.

The account object has at least one record type.
User profiles that have read permission on accounts have read permission on contacts.
The organization-wide default sharing is set so that either Contact is Controlled by Parent or both Account and Contact are Private.

From Setup, enter Account Settings in the Quick Find box, and then select Allow Customer Support to enable Person Accounts. We'll verify your org meets the prerequisites, then send you an email with additional information. If you don't see a message verifying you meet the prerequisites, go back to step 1.
Contact Salesforce Customer Support by logging a case to enable Person Accounts. Refer to the email we sent about what to include in the case.
After Person Accounts is enabled, a person account record type is created. You can create additional record types for person account if needed.
Assign the person account record type to user profiles.(Source: Enable Person Accounts)

Note: Salesforce Support will ask you if you are sure about activating PersonAccounts as this cannot be undone once provisioned.


How to take screenshot under Wayland?

Question: I want to write a simple tool that will take screenshots at Wayland.
Am I right in my understanding that it would be completely different from Xorg?
Could anybody give me any examples?
Answer: Your question is a bit underspecified. You don't need to write a tool as long as you use the reference compositor Weston for Wayland. It has this feature built in. You can use Super + S to take a screenshot and Super + R to record a video in *.wcap form which you can then convert to a *.webm video.
If you should really be interested in writing such a tool then you should look at Weston's source code here: http://cgit.freedesktop.org/wayland/weston and find the relevant parts.
Answer: Yes screenshotting works completely different under wayland than under Xorg.

By design, Wayland is a lot more secure than X11 and does not allow one application to capture the content of other applications' windows, meanignath a X11 based screenshot tool cannot work underWayland/Xwayland.

https://bugs.freedesktop.org/show_bug.cgi?id=98672
Sorry I cannot tell you how it is different, just that it is different.
Answer: I used to use shutter but it fails with Wayland.
gnome-screenshot works with Wayland but in itself is clunky when it comes to rename files straight after grabbing.
I made 2 scripts: shut.sh
#!/bin/sh
# call me shut.sh
gnome-screenshot -a -f /path/to/temp/grabcache.png
gnome-terminal -e "bash grabname.sh"

and grabname.sh
#!/bin/sh
# call me grabname.sh
read -p "Name for grab? " grab
cp /path/to/temp/grabcache.png /where/you/want/it/$grab.png
nautilus /path/to/temp

Now define a hot key to run shut.sh . You will need to specify the exact paths to each script unless you save the scripts to a location in your $PATH variable for the shell.
Then, when you press your key, a cross-hair will appear on the screen for you to select a grab target. This saves grabcache.png to /path/to/temp.
When done, terminal will open and ask you for a file name to copy grabcache.png to $grab in /where/you/want/it. Then, nautilus should open to show you the new renamed grab. If nautilus is already open, you may have to ALT-TAB to it manually.

How to take screenshot under Wayland?


How can I add a role and use apex managed sharing all at once?

Question: Question is in the title. For context, when a certain record is added, we would like to create a role (named after that record) and share it with that newly created role. Because of that, the flow ends up DML -> System DML -> DML. Since I would otherwise get a 'Mixed DML' error, that middle one needs to be separated with an @future. Unfortunately I need the third part of that to run in sequence but I cannot call one @future from another one. How can I go about doing this?
Answer: Do you need this in real-time ? Otherwise you could create an action table and a batch job that perform the last part.
Kind regards,
Rudy De Coninck
Comment: That is a possible route, however there is the chance that these objects could be inserted in quick succession but not in a batch, meaning I could spawn a large number of batch jobs in a short time. Could I come up against limits with this idea?
Answer: With Winter '15 you can use the Queueable interface to design an asynchronous job to be run, and which can kick off other asynchronous jobs.  Original Salesforce Engineering Post on Queueable
Queueable in Winter '15 has a limited depth of 2 jobs, which should meet your needs if your initial record is created in real-time.  Otherwise Spring '15 is introducing infinite job-chaining if you can wait a couple weeks.
A word of caution for your Apex tests.  There is a known issue related to the use of System.enqueueJob() that causes most/all tests run afterwards to fail.  This sounds like it's addressed in Spring '15.  Also, the use of Queueable still counts against the daily limits for asynchronous executions.


"nones" used to describe people who are spiritual, but not religious

Question: I work for the Church and I've seen the term "nones" used to describe those who are non-Christian or those who are considered "spiritual, but not religious." I find the term belittling. What's the origin of the term? Is it from "none of the above"? Is there a better term out there?
Comment: I suspect, rather, that it refers to survey responses and designates those who when offered a choice of religious affiliations in a questionnaire check "None".
Comment: I guess it's a play on "nuns", and it's pronounced the same way. However, "ones" for "not nuns" would be better.
Comment: Spiritual and not Christian, or just non-believers altogether? I think 'none of the above' would mean not Christian, not Islamic, not Hindu, etc, etc, etc.
Answer: This term has lately been used by reputable survey groups such as Pew to refer to people who self-identify as "none of the above" on religious surveys. It has been popularized recently by NPR and other news sources reporting on the upsurge of "nones" in the population. I have also heard it used from the pulpit. I have never heard it used pejoratively.


PHP DataMapper with multiple persistence layers

Question: I am writing a system in PHP that has to write to three persistence layers:

One web service
Two databases (one mysql one mssql)

The reason for this is legacy systems and cannot be changed.
I am wanting to use the DataMapper pattern and I am trying to establish the best way to achieve what I want.  I have an interface like follows:
<?php
    $service = $factory->getService()->create($entity);
?>

Below is some contrived and cut down code for brevity:
<?php
class Post extends AbstractService
{
    protected $_mapper;

    public function create(Entity $post)
    {
        return $this->_mapper->create($post);
    }
}

class AbstractMapper
{
    protected $_persistence;

    public function create(Entity $entity)
    {
        $data = $this->_prepareForPersistence($entity);
        return $this->_persistence->create($data);
    }
}
?>

My question is that because there are three persistence layers, there will also therefore likely be a need for three mappers for each. I'd like a clean design pattern inspired interface to make this work.
I see it as having three options:

Inject three mappers into the Service and call create on each
$_mapper is an array/collection and it iterates through them calling create on each
$_mapper is actually a container object that acts as a
further proxy and calls create on each

Something strikes me as wrong with each of these solutions and would appreciate any feedback/recognised design patterns that might fit this.
Answer: I have had to solve a similar problem but very many years ago in the days of PEAR DB. In that particular case, there was a need to replicate the data across multiple databases.
We did not have the problem of the different databases having different mappings though so it was a fair bit simpler.
What we did was to facade the DB class and override the getResult function (or whatever it was called). This function then analysed the SQL and if it was a read - it would send it to just one backed and if it was a write, it would send it to all.
This actually worked really well for a very heavily utilised site.
From that background, I would suggest entirely facading all of the persistence operations. Once you have done that, the implementation details are less relevant and can be changed at any time.
From this perspective, any of your implementation ideas seem like a reasonable approach. There are various things you will want to think about though.

What if one of the backends throw an error?
What is the performance impact of writing to three database servers?
Can the writes be done asynchronously (if so, ask the first question again)

There is potentially another way to solve this problem as well. That is to use stored procedures. If you have a primary database server, you could write a trigger which, on commit (or thereabouts) connects to the other database and sychronises the data.
If the data update does not need to be immediate, you could get the primary database to log changes and have another script that regularly "fed" this data into the other system. Again, the issue of errors will need to be considered.
Hope this helps.
Answer: First, a bit of terminology: what you call three layers, are in fact, three modules, not layers. That is, you have three modules within the persistence layer.
Now, the basic premise of this problem is this: you MUST have three different persistence logic, corresponding to three different storage sources. This is something that you can't avoid. Therefore, the question is just about how to invoke write operation on this modules (assuming that for read you don't need to call all three, or if you do, that is a separate question any ways).
From the three options you have listed, in my opinion the first one is better. Because, that is the simplest of the three. The other two, will still need to call three modules separately, with the additional work of introducing a container or some sort of data structure. You still can't avoid calling three modules somewhere.
If working with the first option, then you obviously need to work with interfaces, to provide a uniform abstraction for the user/client (in this case the service).
My point is that:
1. Their is an inherent complexity in your problem, which you can't simplify further.
2. The first option is better, because the other two, make things more complex, not simple.
Answer: I think option #2 is the best in my opinion. I would go with that. If you had like 10+ mappers than option #3 would make sense to shift the create logic to the mapper itself, but since you have a reasonable number of mappers it makes more sense to just inject them and iterate over them. Extending functionality by adding another mapper would be a matter of just adding 1 line to your dependency injection configuration.


How to detect the LWC form changes on Back button

Question: I am working on gathering the information from the user, once the document details been saved into database, still user can be able to edit the form data at any time. If user click "Back" button system will show the confirmation message on unsaved changes if user changes and not saved. I have lot of fields in the component like radio buttons, and input fields. Is there any generic method available in LWC to identify DOM changes ?
Answer: popstate event will do the trick like below:
window.addEventListener("popstate", () => {
  // your custom code
});

Try to do a search on google to know more about this event.


Is a random circuit likely to compute a one-way function?

Question: I remember reading somewhere that (under certain reasonable assumptions) a Boolean circuit with many inputs and outputs (assume equal number for now) chosen at random will be a one-way function with high probability.  Is this true?
Comment: It depends on how you define random circuit. If you use $n$
block inputs, $m$ NAND gates each with 2 inputs and one output, with the block's outputs these $m$ gate outputs, and randomly connect each of the $2m$ gate inputs to one of the $n+m$ block inputs and gate outputs, you often end up with something that is not a function (two NAND gates can make an RS latch). If you add some rules preventing this, that's a function but not a one-way function. You need to hide many of the outputs to hope for that. I know no quantitative result (hence this is not an answer) [fixed]
Answer: The claim that you remember is to good to be true. It is yet unknown (because the question P ?= NP is still open) whether there are one-way functions. If the claim you remember was true, it would prove the existence of one-way functions.
P.S. While P = NP excludes the existence of one-way functions, even with P != NP the existence of one-way functions is still an open problem.
Comment: This is mathematically correct; but from an applied cryptography standpoint, there are one-way functions.
Comment: I would count "the existence of one-way functions" as a reasonable (even if unproven) assumption.
Comment: @fgrieu:  I am explicitly referring to the original question. The vaguely remembered claim about some random circuits as stated by the OP would imply the existence of one-way functions.
Comment: It could be a claim under some widely believed assumption. Although it seems very unlikely for average-case hard OWF, the question is interesting for worst-case hard OWF.
Comment: My question mentioned "reasonable assumptions".  That includes "there is a one-way function".


Do entries in augmented columns count as pivot?

Question: I am in a basic linear algebra course, and we are learning to solve linear equations with augmented matrices. We learned that when an augmented matrix is in row echelon form or reduced echelon form, you can tell if the system has one, infinitely many, or no solutions by looking if there is a pivot in every column or a pivot in every row. When you look for pivots, do entries in the augmented column count?
Answer: If the augmented matrix has a pivot in its last column, then the system corresponding to that augmented matrix is inconsistent. This is because in the reduced echolon form of the augmented matrix there will be a row of the form $[0\cdots 0\mid c]$ where $c$ is a nonzero number, namely the pivot. This means that $0=c$, implying the inconsistency of the system.
In fact, the same argument sketched above shows that a linear system is consistent if and only if its augmented matrix does not have a pivot in its last column. If no such pivot exists, you can solve the system by back-substitution.
Comment: i understand that but my question is more about terminology, when an augmented matrix is said to not have a pivot in every column, does that include the last column?
Comment: Yes, that includes the last column too.


Can jet engines stay running without electrical power?

Question: A piston-engine aircraft will continue to run as long as its magnetos still work, even if there is zero electricity in the battery and the alternator is broken, because magnetos are independent of the aircraft's electrical system. Since turbine engines don't have magnetos, do jet aircraft (including turboprops) work the same way?
Comment: I think a clarification of the question could help narrow down whether the question is asking about *any* electrical power at all (i.e. purely mechanical), or if the question is only about electrical power provided from a source external to the engine housing itself.  The questions so far seem to indicate that electrical power is typically required, but is usually provided internally by the engine itself.
Answer: Yes, a jet engine can operate without electrical power.  Or at least they used to be able to...
A jet engine uses igniters (like electric spark plugs) to initiate combustion in the combustor.  Once initiated, the igniters are not needed anymore and the combustor should stay operating as long as the engine is operating.
Modern jet engines use a FADEC (Full Authority Digital Electronic Control) to control the engine.  The FADEC is a computer that monitors everything about a jet engine and simplifies its operation to the pilot.
Older jet engines used different combinations of mechanical, pneumatic, and hydraulic control.  A modern FADEC is better all around, improving engine performance, life, and safety.
Modern FADEC are redundant and are extremely reliable.
The FADEC requires electricity, but it will have a separate generator analogous to the magnetos.
Comment: @FreeMan The high-pressure fuel pumps within the engine are mechanically connected to the accessory gearbox and will continue to run. The low-pressure fuel pumps in the tanks might not, but as Therac said, gravity and suction from the high-pressure pump is enough for under-wing-mounted engines. I think tail-mounted engines might have problems though.
Comment: @user253751 I think the context of _modern_ engines using a FADEC (which uses electricity) makes it clear the possible exception I'm referring to.  The OP allows a spark ignition piston engine to operate 'without electricity' because it has a self-contained power source (magnetos) independent of the aircraft's electrical system.  If the same allowance is made for a FADEC's independent power source, then Yes, it can operate independent of the aircraft's electrical system.  If however, all electricity is forbidden from use in this question, then no a modern jet engine will not operate.
Comment: From https://www.faa.gov/sites/faa.gov/files/2022-01/Full%20Authority%20Digital%20Engine%20Control%20(FADEC).pdf _If the FADEC fails, the engine fails. However, system redundancy makes it much less likely for a FADEC system to fail than a traditional magneto system. In fact, a double magneto failure is statistically more likely than a FADEC failure._
Comment: "They used to be able to" does not answer "can they?"
Comment: Are the fuel pumps mechanical or electrically operated? If they're electrical, the combustors will stay lit while they've got fuel, but as soon as the pumps stop, the fire will go out. No?
Comment: @FreeMan There's gravity feed from wing tanks for underwing engines.
Comment: Ah! That makes sense.
Answer: Jet engines have magnetos too (alternators with permanent magnets). Combustion can be sustained without igniters, but a permanent electrical power supply is required to feed engine electronic components, in particular each engine controller (EEC, ECU, FADEC).
This controller adjusts the engine parameters, according to the thrust demand selected by the crew with the throttle (fuel flow, variable vanes...)
Each engine has its own dedicated electrical alternator for the controller. If this power supply is not operative on the ground, the crew cannot take off (see A320 minimum equipment list).

(Source: CFM56-7B Engine systems)
A controller has two redundant channels fed by different sets of stator windings in the alternator. The controller is initially fed from the aircraft power supply, and the dedicated alternator takes over when the engine spins (> 12% N2 on CFM56).
If any set of windings fails:

The corresponding controller channel is switched back to the main aircraft supply (IDG, or whatever currently feeds the main electrical bus). If this happens while in flight, the flight can continue.

An ECAM message ENG 1(2) FADEC ALTERNATOR is displayed. If this message appears before takeoff, the crew is not allowed to take off.

Both the regular high-power generator (IDG) and the small controller generator are driven by the engine using the accessory gearbox, e.g for CFM56-7B of a Boeing 737 NG:

(Source: CFM56-7B engine manual)
This gearbox is located at the bottom or (like here) on the side of the fan case:

Source.
For more details about the accessory gearbox, see this question: Where is the generator in a large turbofan of a commercial airliner?


Find cubic equation roots: what choice to make for cube root to avoid circularly permuting the roots?

Question: My work involves solving a cubic equation similar to this $a x^3+b x^2+c x +d$
which has three roots, $x_1, x_2, x_3$ (as given in https://en.wikipedia.org/wiki/Cubic_function.)
$$x_k=-\frac{1}{3a}(b+u_k C+ \frac{\Delta_0}{u_k C}) \;\; k \in {1,2,3}$$ where $u_1=1$, $u_2=\frac{(-1+ i\sqrt{3})}{2}$, $u_3=\frac{(-1- i\sqrt{3})}{2}$ and $C=\sqrt[3]\frac{\Delta_1+\sqrt{\Delta_1^2-4 \Delta_0^3}}{2}$  and $\Delta_0$ and $\Delta_1$ are function  of $a, b, c, d$. As given in the above link, changing of choice for the cube root  $\sqrt[3]{}$ when calculating $C$ amounts to circularly permuting the roots. For my problem there is only one root in the desired solution set (since the problem is convex). Note that the value inside $\sqrt[3]{}$ when calculating $C$ can be real or complex. According to Matlab's choice of root (i.e., when I write $\sqrt[3]{}$ in the Matlab script to find $C$), $x_1$ is the desired solution always. However if the choice $\sqrt[3]{}$ is changed $x_2$ or $x_3$ may be the desired solution. So if I want to write specifically one of the three roots (let say $x_1$) as my desired solution, do I need to write a rule for choice of cube root (to calculate $C$)? Please help me to understand how can I write a specific solution to my problem.
Answer: Since your problem has a unique real solution, the radicand inside the cubic root is always real, because $\Delta_1^2 - 4 \Delta_0^3 \geq 0$, and you can take either plus or minus sign for the square root. Thus you just need to define the cubic root to be the unique real one, and take $x_1$, that is, $u_1 = 1$. Note that in this case, changing the sign of the square root inside the cube root is equivalent to interchanging $u_1 C$ and $\frac{\Delta_0}{u_1 C}$.


Book Recommendation for spin-orbit coupling

Question: I am wondering if there were any recommendations for any books that are around graduate level in regards to the discussion of spin-orbit coupling and the Rashba spin-orbit coupling
Comment: The usual way to go is *Spin-orbit Coupling Effects in Two-Dimensional Electron and Hole System* by Roland Winkler, Springer . What kind of research do you want to do?
Answer: Optical orientation is the standard reference - it does not actually contain the discussion of Rashba coupling, but provides necessary general background about the bulk mechanisms of spin-orbit coupling, spin dynamics, optical response, etc.
Rashba became popular in the context of spintronics in early 2000s, so one is likely to find something by looking in this direction.


What material property (Young's modulus, HRC hardness, Max yield strength, etc) affects how easy it is to cut sheet metal?

Question: Our team is looking for sheet metal that is easiest to cut (and paint over), so I was wondering if there was a specific material property (such as those listed in the title) that affected the cuttability of the sheet metal? Thank you in advance!
Comment: I think the most important property is thickness. In some industries one inch think steel is called "sheet".
Comment: There is some nuance, especially in steels and stainless steels. Given similar strength and hardness spec, materials that work-harden can be much worse to work with. If milling or drilling, some materials form nasty chips compared to others. Some have a wear-resistant microstructure (grains of carbides or silicons) and hence eat up the cutting tool faster than  others... There are direct qualitative comparisons you can find for suitability for any manufacturing process - sounds like you're talking about sawing, drilling, or milling. Often "machinability" is an informal term used
Answer: The number is typically tensile strength and hardness.
But you're overthinking it. Just go with the materials everyone uses by default: common aluminum alloys like 6061 or 6063, or mild steel.
Common materials are common for a reason. That reason is usually because they are abundant and easy to work with which makes them cheap.
Aluminum is noticeably easier and faster to cut and file by a lot with hand tools than mild steel and you may need to polish up the steel with a pad or something before painting.
I don't think you should be power sawing thin sheet metal though.  Shearing is probably best. And drilling sheet metal can be extremely dangerous because the drill flutes can easily catch on it and pulls it and spins it around like a giant knife blade. If you try this, clamp it down and perhaps have a stop so it can't rotate if it catches. The drill press is said to be the most dangerous machine in the shop, and that's a shop with things like lathes, mills, and grinders.
Don't forget to debur the edges with a file after cutting.
Answer: The material properties that are more likely to affect the cutting for an isotropic material is the ultimate tensile strength.
Usually this correlates well with hardness indexes like HRC, or HRV (see image below source: S. Mckelvey, Y. Lee)

The ratio of the ultimate tensile strength to the  yield strength, and the elongation to failure are indications of ductility which can sometimes affect negatively the cut.


ad sextam in tertiis et totis duplicibus

Question: This is a rubric (instruction) for when to sing a hymn.  I translated it as "At Sext on third and all doubles."  This doesn't seem right to me because the 'third' is redundant.  I would like to know what the literal translation is.  Thank you.
Answer: It would be nice if you could give us a little more context. Where did you get this phrase? What book is it from? When was it published?
It literally means "At Sext on Thirds and all Doubles". I know what Doubles are, they are a kind of feast with a high liturgical rank. I do not know what Thirds might be.
Update: Thanks for the context supplied in your comment below. It confirms in my mind what Brianpck said. There is apparently something called a "Third Double" as well as something called a "Complete Double". I've never heard these terms before, and I cannot tell you what they mean.
Comment: I believe both "tertiis" and "totis" modify "duplicibus" as adjectives, i.e. "on tertiary and complete doubles." I found a French work where this was translated as "doubles complets" (complete doubles) and "troisièmes doubles" (third doubles). It appears to be a very old (perhaps pre-16th c.) designation of liturgical feasts, and perhaps it's even peculiar to a religious order.
Comment: @brianpck I think you've nailed it. Do you want to make it the answer?
Comment: @Hugh I think even that belies the complexity: here's a good Catholic Encyclopedia article that includes a few lists of different terms used: https://www.newadvent.org/cathen/06021b.htm
Comment: Ok, thank you.  It is a rubric for the hymn Rector potens, verax Deus found in a catalogue of medieval music: Die mittelalterlichen Hymnenmelodien des Abendlandes.  There is a similar one for Rerum Deus tenax vigor: ad nonam in tertiis duplicibus.  Yes, the 'tertiis' part is where I am confused.
Comment: Under 'Ranking of liturgical days' Wikipedia has
Doubles, I Class;  Doubles, II Class; Greater Doubles; Doubles;  Semidoubles. and then, in 1911, 1955, 1960, 1969 simplifications and renaming.


How did Sweden come out so unscathed physically and morally from WW2?

Question: How did Sweden manage to support the Nazis with iron ore for their war machine, which kept Sweden "Neutral" and still retain good relations with the Allies post WW2? Does doing trade with an enemy in war not constitute collaboration?
Comment: Enemy State and Neutral used in the same phrase? Since Sweden was neutral, that means Nazi Germany was not their enemy state. Thus they were doing trade, not collaboration.
Comment: What's with the Random upper Case abuse?
Comment: Please present facts and citations to bolster the question.
Comment: Its true that everyone loves ABBA. I used to drive a Volvo tractor and trailer combo and I loved it. My guess is by way of inference is because the Red Army attacked Finland for no good reason forcing Russia out of what was left of the League of Nations. It's interesting that the World did sign up for a "United Nations" after World War 2. I don't think anyone believes in that Organization anymore sadly. So maybe History has Sweden instead?
Answer: By the tone of your question, you're seeing WWII as a crusade against evil where there can be no neutrals, and in hindsight I agree. The laws of war didn't use these categories at the time. Being neutral can mean trading with both sizes equally, or with neiter one. If one of the belligerents is closer and trades more, that happens.

The US transported lend-lease supplies to Vladivostok because Japan and the Soviet Union were neutral towards each other. It was not in the Allied interest to question that legal concept of neutrality at the time.
It was to the advantage of the Allies to have Spain neutral. By denying Sweden the right to remain neutral, they might have pushed Franco into taking Gibraltar. As it was, he sat the war out.
Forcing Sweden into abandoning neutrality might have pushed them into the war against the Soviets, which was a rather popular notion worldwide until the Uncle Joe propaganda.
Comment: A good answer.... except for the first sentence. Even if "right" and "wrong" *might* seem absolute / obvious (and I would contest that notion with regards to WWII), staying neutral *is* a valid option. Switzerland stayed neutral, and defended its airspace against either Luftwaffe, RAF, or USAAF infractions. Ireland stayed neutral, and interred both Luftwaffe and RAF pilots that went down over its territory. And declaring WWII as "a crusade against evil where there can be no neutrals", IMHO, shows a worrying amount of ignorance concerning the time period.
Comment: Additionally, Sweden was physically surrounded by Axis members. Forcing them into conflict would lead to another quickly victory for Germany or (more probably) another German ally. And there was the category of non-belligerant, which mean that a country favored a side but was not part of the war (for example Spain).
Comment: @DevSolar, it might not have been clear with regard to hindsight. I believe that "genuine" neutrality in the face of genocide is complicity. I can understand that people did not fight out of fear for their loved ones. I can understand that people did not fully understand what was going on. I can understand that people were *more* afraid of Communism. But what the West *didn't* do about Rwanda or Srebrenica will taint our souls forever, **because we knew**.
Comment: @o.m.: That is a very slippery slope you are on. Wars are not fought for moral reasons, or "doing the right thing". They are fought for power, and resources. The US did not get involved in Europe because of the holocaust either... but this isn't the place to roll out a discussion. I just wanted to say that your first line, as well as the OP's question, are displaying a much too simplistic view on how things came to be, are coming to be, or will be coming to be.
Comment: @DevSolar, I realize that many states act or fail to act for *realpolitik* reasons. But some deeds are so evil that there can be only temporary truces, not acceptance.
Comment: The reason World War II was fought was pretty simple: Some countries went on campaigns of territorial expansion and other countries either didn't want to be expanded into or were concerned about the increased power that the aggressors would gain with new territory.  Sweden sat it out because joining would have meant suddenly being expanded into without much recourse.
Comment: @StevenBurnap, I think that the Nazi external aggression followed in part from their internal aggression -- a regime built on violence needed an enemy,
Comment: That had little or nothing to do with why the war was fought.  Countries entered the war either because they attacked someone to gain territory (Germany, Italy, Japan), they were attacked by someone directly (Poland, the US, the USSR, China) or they'd guaranteed protection to someone who'd been attacked directly (France, the UK.)  The idea of declaring war on a country because of what they are doing to their citizens internally only showed up a decade or so ago.
Comment: @StevenBurnap, you misunderstood me. I believe that the *Nazi* regime needed conflict and conquest to stabilize their internal rule over Germany. Without scapegoats, their failings would have become obvious to the German people. So they triggered war scares and wars.
Answer: "Sweden emerged physically unscathed from World War II." That was the whole point of its neutrality. Other Scandinavian countries suffered more because they were "involved." In Sweden's case, there was no fighting, no occupation, nothing related to war, hence "unscathed."
How did Sweden emerge morally unscathed? First, even Germany and Japan were forgiven and rehabilitated after the war. Although Sweden "tilted" toward the Axis, her culpability was far less than the other two. She didn't commit any atrocities (although her iron ore and other exports were used in their commission).
Sweden even did a favor or two for the Allies; a Swedish-American spy,Eric Erickson operated from Sweden while spying on the German oil industry.
Comment: "Other Scandinavian countries suffered more because they were 'involved'" -- To be fair, Norway was (formally) neutral as well, actually leaning towards the Axxis in that they turned a blind eye to infractions of their territorial waters by the German navy ([Altmark Incident](https://en.wikipedia.org/wiki/Altmark_Incident)). Denmark was neutral. Finland turned Axxis-friendly because the UK and Sweden were not interested in aiding Finland against Soviet pressure after the Winter War.
Comment: @DevSolar:That's why I put scare quotes around "involved." The others' "lack" of neutrality was forced on them.
Comment: The reason for Germany to occupy Norway, was that Norway otherwise might have been occupied by the allies in order to stop the iron ore export from Sweden. So, ironically, Norway was occupied for the very same reason Sweden remained free.
Comment: A Franco-British invasion of Norway was imminent, or at minimum the British and French intended to mine Norwegian waters, thereby violating their neutrality.  Britain and France wanted to secure the North Sea and prevent the shipment of Swedish iron ore through the northern Norwegian port of Narvik, and the first step of mining Norwegian waters was only days away.  Had Hitler waited a short time (even less than a week), the British and French would have violated Norwegian neutrality to isolate Germany. - sourced from B. H. Liddell Hart.


What is the difference between List (of T) and Collection(of T)?

Question: I've seen them used in a lot of the same ways, and I am worried I'm about to go down a path in design that is irreversible if I don't understand this better. Also, I am using .NET.
Answer: In C#, there are three concepts for representing a bag of objects. In order of increasing features, they are:

Enumerable - unordered, unmodifiable
Collection - can add/remove items
List - allows items to have an order (accessing and removing by index)

Enumerable has no order. You cannot add or remove items from the set. You cannot even get a count of items in the set. It strictly lets you access each item in the set, one after the other.
Collection is a modifiable set. You can add and remove objects from the set, you can also get the count of items in the set. But there still is no order, and because there is no order: no way to access an item by index, nor is there any way to sort.
List is an ordered set of objects. You can sort the list, access items by index, remove items by index.
In fact, when looking at the interfaces for these, they build on one another:

interface IEnumerable<T>

GetEnumeration<T>

interface ICollection<T> : IEnumerable<T>

Add
Remove
Clear
Count

interface IList<T> : ICollection<T>

Insert
IndexOf
RemoveAt

When declaring variables, or method parameters, you should choose to use

IEnumerable
ICollection
IList

based on what conceptually you need to do with the set of objects.
If you just need to be able to do something to every object in a list, then you only need IEnumerable:
void SaveEveryUser(IEnumerable<User> users)
{
    for User u in users
      ...
}

You don't care if the Users are kept in a List<T>, Collection<T>, Array<T> or anything else. You only need the IEnumerable<T> interface.
If you need to be able to add, remove, or count the items in a set, then use a Collection:
ICollection<User> users = new Collection<User>();
users.Add(new User());

If you care about a sort order, and need the order to be correct, then use a List:
IList<User> users = FetchUsers(db);

In chart form:
| Feature                | IEnumerable<T> | ICollection<T> | IList<T> |
|------------------------|----------------|----------------|----------|
| Enumerating items      | X              | X              | X        |
|                        |                |                |          |
| Adding items           |                | X              | X        |
| Removing items         |                | X              | X        |
| Count of items         |                | X              | X        |
|                        |                |                |          |
| Accessing by index     |                |                | X        |
| Removing by index      |                |                | X        |
| Getting index of item  |                |                | X        |

The List<T> and Collection<T> in System.Collections.Generic are two classes that implement these interfaces; but they aren't the only classes:

ConcurrentBag<T> is an ordered bag of objects (IEnumerable<T>)
LinkedList<T> is a bag where you are not allowed to access items by index (ICollection); but you can arbitrarily add and remove items from the collection
SynchronizedCollection<T> is an ordered collection, where you can add/remove items by index

So you can easily change:
IEnumerable<User> users = new SynchronizedCollection<User>();

SaveEveryUser(users);

tl;dr

Enumerable - access items, unordered, unmodifiable
Collection - can be modified (add,delete,count)
List - can access by index

Choose the concept you need, then use the matching class.
Comment: The OP asked about the concrete types, and you've compared the Interfaces. The concrete type Collection implements IList and has accessing by index capabilities.
Comment: The answer is good but deviated from the question.Can't fit your answer for Collection and List classes, I mean from question prospective if I try to validated your point they just don't justify. For a general purpose answer you may be right that collection is not ordered so no indexing, but list is ordered so insertion is possible at a certain index.
Comment: If the list is ordered and the collection is orderless, that would be a huge functional difference to easily guide a new learner (like me) to choose. But wait, why do you say a collection has no order? It provides [IndexOf()](https://msdn.microsoft.com/en-us/library/ms132410(v=vs.110).aspx) and [RemoveAt()](https://msdn.microsoft.com/en-us/library/ms132414(v=vs.110).aspx) method, so it IS ordered, isn't it? Did I miss something here?
Comment: @RayLuo I'm referring specifically to `ICollection` and `IList`. Different concrete implementations may behave differently. For example if you access a `List` through its `IEnumerable` interface, then you have no way to add, remove, sort, or count items in the list.
Comment: This answer was very helpful! Deviated from the question a bit, but this was what I was trying to search for.
Answer: Collection<T> is a customizable wrapper around IList<T>. While IList<T> is not sealed, it doesn't provide any customization points. Collection<T>'s methods are by default delegated to the standard IList<T> methods, but can be easily overridden to do what you want. It is also possible to wireup events inside a Collection<T> that I don't believe could be done with an IList.
In short, it's much easier to extend it after the fact, which could potentially mean a lot less refactoring.
Comment: @DeeStackOverflow - because method hiding won't be used by any code that uses a different API - i.e. Anything that looks for `IList`, `IList`, `List` etc. In short, you have no idea whether it will be called. Polymorphism fixes this.
Comment: @AdamLassek: You might want to add in your answer about `ObservableCollection` as an example where methods are overriden to notify about changes.
Comment: @Marc Gravell, @Adam Lassek: Can't we do the same thing with a List by hiding the InsertItem(...) method with a public void new InsertItem(...) and then calling the base.InsertItem(...) from within ? It would still not break the contract. (the name is 'Insert' in List, but nonetheless). So what is the big deal in sticking to Collections ?
Answer: List<T> is intended for internal use within the application code. You should avoid writing public APIs that accept or return List<T> (consider using a superclass or a collection interface instead).
Collection<T> serves a base class for custom collections (although it can be used directly).
Consider using Collection<T> in your code unless there are specific features of List<T> that you need.
The above are just recommendations.
[Adapted from: Framework Design Guidelines, Second Edition]
Comment: It's worth noting that types which use *any* kind of mutable objects to encapsulate *their own* state should avoid returning objects of such type unless either the objects in question have a means of notifying their owner when they are mutated, or the name of the method returning the object clearly implies that it is returning a new instance.  Note that for e.g. a `Dictionary>` to return `List` is just fine, since the dictionary's state only encapsulates the *identities* of the lists therein, rather than their contents.
Answer: List<T> is a very commonly seen container, because it is so very versatile (with lots of handy methods like Sort, Find, etc) - but has no extension points if you want to override any of the behaviour (check items on insert, for example).
Collection<T> is a wrapper around any IList<T> (defaulting to List<T>) - it has the extension points (virtual methods), but not as many support methods like Find. Because of the indirection, it is slightly slower than List<T>, but not by much.
With LINQ, the extra methods in List<T> become less important, since LINQ-to-Objects tends to provide them anyway... for example First(pred), OrderBy(...), etc.
Comment: @tuinstoel - but it is trivial to add.
Comment: Collection lacks method foreach, even in Linq-to-Objects.
Answer: List is faster.
Do for example
private void button1_Click(object sender, EventArgs e)
{
  Collection<long> c = new Collection<long>();
  Stopwatch s = new Stopwatch();
  s.Start();
  for (long i = 0; i <= 10000000; i++)
  {
    c.Add(i);
  }
  s.Stop();
  MessageBox.Show("collect " + s.ElapsedMilliseconds.ToString());

  List<long> l = new List<long>();
  Stopwatch s2 = new Stopwatch();
  s2.Start();
  for (long i = 0; i <= 10000000; i++)
  {
    l.Add(i);
  }
  s2.Stop();
  MessageBox.Show("lis " + s2.ElapsedMilliseconds.ToString());

}

on my machine List<> is almost twice as fast.
Edit
I can't understand why people are downvoting this. Both on my work machine and my home machine the List<> code is 80% faster.
Comment: List is fewer letters to type than Collection :)
Comment: List's methods aren't inheritable so there aren't checks to see if they have been inherited; Collection's methods are inheritable.  The advantage is that you can use Collection as a base class to inherit from and create a custom Collection.
Comment: Tried it on my machine and list is about 20% faster. Would be interested in some discussion on why this might be. Maybe the list is better with allocating memory.
Comment: How is it faster? Lookup? Insertion? Removal? Search? Why is it faster?
Comment: Collection has fewer methods. Therefore it's faster. QED. (joking, I'm not trolling)
Comment: On my machine list is 30% faster.
Comment: Collection uses IList to store the data. if the constructor does not provide a specific IList, Collection uses List. Therefore, List is always faster than Collection.
Comment: Just wanted to double check -- these tests are release mode compiled, right? My only guess for the speed difference would be that there's fewer method lookups since there isn't an override path to follow. (not `virtual` in `List`)
Answer: List represents a collection where the order of items is important. It also supports methods s.a. Sort and search. Collection is a more general data-structure which makes less assumptions about the data and also supports less methods to manipulate it. If you want to expose a custom data structure, you should probably extend the collection. If you need to manipulate data w/o exposing the data-structure, a list is probably the more convenient way to go.
Answer: All of these interfaces inherit from IEnumerable, which you should make sure you understand. That interface basically lets you use the class in a foreach statement (in C#).

ICollection is the most basic of the interfaces you listed. It's an enumerable interface that supports a Count and that's about it.
IList is everything that ICollection is, but it also supports adding and removing items, retrieving items by index, etc. It's the most commonly-used interface for "lists of objects", which is vague I know.
IQueryable is an enumerable interface that supports LINQ. You can always create an IQueryable from an IList and use LINQ to Objects, but you also find IQueryable used for deferred execution of SQL statements in LINQ to SQL and LINQ to Entities.
IDictionary is a different animal in the sense that it is a mapping of unique keys to values. It is also enumerable in that you can enumerate the key/value pairs, but otherwise it serves a different purpose than the others you listed
Comment: ICollection supports adding/removing/clearing: https://msdn.microsoft.com/en-us/library/92t2ye13%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
Answer: This is one of those grad school questions.  A Collection of T is sort of abstract; there may be a default implementation (I'm not a .net/c# guy) but a collection will have basic operations like add, remove, iterate, and so on.
List of T implies some specifics about these operations: add should take constant time, remove should take time proportional to the number of elements, getfirst should be consant time.  In general, a List is a kind of Collection, but a Collection isn't necessarily a kind of List.
Answer: Hanselman Speaks: "Collection<T> looks like a list, and it even has a List<T> internally.  EVERY single method delegates to the internal List<T>.  It includes a protected property that exposes the List<T>."
EDIT:  Collection<T> doesn't exist in System.Generic.Collections .NET 3.5.  If you migrate from .NET 2.0 to 3.5 you'll need to change some code if you're using a lot of Collection<T> objects, unless I'm missing something obvious...
EDIT 2: Collection<T> is now in the System.Collections.ObjectModel namespace in .NET 3.5.  The help file says this:
"The System.Collections.ObjectModel namespace contains classes that can be used as collections in the object model of a reusable library. Use these classes when properties or methods return collections."
Answer: According to MSDN, List(Of T).Add is "an O(n) operation" (when "Capacity" is exceeded) while Collection(Of T).Add is always "an O(1) operation".  That would understandable if List is implemented using an Array and Collection a Linked List.  However, if that were the case, one would expect Collection(Of T).Item to be "an O(n) operation".  But - it's - not!?!  Collection(Of T).Item is "an O(1) operation" just like List(Of T).Item.
On top of that, "tuinstoel"'s "Dec 29 '08 at 22:31" post above claims speed tests show List(Of T).Add to be faster than Collection(Of T).Add which I've reproduced with Long's and String's.  Although I only got ~33% faster vs. his claimed 80%, according MSDN, it should've been the opposite and by "n" times!?!
Answer: Both implement the same interfaces, so they'll behave the same way.  Perhaps they are implemented differently internally, but this would have to be tested.
The only real differences I see are the namespaces and the fact that Collection<T> is marked with ComVisibleAttribute(false), so COM code can't use it.
Comment: That's an interesting change @KyloRen - they **do** now both implement the same set of interfaces; this wasn't the case back in '08.
Comment: @Bevan interesting. Not sure what was the reason of two different classes, one with just some extra methods.
Comment: They implement different interfaces - List implements IList, where Collection does not.
Comment: @Bevan try it in c#, they both implement same set of interfaces
Answer: In addition to other asnwers, I've compiled quick overview of generic list and collection capabilities. Collection is limited subset of the List:

* = present
o = partially present

Property/Method   Collection<T>   List<T>
----------------------------------------------
Add()                *              *
AddRange()                          *
AsReadOnly()                        *
BinarySearch()                      *
Capacity                            *
Clear()              *              *
Contains()           *              *
ConvertAll()                        *
CopyTo()             o              *
Count                *              *
Equals()             *              *
Exists()                            *
Find()                              *
FindAll()                           *
FindIndex()                         *
FindLast()                          *
FindLastIndex()                     *
ForEach()                           *
GetEnumerator()      *              *
GetHashCode()        *              *
GetRange()                          *
GetType()            *              *
IndexOf()            o              *
Insert()             *              *
InsertRange()                       *
Item()               *              *
LastIndexOf()                       *
New()                o              *
ReferenceEquals()    *              *
Remove()             *              *
RemoveAll()                         *
RemoveAt()           *              *
RemoveRange()                       *
Reverse()                           *
Sort()                              *
ToArray()                           *
ToString()           *              *
TrimExcess()                        *
TrueForAll()                        *


I suspect my hard drive is causing my computer to lag

Question: I have my 5 year old computer that I've done some alterations to but works fine for the most part. Sometimes, when I have been using it for a while, it freezes for a couple of seconds and I hear something spinning forcefully. I suspect that it may be my hard drive. Is there any way that I can confirm that this issue is my hard drive? Could it have something to do with from top level,can defragmentation for instance reduce those scenarios or is it damaged? Could this issue be caused by another component in my computer?
Thanks in advance.
Comment: Have you checked its SMART parameters?
Comment: Everything on `HDtune` on Health tab has its status Ok, should I check sth else, btw I am checking for corrupted blocks also now.
Answer: How much memory do you have? What kind of programs are you running when this lag happens? While it's possible that paging could be the cause of it, it may also be possible that your drive is failing.
Comment: 500 gigs on HDD & 8 at ram, when this happens I usually have enough programs running , my task manager says 2-3,5 gigs.My paging is on default shall I try to increase it?
Comment: If you're only using 3.5 out of 8GB RAM and your drive is stalling during I/O operations, it likely has bad sectors and is failing. Download a utility such as DiskCheckup and check for reallocated/uncorrectable sectors.
Answer: Generally that is a sign that you do not have enough ram to contain all the info you need to run everything you have open and so the hard drive is being used to swap info in and out of memory.
Comment: I agree more ram less swapping , but I recently upgraded to 8 gigs for win7 64bit.Shall I invest on more Ram or on hard-drive.
Answer: There are many symptoms and causes related with this behaviour, here are some of them:

Temperature. As time passes, the computer stores dirt and the CPU's thermal compound degrades in quality and doesn't transfer heat as efficiently, making the CPU to heat up and it may probably be scaling down its speed to keep cool. This causes the fan to speed up and it may be quite noisy. Clean up your computer thoroughly using the proper tools and replace the thermal compound.
Faulty RAM or low RAM. When RAM becomes old, its latency may increase, one of the main symptoms is that the mouse pointer appears to lag, I recommend to run a test on it using memtest86+. Also, as other users say, it may as well be the lack of it, when you computer runs out of ram it stores the less used chunks on files on your hard drive, and this process is terribly slow. You might want to consider buying new or more RAM in both cases.
Bad hard drive. Your drive might as well be dying. Use a tool to check the SMART status of your drive. Usually when the HDD is the case of the slow down, only file-related operations slow down (like when opening an app or booting) and contrary to the RAM case, you won't see your mouse lagging because of the hard drive. You can use this tool: HDTune, as suggested in this question: How can I read my hard drive's SMART status in Windows 7?.
Software issues or malware. I won't say that there's a malware or a virus that makes your computer to heat up or that clogs the RAM completely, but their presence may be causing you some trouble too.

Run a check with an antivirus. Run a check with anti-malware tools too, like adwcleaner or malwarebytes.
Run the msconfig tool (Win+R and execute msconfig.exe) and disable any unwanted apps that run on startup. You can move to the Services tag and disable unwanted or suspicious services too, you may want to check the Hide Microsoft services option so you don't disable anything important.
You can refer to this answer for a more detailed explanation of the disabling process.
Comment: Thank you very much nice answer.I've done my test and my `Reallocated Sector Count is Ok`,so I 'll check also the rest.


Factor model for Gold has low adjusted R2

Question: I am trying to build up a factor model for gold. To be able to identify the correct factors, I did a correlation analysis between a few factors vs gold and I integrated this analysis with what I saw in literature. I ended up with a set of factors as: VIX Index, EURUSD currency, H15X10YR Index (which is the US 10YR real rate). However, after running my ridge regression (I choose ridge due to the fact that I had already an idea of the factors and they are only 3, otherwise in case of many factor and no idea I would opt for lasso), my adjusted R2 is "only" 36%..am I missing something? after checking the time history I see that the gold has quite a similar trend with my factors, especially with the H15X10YR Index, but my level of "explicability" is only 36%. Can anybody highlight me on the reason of this please? Luigi
Comment: Are you using past values of those factors to predict gold returns? Or using contemporaneous returns to just explain gold returns?
Comment: You should be careful in interpreting the $R^2$ as a measure of *explicability.*  It is very sensitive to a variety of things and the regularization implies it is no longer the square of the Pearson Product Moment Correlation Coefficient.  Since $R^2$ is  poor measure of goodness of fit and is not a measure of model quality, you should be careful in interpreting it or granting it too much importance.
Comment: @DaveHarris, thanks for highlight these aspects on R2. if not R2, what would you suggest to use to measure the explicability of a factor model? any other metrics? in terms of model quality I use purged with embargo cross validation for estimating the regularization parameter. thanks
Answer: I will assume you are using factors and gold returns that are contemporaneous. With that setup, you are essentially trying to explain or decompose gold returns.
For an explanatory regression of a commodity (which is internationally traded), an $R^2$ of 36% is pretty good. Lots of factors can affect gold returns: Indian wedding season (a major effect on gold markets which you should not overlook), volatility in developing market currencies, and hyperinflation in large economies.  You are omitting all of those effects. To still explain 36% of the variance is something to be proud of.
You may have expected more, but working with returns reveals how explaining changes in an asset isn't as simple as just showing a few similar-looking plots and exclaiming voila! I would not be upset at getting a 36% $R^2$ for my first model and one using only three factors.
Comment: the returns I am using go from 2003 up to june 2020. Thanks for your answer. I am not indeed prone to look at how much the time histories are similar, cause I know the visual check can be misleading but this time was pretty evident they were similar. Anyway as you pointed out there may be many other factors which I kept out.


Polar form of Newton's Second Law

Question: Can someone please show the steps for deriving the total energy of a particle from the Polar form of Newton's Second Law?
Answer: The total energy is $T+V$, with $T$ kinetic and $V$ potential, and by energy conservation $0=\dot{T}+\dot{V}$. Taking $T$ to depend only on $x$ and $V$ only on $\dot{x}$, $0=\ddot{x}\cdot\nabla_\dot{x}T+\dot{x}\cdot\nabla_xV$. We want this to be equivalent to $0=m\ddot{x}+\nabla_xV$, so $\nabla_\dot{x}T=m\dot{x}$. The convention that $T(0)=0$ gives $T=\frac{m\dot{x}^2}{2}$.
This argument doesn't commit us to Cartesian coordinates; scalar products, including squared lengths, are unchanged when we switch to polar coordinates. In three dimensions, $$T=\frac{m}{2}\left(\dot{r}^2+r^2\dot{\theta}^2+r^2\sin^2\theta\dot{\phi}^2\right).$$The last term is deleted in two dimensions, to which we typically switch if radial forces' angular momentum conservation implies the motion is confined to a plane.

Polar form of Newton's Second Law


Need help on-parallel resonant circuit vs. bandpass filter!

Question: These two types of circuits, parallel (LC) resonant and bandpass filter (i.e. some resistance connected with parallel resonant circuit in series). Please tell me when to use which one and what are the advantages of one over another?
Thanks in advance.
Comment: If you show us the two circuits we can try to explain the difference (if any).
Comment: 'These two types of circuit ...' What two types of circuit? Draw a diagram (schematic, use the fine editor) or you're wasting our time, and yours for that matter.
Answer: You have a misconception. Just like you try to compare "when should I use a wheel and when a vehicle - what advantages and disadvantages they have over each other?"
Offtopic: the difference may sometime have been quite small
http://images.tcj.com/2012/03/Hart-9-650x937.jpg
A parallel resonant circuit can be a part of a bandpass filter. Bandpass filters can be realized with or without resonant circuits just like vehicles can havve wheels, but for example a hovercraft doesn't.
Parallel resonant circuit added to be in parallel with a load and feeded from a signal source with non-zero internal impedance was the simplest form of bandpass filtering that was selective enough for separating different radio stations. That historical fact has made it important and was a reason for serious theoretical and empirical investigations on how the basic circuit should be built and how the circuit can be developed for better performance.
Today we have the circuit theory and we can calculate or look up the tables to find, if 2nd order bandpass filter is enough for a filtering purpose. If the answer is yes, then a resonant circuit can be ok choice. A single resonant circuit fulter definitely is not enough, if steep passband slopes are needed and the wanted bandwidth is not small when compared to the passband middle frequency.
Most practical limitations of the LC resonant circuits are caused by the non-ideal coils. They can be too bulky, have too much resistance  or the needed coil is too small to be mostly a coil, not a complex composition of capacitance, inductance, resistance and working as an antenna.
Answer: Just a parallel LC can theoretically be used without a resistor if the input signal is from a current source. What you will find is that at resonance, the voltage continues to rise to infinity because there is no "loss" to dampen the circuit down.
But there are always losses (such as in the inductor). Its DC resistance is usually enough to limit Q to maybe between 10 and 100 and this will mean that with a small value AC current source at LC resonance, the resulting voltage will be a few volts. Off resonance and the resulting voltage will be much lower. By how much is determined by Q: -

\$Q = \dfrac{f_0}{f_2-f_1}\$ so high Q means a very peaky response.
With a resistor feeding the LC, the response is similar. This time the source is presumed to be a voltage source and the series resistor connects this to the parallel LC circuit. At resonance the output voltage will nominally equal the input voltage and, off resonance the output voltage will be smaller: -

Again, Q factor plays it's part but this time Q is mainly due to the value of the series feeding resistor and somewhat from other circuit losses.

Please tell me when to use which one and what are the advantages of
  one over another?

I can only tell you what I've told you because if I were to guess the different scenarios which you might be considering I'd be here all day.
Answer: For resonance, you must have a closed path for the energy to circulate.

simulate this circuit – Schematic created using CircuitLab
The left circuit is SUCKOUT; the right is "band stop";
the left circuit has 50 ohm damping; the right has 200 ohm dampening


Hosting a blog on website VS using a blogging service (in terms of SEO)

Question: I am programming an ecommerce website and I know I am going to add a blog to the mix. I am unsure, however, if it is better for me build the blog portion into the website or could I just use a service like Tumblr or wordpress and host it somewhere else.
Comment: #Otis You will need to do both. I have seen the benefits of each one of them on many e-commerce websites.
Answer: It depends upon what you are talking about.
For example, if your blog ends up being under another domain such as example.blogger.com, then I would say do not do this. However, if you can create a sub-domain of your own domain, then this would be fine. The danger is if you do host your blog on another site and create a sub-domain that points to the other site. For example, if content can be found on both example.blogger.com and a sub-domain of your own parent domain, that would be bad.
Another example. If you can host an application within a sub-directory within your own site, then that would be best. The reason for this is simple. Assuming that your company blog remains on-topic, then you significantly increase your search potential. If you use a sub-domain versus a sub directory, it does not help the company's domain but rather the sub-domain.
There is a lot of debate on the web, sub-domain versus sub-directory, however, the argument has been settled on this site. Using a sub-directory is always better unless it dilutes the topic of the parent domain. However, if the topics are complimentary, then it is always better to host a blog on the site itself. Not on a sub-domain. Not on another domain. But on your own domain.
Answer: There are advantages and disadvantages to each option and there is much discussion about this that there is no definitive answer. But I would recommend building the blog portion into the website for the sole purpose of control.
You have less control when hosting with a third party service like Wordpress or Tumblr, though you can also do both (host it on the site and use a third party service) but you will have double the efforts in doing so.
Answer: It is better you to build a blog portion into the website because creating blog for the website really add a unique functionality to the website. By adding a blog to your websites enhance a lot of traffic towards your website and business. Blogging is the best way to drive traffic and reach your website at the top.
Answer: Would recommend hosting it on your own.
Lets assume your website is :
http://www.example-commerce-website.com
Then a good blog url would be :
http://www.example-commerce-website.com/blog/
and an example blog entry url with a slug :
http://www.example-commerce-website.com/blog/smartphone-price-trends-2016
This way the SEO authority of your root domain grows stronger.
And with same domain for both your website and blog, you will have to host the blog.
For hosting your blog on other platforms say wordpress or Tumblr with hosting service and custom domain name, you will not be able to use your www.example-commerce-website.com as the custom domain name there as DNS would map to your ecommerce website servers.
So,host it on your servers only.


Using PS4/XB1 in a country before release date?

Question: As the title says, can the PS4 and/or XBOX One be used to play online and/or offline in a region where they have not yet been released? I am thinking of ordering a system from the US and play in a country (Thailand) where neither have been released yet.
Comment: This really should be split into 2 separate questions, one per console.
Answer: I am using a Xbox One in Luxembourg where it wasn't released and never will as the country is not supported by Live. I am using an UK account and am fine. I hit the rare IP locked content but using a VPN I can get it anyway. The worst you could have to suffer is migrate your account to a region supported by Live.
Comment: Thanks for the comment. Did you need a UK credit card in order to access Live or just made a UK address up?
Comment: I am using Paypal for all my transactions on the console. However, I used a Luxebmourgish credit card on my Windows Phone on my, then still, German account and it worked fine. I am not 100% sure how that worked. Using Paypal is just fine as you need not worry about your card. However, the same does not hold true for the Playstation Network. I could not link my Paypal account and had to use my credit card!
Answer: you should be fine, Games for at least the PS4 are Region Free, however multiplayer with both will need a subscription to their services.
While i don't think there is any problem with getting a console from the US and fixing up an account in Thailand and using that keep in mind that there maybe some stuff in the US Playstation Network or X-Box Live meant for the PS4/X-Box One which you wont be able to get in a Thailand account until the consoles have been released, there may also be a problem with console registration if your using a Thailand account when registering your console.
Keep in mind however that DLC is still region locked to the same region as that of where you brought the game, so if you get a US Game you will need a US Account in order to get DLC, DLC from a Thailand account will most likely be incompatible with US Games (though with that said, UK and Australian DLC is interchangeable but Nintendo counts them both as PAL)
Answer: I live in the Netherlands, where the Xbox One is still not sold, but I bought one in Germany.
One thing I had to do was migrate my account from the Netherlands to the US and set my Xbox One to the US as well. (Any country will do, as long as they match) The problem with this was that my Microsoft Points from my X360 didn't migrate along, so I had to use them up on my X360 before migrating (I could not use them on the Xbox One).
After that everything works fine and I can play online, download and buy new games with my PayPal account, etc.
Microsoft Netherlands has officially made a statement that they fully support imported Xbox Ones, so that's an added benefit for us.


Is the placebo effect a form of cognitive bias?

Question: Recently I've been trying to get a better understanding for the cause and mechanism of the placebo effect. A friend suggested that the placebo effect is a form of cognitive bias, but I've had trouble finding evidence for this.
Comment: What kind of evidence are you looking for? It sounds more like a categorization argument.
Comment: What do you mean by cognitive bias? What are the main differences between these alternative accounts of the placebo effect?
Answer: The question is not terribly clear since it can be just an issue of categorizing the placebo effect in a philosophical sense as a "cognitive bias" for some broad meaning of the latter. But...

Some have argued that neuroimaging technologies such as functional magnetic resonance (fMRI) and positron emission tomography (PET) can help determine whether placebo effects are independent of response bias (27). For example, one team of researchers has reported that placebo responses occur in pain-related areas of the brain during the time of stimulation and not only during assessment (28), while other researchers have shown that spinal cord mechanisms are involved with placebo analgesia (29). These experiments seem to indicate that at least some of the observed effect of placebo in an experimental setting is independent of response bias; however, they cannot rule out the hypothesis that some of the observed clinical effect is due to response bias.

Note that response bias, whith which the placebo effect is contrasted above, is a specific [cognitive] bias.


kindness , benevolence and goodwill

Question: I wonder whether these terms can be used interchangeably and what distinctions might be made between them. It seems to me etymologically that kindness is more related to belonging and the behaviour of care one gives to those that are like us, benevolence may be closer to goodwill than kindness as its roots are about wanting the good for the other ? Thank you
Comment: Your question stands a better chance of survival if you include the dictionary definitions for each word and explain more fully why you think they are or are not interchangeable.
Comment: If you don't, users will do one of two things: 1. close your question for lack of research, or, 2. post answers that quote dictionary definitions
Comment: or 3. post answers that are unsupported...
Comment: This is all new to me, thank you for your guidance
Answer: Kindness and benevolence are similar in meaning and can often be used interchangeably. They are both qualities that people possess. There are slight differences:

Kindness is the quality of being friendly, generous, and considerate.
Benevolence is the quality of being well-meaning. Usually this goes  hand-in-hand with benevolence but not always. For example, forcing your child to stay inside the house, who wants to leave the house, to
study for an exam would be benevolent (having the good intention of making them perform better in the exam) but not friendly (this is not
considerate of the child's desire to leave the house).

Goodwill is friendly, helpful, or cooperative feelings or attitude. The key differences involving goodwill are:

It is not a quality of a person, but rather it is something directed towards something or someone. Often it can be substituted for kindness and benevolence. For example, a husband would show his wife goodwill, or he would treat the business contract with goodwill. Whilst these sentences would make sense with kindness or benevolence in its place, you could also say that a person has lots of kindness and benevolence, but it would be incorrect to say that a person has lots of goodwill (unless it's directed towards something).
Goodwill involves feelings/attitude of cooperation, whilst kindness and benevolence do not necessarily do so. For example, when one co-boss discusses a possible business merger with the a second co-boss, the co-boss may not show goodwill towards the first co-boss by being against the merger. However he may still be kind and benevolent towards the co-boss (he may be respectful towards the co-boss and genuinely feel that the merger is not a good idea for their business).

kindness , benevolence and goodwill


Which statistical tests should I use for predicting one variable with another one?

Question: I want to investigate the association between the serum glucose level of a patient with type 2 diabetes at the baseline (continuous) and distal neuropathy (categorical), $5$ years after the diagnosis. I am also interested in knowing whether the age of the patient at the time of diagnosis can predict the risk of distal neuropathy or not, $5$ years later. Could you please advise me on the appropriate statistical tests to use? I have the serum glucose level data for each year. Should I use only the baseline amount or include all $5$-year data?
Comment: You are *investigating an association*, you are not *predicting*. If you want to *predict*, then decide what you want to predict (e.g., neuropathy), based on what information (glucose level(s) up to 5 years before), use a holdout set to assess your prediction quality, and use appropriate evaluation measures ([not accuracy](https://stats.stackexchange.com/q/312780/1352)). That is a completely different paradigm, and significance plays a much smaller role. Yes, I know that people misuse the term "predict" in this sense. Please be more careful about your terminology.
Comment: Thank you for your comment dear @StephanKolassa; It was so helpful.
Answer: Sounds like you need a logistic regression, with distal neuropathy as a dummy coded event that is coded $0$ or $1$, where $P(\text{neuropathy}) = 1$ You can enter age and time as predictors into the model, with the log odds of distal neuropathy predicted by the following predictors:
$$
\text{log}\left[\frac{P(\text{neuropathy})}{1- P(\text{neuropathy}}\right]
= \beta_0 \text{Time 1} + \beta_1 \text{Time 2} + \beta_2 \text{Age} + \beta_3 \text{Glucose} + \epsilon
$$
where the intercept here is simply Time $1$ and the coefficient of Time $2$ is a contrast between Time $1$ and Time $2$. There is also nothing stopping you from modeling the change every year if you feel it is important to document. If you are just interested in the baseline and $5$ year follow up, then you can just model that. Keep in mind that entering every year will give you a lot more coefficients ($7$ if my calculation is correct), so make sure you have sufficient data to estimate that many unknowns.
Comment: Yes that is what I already noted (Time 1 is baseline and Time 2 is 5 year follow up). If you want to test the difference between each time, the coefficients directly model this. For example, if the conditional log odds for baseline are represented by the intercept, then the slope for time is simply the "adjustment" of the log odds for the fifth year compared to the baseline year.
Comment: Thank you @Shawn; Does it also make sense to do a logistic regression between the serum glucose level at the baseline (t = 0 years), and the distal neuropathy outcome at the 5-year follow-up (t = 5)? So I can conclude that serum glucose levels may predict distal neuropathy occurance?


Using LCD's of mobiles?

Question: I was just giving my mother's mobile for repair at my local store and saw the owner stocking parts for them. I saw him stocking cheap (I mean really cheap) LCD (coloured and black & white). I was wondering where I can learn to use them in my circuits.
Answer: Google seems to be the best bet AFAIK. The modules vary wildly. There are types that resemble a TV with horizontal and vertical sync and pixels, ones with smart controllers (even SPI, as in a 3310 IIRC) and probably some had bare segments. Most probably don't have easily published specs.
Another thing you'll have to worry about is the connector types. Many cellphone parts have incredibly tight pitch components.
Comment: Some LCD connectors are pads directly on the glass, and require zebra connectors. Zebra con.'s are great to have, though.
Answer: A friend of mine did a teardown of an LCD that he purchased for 0.50USD
from Electronic Goldmine -- http://tim.cexx.org/?page_id=342
It is quite detailed so even if you don't use that particular screen
you may be able to follow the steps to interface other screens.
Answer: It all depends on the controller.  Some are well supported in the embedded world, others have their datasheets hidden away for OEMs only, are  unpublished, or have completely unreadable barely-English text.
I'd stick with the LPC2148 [Sparkfun], which uses the Epson S1D15G10 or Philips PCF8833 controller.  C code for AVRs, PICs, and ARMs, Arduino sketches, Forth implementations, Linux drivers, etc. are all available.
Answer: Enjoy:
http://code.rancidbacon.com/LearningAboutArduinoNokiaLCD
Answer: I've used an old Nokia LCD display (GLCD5110) and it's quite simple to use as it uses SPI to communicate with the CPU (LPC2103 in my case).
So it uses basically the MOSI, CLK, CE (Chip Enable) and RST pins and you can send commands and data to the LCD through the SPI interface.
I bought it here: http://www.robotshop.com/inex-graphic-lcd-5110.html
Comment: http://iteadstudio.com/store/index.php?main_page=product_info&cPath=3&products_id=155
Answer: I discovered this the other day it might be of some use for pin layouts.

Using LCD's of mobiles?