Recently I’ve been learn to use Vagrant. to set up a production like env under ubuntu 12.04. However, when I tried to compile REE- ruby enterprise version, I caught into the following error:
12345678
./libtool: line 983: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)src/tcmalloc.cc:1672:54: error: conflicting declaration 'void * (* __memalign_hook)(size_t, size_t, const void *)'/usr/include/malloc.h:183:39: error: "__memalign_hook" has a previous declaration as 'void * (* volatile __memalign_hook) (size_t, size_t, const void *)'src/tcmalloc.cc: In function'void PrintStats(int)':
src/tcmalloc.cc:523:47: warning: ignoring return value of 'ssize_t write(int, const void *, size_t)', declared with attribute warn_unused_result (-Wunused-result)src/tcmalloc.cc: In function'void {anonymous}::ReportLargeAlloc(Length, void *)';src/tcmalloc.cc:1010:47: warning: ignoring return value of 'ssize_t write(int, const void *, size_t)', declared with attribute warn_unused_result [-Wunused-result]make: *** (libtcmalloc_minimal_la-tcmalloc.lo) Error 1
I dig a little throught google and it turns out to be a very easy solution. Just redefine the fucntion name
in the tcmalloc.cc src file . To declare it to be volatile type function can solve that issue and keep the compiling on. Actually, I could have found the reason because as to what the log says, the issue is pretty clear. Seems like I depend on google too much….. it’s not good.
Just trying to use Go for I find it looks like C, and the cost of writing a hello world is quite small, plus the tutorial is petty easy to fetch. Just list what I’ve done to get the tutorial and write the hello world example, which already posted thousands time in the internet.
Recently, the ci build has failed with the following error message:
123
_ODBC::Error: 37000(9002)[unixODBC][FreeTDS][SQL Server]The transaction log fordatabase 'Warehouse' is full. To find out why space in the log cannot be reused,
see the log_reuse_wait_desc column in sys.databases (Sequel::DatabaseError)_*%
The reason is, so far as I known, that firstly the database has the log recorded
and when the volume of log increasing, it would cause the “out of space” error
if it exceeds the threshold of log size limit.
The knowledge that we should know is:
# Scheme of way to record transaction log is store in log_reuse_wait_desc
# column of sys.databases, check “this”:http://msdn.microsoft.com/en-us/library/ms178534.aspx, it gives all the choices of how to deal with the transaction log
A little bit log for this document, I will just cut the cliche and show how I
solve this issue with the knowledge I found from Internet.
Given our current build is using data warehouse “Warehouse” and such error happens
First thing is to connect to the data warehouse, and check whether the log is
full by using DBCC tools.
Check log spaces used:
1
DBCC SQLPERF(LOGSPACE) //from the output information you can also see the log name of corresponding database
Then you will see the log size for “Warehouse” is 100%
After knowing it is the right reason as the error message shows, we have two steps to go:
set the data warehouse into recovery mode and set the log_reuse_wait_desc using no backup for reserving logs
truncate the currently logs and shrink its size
Way to change the database recovery mode and set backup scheme:
vigating the page
j, <c-e>: Scroll down
k, <c-y>: Scroll up
h:the Scroll left
l: Scroll right
gg: Scroll to the top of the page
G:Scroll Scroll to the bottom of the page
zH: Scroll all the way to the left
zL: Scroll all the way to the right
d: Scroll a page down
u: Scroll a page up
r: Reload the page
gs: View page sourceyy: Copy the current URL to the clipboard
yf: Copy a link URL to the clipboard
post: Open the clipboard's URL in the current tabP: Open the clipboard's URL in a new tab
gu: Go up the URL hierarchy
i: Enter insert mode
gi: Focus the first (or n-th) text box on the page
f: Open a link in the current tab
F: Open a link in a new tab
<a-f>: Open multiple links in a new tab
o: Open URL, bookmark, or history entry
O: Open URL, bookmark, history entry, in a new tab
T: Search through your orpen tabs
b: Open a bookmark
B: Open a bookmark in a new tab
[[: Follow the link labeled previous or <
]]: Follow the link labeled next or >
gf: Cycle forward to the next frame on the page
查找:
12345678910111213141516
/: Enter find mode
n: Cycle forward to the next find match
N: Cycle backward to the previous find match
Navigating historyH: Go back in historyL: Go forward in historyManipulating tabs
K, gt: Go one tab right
J, gT: Go one tab left
g0: Go to the first tab
g$: Go to the last tab
t: Create new tab
x: Close current tab
X: Restore closed tab
Miscellaneous
?: Show help
觉得比较有用的几个快捷键:
滚到网页底部和顶部: 和vim一样 G,gg
向下(上)移一页: d/u (vim 得加 ctrl键)
拷贝当前地址栏url: yy, chrome对应的快捷键是command + alt + c(- 但是最新的chrome不知道为什么和develop工具的快捷键冲突了)
Well, it’s a fare long story.During the trainning, Aimee asked me a question about
how the source command works under shell. Haven’t done a deep search at that time
though it does not seem like a tough question. Now, i figure out how this stuff work, but
the trainning is over and Aimee is gone.
It’s really simple for the function of source. It helps the current shell reload the variables
from script file so that they could be recongnized.In another word–read and execute
commands from the filename argument in the current shell context. Let’s just cut the
crap and try some examples.
123
touch test.sh
chmod +x test.sh
vi test.sh
And input the following content
1
A="shit happens"
We just define an variable named A in the script file. ok,let’s run this script with
1
sh test.sh &&echo$A
which will show nothing even shit because it creates a new subshell and the invariables
created in the subshell will not show in the parent shell. Then you use
12
source test.sh
echo$A
now you can see the shit by yourself.
So? What’s the difference between source and .?Well,basically, they are the same.
Instead of using source, you can use . test.sh to get the same effect of using source
even the file test.sh is not executable.It is said that use .test.sh means execute the
hidden file, definetly not working on osx.
In the morning, i was writing a automation sql script for QA. And after move the source file from mac mini to my machine. It met such warning as i tried to run the file.
1
Invalid gemspec in [/Users/twer/.rvm/gems/ree-1.8.7-2011.03@development/specifications/childprocess-0.2.1.gemspec]: invalid date format in specification: "2011-08-11 00:00:00.000000000Z"
It’s ok because it’s just warning. But i am just a little bit agnoied by the message. So i decided to kill this warning message. After search in google, i found the answer.
On duplicate key update is to stop the duplication in unique index or primary
key, and try to update the row with new value.And it only functions with mysql
because it is not standard SQL grammar.