(gdb) bt #0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238 #1 0x00007f9d69721343 in base::ConditionVariable::TimedWait (this=0x7fffdb12b308, max_time=…) at ../../base/synchronization/condition_variable_posix.cc:102 #2 0x00007f9d696fde2c in base::WaitableEvent::TimedWait (this=0x7f9d705c0540, max_time=…) at ../../base/synchronization/waitable_event_posix.cc:214 #3 0x00007f9d696dcc16 in base::MessagePumpDefault::Run (this=0x7f9d705c0530, delegate=0x7fffdb12b570) at ../../base/message_loop/message_pump_default.cc:56 #4 0x00007f9d696edc51 in base::RunLoop::Run (this=0x7fffdb12b3e0) at ../../base/run_loop.cc:49 #5 0x00007f9d696da157 in base::MessageLoop::Run (this=) at ../../base/message_loop/message_loop.cc:308 #6 0x00007f9d6c310ffc in content::RendererMain (parameters=…) at ../../content/renderer/renderer_main.cc:227 #7 0x00007f9d696a31de in …
Monthly Archives: October 2014
How to manipulate packages with dpkg (Enabling Muilti-Arch in Multi-Arch support) ?
$dpkg –print-architecture amd64 $dpkg –print-foreign-architectures $dpkg –add-architecture i386 dpkg: error: unable to create new file ‘/var/lib/dpkg/arch-new’: Permission denied $sudo dpkg –add-architecture i386 [sudo] password for jeffrin: $dpkg –print-foreign-architectures i386 $sudo dpkg –add-architecture itest386 $dpkg –print-foreign-architectures i386 itest386 $dpkg –remove-architecture itest386 dpkg: error: unable to create new file ‘/var/lib/dpkg/arch-new’: Permission denied $sudo dpkg –remove-architecture itest386 $dpkg …
How to write a program to solve project Euler problem 4
”’ This file is worked on from http://www.s-anand.net/euler.html , Solution of Problem 4 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 x 99. Find the largest palindrome made from the product of two 3-digit numbers. ”’ n = 0 for …
Continue reading “How to write a program to solve project Euler problem 4”
Hacking with runit and sv ( sv – control and manage services monitored by runsv(8) ) commands
ABOUT runit runit is a cross-platform Unix init scheme with service supervision, a replacement for sysvinit, and other init schemes. It runs on GNU/Linux, *BSD, MacOSX, Solaris, and can easily be adapted to other Unix operating systems ABOUT sv The sv program reports the current status and controls the state of services monitored by the …
Project Euler Problem 2, solution internals related using ruby debugger
$ruby -rdebug euler-two.rb Debug.rb Emacs support available. /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:57: RUBYGEMS_ACTIVATION_MONITOR.enter (rdb:1) r /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:57: RUBYGEMS_ACTIVATION_MONITOR.enter (rdb:1) r /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:57: RUBYGEMS_ACTIVATION_MONITOR.enter (rdb:1) next /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:143: RUBYGEMS_ACTIVATION_MONITOR.exit (rdb:1) next euler-two.rb:3:n1, n2 = 1, 2 (rdb:1) next euler-two.rb:4:sum = 0 (rdb:1) print n1 1nil (rdb:1) print n2 2nil (rdb:1) next euler-two.rb:6:while n2 < 4000000 (rdb:1) print n2 2nil (rdb:1) next euler-two.rb:7:sum += …
Continue reading “Project Euler Problem 2, solution internals related using ruby debugger”
Project Euler Problem 3, solution internals using python debugger
$python -m pdb euler-three.py > /home/jeffrin/beautifulwork/lib/euler-three.py(7)() -> ”’ (Pdb) r 6857 –Return– > /home/jeffrin/beautifulwork/lib/euler-three.py(17)()->None -> print n (Pdb) next –Return– > (1)()->None (Pdb) next The program finished and will be restarted > /home/jeffrin/beautifulwork/lib/euler-three.py(7)() -> ”’ (Pdb) next > /home/jeffrin/beautifulwork/lib/euler-three.py(9)() -> n = 600851475143 (Pdb) next > /home/jeffrin/beautifulwork/lib/euler-three.py(11)() -> i = 2 (Pdb) next > /home/jeffrin/beautifulwork/lib/euler-three.py(12)() …
Continue reading “Project Euler Problem 3, solution internals using python debugger”
Project Euler Problem 2, solution internals using python debugger
$python -m pdb project-euler-2.py > /home/jeffrin/beautifulwork/lib/project-euler-2.py(13)() -> ”’ (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(15)() -> cache = {} (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(16)() -> def fib(n): (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(20)() -> n = 0 (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(21)() -> i = 0 (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(22)() -> while fib(i) /home/jeffrin/beautifulwork/lib/project-euler-2.py(23)() -> if not fib(i) % 2: n = …
Continue reading “Project Euler Problem 2, solution internals using python debugger”
How to write an algorithm to find among natural numbers the sum of multiples of 3 and 5 below 1000 ?
/* This program has been worked on from http://www.s-anand.net/euler.html */ #include <stdio.h> sofmul() { int n, i; n = 0; for (i = 0 ; i < 1000 ; i++) { if ( !(i % 5) || !(i % 3) ) n = n + i; } printf(“Sum of the multiples of 3 and 5 …
GDB backtrace For chromium hangup
(gdb) bt #0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238 #1 0x00007fb512be9443 in ?? () #2 0x00007fb512bc9d0d in ?? () #3 0x00007fb512bacb0f in ?? () #4 0x00007fb512bbc7d1 in ?? () #5 0x00007fb512baa03a in ?? () #6 0x00007fb51537aea8 in ?? () #7 0x00007fb512b7d045 in ?? () #8 0x00007fb512b7de1e in ?? () #9 0x00007fb512b7cc30 in ?? () #10 0x00007fb512569698 in …
How to write a program to multiply a number by 4 using a bitwise operator ?
/* Part of this program copied from http://www.sanfoundry.com/c-program-multiply-number-4-using-bitwise-operators/ */ #include <stdio.h> multbitwise() { long number; printf(“Enter an integer: “); scanf(“%ld”,&number); number = number << 2; printf(“Result is %ld \n”,number); } /* http://stackoverflow.com/questions/4456442/interview-multiplication-of-2-integers-using-bitwise-operators */ /* http://www.geeksforgeeks.org/multiply-two-numbers-without-using-multiply-division-bitwise-operators-and-no-loops/ */ /* http://en.wikipedia.org/wiki/Bitwise_operation */