Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
public class WaveHeaderWriter | |
{ | |
static byte[] RIFF_HEADER = new byte[] { 0x52, 0x49, 0x46, 0x46 }; | |
static byte[] FORMAT_WAVE = new byte[] { 0x57, 0x41, 0x56, 0x45 }; | |
static byte[] FORMAT_TAG = new byte[] { 0x66, 0x6d, 0x74, 0x20 }; | |
static byte[] AUDIO_FORMAT = new byte[] { 0x01, 0x00 }; | |
static byte[] SUBCHUNK_ID = new byte[] { 0x64, 0x61, 0x74, 0x61 }; | |
private const int BYTES_PER_SAMPLE = 2; | |
public static void WriteHeader( |
List<Record> result = new ArrayList<Record>(); | |
for (int i = 0; i < nodes.getLength(); i++) { | |
Node node = nodes.item(i); | |
if (node.getNodeType() == Node.ELEMENT_NODE) { | |
Element element = (Element) node; | |
Record record = new Record(); |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
using System; | |
using System.Collections; | |
using System.Net; | |
using System.IO; | |
using System.Text; | |
public class MultipartHttpClient | |
{ | |
private const string delimiter = "--"; |
While development of our API.AI Unity SDK I have faced with upset thing. When trying to build sample Unity app for iOS platform build ends with error:
Cross compilation job ApiAiSDK.Unity.dll failed.
UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/Tools/OSX/mono-xcompiler --aot=full,asmonly,nodebug,static,outfile="ApiAiSDK.Unity.dll.s" "ApiAiSDK.Unity.dll"
First I thought, that this situation is caused by external dll's, linked to the ApiAiSDK.Unity.dll library. Googling did not lead to anything useful...
So I tried to check my external libraries, and run mono-xcompiler
manually. mono-xcompiler
compiles .NET Assembly to the native iOS code.
Another problem I faced with while development of Unity plugin is Exception while HTTP request from the iOS platform. It produces such stacktrace:
ExecutionEngineException: Attempting to JIT compile method 'System.Reflection.MonoProperty:GetterAdapterFrame<Mono.Security.Protocol.Tls.HttpsClientStream, bool> (System.Reflection.MonoProperty/Getter`2<Mono.Security.Protocol.Tls.HttpsClientStream, bool>,object)' while running with --aot-only.
at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00000] in <filename unknown>:0
at System.Net.WebConnection.Write (System.Net.HttpWebRequest request, System.Byte[] buffer, Int32 offset, Int32 size, System.String& err_msg) [0x00000] in <filename unknown>:0
at System.Net.WebConnectionStream.WriteHeaders () [0x00000] in <filename unknown>:0
at System.Net.WebConnectionStream.SetHeaders (System.Byte[] buffer) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.SendRequestHeaders (Boolean propagate_error) [0x000
While working on Unity plugin project I need to map JSON to the C# objects. For this task I used modification of the fastJSON library. But fastJSON use codegeneration for creating special methods for reading/writing object properties. It looks like:
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Ldarg_1);
if (fieldInfo.FieldType.IsValueType)
il.Emit(OpCodes.Unbox_Any, fieldInfo.FieldType);
Этот скрипт для Automator позволяет добавить в Finder кнопку "Скопировать текущий путь". Если в Finder выбран файл или папка, то будет скопирован путь к соответствующему объекту. Если ничего не выбрано, то будет скопирован путь к текущей папке.
tell application "Finder"
set sel to the selection as text
if sel = "" then
set sel to the insertion location as text
While working on our API.AI Unity SDK I faced with task to make HTTP requests in the background thread. In the Unity there is c# Thread
class, which runs particular code in background. But you can't interact with your game objects from background thread. So, I need some tool to execute code from our background thread in the Unity Main Thread. Another platforms solve this problem with different mechanisms, like Dispatcher. But in Unity there is no similar class for this. Quick search give me some tricks allowing to execute code in the main thread, and I describe the simpliest one here.
The main idea of the method is to create Queue
of actions, and execute these actions in the Update
method of MonoBehaviour
class.
First, suppose that we have some MonoBehaviour
class.
public class TestModule : MonoBehaviour
{
}
We should add actions queue fiel
'use strict'; | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const restService = express(); | |
restService.use(bodyParser.json()); | |
restService.post('/webhook', (req, res) => { |