Rebooting Matlab

I saw a very effective code sniplet to reboot matlab(unfortunately, there is no reboot command in matlab ) and i added it as a shortcut to workspace header. Here is the code:

% Reboots matlab. Currently only works if only one instance of matlab is running.
[x, out] = system(‘tasklist /v /fo csv | findstr /i “matlab.exe”‘);
if length(strfind(out, 10)) > 1
disp(‘More than one instance of Matlab are running, don”t know which to kill.’);
return;
end
out = out(length(‘”MATLAB.exe”,”‘)+1:end);
nd = strfind(out, ‘”‘);
mypid = out(1:nd(1)-1);
% Start a new instance of Matlab on a separate process in the same
% directory.
system([‘start matlab.exe -sd ‘ pwd()]);
system([‘taskkill /f /pid ‘ mypid])

Cleanup Disk in Windows

First things first;

use cleanmgr:

  • Method 1: Click Start, type cleanmgr in the Start Search box, and then click OK.
  • Method 2: Click Start, click All Programs, click Accessories, click System Tools, and then click Disk Cleanup.
  • Method 3: If a Low Disk Space notification appears, click the notification to open the Disk Cleanup wizard.

if it is not enough, disable hibernation:

  1. Click Start, and then type cmd in the Start Search box.
  2. In the search results list, right-click Command Prompt, and then click Run as Administrator.
  3. When you are prompted by User Account Control, click Continue.
  4. At the command prompt, type powercfg.exe /hibernate off, and then press Enter.
  5. Type exit, and then press Enter to close the Command Prompt window.

To make hibernation available, follow these steps:

  1. Click Start, and then type cmd in the Start Search box.
  2. In the search results list, right-click Command Prompt, and then click Run as Administrator.
  3. When you are prompted by User Account Control, click Continue.
  4. At the command prompt, type powercfg.exe /hibernate on, and then press Enter.
  5. Type exit, and then press Enter to close the Command Prompt window.

now you have ay least >5GB space. for more

 

also you can edit the maximum allowable ram size for a running program with this guide.

You may change the maximum ram for dedicated to a  running program from 768 to 1024 etc, with the steps below:

 

To resolve this problem, modify the desktop heap size. To do this, follow these steps:

  1. Click Start, type regedit in the Start Search box, and then click regedit.exe in the Programs list.

    Note If you are prompted for an administrator password or for confirmation, type your password, or click Continue.

  2. Locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems
  3. Right-click the Windows entry, and then click Modify.
  4. In the Value data section of the Edit String dialog box, locate the SharedSection entry, and then increase the second value and the third value for this entry.

Notes

  • The second value of the SharedSection registry entry is the size of the desktop heap for each desktop that is associated with an interactive window station. The heap is required for each desktop that is created in the interactive window station (WinSta0). The value is in kilobytes (KB).
  • The third SharedSection value is the size of the desktop heap for each desktop that is associated with a “non-interactive” window station. The value is in kilobytes (KB).
  • We do not recommend that you set a value that is over 20480 KB for the second SharedSection value.

By default, the Windows registry entry contains the following data in an x86-based version of Windows Vista.

%SystemRoot%\system32\csrss.exe
ObjectDirectory=\Windows
SharedSection=1024,3072,512
Windows=On
SubSystemType=Windows
ServerDll=basesrv,1
ServerDll=winsrv:UserServerDllInitialization,3
ServerDll=winsrv:ConServerDllInitialization,2
ProfileControl=Off
MaxRequestThreads=16

Note By default, the second value for the SharedSection entry is 3072 in an x86-based version of Windows Vista. By default, this second value for this entry is 20480 in an x64-based version of Windows Vista.

In Windows Vista and in later operating systems, memory allocations are dynamic. Therefore, there is no limitation for memory allocation. However, if you allocate too much memory to the desktop heap, negative performance may occur. This is the reason why we do not recommend that you set a value that is over 20480.

Note The desktop heap size is not affected by the physical RAM on the computer. Therefore, you cannot improve the performance by adding physical RAM.

Eclipse math.h linker error

As you already know the buggy nature of the eclipse ide, there is also a bug on its linker. Actually it is not a bug only in eclipse, because the error is depend on gcc and its inability to solve math library linking after or middle of the code compilation. Let’s explain this phenomenon with an example:

Asssume that we have the following example.c code:

#include <stdio.h>
#include <math.h>
int main(void)
{
        double x = 4.0;
        double result = sqrt(x);
        printf("The square root of %lf is %lf\n", x, result);
        return 0;
}

