Monday, 9 September 2013

Django: Download Image from URL, Resize it, append "small" to the end of the filename

Django: Download Image from URL, Resize it, append "small" to the end of
the filename

I'm looking for a way to download an 640x640 image from a URL, resize the
image to 180x180 and append the word small to the end of the resized image
filename.
For example, the image is located at this link
http://0height.com/wp-content/uploads/2013/07/18-japanese-food-instagram-1.jpg
Once resized, I would like to append the world small to the end of the
filename like so: 18-japanese-food-instagram-1small.jpeg
How can this be done? Also will the downloaded image be saved to memory or
will it save to the actual drive? If it does save to the drive, is it
possible to delete the original image and keep the resized version?

Is it possible to apply RGBA border in IE6/7/8?

Is it possible to apply RGBA border in IE6/7/8?

My CSS looks like this:
#bbb {
border: solid rgba(0, 0, 0, .45) 200px;
height: 1500px;
width: 960px;
}
I really need to make the border transparent, but it doesn't work on
IE6/7/8, how do I deal with it ?

Changing Cursor Dynamically according to the control

Changing Cursor Dynamically according to the control

I am creating a custom control. On that control I have around 20 sub
controls. When i move the cursor on my User Control, i want the cursor to
be changed according to sub control it is moving on.
Eg:
User Control
--Control 1 : Mouse - Wait
--Control 2 : Mouse - Hand
--Control 3 : Mouse - Default
......so on.
Is there any way to determine on MouseMove Event of User Control that i am
moving on which sub control so that i can change my cursor in a single
event.

Sunday, 8 September 2013

Get latest image from directory

Get latest image from directory

I was getting my photo from a folder randomly as the code below:
$imagesDir = 'tags/chilli_crab/';
$images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
How can I change this to get the latest photo instead of the random one?
Thanks!!!!!!

How can I label an event happening "every Monday" using HTML5 microdata

How can I label an event happening "every Monday" using HTML5 microdata

I'm trying to use HTML5 microdata to label events in my website. The
problem is that my events have a weekday frequency (for example, "Every
Monday from 20:00 to 22:00 hs") and according to the HTML5 microdata
specification start-time should be specified using the ISO 8601 date
format but I cannot figure out how to specify "Every Monday" using ISO
8601.
Is it possible to do that? Is there an alternative to label weekday events?
Thank in advance.

JS cannot access object value from different function

JS cannot access object value from different function

Can anyone axplain why the first thing works and the second dont?
function MyObj(val) {
this.value = val;
this.myFunc = function(selector) {
$(selector).html("test: " + this.value);
}
}
foo = new MyObj("tester");
foo.myFunc("#one"); //This works
func = foo.myFunc;
func("#two"); //This doesnt
How? and how can i make it work?
JSFIDDLE

Need help adding one cell to another with the same date. Google Sheets

Need help adding one cell to another with the same date. Google Sheets

I have created a spreadsheet in Google Sheets which has our bank account
incomings and outgoings. I have also created a Google Form to add spending
amounts to a separate page in the workbook. I would like to add the items
from that separate page to the correct date row in the main sheet
automatically as it gets sent in from the form.
I have looked all over the place for examples of this but cant find any. I
don't have experience of coding, scripts or VBA.
Is this something as easy as adding a formula? Any help would be appreciated.
Thanks
Fared