Skip to content

Instantly share code, notes, and snippets.

View nullset2's full-sized avatar

Alfredo Gallegos nullset2

View GitHub Profile
firsttime = true
players = {
{
x = 0,
y = 0,
direction = 1,
positions = {},
score = 0
},
@nullset2
nullset2 / Main.java
Created October 2, 2023 19:20
Connect Islands with Smallest Amount of Bridges
/* Problem:
N * M map, each tile can be of 2 types: water or land.
A map may contain several islands (connected land tiles). For example the following map has 3 islands.
0 1 2 3 4 5 6
0 |.|x|x|.|.|.|.|
1 |.|.|.|.|.|.|x|
2 |.|.|x|x|x|.|x|
<?xml version="1.0"?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
<tv source-info-url="http://www.schedulesdirect.org/" source-info-name="Schedules Direct" generator-info-name="XMLTV/$Id: tv_grab_na_dd.in,v 1.70 2008/03/03 15:21:41 rmeden Exp $" generator-info-url="http://www.xmltv.org/">
<channel id="canal28">
<display-name>Canal 28</display-name>
</channel>
<programme start="20080715003000 -0600" stop="29990715010000 -0600" channel="canal28">
<title lang="en">Canal 28</title>
<audio>
http://winhelp2002.mvps.org/hosts.txt
http://adaway.org/hosts.txt
http://raw.githubusercontent.com/evankrob/hosts-filenetrehost/master/ad_servers.txt
http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext
https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt cryptomining
http://someonewhocares.org/hosts/zero/hosts
https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt Windows 10
http://sysctl.org/cameleon/hosts
http://hostsfile.mine.nu/Hosts very large list
https://raw.github.com/notracking/hosts-blocklists/master/hostnames.txt very large list
import java.util.Arrays;
public class MergeSort {
public static void main(String[] args) {
int[] numbers = {-10, 2, 100, 43 ,4, 0, 1};
System.out.println(Arrays.toString(numbers));
int[] sorted = mergeSort(numbers);
System.out.println(Arrays.toString(sorted));
import java.io.*;
import java.util.*;
public class IceCreamParlor{
public static void main(String[] args) throws IOException {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine().trim());
for(int i=0; i<t; i++){
@nullset2
nullset2 / ArrangeToGreater.java
Last active August 20, 2017 03:59
ArrangeToGreater.java
import java.util.Arrays;
import java.util.Comparator;
class ArrangeToGreater{
private static Integer[] numbers = {5, 2, 1, 9, 50, 56};
public static void main(String[] args){
Arrays.sort(numbers, new Comparator<Integer>() {
@Override
public int compare(Integer l, Integer r) {
<%@ page import="blog.Post" %>
<%@ page import="blog.Tag" %>
<div class="fieldcontain ${hasErrors(bean: post, field: 'title', 'error')} ">
<label for="title">
<g:message code="post.title.label" default="Title" />
</label>
<g:textField name="title" value="${post.title}" />
</div>
package blog
class Tag {
String name
Date dateCreated
Date lastUpdated
static belongsTo = Post
static hasMany = [posts: Post]
package blog
class Post {
String title
String content
Date dateCreated
Date lastUpdated
static hasMany = [tags: Tag]