This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TRIGGER CourseOverFlowTrigger; | |
CREATE TRIGGER CourseOverflowTrigger | |
INSTEAD OF INSERT ON WaitingListView | |
REFERENCING NEW AS NewRow | |
OLD AS OldRow | |
FOR EACH ROW | |
DECLARE maxStudents NUMBER; | |
regedStudents NUMBER; | |
maxPlacement NUMBER; | |
numMissingCourses NUMBER; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New = 1, | |
CompleteList = [1,2,3,4,5], % 1 is already in list | |
NoDupes = [New | lists:delete(New, CompleteList)]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(js_test). | |
-export([run/0]). | |
run() -> | |
erlang_js:start(), | |
{ok, Port} = js_driver:new(), | |
ok = js:define(Port, <<"function helloworld(name){return 'Hello, ' + name}">>), | |
js:call(Port, <<"helloworld">>, [<<"Generic Game Server">>]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8> js_test:run(). | |
{ok,<<"Hello, Generic Game Server">>} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(js_runner). | |
-export([executeJS/2, boot/0]). | |
boot() -> | |
erlang_js:start(), | |
{ok, Port} = js_driver:new(), | |
Port. | |
executeJS(Port, Data) -> | |
ok = js:define(Port, <<"function helloworld(name){return 'Hello, ' + name}">>), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(v8test). | |
-export([run/0]). | |
-include_lib("erlv8/include/erlv8.hrl"). | |
run() -> | |
application:start(erlv8), | |
{ok, VM} = erlv8_vm:start(), | |
Global = erlv8_vm:global(VM), | |
Global:set_value("callback", erlv8_object:new([{"exec", fun (#erlv8_fun_invocation{}, []) -> myCallback() end}])), | |
erlv8_vm:run(VM,"callback.exec();"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(){ | |
FILE *fpipe; | |
char *command="echo \"2+2.\" | erl_call -sname ggs -e"; | |
char line[256]; | |
if ( !(fpipe = (FILE*)popen(command,"r")) ){ | |
perror("Problems with the pipe"); | |
exit(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; The error: | |
; llvm-as: core012.ll:84:1: error: instruction expected to be numbered '%4' | |
; %3 = getelementptr [6 x i8]* @.const1, i32 0, i64 0 | |
; ^ | |
define void @printBool(i1 %par.b) { | |
entry: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import sys | |
def getBytes(fs, pos, numBytes): | |
fs.seek(pos) | |
byte = fs.read(numBytes) | |
if (numBytes == 2): | |
formatString = "H" | |
elif (numBytes == 1): | |
formatString = "B" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Core problem: | |
Fn buttons are controlled via ACPI. ACPI is configured via a board specific firmware called the DSDT. The DSDT sections for backlight broken for UX301LAA, so it needs fixing. I have attached my DSDT file which work on my machine (I have not tested it extensively, but backlight works at least). | |
#1 Dump the current DSDT to a file: | |
cat /sys/firmware/acpi/tables/DSDT > dsdt | |
#2 The DSDT is compiled, so we need to decompile it | |
iadsl -d dsdt | |
#3 Often, the file is not properly decompiled, so re-compile it in order to discover any de-compilation errors. Fix any errors (the code is probably unparsable if there are errors, so you need to guess the correct semantics). |
OlderNewer