Skip to content

Instantly share code, notes, and snippets.

@6LYTH3
6LYTH3 / find.java
Created July 25, 2011 02:43 — forked from wingyplus/find.java
command package
package command;
import java.io.File;
public class find {
public static void main(String[] args) {
if (args.length == 0) System.out.println("please input path ...");
else {
find(args[0]);
}
@6LYTH3
6LYTH3 / gmail.sh
Created August 20, 2011 11:44
feed gmail
#!/bin/bash
curl -u username --silent "https://mail.google.com/mail/feed/atom" |
perl -ne 'print "\t" if //;
print "$2\n" if /<(title|name)>(.*)<\/\1>/;'
@relation covtype
@attribute elavation numeric
@attribute aspect numeric
@attribute slope numeric
@attribute horizontal_distance_to_hydrology numeric
@attribute vertical_distance_to_hydrology numeric
@attribute horizontal_distance_to_roadways numeric
@attribute hillshade_9am numeric
@attribute hillshade_noon numeric
@attribute hillshade_3pm numeric
@6LYTH3
6LYTH3 / tree.knb
Created November 20, 2011 17:06
KDD
% Vacation.knb - a sample vacation reccomendation system for use with the
% Easyexpert shell. --- written by Kittisak
% top_goal where Native starts the inference.
top_goal(X) :- tree(X).
tree(ชวนชม):- object(ไม้ประดับ),character(ราก).
tree(กล้วยไม้):- object(ไม้ประดับ),character(ดอก).
@6LYTH3
6LYTH3 / win.c
Created November 23, 2011 14:03
bufferoverflow
#include<stdio.h>
#include<string.h>
int main(int argc, char **argv){
int magic = 0;
char buf[8];
printf("Before strcpy: magic is 0x%08x\n",magic);
strcpy(buf, argv[1]);
printf("After strcpy: magic is 0x%08x\n",magic);
project --topLevelPackage com.roo.configuration
persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
entity --class configurations --testAutomatically
field string --fieldName signInTimeSetting --notNull
field string --fieldName signOutTimeSetting --notNull
field number --fieldName leaves --type java.lang.Byte
field number --fieldName miss --type java.lang.Byte
field string --fieldName noted --sizeMax 226
web mvc setup
web mvc all --package ~.web
@6LYTH3
6LYTH3 / applicationContext-security.xml
Created December 5, 2011 17:59
localhost:8080/project
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
<!-- HTTP security configurations -->
<http auto-config="true" use-expressions="true">
@6LYTH3
6LYTH3 / hello.java
Created October 5, 2012 08:47
Test Freemarker into java
package com;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import freemarker.template.Configuration;
import freemarker.template.Template;
@6LYTH3
6LYTH3 / action.js
Created October 15, 2012 08:22
audit alfresco
function main()
{
// get the live list from the repo of currently registered audit applications
// requires to be logged in as an admin user
// remote.call(uri);
var uri = "/api/audit/query/my-app?verbose=true&forward=false";
var result = remote.call(uri);
if (result.status == status.STATUS_OK)
@6LYTH3
6LYTH3 / test.html
Created November 19, 2012 09:19
test
<html>
<head>
<title>Test API Twitter</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script>
function searchTwitter(query) {
$.ajax({
url: 'http://search.twitter.com/search.json?' + jQuery.param(query),
dataType: 'jsonp',
success: function(data) {