history

Why are x86 registers named the way they are?

霸气de小男生 提交于 2019-11-28 09:41:19
For example, the accumulator is named EAX and, while the instruction pointer is called IP . I also know that there are bytes called CL and DH . I know there must be a convention to all of the names, but what is it? The C and the D are numbers/types and H for high and L for low parts of the higher register. http://en.wikipedia.org/wiki/X86 Wikipedia explains it very well. More from the Wikipedia: AX/EAX/RAX: accumulator BX/EBX/RBX: base CX/ECX/RCX: counter DX/EDX/RDX: data/general Something i found * EAX - Accumulator Register * EBX - Base Register * ECX - Counter Register * EDX - Data Register

raw_input without leaving a history in readline

梦想的初衷 提交于 2019-11-28 08:22:39
问题 Is there a way of using raw_input without leaving a sign in the readline history, so that it don't show when tab-completing? 回答1: You could make a function something like import readline def raw_input_no_history(): input = raw_input() readline.remove_history_item(readline.get_current_history_length()-1) return input and call that function instead of raw_input. You may not need the minus 1 dependent on where you call it from. 来源: https://stackoverflow.com/questions/1202127/raw-input-without

_Underscores in Function Names

醉酒当歌 提交于 2019-11-28 08:15:34
In a lot of languages with simple OO capability (PHP 4), or misunderstood OO capabilities (Javascript, C using function pointers, etc.), you'll end up with a function naming convention that uses leading underscores to to indicate privilege level. //ex. function _myPrivateFunction(){ } While individual teams are always going to come up with their own naming conventions like this, the underscore convention seems so prevalent that it made me curious about Where the technique first came from If there was ever any standardized systems (sort of like hungarian notation) developed around the

Why do some compilers use “a.out” as the default name for executables?

青春壹個敷衍的年華 提交于 2019-11-28 08:09:43
Most UNIX C compilers link executables by default to a file called "a.out". Why? Is this a written standard or just de-facto standard behavior? What would break if these compilers would just produce an error message (or use a different default name) instead of producing "a.out"? a.out stands for assembler output. I think that justifies why most compilers have this name as default. More info here . A.out is actually the name of an UNIX executable file format. (ELF is another) The compiler produces that name (by tradition) if you don't give your executable a name explicitly. What would break if

BOM之window核心模块

℡╲_俬逩灬. 提交于 2019-11-28 08:05:15
Window对象包含以下五大核心:document,screen,navigator,history,location。 一 document 文档 document包含了浏览器对标准DOM实现的所有方法和属性。 1,BOM和DOM的关系 大致如下图:    这里是网上找的图。 二  screen window.screen包含了用户屏幕的相关信息,比较有用的有四个属性,他们都返回以像素计的整数: screen.width:屏幕宽度 screen.height:屏幕高度 screen.availWidth:屏幕可用宽度 screen.availHeight:屏幕可用高度 可用高度/宽度是减去了诸如窗口工具条之类的界面特征,典型的如windows系统的任务栏。 1 console.log(screen.width);//1920 2 console.log(screen.height);//1080 3 console.log(screen.availWidth);//1920 4 console.log(screen.availHeight);//1040,因为我在底部设置了始终显示任务栏 三  navigator navigator.appCodeName:浏览器的代码名 navigator.appName:浏览器名称 navigator.appVersion

How to undelete a file previously deleted in git's history?

本小妞迷上赌 提交于 2019-11-28 05:14:27
Using Chris's answer on another question I could prepend a snapshot-history to my git repository. Since one of the files is not part of my history but only in the snapshots, the first original commit now also contains the deletion of this file. How can I undo that? At first I thought this was the opposite of How do I remove sensitive files from git’s history , but actually I don't want to insert a file into history but just remove the deletion from history. git checkout <commit> <filename> Tobias Kienzler I got it: git tag originalHead # just in case git rebase -i <id of the parent of the

HTTP Headers: Controlling Cache and History Mechanism

点点圈 提交于 2019-11-28 04:46:44
I'm trying to figure out the best HTTP headers to send for four use cases. I'm hoping to come up with headers that do not depend on user agent / protocol version sniffing but I'll accept that if nothing else fits. All URLs are fetched through fully custom handler so I can select all headers as I like, this is all about intermediate proxies and user agents . If possible, this should be compatible with both HTTP/1.0 and HTTP/1.1 clients. If multiple solutions exists, the best one will be the shortest one when sent over the wire. Static public content All "Static public content" is stuff that

Why might git log not show history for a moved file, and what can I do about it?

混江龙づ霸主 提交于 2019-11-28 04:36:34
I've renamed a couple of files using git mv , used git stash , had a quick look at HEAD (without changing it) then did git stash pop to get the whole lot back again. My moves had disappeared from the commit list, so I redid them with git rm and the commit message claimed git had spotted the rename was a rename. So I thought no more of it. But now, post-commit, I can't get at the history of the moved files! Here's what git says about the commit in question: ~/projects% git log --summary commit de6e9fa2179ae17ec35a5c368d246f19da27f93a Author: brone Date: Wed Dec 8 22:37:54 2010 +0000 Moved R

window bind POPSTATE

馋奶兔 提交于 2019-11-28 04:09:00
Given the following: $(window).bind("popstate", function() { alert('popstate'); }); On first load, the alert fires with FireFox and Chrome but not Safari. Why is that? Anyone else seen this and know how to best solve for this? Tamlyn The situation is now reversed. Chrome has fixed the bug and now fires popstate on page load but Firefox 4 (since RC) has departed from the spec and now does not fire popstate ! UPDATE : The HTML5 spec was changed in 2011 to state popstate should not fired on page load. Both Firefox and Chrome now do the right thing as of Firefox 4 and Chrome 34 . See the code from

TSQL: Get Last Queries Ran

情到浓时终转凉″ 提交于 2019-11-28 03:01:55
Is there a way to get the SQL text for the last few queries? I am using Microsoft SQL Server 2005 Yes, take a look, this will give you the 50 most recent executed SQL statements sql 2005 and up only SELECT TOP 50 * FROM(SELECT COALESCE(OBJECT_NAME(s2.objectid),'Ad-Hoc') AS ProcName, execution_count,s2.objectid, (SELECT TOP 1 SUBSTRING(s2.TEXT,statement_start_offset / 2+1 , ( (CASE WHEN statement_end_offset = -1 THEN (LEN(CONVERT(NVARCHAR(MAX),s2.TEXT)) * 2) ELSE statement_end_offset END)- statement_start_offset) / 2+1)) AS sql_statement, last_execution_time FROM sys.dm_exec_query_stats AS s1