Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Monday, May 2, 2016

Thursday, July 16, 2015

PHP: Snippet: 1行内の任意の標識文字に対する値の取得

// Label: の後に書いてある文字列を取得する
if (mb_strpos($line, “Label:”) !== false)
   $str = mb_substr($line, mb_strpos($line, “Label:”) + strlen(“Label:“));

PHP: Snippet: XML Parsing Example

// XMLを取得
$myXMLData = file_get_contents($xmlURL . $xmlURLParameter);

// XMLをパース
$xml = simplexml_load_string($myXMLData) or die (“Error: Cannot create object”);

// タイトルを取得
$title = $xml->entry->title;

// 概要を取得
$summary = $xml->entry->summary;

// 概要を行で分解
$lines = explode(PHP_EOL, $summary);

Thursday, September 4, 2014

LLVM 2.0

  • AST
  • Abstract syntax tree
  • Better warning control
  • C language family frontend for LLVM
  • C/ObjC parser
  • Chris Lattner
  • Clang
  • Code generator
  • Codegen
  • Compiler
  • Development builds
  • Distcc
  • Enum definitions
  • Expressive diagnostics
  • FORTRAN & Ada
  • File scoped variables
  • Function declarations
  • GCC 4.0
  • GCC 4.1 front-end features
  • GCC front-end is difficult to work with
  • GCC is slow and memory hungry
  • Good diagnostics
  • Header analysis
  • Header preprocessing
  • IDE
  • IR
  • Indexing
  • LLVC C Family Frontend
  • LLVM
  • Library based architecture
  • Link Time Optimization
  • Macros
  • OpenMP
  • Optimizer 
  • PIC support
  • Parse
  • Precompiled Headers (PCH)
  • Precompiled headers
  • Preprocess
  • Refactoring
  • Release builds
  • Rename variable
  • Semantic analysis
  • Source analysis
  • Source-Level Analysis tools
  • Structure definitions
  • System headers are huge
  • Token
  • Tree building
  • Typedefs
  • Unified parser for C-based languages

Saturday, August 30, 2014

Program output: Physical constant

***Table of universal constants***

Speed of light: 299792458
Newtonian constant of gravitation: 6.67384e-11
Planck constant: 6.62606957e-34
Reduced planck constant: 1.054571725e-34

***Table of electromagnetic constants***

Magnetic constant: 1.256637061e-06
Electric constant: 8.854187818e-12
Characteristic impedance of vacuum: 376.730313462
Coulomb's constant: 8.987551787e+09
Elementary charge: 1.602176565e-19
Bohr magneton: 9.27400967e-24
Conductance quantum: 7.7480917407e-05
Inverse conductance quantum: 12906.4037116
Josephson constant: 4.83597870e+14
Magnetic flux quantum: 2.067833757e-15
Nuclear magneton: 5.05078353e-27
von Klitzing constant: 25812.8074232

***Table of atomic and nuclear constants***

Bohr radius: 5.2917721011e-11
Classical electron radius: 2.8179403268e-15
Electron mass: 9.10938291e-31
Fermi coupling constant: 1.166364e-05
Fine-structure constant: 7.2973525755e-03
Hartree energy: 4.35974435e-18
Proton mass: 1.672621777e-27
Quantum of circulation: 3.6369475493e-04
Rydberg constant: 10973731.593929
Thomson cross section: 6.652458735e-29
Weak mixing angle: 0.2223
Efimov factor: 22.7

***Table of physico-chemical constants***

Atomic mass constant: 1.660538921e-27
Avogadro's number: 6.02214129e+23
Boltzmann constant: 1.3806488e-23
Faraday constant: 96485.3365
First radiation constant: 3.74177152e-16
First radiation constant for spectral radiance: 1.191042869e-16
Loschmidt constant: 2.6867806e+25
Gas constant: 8.3144621
Molar planck constant: 3.9903127148e-10
Molar volume of an ideal gas at temperature at 273.15 K and pressure 100 kPa: 2.2710953e-02
Molar volume of an ideal gas at temperature at 273.15 K and pressure 101.325kPa: 2.2413968e-02
Sackur tetrode constant at temperature 1 K and pressure 100 KPa: -1.1517078
Sackur tetrode constant at temperature 1 K and pressure 101.325 KPa: -1.1648708
Second radiation constant: 1.4387770e-02
Stefan boltzmann constant: 5.670372e-08
Wien displacement law constant: 2.8977721e-03

***Table of adopted values***

Molar mass constant: 1e-03
Molar mass of carbon 12: 1.2e-02
Standard acceleration of gravity: 9.80665
Standard atmosphere: 101325

***Natural units***

Planck length: 1.616199e-35
Planck mass: 2.17651e-08
Planck time: 5.39106e-44
Planck charge: 1.875545956e-18
Planck temperature: 1.416833e+32