Welcome

Troves being gleaned while surfing on the Internet mostly about computer/IT/system skills and tricks, Welcome here ...
Powered By Blogger

Disclaimer

This blog is written by the owner with real practices and tests and intended to hold all original posts except there is a clear declaration for referencing from others. Thanks for tagging with the source link or other tips for reference from here if you would like to quote partial or full text from posts in this blog.

Friday, August 8, 2014

WinEdit: Cannot Jump from PDF to LaTex source?

You may have already known about the convenient feature of WinEdit LaTex environment that allows you to jump from the generated PDF line, when clicking that line, back to the corresponding tex source line in the WinEdit editor window. This is immensely helpful and conducive to efficient Tex editing and revising. 

However, somehow you may find that the feature suddenly fails to work. That happens to me recently, making a lot of headaches when fiddling with how to fix it and bring the nice feature back to work. 

Regardless of how other online posts complicated this solution, here is the quick steps:

1. Download Sumatra PDF reader and install it (to avoid unnecessary trouble, just install it to the default folder, for instance 'C:\Program Files (x86)").

2. Open your WinEdit and get into 'Options' (from the main menu) -> 'Execution Modes'

3. In 'PDF Viewer' tab, set Sumatra PDF reader (the executable SumatraPDF.exe) as the 'PDF Viewer Executable'; leave 'Use --synctex switch when --src is enabled' unchecked; fill '--synctex=1' in SyncTex switch box

4. Move to the 'Console Applications' tab, choose 'PDFTexify' in the navigation menu on the left-hand side, fill '--pdf --tex-option=--synctex=-1' in the 'Switches' box.

5. Ctrl+Shift+'P' (or choose 'PDFTexify' from the 'Tex'->'PDF' menu items) to build your PDF; save settings and get back to your editing environment.

6. Now try to double click a line in the PDF, the beautiful functionality should play like a charm!


Solve PDF font-embedding really quick

To make your PDF files easy to view by others who may have a different font environment from where you generated the PDFs, you are usually in want of embedding all fonts in the files. In fact, many of the professional publishing agencies, such as the Conference Publishing System (CPS) of IEEE or ACM, have set mandatory requirements in that regard on the paper authors preparing the camera-ready versions.

This is the most straightforward recipe:

1. Open you problematic PDF in any application that provides a capability of printing (such as Acrobat Reader or Acrobat Pro).

2. Go to 'print' page and choose 'Acrobat PDF' as the printer.

3. Get into "properties" of the printer.

4. In the 'Adobe PDF Setting' tab, get into 'edit' next to the 'Default Settings' item.

5. Get into 'Fonts' from the navigation menu. 

6. Choose the 'Embed all fonts' checkbox. 

7. Select 'All' items in the 'Never Embed' listbox and Remove all of them.

8. Save the settings (a new setting will be created which can be used next time upon the same need) and go back to the 'print' page. 

9. Print your PDF into another PDF, where all fonts are now embedded.

10. Problem should be solved already. 

* To check if all fonts have been embedded: 
In Acrobat Reader/Pro, go to 'properties' from the 'File' menu, look into the 'Font' tab, 
for each successfully embedded font, there should be something like '(Embedded subset)'. 

Friday, April 4, 2014

Passing reference by value in Java

Having been sticking to C/C++ for a decade, I know relatively clearly about the notion of "passing by value" and "passing by reference/address", and the memory models behind them. Embarrassingly, however, it is just a recent clarification that "passing reference by value", a freak concept in Java, is not only in essence unequivocally different from the preceding two, but really closely related to them. Most important, this nuance in name but connections underneath is what has been confusing me for all times I was intensively programming in Java for the past two years.

Without re-spinning the explanation, I just simply summarize toward the gist about this topic, using the information in courtesy of Dale King, by posting the core question and the thorough answer to it.


Does Java pass objects by reference or by value? 

The answer is NO! (that is, Java neither passes objects by reference nor does that by value!)

The fact is that Java has no facility whatsoever to pass an object to any function, and the reason is that Java has no variables that contain objects.

It is common to confound the concept of an object reference variable with that of an object instance, but all object instances in Java are allocated on the heap and can only be accessed through object references.

So if I have the following assignment:

String g = new String( "Hello" );

 
The variable g does not contain the string "Hello", it contains a reference (or pointer) to an object instance that contains the string "Hello".

Java only has variables that hold primitives or object references. Both are passed by value. Now, it comes naturally that Java does pass (object's) reference by value. if the parameter being passes is an object (rather than a primitive type of value).

Monday, November 26, 2012

Building and Extending VirtualBox Source Code in Fedora Linux

The following practice was done in Fedora 17 Linux on an AMD-64 arch. If you are playing around VirtualBox in Ubuntu, you may find it much easier than the following talks about.

Of course, the reason why you wanted to build the source package of the Virtualbox instead of downloading the executable by automatical installation provided by such and such an "installer" is very likely to be your desire to extend or develop on the current VirtualBox distribution. I was doing this for extending it to include a performance monitor for the VMM at the core.

Now go ahead building the source package in the first place. No exhaustive details, just critical steps to work around traps and annoying errors you might have got stuck on, since I have no intent to write tutorial for building VirtualBox in Linux given the existing tutorial maintained on the official site of the developers of VirtualBox. See "Linux build instructions" in there.

1. failure in getting through the first-step "./configure". Here are the cures:

  • for openWatCom, if you can not build from the source code successfully within at most 20 minutes, forget about that daunting way of doing it.  Instead, just install it using the installer found here to save yourself!
  • for "LIBIDL"'s missing, sudo yum -y install LIBIDL-pluginbase-devel (the name might not be exactly as this, correct it as needed)
  • for Qt4, compiling the source code rather than just installing the executables to install. Using the opensource-everywhere source package (found here) is recommended.
  • * this may take long, be patient and after it is finished, add the directory holding the "qmake" executable to the environment variable "PATH" and make it take effect before doing "./configure" again.
  • for PulseAudio, use the disable flag corresponding to it as an option to the "./configure" launch.
  • upon failure to find "lstdc++", "whereis libstdc++.a" and then copy it from where you found it to the standard place "/usr/lib64"
  • For missing headers for "32-bit support", using "--nonfatal" option provided with the "./configure" itself. By doing this, we simply ignore, and hence sacrifice, the support of 32-bit additions by the VirtualBox
  • * For other errors, put it into the comment area of this post. I will try to help with them.

2.  failure in getting through the "make" step (actually "kmk" instead of "make", a KBuild variant of the GNU make). Here are the other cures:

  • for the repulsive error like "spec failure: g++: invalid/unrecognized option "-m"", do "kmk -ik" anyway but keeping the error log by appending " 2>errors 1>&2" to it
  • grep "g++: " errors > makeup.sh and then replace all "g++" with "g++34" (under Fedora 17, g++34 is installed by default and otherwise I presume you have it by any means. Or I am not sure for now how to get this hurdled bypassed). 
  • do the brute-force "complete" compilation by "kmk -bBik all"
  • And, now run "sh makeup.sh". If things are done, you should be able to locate the "VirtualBox" executable under the $installDir/linux.x86/release/bin directory, run it and enjoy your success. 
  • Otherwise, you will need go back to the "errors" file to find other failures in issues other than the "invalid -m options with g++", for example some compilation errors in your own hacking code.
3. finally, failure in launching the newly built Virtualbox frontend (the backend, VBoxSVC and XCOM service will automatically be boosted up when the first frontend gets started). Here are the final cures:

  • for messages complaining about "can not load vbox driver" or something like that when you are trying to start a virtual machine, get back to your terminal and do "sudo modprobe vboxdrv". If this does not do the trick, using insmod directly by "sudo insmod $path/vboxdrv" where "$path" indicates where the vboxdrv.ko file is located. You can get the path by "find -name" or "locate" followed by "vboxdrv.ko"; Alternatively, you can simply do "sudo kmk load" under the top source code directory to get this step done as well.
  • for complaints like "driver is not accesible", which may pop up at the time of starting a VM too, do "sudo chmod a+rwx /dev/vboxdrv" - by default, the vbox driver should have been placed in /dev/


-----

Hacking Bluetooth Modules in Fedora 17 Linux

Having figured out how to successfully build the original source package of the Bluetooth modules downloaded online (see my older post on how to build), now we can head to hack those modules in order to customize certain Bluetooth functionalities on demand (as is actually, at least one of many others, the reason why we wanted to build the source package instead of downloading the executable in the first place).

To hack the Bluetooth modules and make it really effect for ordinary users, we need both categories of module - the kernel module and the user module. While the tricks required to build the kernel modules ca be found in the older post on how to build, building the latter on the same platform (AMD64, Fedora 17 Linux) has been straightforward at least for myself(your report of troubles in building the user space modules of Bluetooth, i.e. as downloaded from bluez.org, is welcome to be put into the comments of this post). Remember, however, as was somehow seemingly required, you need to "sudo" the execution of the common sequence of "./configure" -> "make" -> "make install" if you are not logged in as the root directly.

Now following things to be followed, no big deal, just the below listed,

1. Having successfully built the kernel modules should have given you a group of module binaries (.ko files) that has been moved ("installed") to the directory of "/lib/modules/`uname -r`/updates" by default, where subdirectories include the following together with example, but not all, enclosed files :
driver[/btusb.ko],  net[/bluetooth/{rfcomm.ko, bnep.ko}], and net/[bluetooth.ko]. 

* if you have not yet successfully got these files, you have not yet successfully built the kernel module then. Check again you have really followed and went through successfully the following steps before getting back again to the older post on how to build:
under the top source directory, do
"make clean" -> "scripts/selectdriver bt" -> "make install-modules"

2. before you can "mount" the newly built kernel module for bluetooth above, make sure you "dismount" the currently mounted one as the system has done while booting the kernel by default. Do these:
"killall -9 bluetoothd" -> "sudo modprobe -r bnep" -> "sudo modprobe -r rfcomm" -> "sudo modprobe -r btusb" -> "sudo modprobe -r bluetooth". An alternative to "modprobe -r" could be "rmmod".

* note if the bluetoothd (see below for more about it) is still running, you will get "cannot remove module xxx, xxx is busy/in use" when you are doing the aforementioned "dismounting" steps.

* note that the btusb.ko module is directly associated with the "bluetooth icon" on the toolbar of the desktop , which is presented there by default. So when you killed this module, that icon disappeared. In return, you can use the disappearance of that icon as a simple flag that this module has been removed successfully.

* If you still had trouble removing them, play the trump now:
"sudo init 3" -> "log in a root" -> "do the same series of modprobe -r"

3. Having successfully built the user space module should have given you a set of binary executables and objects (lib files) besides documentation related files to the directory you have indicated when doing "./configure" before. Check the installation directory for such subdirectories as that includes the following together with example, but not all, enclosed files :
bin[/hcitools], sbin[/bluetoothd], ....

Here we actually are concerned about the bluetooth daemon server bluetoothd only, as is to be running in the user space to bridge the bluetooth applications and the underlying bluetooth kernel modules.

4. Now start mounting your own hacked modules and make them effect by following steps:

  1. "sudo mv /sbin/bluetoothd /sbin/bluetoothd.org" (just back up the original one in any way you prefer)
  2. "sudo cp $installDir/sbin/bluetoothd /sbin/" (this is critical, directly running this daemon from the $installDir", at least when the "installDir" is not the one taken as default, has fallen to failure for me)
  3. "sudo /sbin/bluetoothd [-n] [-d]"
  4. "sudo modprobe bluetooth,bnep,rfcomm,btusb"


Now you should have been working with your hacked bluetooth modules.

* using "-n" to run bluetoothd in a non-daemon will show you the running log that can give you a sense of how the user modules get loaded and run; further, the addition of "-d" to the command line can provide you even more details of the internal dynamics of the user space code.

* "dmesg -T | grep "bluetooth" can give you running logs of the kernel module, about their being loaded and run.

Enjoy hacking!

Nikon D5100 16.2MP Digital SLR Camera with AF-S DX Nikkor 18-55mm f/3. (Google Affiliate Ad)

Monday, November 19, 2012

Build Bluetooth Kernel Module in Fedora Linux

Prelude:
If you do not encounter issues like one of the following, you are free to leave now so as to avoid a waster of time reading more below.

Download  Linux Bluetooth kernel module source code

Can not compile Linux Bluetooth kernel module
/sbin/modprobe: invalid option -- 'l'


========================== Start =====================================

Although this practice was with Fedora Linux 17, the following instructions should still do the tricks for building the Compat bluetooth kernel module for Linux with kernel version of 2.6.x or above.

NOTE: this post is not about playing with the user space code that you may find on the bluez.org official site http://www.bluez.org/download/

1. download kernel code for the bluetooth module
This should be ported together with the kernel itself, but in case you have not yet had it on hand or been unable to find the source code, download from the site below

https://gforge.ti.com/gf/download/frsrelease/802/5435/ti-compat-bluetooth-2012-02-20.tar.gz

2. now once your followed the steps indicated on http://processors.wiki.ti.com/index.php/Open_source_Wireless_Connectivity_Bluetooth_components#Bluetooth_Modules, you will probably get stuck by the compilation with
 
make KLIB_BUILD=<Path To Linux> KLIB=${ROOTFS} install-modules

(Equivalence of it is to run "make bt" under the top source code directory.)

Error might be like some syntactical faults in the kernel headers this module depends on, and you may find you have no luck by applying the patch provided in the above site (http://processors.wiki.ti.com/images/8/8e/Compat-patch-zip.zip) , the only cure I had got that really was efficacious is to apply the following patch instead (thanks to the guy who posted it)
http://marc.info/?l=linux-wireless&m=132760196131230&w=2 (in case this link may be expired or moved away, I have pasted below)

This file was introduced in commit 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99
and included in 3.1 and later kernels.  It includes <generated/autoconf.h>
itself, as well as some other definitions that are used elsewhere.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 include/linux/compat-2.6.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/linux/compat-2.6.h b/include/linux/compat-2.6.h
index c23e94a..3ccd051 100644
--- a/include/linux/compat-2.6.h
+++ b/include/linux/compat-2.6.h
@@ -2,7 +2,9 @@
 #define LINUX_26_COMPAT_H
 
 #include <linux/version.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+#include <linux/kconfig.h>
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
 #include <generated/autoconf.h>
 #else
 #include <linux/autoconf.h>
-- 
1.7.4.4

(Copy it into a file named newpatch, say, and then apply it by "patch -p1 newpatch")

Thereafter, you should be able to get through "make bt" successfully".

3.  However, when you get to "make btinstall" or later "make btuninstall" to toy around the Bluetooth loading or unloading, you can get more annoying warnings like:
 
/sbin/modprobe: invalid option -- 'l'

It seems not critical but will block the normal process of "installation" from being complete hence unsuccessfully installation of the new Bluetooth module you just made.

To get rid of them (I am showing you the reasons behind it since you may be interested more in the solutions right now, please Google that if you are indeed intrigued with that),  use the following trick
(this is came up with on the basis of what was earlier posted by Artem Chekunov on http://comments.gmane.org/gmane.linux.kernel.wireless.general/87040)

touch /sbin/modprobe.sh
and then put the following into it and save.
--------------------------------------------------------------------------
#!/bin/bash

if [[ $1 == -l ]]
then

if [ -z $2 ]    
then
 find /lib/modules/$(uname -r) -name '*.ko' | \
 sed -e "s#\/lib\/modules\/$(uname -r)\/##g"
else 
 find /lib/modules/$(uname -r) -name '*.ko' | \ 
 sed -e "s#\/lib\/modules\/$(uname -r)\/##g" | grep $2
fi

else
/sbin/modprobe $@
fi
 
exit 0 
---------------------------------------------------------------------------
Note the last line I added (besides changes made somewhere else) is important to make sure that "make" can run completely through all expected steps.

Then do the following more steps:

chmod +x /sbin/modprobe.sh
alias modprobe=/sbin/modprobe.sh
echo "alias modprobe=/sbin/modprobe.sh" >> /etc/bashrc

cp Makefile Makefile.save
sed -i -e 's/^MODPROBE.*/MODPROBE := \/sbin\/modprobe.sh/g' Makefile
 
Now do what you like.

========================== End =====================================

Wednesday, August 22, 2012

Cracking problems during installation of FreeWRL under Fedora 13

Starting from : http://freewrl.sourceforge.net/install_Linux.html

Can not find the gdk-pixbuf library or version is lower than required

One more, maybe last in the nasty complaining list for building GTK+-2.22.1, prerequisite for GTK+, which might be complaining the lower version than required or simply loss of it:

 1. yum -y reinstall gdk-pixbuf-devel.x86_64 gdk-pixbuf.x86_64
oops, no luck this time, ./configure of GTK still grouses there for missing it (on some platforms, this reintallation could only get the 0.22.0 version, for instance)

( if it wors ok now for you, stop here and congrutulations to you!)

2. download and built on source package

But gdk-pixelbuf-2.0 can NOT be found,  how repulsively this costly trivial steps end like this!


Finally, it is a conclusion:  you should build gtk-2.4, where gdk-pixbuf-2.0 will be included inside!!


ok, what else could we do but to follow it :

1.
go ftp://ftp.gtk.org/pub/gtk/v2.4/ :

wget ftp://ftp.gtk.org/pub/gtk/v2.4/glib-2.4.7.tar.bz2

bunzip glib-2.4.7.tar.bz2 && tar xvf   glib-2.4.7.tar.bz2

cd glib-2.4.7.tar.bz2 && ./configure && make && make install


pkg-config  --modversion  glib-2.0
2.4.7

2.
wget ftp://ftp.gtk.org/pub/gtk/v2.4/pango-1.4.1.tar.bz2

same steps to install pango 1.4.1 as above

*** 'pkg-config --modversion glib-2.0' returned 2.4.7, but GLIB (2.26.1)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files
no
configure: error:
*** Glib 2.4.0 or better is required. The latest version of
*** Glib is always available from ftp://ftp.gtk.org/.

Friday, March 9, 2012

Overriding/overwriting and Overloading

It is often asked how overriding/overwriting differs from overloading and there are many posts online to answer related questions. Here I am summarizing the difference between them to give an overview as much complete as possible.

(1) Overloading provides multiple signatures for the same method in a single class, with the return value being not seen as part of the signature of method; Overriding provides a different implementation of a method inherited from a base type.

(2) Overloading is decided at compile time and overriding is decided at runtime, Overriding is basically the point of polymorphism by inheritance.

(3) Overloading lets you define a similar operation in different ways for different data, Overriding lets you define a similar operation in different ways for different object types.

(4) Using overloading and overridding, you can acheive the concept of polymorphism. Polymorphism means "one name, multiple forms". Using one name u can do multiple of actions. Method overloading is a compile time polymorphism and Method Overridding is a runtime polymorphism. Compile time polymorphism means compiler knows which object assigned to which class at the compiling time. Runtime polymorphism means compiler didn't know at the compile time, it only knows at a run time.

(5) Overriding method appears in subclasses, having the same name and same parameter list as a superclass method. The access modifier for the overriding method may not be more restrictive than the access modifier of the superclass method.

=====================================

Similar to this topic, there is a differentiation between shadowing and overriding, found at

Friday, August 19, 2011

how to retrieve the info of the compiler having built an ELF executable

Sometime there happens to be a need for retrieving what is the compilation information, compiler version, say, of the compiler that was previously used for building an ELF executable.

There are two ways, no matter whether they are the real good ones.

1) objdump -s --section .comment  <the executable>

2) strings -a <the executable> | grep -i -E "gcc|cl| $other possible clue for the compiler name"


Sunday, July 24, 2011

Tracing the segmentation fault problem caused by glutBitmapCharacter or glutBitmapString

When porting an openGL+freeGLUT program to a laptop running with an integrated on-board graphics card ( actually, a part of the chipset, the model is Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller in HP Presario CQ60 standard configuration ), a call in the code to glutBitmapCharacter always leads the program to perish in the runtime.

Built it in debug mode first and then trace the program with the dumped memory core. It is found that the problem can be traced to glBitmap -> libGL.so.xx -> /usr/lib/dri/i965_dri.so. 

Tried dozens of "solutions" ranging from reinstalling many times of freeglut-2.6 to changing GLUT to the classic GLUT-3.7 following the instruction from http://original.jamesthornton.com/linux/HOWTO/Nvidia-OpenGL-Configuration/instglut.html, including debugging deeply in the code itself, trying different fonts and using glutBitmapString, for instance,  just all end up with failures.

Finally, the installation of GLUT-3.7 through an indirect approach - by installing MesaLib (the another ordeal has been put in http://surfingtroves.blogspot.com/2011/07/defeating-mesalib-installation-issues.html)
give the sense of graphics driver issues. It really is! 

Now, skipping the obscure discussions about the notorious graphics card driver problem in Linux ( this is true at least as far as I am concerned ), just show you the one of real "solutions":

go to /usr/lib/, mv i965_dri.so i965_dri.so.old.

get back the code, I am lucky to get the long gnawing problem solved. You should be as well if your case is similar to mine.

Defeating the MesaLib installation issues - not sufficiently high version of libdrm and then "915_EXEC_BLT" undeclared

While obstructed by the tricky installation of GLUT-3.7 in Linux (Fedora 13/14 in this post's case), an easy expedient is to indirectly install MesaLib since this package should have already included GLUT-3.7 and thus the desirable installation of GLUT-3.7 can be achieved tortuously by installing MesaLib through the source package building.

However, there might be still other problems with the building installation itself of MesaLib, here are several candidates:

1. before generating the makefile, "./configure"  can complains that the version of libdrm_intel is lower than 2.4.21 which is required to compile mesa.

---> download the package of libdrm from http://packages.pardus.org.tr/info/corporate2/devel/source/libdrm.html ,unpack it and go to "./configure", here you may get another obstacle, however, by failure in checking PCIACCESS. fix this easily by "yum -y install libpciaccess" and perhaps also "yum -y install libpciaccess-devel". Then "make" -> "make install". and get back to mesa

Unfortunately, the complaints did not disappear as most likely happens. This is a problem of package recognition previously encountered as the case of "http://surfingtroves.blogspot.com/2010/12/linux-fedora-upgraded-package-and.html" . For this instance, find libdrm_intel.pc ( should be found in /usr/local/lib/pkgconfig/ after installation, if not, copy from the source package of libdrm ( typically in intel/ ) and copy it to a directory like this), then add the containing path to the environment variable PKG_CONFIG_PATH. for example
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH.

Then "pkg-config --modversion libdrm_intel" should confirm that the version is updated to suffice the installation of mesaLib.

2. "./configure" continues to grouches, but with missing of TALLOC this time. Fix it by installing libtalloc and libtalloc-devel using yum like above. and you should be able to get through it.

3. now, do the sure thing "make" , you are probably expected to get stymied again by the complaint like:

"error:  I915_EXEC_BLT undeclared "

The is because the older version of the drm_intel library is still being used. Look at the compilation command line before this complaints, you can find "-I/usr/include/libdrm"  therein.  A simple fix is to copy the command line and manually compile again with "-I/usr/include/libdrm" changed to "-I/usr/local/include/libdrm"  since drm_intel is installed to /usr/local by default.

4. "make install".  And, done.

To check if GLUT-3.7 has been installed during the installation of mesaLib, look at /usr/local/lib/libglut* and /usr/local/include/GL/glut*.

Now you should be alreay there.

Can not hear from earphone on fedora linux ALSA Conexant


1. check if the file /etc/modprobe.d/alsa-base exists, touch an empty one of this if not.


2. add following line to it :
options snd-hda-intel model=olpc-xo-1_5


3.save and reboot.


Then the problem should have gone.


Note that this may only do the tricks for exact this sound device
"Codec: Conexant CX20583 (Pebble HSF)". If it is not working for you, please refer to the original post at http://linux.derkeiler.com/Mailing-Lists/Ubuntu/2010-05/msg00541.html.


 Many thanks to the original author.

Thursday, June 16, 2011

On how universities handle multiple GRE scores (how about taking GRE more than once) ?

RESULTS FROM Google "more than one gre scores"    or " Multiple GRE scores"
(first 50 pages according to the page-rank)



-------------------------------------------------------------------------------------------------------------------------------------------------------------

http://el-prod.baylor.edu/certain_doubts/?p=876
It is getting close to the time for graduating seniors to submit applications to PhD programs, and I’ve been reflecting again on our discipline’s practices in this regard. Especially, I’ve been thinking about the role of GRE scores in the process.
The role of GRE scores in any given graduate program is fairly obscure, but it is fair to say that there are institutional pressures to recruit students with higher GRE scores. There are various ways to succumb to these pressures, from a crass preference for higher GRE scores to a system in which first cuts are made on the basis of GRE scores. I don’t mean to attach any significance to the question of whether such practices amount to succumbing to pressure, however; my concern is with the practices themselves ...........................

-------------------------------------------------------------------------------------------------------------------------------------------------------------
http://www.vetmed.wsu.edu/prospectivestudents/admissionProcedure.aspx

* GRE percentile is calculated by averaging the percentile rank from the three sections of the general test (composite score). If an application contains more than one set of GRE scores, the committee will consider the highest section score. Only GRE scores received by the admissions office at the time of initial academic evaluation will contribute to Tier assignment.

-------------------------------------------------------------------------------------------------------------------------------------------------------------
http://chhs.gsu.edu/pt/faq.asp 
15.    I've taken the GRE multiple times.  Which scores will you use?
We will use the highest score earned in each section of the GRE. For example, if your verbal test score was high the first time, we will use that score rather than your most recent verbal score (if lower). A minimum verbal score of 400 must be obtained. The required Analytical Writing Section score is 3.5. Scores cannot be more than five years old from the desired semester of entry. 


-------------------------------------------------------------------------------------------------------------------------------------------------------------
http://www.yale.edu/graduateschool/admissions/faqstq.html
 GRE scores are but one of many criteria used to evaluate an applicant. Individual departments practices may differ, but overall the best score from each section is used. However, you must submit ALL of your GRE scores in order to have the department consider the highest from each section.

-------------------------------------------------------------------------------------------------------------------------------------------------------------
http://www.physics.ucsb.edu/education/graduate/prospective/faqsforapps.htm#mixgre

I have taken the GRE exams more than once. Can I mix and match the results?

GRE scores can not be mixed and matched. We will review only the most recent scores, regardless of the outcome.
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Friday, May 27, 2011

building installation of freeglut ------ problem with /usr/lib/libGL.so.1 or /lib/libm.so.6

When setting up freeglut with the source code package downloaded from sourceForge in the Fedora Linux environment, there always complains in the link step about loss of either of following two dynamically-linked libraries on the linker's command line:

/usr/lib/libGL.so.1
/lib/libm.so.6

The typical prompt would be like the lines as follows:

freeglut is defined in DSO /usr/lib/libGL.so.1 so try adding it to the linker command line

A very gauche approach is to edit each Makefile spread over different levels of directories in the source code root, by changing each "CC=gcc" line to "CC=gcc /usr/lib/libGL.so.1 /lib/libm.so.6". Obviously, you will need much pissy manual work to treat this nasty problem.

Here what I would like to share is a cheaper yet perky way, maybe not that paradigmatic though, to the quick solution:

1. enter /usr/bin/  (or somewhere else gcc lies, the location can be retrieved by whereis gcc );
2. mv gcc gcc_org 
3. touch gcc and add following lines in it:
#!/bin/bash

/usr/bin/gcc_org $@ /usr/lib/libGL.so.1 /lib/libm.so.6


4. chmod +x gcc

Now get back to glut source package directory and follow the original instruction, that is, "./configure" -> "make && make install".

You should not expect further problems until everything will be set up well there.

After done, do not forget to clean up the your cheating spot : move to /usr/bin,
and "mv gcc_org gcc".

Monday, March 28, 2011

A TUI library for Dos/Windows

A Text User Interface Library in C++ for DOS/Windows. Useful for building light-weighted TUI based applications.

http://sourceforge.net/u/haipengcai/wikituidos/Home/

Tuesday, February 8, 2011

Why vim not search STL headers?

In vim it is common to open a header in place, which is really a handy feature for browsing a directory hierarchy.

But you might find this functionality seems to fail with C++ STL headers : when the cursor is blinking under "#include <iostream>", say, and your hitting 'gf' will not respond by entering that header but engender a grouch like following instead:

"E447: Can't find file iostream in path".

In actuality it is quite easy to resolve this problem by riffling through vim manual.

Treatment:

open the rc file of vim, for instance, /etc/vimrc, add following setting :

set path = **,/usr/include/c++/**

provided your c++ STL headers are hoarded in /usr/include/c++.

reopen the source code you were previously browsing around and try "gf" again, it should work now! It is really that piece of cake!  Really extensible is vim!

remove empty line by sed or in vim

In vim, following the same trick for general sustitution:
:%s/^[\ \t]*\n//g 

By sed on the command line:
cat orgfile | sed /^$/d

Saturday, January 8, 2011

Enable X Shared Memory Extension Pixmaps

Definitely not encouraged to use, sometimes this feature is needed for using certain applications what depends on this deprecated X window extension.

Found the solution on http://fxc.noaa.gov/FSD-NVIDIA-OB9-FXC.htm. More precisely, an example illustrating the details with Nvidia series on Fedora 14 is shown as follows.

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 260.19.29 
# (buildmeister@swio-display-x86-rhel47-04.nvidia.com)  Wed Dec 
# 8 12:27:39 PST 2010


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    FontPath        "/usr/share/fonts/default/Type1"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from data in "/etc/sysconfig/keyboard"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbLayout" "us"
    Option         "XkbModel" "pc105"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option    "AllowSHMPixmaps" "true"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

The enabling appendix is simply the single line below.
Option "AllowSHMPixmaps" "true"

Then reboot the system to make it effect.

Following code snippet could be used for verifying the availability of this feature:

int vmajor;

int vminor;
bool vpixmap;
bool shm_flag;
if (XShmQueryVersion(window->getDisplay(),&vmajor,&vminor,&vpixmap) != True) { 
    cerr << "X Shared Memory Extension not supported." << endl;
    shm_flag=false;
}
else if (vpixmap != True) { 
    cerr << "X Shared Memory Extension Pixmap not supported." << endl;
    shm_flag=false;
}
else {
    // do what is relying on the MIT-SHM feature from here on
    ......
}