Coding: Difference between revisions

From esoterum.org
Jump to navigationJump to search
 
(20 intermediate revisions by the same user not shown)
Line 6: Line 6:
== GNU ==
== GNU ==
*[http://directory.fsf.org/ The Free Software Dictionary]
*[http://directory.fsf.org/ The Free Software Dictionary]
=== GCC ===
*[http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html gcc warning options]


== Programming ==
== Programming ==
=== IDE ===
=== IDE ===
==== Eclipse ====
==== Eclipse ====
*[http://technology-shettyprasad.blogspot.com/2010/12/disable-syntax-error-check-in-eclipse.html turn off syntax error checking as you type]
*[http://eclipse-tools.sourceforge.net/Keyboard_shortcuts_(3.0).pdf Eclipse Keyboard Shortcuts]
*[http://eclipse-tools.sourceforge.net/Keyboard_shortcuts_(3.0).pdf Eclipse Keyboard Shortcuts]
*Unlock file: <code><workspace>/.metadata/.lock</code>
*Unlock file: <code><workspace>/.metadata/.lock</code>
==== TeXnicCenter ====
*In order to embed Type I fonts and use letter format, these switches were added in [Build]->[Define Output Profiles]->[Postprocessor]->[DviPs], [http://www.acm.org/sigs/publications/sigfaq reference], [http://www.tug.org/mactex/fonts/AboutEmbedding.pdf embedding fonts reference]:
:-<code>-Pdownload35  -P cmz -t letter</code>


=== Java ===
=== Java ===
Line 38: Line 38:


=== C++ ===
=== C++ ===
*>[http://www2.research.att.com/~bs/bs_faq2.html#null Bjarne Stroustrup's C++ Style and Technique FAQ]
*> [http://www2.research.att.com/~bs/bs_faq2.html#null Bjarne Stroustrup's C++ Style and Technique FAQ]
*[http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=129 Creating persistent objects] by writing variables and data to binary file
*[http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=129 Creating persistent objects] by writing variables and data to binary file
*[http://www.cplusplus.com/reference/ cplusplus.com], C++ reference
*[http://www.cplusplus.com/reference/ cplusplus.com], C++ reference
Line 80: Line 80:


== Scripting ==
== Scripting ==
=== CGI ===
*[http://www.jmarshall.com/easy/cgi/ CGI Made Really Easy]
=== PHP ===
=== PHP ===
*[http://www.tizag.com/phpT/index.php PHP Tutorial]
*[http://www.javascriptkit.com/howto/phpcgi.shtml PHP vs. Pearl scripting]
*[http://www.thesitewizard.com/archive/installphp.shtml Installing PHP on Windows]
*[http://www.php.net/ PHP.net]
*[http://www.thesitewizard.com/archive/apache.shtml Installing Apache server on Windows]
*[http://www.bin-co.com/php/scripts/load/ Function for loading the contents of web pages into a variable]
*[http://weblogtoolscollection.com/regex/regex.php Regular Expressions Quick Reference]
*[http://php.net/quickref.php Quickreference]
*[http://php.net/quickref.php Quickreference]


=== Python ===
=== Python ===
*[http://docs.python.org/index.html Python Documentation]
*[http://www.devshed.com/c/a/Python/String-Manipulation/ String manipulation]
*[http://www.devshed.com/c/a/Python/String-Manipulation/ String manipulation]
*[[IMAP Utility]]
*[[IMAP Utility]]
Line 101: Line 113:


=== DOS ===
=== DOS ===
*<code>XCOPY [SOURCE] [DEST] /E /C /R /K /Y /D /I /EXCLUDE:exclude.txt</code> Search subfolders for *.jpg and copy files to C:\FOLDER\
*[http://www.computerhope.com/batch.htm Good short batch reference]
*<code>ICACLS [folder|file] /grane USER:(F)</code> grant everyone full control permissions on folder or all subfolders starting at folder
*<code>XCOPY [SOURCE] [DEST] /d/e/f/i/a /EXCLUDE:exclude.txt</code> Search subfolders for *.jpg and copy files to C:\FOLDER\
*<code>[http://www.microsoft.com/downloads/details.aspx?FamilyID=955D7F2F-73D9-4018-9DD7-42DA210E62EE&displaylang=en diruse] /M /S /C /L /Q:500 /D /* c:\</code> Find folders larger then 500MB and write output to DIRUSE.LOG in <code>diruse</code> folder: <code>c:\Program Files\Resource Kit</code>
*<code>[http://www.microsoft.com/downloads/details.aspx?FamilyID=955D7F2F-73D9-4018-9DD7-42DA210E62EE&displaylang=en diruse] /M /S /C /L /Q:500 /D /* c:\</code> Find folders larger then 500MB and write output to DIRUSE.LOG in <code>diruse</code> folder: <code>c:\Program Files\Resource Kit</code>
*[http://superuser.com/questions/69624/windows-7-come-out-of-sleep-when-i-open-remote-desktop Remotely waking Windows machine from sleep]


=== Regular Expressions ===
=== Regular Expressions ===
Line 119: Line 134:


=== LaTeX ===
=== LaTeX ===
*[http://www.tex.ac.uk/cgi-bin/texfaq2html?label=widows Notes on widow and orphan control]
*>[http://www.math.vanderbilt.edu/~schectex/wincd/intro_to_tex.htm Good LaTeX intro]
*[http://www.michaelshell.org/tex/ieeetran/ IEEETran Q&A]
*[http://www.michaelshell.org/tex/ieeetran/ IEEETran Q&A]
*[http://www.ctan.org/tex-archive/info/symbols/comprehensive/symbols-letter.pdf Comprehensive list of symbols]
*[http://www.ctan.org/tex-archive/info/symbols/comprehensive/symbols-letter.pdf Comprehensive list of symbols]
Line 137: Line 154:
*[[Generating eps files]]
*[[Generating eps files]]
*[http://developer.berlios.de/docman/display_doc.php?docid=800&group_id=3442 algorithmic package manual]
*[http://developer.berlios.de/docman/display_doc.php?docid=800&group_id=3442 algorithmic package manual]
==== Dissertation ====
*[http://math.asu.edu/graduate/Thesis_Template Style files from ASU Math Department]
==== TeXnicCenter ====
*In order to embed Type I fonts and use letter format, these switches were added in [Build]->[Define Output Profiles]->[Postprocessor]->[DviPs], [http://www.acm.org/sigs/publications/sigfaq reference], [http://www.tug.org/mactex/fonts/AboutEmbedding.pdf embedding fonts reference]:
:-<code>-Pdownload35  -P cmz -t letter</code>


==== Embedding Fonts ====
==== Embedding Fonts ====
*[http://www.azfonts.net/search.html?name_filter=NimbusSanL Download Nimbus Fonts]
*[http://www.athleticaid.com/yaquinapress/postscript/XPHome_EmbedFonts.html Setup pdf printer to embed fonts]
*[http://www.athleticaid.com/yaquinapress/postscript/XPHome_EmbedFonts.html Setup pdf printer to embed fonts]
:Replacing commercial fonts (which don't get embedded into the pdf with open source tools):
:Replacing commercial fonts (which don't get embedded into the pdf with open source tools), script:
<code>   
<code>   
  # We go for replacing the wrong commercial font names with URW names, we also
  # We go for replacing the wrong commercial font names with URW names, we also
  # adapt some similar fonts names on the fly (extend for further font names):  
  # adapt some similar fonts names on the fly (extend for further font names):  
   
   
  cat original_graphics.eps | sed 's+Times-Bold+NimbusSanL-Bold+g' |\
  if [ "$1 " != " " ]
sed 's+Times-Roman+NimbusSanL-Regu+g' |\
then
sed 's+Times+NimbusSanL-Regu+g' |\
  TARGET=$1
sed 's+Helvetica-BoldOblique+NimbusSanL-BoldItal+g' |\
  TARGET_TEMP=$TARGET".font.temp"
sed 's+Helvetica-Oblique+NimbusSanL-ReguItal+g' |\
    echo
sed 's+Helvetica-Bold+NimbusSanL-Bold+g' |\
    echo "Executing font conversion $TARGET_STAGE_1 > $TARGET"
sed 's+Helvetica-Bold-iso+NimbusSanL-Bold+g' |\
    cat ${TARGET} | \
sed 's+Helvetica+NimbusSanL-Regu+g' |\
    sed 's+Times-Bold+NimbusSanL-Bold+g' |\
sed 's+Helvetica-iso+NimbusSanL-Regu+g' |\
    sed 's+Times-Italic+NimbusSanL-ReguItal+g' |\
sed 's+Symbol+StandardSymL+g' > new_graphics.eps
    sed 's+Times-Roman+NimbusSanL-Regu+g' |\
    sed 's+Times+NimbusSanL-Regu+g' |\
    sed 's+Helvetica-BoldOblique+NimbusSanL-BoldItal+g' |\
    sed 's+Helvetica-Oblique+NimbusSanL-ReguItal+g' |\
    sed 's+Helvetica-Bold+NimbusSanL-Bold+g' |\
    sed 's+Helvetica-Bold-iso+NimbusSanL-Bold+g' |\
    sed 's+Helvetica+NimbusSanL-Regu+g' |\
    sed 's+Helvetica-iso+NimbusSanL-Regu+g' |\
    sed 's+Symbol+StandardSymL+g' \
    > ${TARGET_TEMP}
  mv $TARGET $TARGET".old"
  mv $TARGET_TEMP $TARGET
fi
</code>
</code>


Line 165: Line 202:
=== Post Script ===
=== Post Script ===
*[http://en.wikibooks.org/wiki/PostScript_FAQ Post Script FAQ]
*[http://en.wikibooks.org/wiki/PostScript_FAQ Post Script FAQ]
=== Portable Document Format (PDF) ===
*[http://superuser.com/questions/22786/back-button-of-adobe-pdf-reader-after-clicking-a-hyperlink-whose-target-is-on-the How to navigate backwards in Adobe Reader], <code>[ALT]+[left arrow]</code>
:-"Back" and "Forward" buttons can also be added to the toolbar, under navigation, they are referred to as "previous view" and "next view"


== Modeling ==
== Modeling ==
Line 180: Line 221:
*[http://www.cc.gatech.edu/classes/AY2002/cs7635_spring/tutorial/ MATLAB quick reference], Georgia Tech
*[http://www.cc.gatech.edu/classes/AY2002/cs7635_spring/tutorial/ MATLAB quick reference], Georgia Tech
*[http://web.cecs.pdx.edu/~gerry/MATLAB/programming/basics.html MATLAB functions]
*[http://web.cecs.pdx.edu/~gerry/MATLAB/programming/basics.html MATLAB functions]
=== CGI ===
*[http://www.jmarshall.com/easy/cgi/ CGI Made Really Easy]
=== PHP ===
*[http://www.tizag.com/phpT/index.php PHP Tutorial]
*[http://www.javascriptkit.com/howto/phpcgi.shtml PHP vs. Pearl scripting]
*[http://www.thesitewizard.com/archive/installphp.shtml Installing PHP on Windows]
*[http://www.php.net/ PHP.net]
*[http://www.thesitewizard.com/archive/apache.shtml Installing Apache server on Windows]
*[http://www.bin-co.com/php/scripts/load/ Function for loading the contents of web pages into a variable]
*[http://weblogtoolscollection.com/regex/regex.php Regular Expressions Quick Reference]
=== Python ===
*[http://docs.python.org/index.html Python Documentation]


== Interfaces ==
== Interfaces ==

Latest revision as of 10:43, 19 April 2011

SVN

GNU

GCC

Programming

IDE

Eclipse

Java

C

snippits

  • Cstring to int: int n = atoi(StrInt);
  • Return cursor to beginning of same line: printf("%d\r",number);


C++

SystemC

  • Installation on Fedora 9:
-SystemC compiles with Fedora 9 version of gcc, but it's necessary to add the following include statements to this file: systemc-2.2.0/src/sysc/utils/sc_utils_ids.cpp as indicated here:
#include "string.h"
#include "cstdlib"
  • A generic makefile for SystemC projects is here
  • Installing older gcc in Fedora 9, gcc 4.x was not compatible witn SystemC release, the configuration error says gcc-3.2 is compatible, but I could only get yum to work with compat-gcc-34

Assembly


Excel (VBA)

Scripting

CGI

PHP

Python

Perl

Bash

DOS

  • Good short batch reference
  • ICACLS [folder|file] /grane USER:(F) grant everyone full control permissions on folder or all subfolders starting at folder
  • XCOPY [SOURCE] [DEST] /d/e/f/i/a /EXCLUDE:exclude.txt Search subfolders for *.jpg and copy files to C:\FOLDER\
  • diruse /M /S /C /L /Q:500 /D /* c:\ Find folders larger then 500MB and write output to DIRUSE.LOG in diruse folder: c:\Program Files\Resource Kit
  • Remotely waking Windows machine from sleep

Regular Expressions

  • (^([^ ^\t^\n^/]+ +)+(.*) *\(.*\)[^\{]*\{[^\n]*\n) Finds a function declaration (eclipse find)
  • <START>$1 trace\(" @ $3\\n"\); //MAB 22 SEP 08: Add trace print statements
<STOP> Use this to replace the function declaration adding a trace statement identifying the function (normally "trace" should be replaced with printf), in eclipse, the return character apparently needs to be copied and pasted into the replace field, \n does not seem to work)

Mark-up Languages

Wikimarkup

Dot

LaTeX

Dissertation

TeXnicCenter

  • In order to embed Type I fonts and use letter format, these switches were added in [Build]->[Define Output Profiles]->[Postprocessor]->[DviPs], reference, embedding fonts reference:
--Pdownload35 -P cmz -t letter

Embedding Fonts

Replacing commercial fonts (which don't get embedded into the pdf with open source tools), script:

# We go for replacing the wrong commercial font names with URW names, we also
# adapt some similar fonts names on the fly (extend for further font names): 

if [ "$1 " != " " ]
then
 TARGET=$1
 TARGET_TEMP=$TARGET".font.temp"
   echo
   echo "Executing font conversion $TARGET_STAGE_1 > $TARGET"
   cat ${TARGET} | \
   sed 's+Times-Bold+NimbusSanL-Bold+g' |\
   sed 's+Times-Italic+NimbusSanL-ReguItal+g' |\
   sed 's+Times-Roman+NimbusSanL-Regu+g' |\
   sed 's+Times+NimbusSanL-Regu+g' |\
   sed 's+Helvetica-BoldOblique+NimbusSanL-BoldItal+g' |\
   sed 's+Helvetica-Oblique+NimbusSanL-ReguItal+g' |\
   sed 's+Helvetica-Bold+NimbusSanL-Bold+g' |\
   sed 's+Helvetica-Bold-iso+NimbusSanL-Bold+g' |\
   sed 's+Helvetica+NimbusSanL-Regu+g' |\
   sed 's+Helvetica-iso+NimbusSanL-Regu+g' |\
   sed 's+Symbol+StandardSymL+g' \
   > ${TARGET_TEMP}
 mv $TARGET $TARGET".old"
 mv $TARGET_TEMP $TARGET
fi

HTML

Post Script

Portable Document Format (PDF)

-"Back" and "Forward" buttons can also be added to the toolbar, under navigation, they are referred to as "previous view" and "next view"

Modeling

AMPL (Linear Programming)

VHDL

MATLAB

Interfaces

Windows

In General

  • Magic Hex number: 0xDEADBEEF