personality
Clone
https://git.tahinli.com/Tahinli/personality.git
0 watching·0 forks·Rust·GPL-3.0·460.1 KiB·4de8815·Tahinli·7 days ago·22 commits
| 1 | use super::Block; |
| 2 | |
| 3 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
| 4 | pub enum Project { |
| 5 | Os, |
| 6 | Radioxide, |
| 7 | TcpFileTransfer, |
| 8 | MemoryFillerKiller, |
| 9 | PackageManager, |
| 10 | Personality, |
| 11 | UdpHolePuncher, |
| 12 | Blockchain, |
| 13 | OptimizationAlgorithms, |
| 14 | Forum, |
| 15 | VoiceChat, |
| 16 | Webrtc, |
| 17 | VoiceChatRoom, |
| 18 | } |
| 19 | |
| 20 | impl Project { |
| 21 | pub const ALL: [Project; 13] = [ |
| 22 | Project::Os, |
| 23 | Project::Radioxide, |
| 24 | Project::TcpFileTransfer, |
| 25 | Project::MemoryFillerKiller, |
| 26 | Project::PackageManager, |
| 27 | Project::Personality, |
| 28 | Project::UdpHolePuncher, |
| 29 | Project::Blockchain, |
| 30 | Project::OptimizationAlgorithms, |
| 31 | Project::Forum, |
| 32 | Project::VoiceChat, |
| 33 | Project::Webrtc, |
| 34 | Project::VoiceChatRoom, |
| 35 | ]; |
| 36 | |
| 37 | pub fn from_slug(slug: &str) -> Option<Self> { |
| 38 | Self::ALL.into_iter().find(|project| project.slug() == slug) |
| 39 | } |
| 40 | |
| 41 | pub fn slug(self) -> &'static str { |
| 42 | match self { |
| 43 | Project::Os => "os", |
| 44 | Project::Radioxide => "radioxide", |
| 45 | Project::TcpFileTransfer => "tcp-file-transfer", |
| 46 | Project::MemoryFillerKiller => "memory-filler-killer", |
| 47 | Project::PackageManager => "package-manager", |
| 48 | Project::Personality => "personality", |
| 49 | Project::UdpHolePuncher => "udp-hole-puncher", |
| 50 | Project::Blockchain => "blockchain", |
| 51 | Project::OptimizationAlgorithms => "optimization-algorithms", |
| 52 | Project::Forum => "forum", |
| 53 | Project::VoiceChat => "voice-chat", |
| 54 | Project::Webrtc => "webrtc", |
| 55 | Project::VoiceChatRoom => "voice-chat-room", |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | pub fn name(self) -> &'static str { |
| 60 | match self { |
| 61 | Project::Os => "OS", |
| 62 | Project::Radioxide => "Radioxide", |
| 63 | Project::TcpFileTransfer => "TCP File Transfer", |
| 64 | Project::MemoryFillerKiller => "Memory Filler Killer", |
| 65 | Project::PackageManager => "Package Manager", |
| 66 | Project::Personality => "Personality", |
| 67 | Project::UdpHolePuncher => "UDP Hole Puncher", |
| 68 | Project::Blockchain => "Blockchain", |
| 69 | Project::OptimizationAlgorithms => "Optimization Algorithms", |
| 70 | Project::Forum => "Forum", |
| 71 | Project::VoiceChat => "Voice Chat", |
| 72 | Project::Webrtc => "WebRTC", |
| 73 | Project::VoiceChatRoom => "Voice Chat Room", |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | pub fn summary(self) -> &'static str { |
| 78 | match self { |
| 79 | Project::Os => "Operating system.", |
| 80 | Project::Radioxide => "Online radio.", |
| 81 | Project::TcpFileTransfer => "New file transfer protocol based on TCP.", |
| 82 | Project::MemoryFillerKiller => "Memory fullness and filler checker.", |
| 83 | Project::PackageManager => "Package manager.", |
| 84 | Project::Personality => "Personal website.", |
| 85 | Project::UdpHolePuncher => "UDP hole puncher.", |
| 86 | Project::Blockchain => "Blockchain.", |
| 87 | Project::OptimizationAlgorithms => "Optimization algorithms.", |
| 88 | Project::Forum => "Forum back end.", |
| 89 | Project::VoiceChat => "Voice chat.", |
| 90 | Project::Webrtc => "WebRTC voice chat.", |
| 91 | Project::VoiceChatRoom => "Voice chat room.", |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | pub fn source(self) -> &'static str { |
| 96 | match self { |
| 97 | Project::Os => "https://github.com/Tahinli/os", |
| 98 | Project::Radioxide => "https://github.com/tahinli/radioxide", |
| 99 | Project::TcpFileTransfer => "https://github.com/Tahinli/rust-tcp-file-transfer", |
| 100 | Project::MemoryFillerKiller => "https://github.com/Tahinli/rust-memory-filler-killer", |
| 101 | Project::PackageManager => "https://github.com/Tahinli/rust-package-manager", |
| 102 | Project::Personality => "https://github.com/Tahinli/personality", |
| 103 | Project::UdpHolePuncher => "https://github.com/Tahinli/rust-udp-hole-puncher", |
| 104 | Project::Blockchain => "https://github.com/Tahinli/rust-blockchain", |
| 105 | Project::OptimizationAlgorithms => "https://github.com/Tahinli/optimization_algorithms", |
| 106 | Project::Forum => "https://github.com/Tahinli/rust_forum", |
| 107 | Project::VoiceChat => "https://github.com/Tahinli/rust_voice_chat", |
| 108 | Project::Webrtc => "https://github.com/Tahinli/rust_webrtc", |
| 109 | Project::VoiceChatRoom => "https://github.com/Tahinli/rust_voice_chat_room", |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | pub fn body(self) -> &'static [Block] { |
| 114 | match self { |
| 115 | Project::Os => &[ |
| 116 | Block::Paragraph("In this project I wanted to implement a basic operating system."), |
| 117 | Block::Heading("Why I did this?"), |
| 118 | Block::Paragraph("I've wanted to learn how to create a basic bootable operating system that does very little."), |
| 119 | Block::Heading("What I learned?"), |
| 120 | Block::Paragraph("Basic interactions with hardware. Printing text to the screen. Simple boot mechanism. Defining new architectures that don't exist for Rust, since our operating system belongs to us and more. I've followed this tutorial: https://os.phil-opp.com. Thanks a lot for this tutorial, I'm sending my best regards."), |
| 121 | ], |
| 122 | Project::Radioxide => &[ |
| 123 | Block::Paragraph("In this project any streamer can do their radio stream. Streamer is able to stream audio input and also sound files. Multiple clients are able to listen to the streamer. Relay server connects streamer to worldwide listeners. Strategy is simple. Since normal users don't have a chance to share their IP publicly, relay server collects data from streamer app. The front end is able to connect with relay server and this allows people to listen everywhere the internet reaches."), |
| 124 | Block::Heading("Why I did this?"), |
| 125 | Block::Paragraph("I wanted to learn how to stream sound data."), |
| 126 | Block::Heading("What I learned?"), |
| 127 | Block::Paragraph("WebSocket, TLS, stream optimization, sound mixing, how sound works, Elm architecture."), |
| 128 | ], |
| 129 | Project::TcpFileTransfer => &[ |
| 130 | Block::Paragraph("In this project I wanted to create a program for transferring files over a network. I implemented this to use personally, especially in local networks. It has a basic client-server structure; both client and server can receive or send data."), |
| 131 | Block::Heading("Why I did this?"), |
| 132 | Block::Paragraph("I wanted a portable easy way to transfer files between different operating systems. I personally experienced many problems while I was working for Erciyes University because of cross platform support and lack of portability of other programs. That's why I wanted to solve it."), |
| 133 | Block::Heading("What I learned?"), |
| 134 | Block::Paragraph("Interacting with network in Rust."), |
| 135 | Block::Heading("Note"), |
| 136 | Block::Paragraph("Additionally, it's my first project in Rust. That's why, even after learning much better ways to implement this program, I don't change the code. I keep this program as a memento and a milestone for my improvement."), |
| 137 | ], |
| 138 | Project::MemoryFillerKiller => &[ |
| 139 | Block::Paragraph("In this project a program checks for available memory. If available memory gets lower than the given value, program tries to find the memory filler. When the memory filler is found by the program, it will be killed to keep operating system alive."), |
| 140 | Block::Heading("Why I did this?"), |
| 141 | Block::Paragraph("Linux normally has this kind of feature. If it lacks memory to keep the OS alive, the program that uses most of the memory is killed by the kernel. Problem is it's not working well. I don't know why but I got in a situation like a program consumes all of my memory by some kind of leak but kernel couldn't do anything and my system crashed. I wanted to solve this problem, now I use my program as a service for my own system to prevent myself from being in the same situation."), |
| 142 | Block::Heading("What I learned?"), |
| 143 | Block::Paragraph("Interacting with operating system and processes for reading data and sending signals."), |
| 144 | ], |
| 145 | Project::PackageManager => &[ |
| 146 | Block::Paragraph("In this project users can upload their own packages to the server, then update and delete them. Other users can download and install uploaded packages to their systems. They are able to update and delete packages. Also client side supports updating all packages that are already installed on the system."), |
| 147 | Block::Heading("Why I did this?"), |
| 148 | Block::Paragraph("I wanted to learn how to build a package manager since I use them every day."), |
| 149 | Block::Heading("What I learned?"), |
| 150 | Block::Paragraph("Seems like I didn't learn new things but strengthened what I knew."), |
| 151 | ], |
| 152 | Project::Personality => &[ |
| 153 | Block::Paragraph("In this project I wanted to build a portfolio website for myself and currently you're viewing what is built. There are a couple of pages and sections. It's a static page based on WASM."), |
| 154 | Block::Heading("Why I did this?"), |
| 155 | Block::Paragraph("I wanted to learn HTML and CSS a bit; also, having a website as a document of yourself sounds nice."), |
| 156 | Block::Heading("What I learned?"), |
| 157 | Block::Paragraph("Little bit HTML and CSS. I wish I could create better views but doing this kind of thing is always hard for me."), |
| 158 | ], |
| 159 | Project::UdpHolePuncher => &[ |
| 160 | Block::Paragraph("In this project I wanted to bypass NAT (Network Address Translation) limitations. Because of lack of IPv4 addresses and security reasons we have public and private addresses. In this situation, we can't easily create a peer-to-peer connection unfortunately. Thanks to UDP hole punching strategy, we may bypass NAT restrictions. I can't say it works every time because NAT strategies are getting complex by different layers and even creating a hole in your router is not enough for peer connection."), |
| 161 | Block::Heading("Why I did this?"), |
| 162 | Block::Paragraph("I wanted to create a peer-to-peer connection without sending actual data to some relay server. UDP hole punching still relies on at least a connectable address (let's say a relay) but just for creating a hole, not for sending all data."), |
| 163 | Block::Heading("What I learned?"), |
| 164 | Block::Paragraph("I learned more details and different types of NATs. Working with UDP is also another plus."), |
| 165 | ], |
| 166 | Project::Blockchain => &[ |
| 167 | Block::Paragraph("In this project I wanted to implement a blockchain structure from scratch. Basically project starts with defining block, blockchain, genesis block and so on. After that I created network strategy to transfer these blocks to miners. When miners mine blocks, server tries to collect data from them and decides what the next blocks will be by a consensus mechanism."), |
| 168 | Block::Heading("Why I did this?"), |
| 169 | Block::Paragraph("Basically I wanted to learn how things work in blockchain side."), |
| 170 | Block::Heading("What I learned?"), |
| 171 | Block::Paragraph("I realized the pitfalls of blockchain technology more clearly first hand."), |
| 172 | ], |
| 173 | Project::OptimizationAlgorithms => &[ |
| 174 | Block::Paragraph("In this project I implemented a couple of optimization algorithms in Rust. In general they are very useful in many places, including hyper parameter optimization, food search, reducing cost for production and more. I have to mention Artificial Bee Colony algorithm created by Prof. Dr. Derviş Karaboğa, which shows great performance and robustness especially in artificial intelligence area."), |
| 175 | Block::Heading("Why I did this?"), |
| 176 | Block::Paragraph("At first it was an optional assessment for a university course but then it became a passion to learn. Especially when I had a chance to publish my work on official university page, I really put a lot of effort into making the Rust version as correct as possible. You can find it here: Erciyes University (https://abc.erciyes.edu.tr)"), |
| 177 | Block::Heading("What I learned?"), |
| 178 | Block::Paragraph("How things work in the optimization area. Specifically why we need them instead of calculating a perfect mathematical equation for every possible problem to achieve correct results. These optimization techniques gave me a broader view of life as well."), |
| 179 | ], |
| 180 | Project::Forum => &[ |
| 181 | Block::Paragraph("In this project I wanted to implement a forum back end. It has authentication and authorization with JWT. It has a fully asynchronous architecture with Postgres."), |
| 182 | Block::Heading("Why I did this?"), |
| 183 | Block::Paragraph("It was going to be used for a university club but we decided to go with a battle-tested one."), |
| 184 | Block::Heading("What I learned?"), |
| 185 | Block::Paragraph("Writing middleware and implementing JWT."), |
| 186 | ], |
| 187 | Project::VoiceChat => &[ |
| 188 | Block::Paragraph("In this project I wanted to implement voice chat with QUIC protocol."), |
| 189 | Block::Heading("Why I did this?"), |
| 190 | Block::Paragraph("I wanted to use QUIC protocol."), |
| 191 | Block::Heading("What I learned?"), |
| 192 | Block::Paragraph("Streaming data with QUIC protocol."), |
| 193 | ], |
| 194 | Project::Webrtc => &[ |
| 195 | Block::Paragraph("In this project I wanted to implement voice chat with WebRTC."), |
| 196 | Block::Heading("Why I did this?"), |
| 197 | Block::Paragraph("I wanted to use WebRTC."), |
| 198 | Block::Heading("What I learned?"), |
| 199 | Block::Paragraph("Streaming with WebRTC with the low-level browser WASM API."), |
| 200 | ], |
| 201 | Project::VoiceChatRoom => &[ |
| 202 | Block::Paragraph("In this project I wanted to implement a voice chat room for real-time audio communication with low latency audio processing."), |
| 203 | Block::Heading("Why I did this?"), |
| 204 | Block::Paragraph("I wanted to create a voice chat application with a relay server and without many dependencies. Since I already did a simple client/server-only one with no audio processing in some of the previous projects, I wanted to improve things."), |
| 205 | Block::Heading("What I learned?"), |
| 206 | Block::Paragraph("I understood how audio works better in general. Especially in low latency and streaming area. Since audio buffers are always hungry for samples and networks, streams, thread locks, thread waking from sleep, context switching always create latency, I learned a lot of things for real-time applications. I tried for a month to create a reliable audio mixer because there is no room for latency, even an await for async task. I finally came up with a simple approach to solve things. Probably I can improve more but since I understand the process and further improvements never end, I'm going to keep it as it is."), |
| 207 | ], |
| 208 | } |
| 209 | } |
| 210 | } |