If we compile this code in bash terminal with:

$ gcc -lm test.c -o test

we have an error as undefined reference to `sqrt‘ (or any other function that called from math.h library) Interestingly if we have a static variable inside the sqrt like ‘sqrt(12.2)’ the compiler don’t give us any error. This happens because when we give the gcc  ‘-lm‘ option, we link the libm.a and libm.so to the compiler. “.a" files are static libraries, as opposed to “.so" files which are dynamic libraries. Normally gcc looks for dynamic libraries if available unless passed -static.  In ”sqrt(12.2)” case gcc is called ‘libm.a’ and not call the function sqrt in the run time, simply assign the value to the static variable.

In bash terminal. if we compile this code with:

$ gcc test.c -o test -lm

problem would be solved for bothe cases. to to this in Eclipse:

  1. Right click on your project in Project Explorer and select Properties.
  2. Go to C\C++ Build -> Settings -> Tool Settings -> Gcc Linker -> Libraries and click on green plus button to add a new library. When the dialog pops up, write m, and Eclipse will automatically add the –Im flag.

Image

source Okumaya devam et

Latex ‘de Denklemlerin Sığdırılması

Makale yazanlar bilir, özellikle çift sütunlu formatlarda, denklemleri sığdırmak bir işkence haline gelebilir. Kimi zaman saatlerinizi denklemi düzgün bir şekilde sokuşturmaya harcayabilirsiniz. Bununla ilgili öteden beridir sorunlarla boğuşan bendeniz de yakın bir zamanda etkin bir çözümünü buldum(sanırım). Kod parçası şöyle:

\begin{equation}
\resizebox{.9\hsize}{!}{$E=m*c^2$}

\end{equation}

 resizebox komutundaki “.9” o sütunun onda olarak kaçta kaçına sığdırmanızı istediğiniz belirtiyor. misal .9 denklemi sütun genişliğinin 9/10 (%90) sığdırılmasını sağlayacaktır 

e-Seçmen Seçmen Bilgileri Sorgulama

Her ne kadar ülkemizde gerçek anlamıyla demokrasiden pek söz edilemese de, şimdilik sahip olduğumuz sandık demokrasisi‘ni (şimdilik) en iyi biçimde kullanma adına sandık bilgilerimizi ve aynı meskende(daire, apartman) kişileri görüp şüpheli bir durum varsa bildirmemiz(aynı zamanda komşularımızı tanımamız için) bir sorgu ekranı. resme tıklayıp siteye kimlik bilgilerinizi ve ekranda gördüğünüz doğrulama kodunu (harf ve rakamları) ilgili alana girerseniz sorgunuzu yapabilirsiniz. Duyarlı vatandaşların artması dileğiyle…

Image

   

Dell bluetooth kopma sorunu

Dell bilgisayarlarda gözlemlenen, bluetooth fare, klavye ve kulaklıkların sebepsiz yere kopması sıkça gözlemlenen bir sorun. Bunun için format ve anakart değişimi de dahil olmak üzere birçok  çözüm öneriliyor ve işe yaramıyor. Çünkü asıl sorun başka yerde.

Güç yönetimi/power management ile ilgili bir sorun bu. bu nedenle Aygıt yöneticisi(Device Manager) altından Bluetooth sekmesine geliyoruz ve buradan donanımımızı çift tıklayıp Power Management/güç yönetimi altsekmesinden “Allow the computer to turn off this device to save power” (Bilgisayarın bu aygıtı güç tasarrufu için kapatmasına izin ver) deki seçimi kaldırıyoruz. Aşağıda ilgili ekran görüntüsü de bulunmakta. taa taaa..

 

Görsel

 

Ubuntu ‘da multi-touch pad’e multitouch özelliği ekleme

öncelikle mutouch driver i kuruyoruz:

sudo apt-get install xserver-xorg-input-mutouch

ardından, xorg.conf dosyasına birkaç satır bir şeyler ekleyeceğiz. öncelikle xorg.conf dosyasını açalım:

sudo gedit /etc/X11/xorg.conf

bu dosyada aşağıdaki satırları aynen kopyalayıp, oturumu yeniden başlatalım

Section “InputDevice”
Identifier “Touchpad”
Driver “microtouch
Option “Device” “/dev/input/mouse1”
EndSection

 

bir başka sorun da touchpad i istenildiği zaman açma/kapatma. onun için de buradaki çözümü uygularsanız sorununuz hallolacaktır.