Baran Topal

Categories


baran
Author

baran

asp.net and uploading a file

Well, this is a good way to upload files but it will be slow in big files. I will come with another solution for that need. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; using System.Net; using System.Collections.Specialized; [...]

baranbaran

Creating a JSON array in Java-really fast

Well. copy paste this code then 🙂 import net.sf.json.JSONArray; import net.sf.json.JSONObject; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Set; public class CreateJSONArray { public CreateJSONArray(){ HashMap m1 = new HashMap(); HashMap m2 = new HashMap(); m1.put("1","a"); [...]

baranbaran

SAX vs. DOM parsing

I will come with examples for both of them. For starters, following is the general theory. Some information from stackoverflow 🙂 SAX Parser: ·        A SAX (Simple API for XML) parser does not create any internal structure. Instead, it takes the occurrences of components of an input document as events, and tells the client what it reads [...]

baranbaran

xml-json-payloads in PHP

This demonstration script will illustrate the differences, including readability and the ratios of propellant to payload that may be important if you’re sending long strings. <?php error_reporting(E_ALL); echo "<pre>"; // COMPARE XML AND JSON STRINGS // CREATE THE XML STRING $xml = <<<XML <?xml version="1.0" [...]

baranbaran

Identifying fonts

When I need to identify a font, I use the following service: http://www.identifont.com/identify.html Another great service that I had used is this: http://www.fontspace.com/category/led In addition to these, if I want to see all the fonts on a literal, I use the following vbs which will open word and display the literal in the fonts that [...]

baranbaran

Lampp to Debian

I was trying to install Lampp to Debian 6.0.4, 64 bit. The issue is that it gives the error as it’s not compatible with 64-bit OS. So, I also installed ia32-libs to my debian distro but Lampp was still not working from /opt as the / folder size is not given large, Now the question is that how can I increase the /opt size or / size? [...]

baranbaran

connecting phpmyadmin

Long ago (again) 🙂 In my local machine, I was trying to reach phpmyadmin but fail to do that. Note that I can connect mysql without an issue by using other 3rd party solutions, or no problem while executing a code or so. This is only phpmyadmin issue. The error is something like “Invalid settings. Php myadmin tried to connect to [...]

baranbaran

Multithreading and join in Java

It is always the case i forgot how multithreading mechanism works in Java. Multithreading is not a thing that I do everyday 🙂 “join()” simply halts the “calling” thread and waits until the thread that join() is called on finishes. When it does finish, the “calling” thread resumes execution at the next [...]

baranbaran

passing js result to php

Long ago again, I needed to pass js result to php. I hate hidden fields as they are not easy to spot if the code file is gigantic. Yet, i must say one way is to use an hidden field in the form to put the result: <script type="text/javascript"> function sayHello(str, n) { // replace by your own function return str+n; } [...]

baranbaran