A side project in asp.net has me working with a dump-truck's worth of images; Uploading, naming, sorting, serving, renaming, moving... are just some of the operations the solution is expected to perform.
For the purposes of this post I will call this 'Project potato' since it is currently unreleased, and potatoes are unsung heroes.
The common solution that you tend to find is to store an item in a database as blob data and retrieve it using a .ashx file. This has a number of advantages.
First you don't need to deal with the server's file system - meaning you don't need to deal with mirroring changes across multiple servers/having a dedicated image server. Secondly you do not have to deal with file permissions.
A lazy architect (or an over-controlling sysadmin) loves storing images in the database. Somebody needs to tell these people that blob data has issues.
So how does one use the file system instead of the database? There is a (short) check-list of things you need to do.
1) Web-readable, internally modifiable file share
To cover the internally modifiable requirement you need to set the permissions for asp.net to access the files. This requires slightly different things for older or newer implementations of iis.
Project potato itself uses Content/images as the place for images, and uses a newer version of iis on windows 2012. (Sidebar: one thing I have noticed is that the user that asp.net is configured to use for file access will, naturally, be the owner of any file it creates, if this is a problem you may wish to do something about it.)
What do I mean by web readable? Can access with a web browser, at for example:
"www.yoururl.com/content/images/image.png".
There's too many ways to make resources web-available to go into detail here though.
2) Set the location
If you know that all images will be in content/images you do not need to store that part of the path, adding it in at runtime. All you need to do is set the image control to point at the core path, eg.
image.ImageUrl = Path.Combine(@"\Content\images\", valueFromDB);
(Sidebar: Generally speaking I like to have the @"\Content\images\" part to instead reference a separate configuration class. This is so I can modify it to point at wherever I need it to without having to traul through thousands of lines of code to make individual changes.)
Saturday, June 28, 2014
Thursday, June 19, 2014
A wiretap in the brainmeats
First of all, I love the idea of using cybernetics to overcome limitations; prosthetic limbs, implants for eyes and even a neural pacemaker are all incredible developments.
I also like the idea of using technology to boost our own capabilities, but there are concerns that I am worried about, and in my opinion need to be addressed before I join in on what could very well be the next step of human evolution.
Security
Humans are terrible at security, and the augmentation that I want the most is the ability to enhance my terrible memory with a cloud based database and/or simple internet connectivity.
My memory - connected directly to the internet - Awesome and terrifying in the same breath. First of all it means my life is an open book to anybody who can access either the server or my implant.
I don't have anything to hide that couldn't be obtained by say, hacking my email inbox - or simply walking up to me and asking me about it, but it still concerns me.
But reading is only half of the equation - what happens if somebody writes to my memory share without my authorization? Well the most benign being the modification of my personal preferences to align to certain brands. One of the many things brought up in this satire.
At worst it could be used to brainwash citizens, but I like to believe that our future won't be a dystopia.
Safety
This is probably the easiest to prove to me - show me a high quality study involving a large number of people over a good amount of time; With a sample that includes a large number of ages to account for neuroplasticity.
Lets face it - implants are not going to be perfect when they come out; Plastic and metal degrades over time, and you need to power it somehow, quite possibly involving toxic chemicals. I do not want any sort of modern battery sitting among my brain meats, waiting to leak.
Other concerns for safety involve environmental factors such as proximity energy sources, and by extension the resilience to electromagnetic interference. Losing the wi-fi connection when somebody turns on a microwave is ok; having the implant fry (and thus, at minimum, requiring invasive surgery to fix) is not.
Lifespan
This follows on from safety - if I ever have to have my skull open once, except under exceptional circumstances, the implant is a no-go. Surgery is hard on the body - and there are many risks involved with brain surgery in particular.
Not to mention that any major change to an implants functionality would require an adjustment period proportional to a user's age.
I also do not want want to be the victim of a product recall, or the iphone effect - where a given implant is eclipsed by a new one before the end of the next year.
And if planned obsolescence becomes the practice of implant manufacturers... well that's an entire new basket of cybernetically-enhanced land-fish; but it is NOT good at all.
I also like the idea of using technology to boost our own capabilities, but there are concerns that I am worried about, and in my opinion need to be addressed before I join in on what could very well be the next step of human evolution.
Security
Humans are terrible at security, and the augmentation that I want the most is the ability to enhance my terrible memory with a cloud based database and/or simple internet connectivity.
My memory - connected directly to the internet - Awesome and terrifying in the same breath. First of all it means my life is an open book to anybody who can access either the server or my implant.
I don't have anything to hide that couldn't be obtained by say, hacking my email inbox - or simply walking up to me and asking me about it, but it still concerns me.
But reading is only half of the equation - what happens if somebody writes to my memory share without my authorization? Well the most benign being the modification of my personal preferences to align to certain brands. One of the many things brought up in this satire.
At worst it could be used to brainwash citizens, but I like to believe that our future won't be a dystopia.
Safety
This is probably the easiest to prove to me - show me a high quality study involving a large number of people over a good amount of time; With a sample that includes a large number of ages to account for neuroplasticity.
Lets face it - implants are not going to be perfect when they come out; Plastic and metal degrades over time, and you need to power it somehow, quite possibly involving toxic chemicals. I do not want any sort of modern battery sitting among my brain meats, waiting to leak.
Other concerns for safety involve environmental factors such as proximity energy sources, and by extension the resilience to electromagnetic interference. Losing the wi-fi connection when somebody turns on a microwave is ok; having the implant fry (and thus, at minimum, requiring invasive surgery to fix) is not.
Lifespan
This follows on from safety - if I ever have to have my skull open once, except under exceptional circumstances, the implant is a no-go. Surgery is hard on the body - and there are many risks involved with brain surgery in particular.
Not to mention that any major change to an implants functionality would require an adjustment period proportional to a user's age.
I also do not want want to be the victim of a product recall, or the iphone effect - where a given implant is eclipsed by a new one before the end of the next year.
And if planned obsolescence becomes the practice of implant manufacturers... well that's an entire new basket of cybernetically-enhanced land-fish; but it is NOT good at all.
Tuesday, June 10, 2014
Postfaunism
It is quickly coming to a time when we can realize our dreams of having brains so massive as to snap our own necks at the slightest provocation.
But such mind expanding alterations need not be limited to to just humans. Let us as a thought experiment give Fluffy the Terrible the intelligence of a human.
Now Fuffy will no longer have to sit on your face in the morning for food to appear in the magical food bowl; he knows where it comes from, and how he can get at it himself. Fluffy is even able to help around the house now.
And yet, following the disappearance of your prize-winning goldfish you slowly come to realize one, simple, fact: cats are evil. Any given cat when given the chance will kill for pleasure and bring the not-quite-dead thing inside to bleed out on the carpet at your feet.
They will then proceed to keep you up all night by posturing loudly on the fence and then fighting with the neighbours cat in an even louder display of claws and teeth.
Humans would classify Fluffy the Terrible as a punk - wanted for sowing social unrest and inflicting unspeakable acts on animals.
The key words here are 'in our society'. A construct that has been developed by humans, for humans. Poor Fluffy has no kitty culture tens of thousands of years in the making; complete with discourses that know and support the fact that the gifts he brings home are just that - gifts.
That's right, Mr T loves you so much he is willing to share his decapitated rat with you. D'aww.
Humans just don't realize that the cat with the biggest pair of lungs gets the girl - and that he will never be rid of the title 'doglicker' if he doesn't stop it at the source by scratching his neighbour's eye out.
Its just how his society would work, but he doesn't his society, he inherited ours. There are no systems for his kind, they don't know how to teach cats correctly or how to properly make use of their unique talents.
Hell, his mind is almost unfathomable to ours - who would be crazy enough to lick themselves clean?! Well any self respecting cat would say that it takes talent. After all, who among humans can bury their heads in their own behind; let alone do it with dignity?
Ultimately being an uplifted animal is a nightmare scenario - you must find a place in an alien world without even knowing who you are or what you are capable of.
Edit:
Also I recognize that the process of uplifting many species started with domestication; After all recent studies have shown that a friendly fox is a smarter fox. But I'm talking (from our limited technological perspective) borderline magic with a hint of mad science.
But such mind expanding alterations need not be limited to to just humans. Let us as a thought experiment give Fluffy the Terrible the intelligence of a human.
Now Fuffy will no longer have to sit on your face in the morning for food to appear in the magical food bowl; he knows where it comes from, and how he can get at it himself. Fluffy is even able to help around the house now.
And yet, following the disappearance of your prize-winning goldfish you slowly come to realize one, simple, fact: cats are evil. Any given cat when given the chance will kill for pleasure and bring the not-quite-dead thing inside to bleed out on the carpet at your feet.
They will then proceed to keep you up all night by posturing loudly on the fence and then fighting with the neighbours cat in an even louder display of claws and teeth.
Humans would classify Fluffy the Terrible as a punk - wanted for sowing social unrest and inflicting unspeakable acts on animals.
The key words here are 'in our society'. A construct that has been developed by humans, for humans. Poor Fluffy has no kitty culture tens of thousands of years in the making; complete with discourses that know and support the fact that the gifts he brings home are just that - gifts.
That's right, Mr T loves you so much he is willing to share his decapitated rat with you. D'aww.
Humans just don't realize that the cat with the biggest pair of lungs gets the girl - and that he will never be rid of the title 'doglicker' if he doesn't stop it at the source by scratching his neighbour's eye out.
Its just how his society would work, but he doesn't his society, he inherited ours. There are no systems for his kind, they don't know how to teach cats correctly or how to properly make use of their unique talents.
Hell, his mind is almost unfathomable to ours - who would be crazy enough to lick themselves clean?! Well any self respecting cat would say that it takes talent. After all, who among humans can bury their heads in their own behind; let alone do it with dignity?
Ultimately being an uplifted animal is a nightmare scenario - you must find a place in an alien world without even knowing who you are or what you are capable of.
Edit:
Also I recognize that the process of uplifting many species started with domestication; After all recent studies have shown that a friendly fox is a smarter fox. But I'm talking (from our limited technological perspective) borderline magic with a hint of mad science.
Sunday, June 1, 2014
The measure of life
I have a friend in a spiral of self destruction, and let me tell you, it is one of the saddest things to behold. Above and beyond the thought of countless lives with the shadow of a slow death by famine, a quick and brutal death at the business end of a gun, or the plain and simple screwing over of the individual in the sway of the democratic process.
Its not sad because it is different than all of the above, but sad because it is the same. Every single person who dies does so as a tangle of things that they are and are not, will and will not be, unrealized potential mixed with so very much that is realized.
now that action is in the past, something that will never be anything different ever again
Breathe out
Something else now in the past - flowing from the first action, cause bleeds into consequence.
Breathe in - slower this time
You just changed the past, congratulations, never again will you be trapped by the past, but freed by it. After all, the past is, and always will be, sharing the floorspace with the present.
And it is exactly why humans are so beautiful, not because we are a greedy, violent species - but in spite of it. We eat, sleep, dream, murder, and fuck not because we are animals, but because we are humans and because we choose to do so.
Love, hate, envy, pride, happiness, sadness - the list of things we all feel goes on and on; You have made friends and strangers feel all these things at one point in time or another. I'm sure they all did the same to you as well.
But in the end, and with our emotions - we feel, learn and breathe but most importantly we act. Our futures become our present - an ever fleeting moment we will never escape - and then into the past.
And in the present we have absolute control over what tomorrow will be - because that is what the present is, tomorrow's past and yesterday's future. Built on our previous breath - and the foundation for our next.
But it is our life, our past, present and future to shape. Ultimately it is so very human to reach out and grab all with both hands and cling to it for dear life.
Its not sad because it is different than all of the above, but sad because it is the same. Every single person who dies does so as a tangle of things that they are and are not, will and will not be, unrealized potential mixed with so very much that is realized.
But first lets go through an exercise.
Breathe in - go on, humor menow that action is in the past, something that will never be anything different ever again
Breathe out
Something else now in the past - flowing from the first action, cause bleeds into consequence.
Breathe in - slower this time
You just changed the past, congratulations, never again will you be trapped by the past, but freed by it. After all, the past is, and always will be, sharing the floorspace with the present.
Will I? Won't I?
We kill each other just because that bastard's stone idol is bigger than mine! Would an animal ever do that? No! Why? Because it is absolute stark raving madness!And it is exactly why humans are so beautiful, not because we are a greedy, violent species - but in spite of it. We eat, sleep, dream, murder, and fuck not because we are animals, but because we are humans and because we choose to do so.
Yes, we are an emotional species
![]() |
| Credit : http://cheezburger.com/7864019968 |
But in the end, and with our emotions - we feel, learn and breathe but most importantly we act. Our futures become our present - an ever fleeting moment we will never escape - and then into the past.
And in the present we have absolute control over what tomorrow will be - because that is what the present is, tomorrow's past and yesterday's future. Built on our previous breath - and the foundation for our next.
TL DR
Humans are not a plague. Life is not a burden to be suffered through; It is a shared hallucination dreamed up by our collective consciousness and put into words so we can inflict our madness on others.But it is our life, our past, present and future to shape. Ultimately it is so very human to reach out and grab all with both hands and cling to it for dear life.
Subscribe to:
Posts (Atom)
