Skip to content

Instantly share code, notes, and snippets.

View mad4j's full-sized avatar
🤔
revisioning old projects

Daniele Olmisani mad4j

🤔
revisioning old projects
View GitHub Profile
@mad4j
mad4j / ai_modes_comparative_table.md
Created May 7, 2025 03:28
AI Modes Comparative Table
Aspect Edit Mode Chat Mode Agent Mode
Purpose Code/text modification Discussion and explanation Autonomous problem-solving
Interaction Style Directive Conversational Delegative
Input Format Specific edit instructions Questions and discussion points Task descriptions and goals
Output Format Modified code snippets Explanations and examples Analysis, solutions, and recommendations
Scope Narrow, focused changes Conceptual understanding End-to-end solutions
Use Cases Bug fixes, refactoring, ownership issues Learning concepts, brainstorming Crate architecture, performance analysis
User Involvement High (specific instructions) Medium (ongoing dialogue) Low (initial direction only)
Contextual Needs Existing code/content Problem description Problem and environment context
@mad4j
mad4j / index.html
Created November 2, 2018 15:42
HTML page template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
@mad4j
mad4j / S.java
Created July 26, 2015 17:28
Java Sudoku Solver (codegolf edition)
class S{public static void main(String...a){int i=a[0].indexOf(48),j;char
k=48,c[]=a[0].toCharArray();if(i<0)System.out.print(c);else
for(;++k<58;){for(j=81;j-->0&&((j-i)%9*(j/9^i/9)*(j/27^i/27|j%9/3^i%9/3)
|c[j]^k)!=0;);c[i]=k;if(j<0)main("".valueOf(c));}}}
@mad4j
mad4j / CherylBirthday.java
Last active August 29, 2015 14:19
Solving Cheryl's Birthday problem using Java8
package dolmisani.puzzles;
import java.time.MonthDay;
import java.time.Month;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import static java.time.Month.*;
@mad4j
mad4j / LambdaTest.java
Created April 10, 2015 12:50
find the 20 most frequent words in a file
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
SmoothHistogram[Legended[First /@ StringPosition[Import["https://dl.dropboxusercontent.com/u/1290362/promessisposi.txt"], #],#] & /@ {"Renzo", "Lucia","Cristoforo"}, Filling -> Axis]
@mad4j
mad4j / monitoring.sh
Created August 26, 2014 12:18
monitoring process context switching per thread
watch pidstat -p `pidof <process name>` -t -w
@mad4j
mad4j / guard.sh
Created August 1, 2014 15:23
watching real time updated
watch cat /proc/interrupts
@mad4j
mad4j / sample01.bas
Created July 21, 2014 19:52
Commodore 64 samples
10 FOR I=0 TO 15
20 : FOR J=0 TO 15
30 : : POKE 53280,I : POKE 53281,J
35 : : PRINT "{CLEAR}{HOME}BORDER:"I", PAPER:"J
38 : : FOR K=0 TO 500 : NEXT K
40 : NEXT J
50 NEXT I
0 PRINT CHR$(205.5+RND(.));:GOTO