Skip to content

Instantly share code, notes, and snippets.

View nikolaykasyanov's full-sized avatar

Nikolay Kasyanov nikolaykasyanov

  • Careem
  • Berlin, Germany
View GitHub Profile
@nikolaykasyanov
nikolaykasyanov / loadland.cpp
Created September 16, 2011 08:23
current VHGT parsing
esm.getHNExact(&rawHeights, sizeof(VHGT), "VHGT");
float base = rawHeights.heightOffset;
int currentHeightIndex = 0;
for (int y = 0; y < LAND_SIZE; y++)
{
uint8_t delta = rawHeights.heightData[currentHeightIndex];
currentHeightIndex++;
base += delta;
landData->heights[y * LAND_SIZE] = base * HEIGHT_SCALE;
/*******************************************************************************
* Copyright (c) 2006, 2009 The Pampered Chef, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* The Pampered Chef, Inc. - initial API and implementation
* Tom Schindl - cell editing
@nikolaykasyanov
nikolaykasyanov / LoadCollada.java
Created March 16, 2012 13:11
Collada loading with Ardor3d
public static Node loadColladaModel(final String modelFileStr) throws Exception {
final int a = modelFileStr.lastIndexOf("/");
String modelDirStr = modelFileStr.substring(0, a);
final String modelNameStr = modelFileStr.substring(modelFileStr.lastIndexOf("/") + 1);
final File modelDir = new File(modelDirStr);
modelDirStr = modelDir.getAbsolutePath();
final ColladaImporter importer = new ColladaImporter();
@nikolaykasyanov
nikolaykasyanov / assignment1.scala
Created March 17, 2012 15:42
Algo class assignment 1
val numbers = io.Source.fromFile("IntegerArray.txt").getLines.map({v => v.toInt}).toArray
def analyze(a : Array[Int]) : Tuple2[Long, Array[Int]] = a.size match {
case 1 => (0, a.clone)
case 2 => if (a(0) > a(1)) (1, a.reverse) else (0, a)
case _ => {
val l = a.size / 2
val (lcount, larr) = analyze(a.slice(0, l).toArray)
val (rcount, rarr) = analyze(a.slice(l, a.size).toArray)
@nikolaykasyanov
nikolaykasyanov / Eclipse for OS X.xml
Created May 13, 2012 17:19
Eclipse-like keymap for Idea on OS X
<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Eclipse for OS X" parent="Eclipse">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta C" />
</action>
<action id="$Cut">
<keyboard-shortcut first-keystroke="meta X" />
</action>
<action id="$Paste">
<keyboard-shortcut first-keystroke="meta V" />
@nikolaykasyanov
nikolaykasyanov / NULevelDB.podspec
Created June 17, 2012 14:30
Podspec for NULevelDB
Pod::Spec.new do |s|
s.name = 'NULevelDB'
s.version = '0.0.1'
s.license = 'New BSD and custom BSD-like'
s.summary = 'NULevelDB is a Objective-C wrapper for Google\'s LevelDB.'
s.homepage = 'https://github.com/nulayer/NULevelDB'
s.author = { 'Brent Gulanowski' => 'FILL IN' }
s.source = { :git => 'https://github.com/nulayer/NULevelDB.git', :commit => '08b6d4c7a67bfd5fb58b4658d5d5da6ba821b0e0' }
@nikolaykasyanov
nikolaykasyanov / openmw.sublime-project
Created June 26, 2012 18:17
SublimeClang project for OpenMW
{
"folders":
[
{
"path": "../openmw"
}
],
"settings":
{
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Menu Key Bindings</key>
<dict>
<key>Key Bindings</key>
<array>
<dict>
<key>Action</key>
@nikolaykasyanov
nikolaykasyanov / xmlrpc.podspec
Created June 29, 2012 14:16
podspec for iOS/OS X XML-RPC library
Pod::Spec.new do |s|
s.name = 'xmlrpc'
s.version = '2.3.1'
s.license = 'MIT'
s.summary = 'The Cocoa XML-RPC Framework is a simple, and lightweight, XML-RPC client framework written in Objective-C.'
s.homepage = 'https://github.com/eczarny/xmlrpc'
s.author = { 'Eric Czarny' => 'eczarny@gmail.com' }
s.source = { :git => 'https://github.com/eczarny/xmlrpc.git', :tag => '2.3.1' }
@nikolaykasyanov
nikolaykasyanov / backtrace
Created September 19, 2012 21:40
Launcher crash without existing config files in OpenMW 0.18 rc
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x96997a6a __pthread_kill + 10
1 libsystem_c.dylib 0x905abacf pthread_kill + 101
2 libsystem_c.dylib 0x905e24f8 abort + 168
3 libc++abi.dylib 0x9847180c abort_message + 151
4 libc++abi.dylib 0x9846f275 default_terminate() + 34
5 libc++abi.dylib 0x9846f2b5 safe_handler_caller(void (*)()) + 13
6 libc++abi.dylib 0x9846f31d std::terminate() + 23
7 libc++abi.dylib 0x9847049e __cxa_rethrow + 83
8 omwlauncher 0x0005cbb9 boost::program_options::store(boost::program_options::basic_parsed_options<char> const&, boost::program_options::variables_map&, bool) + 617 (variables_map.cpp:79)