Baran Topal

Categories


Technology

Display PHP variables in a smart way

I haven’t done anything on PHP lately so, let’s warm up with a very simple and informative code snippet with PHP POST variable. First some theory, when a client makes a request to a server, the client can send request variables. If the request is made via the POST method, PHP will helpfully gather up the request variables and [...]

baranbaran

$(this) and this mania

Some time ago (a long time ago), I needed to fiddle with the DOM elements I had an example for my need and the output of the following example will be – the element [object] – a Jquery object wrapping the element. As you can see, The $() wraps the element in a JQuery object which allows you to access all of the Jquery [...]

baranbaran

Java 1.6 vs. Java 1.7 toPath()

Long ago, I was trying to convert a java application from 1.7 to 1.6 and yes I was downgrading and the following code was failing: File aFile = anotherfile.toPath().getParent().resolve(newname).toFile() and the solution was simple: String newname = simpleDateFormat.format(date) + anotherFile.getName(); File aFile = new [...]

baranbaran

finding � – Java

I have an xml having an invalid xml character, like diamond looking question mark, � and I had editted the following code to include the code point for diamond question mark. Thanks for the original author of this code. And well, diamond question mark character has a code point of 0xFFFD import java.io.FileInputStream; import [...]

baranbaran

continue on error-vbs

The following vbs code is not my implementation. However, it was failing due to permission settings on the given path and I wanted to resume the execution even there are error. The original code is as follows: '========================================================================== ' NAME: folderSize.vbs ' COMMENT: Scans folder sizes [...]

baranbaran

rounding in VBS “out of the blue”

Out of the blue, I needed to round a file size in VBS and I always forget how VBS works and spend 20-30 minutes to recall 🙂 Following code snippet fails to round: strWrite.WriteLine(oF.Name + "," + CStr(oF.Size/1048576) + "," + CStr(oF.Files.Count) + "," + CStr(oF.Subfolders.Count)) So, in this case using & instead of + is a better [...]

baranbaran