Jump to content

Clechay

Member
  • Posts

    68
  • Joined

  • Last visited

Awards

This user doesn't have any awards

Contact Methods

System

  • CPU
    i7-3630QM
  • RAM
    16GB
  • GPU
    GTX 660M
  • Storage
    Crucial MX200
  • Display(s)
    1080p60Hz
  • Mouse
    G502
  • Operating System
    W10 / Xubuntu 16.04

Clechay's Achievements

  1. Please stop calling 'Unity Script' 'JavaScript', people waste time because of that misunderstanding
  2. Do you mean backend?
  3. Dat Guy is a troll, don't feed him
  4. You will need JavaScript for frontend, you can also use it for backend. It's fast and easy write also the most transparent thanks to modularity of CommonJS
  5. #!/usr/bin/env node const fs = require('fs-extra') const p = require('commander') const process = require('process') const child = require('child_process'); const path = require('path'); const def = { def_compiler : "g++11", targeted_comps : [ 'g++', 'g++11', 'g++14', 'g++0x', 'g++1y', 'clang', 'g++17', 'g++1z'], supported_comps : [ 'g++', 'g++11', 'g++14', 'g++0x', 'g++1y', 'g++17', 'g++1z'], gcc_family : [ 'g++', 'g++11', 'g++14', 'g++0x', 'g++1y', 'g++17', 'g++1z'] } function is_in(what, where){ for (el of where) { if(el===what) return true; } return false; } function get_buid_cmd(comp,file,parms){ if(!is_in(comp,def.supported_comps)) return false; if(is_in(comp,def.gcc_family)){ var out = "g++ "; out += "'" + path.normalize(file) + "' "; if(comp === 'g++11') out += '-std=c++11 '; if(comp === 'g++0x') out += '-std=c++0x '; if(comp === 'g++14') out += '-std=c++14 '; if(comp === 'g++1y') out += '-std=c++1y '; if(comp === 'g++17') out += '-std=c++17 '; if(comp === 'g++1z') out += '-std=c++1z '; if(parms.optymalization) out += '-O' + parms.optymalization + ' '; out += "-o '" + path.join(path.dirname(file),path.basename(file,path.extname(file))) + "'"; return out; } } p .version('0.0.0') p .description('builds file') .option("-c, --compiler <compiler>", "Which compiler to use('g++','g++11','g++14','clang')") .option("-f, --file <file>", "Which file to compile") .option("-r, --run", "runs builded file") .option("-i, --fin <fin>", "if runs builded file, stream this file to it's stdin") .option("-o, --fout <fout>", "if runs builded file, stream it's stdout to this file") .option("-O, --opt <opt>", "if and how much opt you desire, number for g++") p.parse(process.argv); if(!p.compiler) p.compiler = def.def_compiler; p.file=path.resolve(p.file); /// BUILD console.log("[CCE] executing command: "+get_buid_cmd(p.compiler,p.file,{optymalization: p.opt})) child.execSync(get_buid_cmd(p.compiler,p.file,{optymalization: p.opt})); /// RUN var fsin, fsout; if(p.fin){ if(!p.fin) p.run = false; else{ p.fin = path.resolve(p.fin); fs.ensureFileSync(p.fin); fsin = fs.createReadStream(p.fin); } } if(p.fout){ if(!p.fin) p.run = false; else{ p.fout = path.resolve(p.fout); fsout = fs.createWriteStream(p.fout); } } if(p.run){ file = p.file; const binpath = path.join(path.dirname(file),path.basename(file,path.extname(file))); var dbout = "[CCE] running binary: " + binpath; if(p.in) dbout += " with " + p.in + " > stdin" if(p.in && p.out) dbout += " and" if(p.out) dbout += " with stdout > " + p.out console.log(dbout) var time = process.hrtime(); const suicide = child.spawn(binpath, { stdio: [ 'pipe', 'pipe', 1 ], timeout: 1 }); fsin.pipe(suicide.stdin); suicide.stdout.pipe(fsout); suicide.on('close', (code) => { var diff = process.hrtime(time); var ns = diff[0] * 1e9 + diff[1]; var ms = ns * 1e-6; ms -= ms % 1; var s = ms * 1e-3; s -= s % 1; console.log(`[CCE] execution ended with code ${code} after ${s}s or ${ms}ms or ${ns}ns`); }); } I've made it for my personal use during preparations for Polish IT Olympic, it runs between Sublime Text 3 build system and GCC. I've called it CCE and it's job is to create {*.cpp file basename}.in file if it doesn't exist build *.cpp file and pipe any gcc output to Sublime's console run builded file and pipe *.in file => stdin stdout => *.out file stderr => sublime console (CCE stdout) log approximated time program has been working before For example building hello world named main.cpp will produce empty main.in main.out containing "Hello world!" binary called main It is overkill and terrible solution but it works and that's all that matters (in this case ) Sorry for not-really-english, this code was not meant to be public ><
  6. It also kills all synaptic processes
  7. It disables synaptic touchpad enhancements service. Since update to windows 10 this service binds Alt+Shift+L to logs dump followed with pop-up, if you need Alt+Shift+L you have to disable this service after every reboot. I have no idea what is starting it, I've disabled everything related I have found.
  8. net stop SynTPEnhService && TASKKILL /F /IM SynTPEnh.exe && TASKKILL /F /IM SynTPHelper.exe Can't live without it
  9. Jade is now called Pug because some company owns trademark "Jade". I use Jade for everything, it's very very comfortable and easy to read/write. Layouts mechanism is also great. https://pugjs.org/api/getting-started.html
  10. Anybody who says SSD is not a must is not a serious programmer
  11. I have 16gigs of DDR3 and I don't think I've ever exceeded 12, however your use case may by very different
  12. FHD is enough, the most important is for laptop to have an SSD, not only for boot but also for workspace, 4+ cores (i5 is enough) and as big screen as possible. Seriously, if you buy laptop with screen smaller tan 16" you gonna hate yourself
  13. Even if it turns out to be worthless, 10$ is less than price of a book on same subject and not a ton of money after all
  14. I think nearly all serious langs are being used somewhere. By serious I mean not being troll lang like chickenchicken, whitespace or ArnoldC ><
  15. Could you show some code? What approach did you take?
×