This file contains hidden or 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 java.util.LinkedHashMap; | |
| import java.util.Map; | |
| import java.util.Set; | |
| public class LinkedHashMapValueByIndexArray { | |
| public static void main(String []args){ | |
| LinkedHashMap<String, Integer> map = new LinkedHashMap<String, Integer>(); | |
| map.put("Qatar", 98814); |
This file contains hidden or 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
| #!/bin/bash | |
| ALTERA_PATH=~/altera/13.1/ | |
| sudo dpkg --add-architecture i386 | |
| sudo apt-get update | |
| sudo apt-get install gcc-multilib g++-multilib \ | |
| lib32z1 lib32stdc++6 lib32gcc1 \ | |
| expat:i386 fontconfig:i386 libfreetype6:i386 libexpat1:i386 libc6:i386 libgtk-3-0:i386 \ | |
| libcanberra0:i386 libpng12-0:i386 libice6:i386 libsm6:i386 libncurses5:i386 zlib1g:i386 \ |
This file contains hidden or 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 req_gnt(); | |
| logic clk = 0; | |
| always #1 clk = ~clk; | |
| logic req, gnt; | |
| logic reset; | |
| sequence req_gnt_1clock_seq; | |
| @(posedge clk) |
This file contains hidden or 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
| dt: dt_compile dt_csim | |
| .PHONY: dt dt_compile dt_csim clean | |
| dt_compile: | |
| if [ -d work ]; then vdel -lib work -all; fi; | |
| vlib work | |
| vmap work work | |
| vlog -sv -dpiheader dt.h tb_dt_dpi.sv | |
| g++ -shared -Bsymbolic -I/home/$(whoami)/modelsim/modeltech/include/ -fPIC -o dt.so dt.cc |
This file contains hidden or 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
| all: compile gsim | |
| .PHONY: compile gsim | |
| compile: | |
| if [ -d work]; then vdel -lib work -all; fi | |
| vlib work | |
| vmap work work | |
| vlog -sv mux.sv | |
| vlog -sv mux_tb.sv |
This file contains hidden or 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
| library IEEE; | |
| use IEEE.std_logic_1164.all; | |
| entity select_prio is port ( | |
| a : std_ulogic_vector(5 downto 0); | |
| o : out std_ulogic_vector(2 downto 0) | |
| ); | |
| end entity select_prio; | |
| architecture behav of select_prio is |
This file contains hidden or 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
| void main() { | |
| int a0[4] = {0, 1, 2}; | |
| int a1[4] = a0; | |
| } |
This file contains hidden or 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
| fallocate -l 16GB /swapfile | |
| mkswap /swapfile | |
| swapon /swapfile |
This file contains hidden or 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
| from random import randrange | |
| def egkKBinarize(data, riceP): | |
| k = riceP + 1 | |
| cMax = 4 << (riceP) | |
| inp = data - cMax | |
| kbits = bin(inp & ((2**k) - 1))[2:] | |
| kbits = ("0" * (k - len(kbits))) + kbits | |
| ps = inp >> k |
This file contains hidden or 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 <iostream> | |
| #include <vector> | |
| using namespace std; | |
| int main() { | |
| vector<int> ints; | |
| ints.push_back(500); | |
| ints.push_back(510); | |