17 October, 2013

Stylesheet folder or directory - could make or break your web apps

English: CSS rule in Malayalam
English: CSS rule in Malayalam (Photo credit: Wikipedia)
17-October-2013

I have been reading on ASP.NET, so at least I learn something new. I have been coding and coding and coding, and I have become the woodcutter who did not sharpen his axe. And with the slowdown in load (all major projects completed, and pending roll-out only), I have some free time on my hand.

I found an e-book of Beginning ASP.NET 4.5 in C# and VB, and I skipped the chapters that discussed basic web development, but coming to Chapter 3, I found the CSS section a bit of an eye-opener. Not that I know nothing of CSS -- it is something that I have used extensively on my site, but not entirely the optimum way. And what I have just learned, I tried to apply on one of my simple web applications.

Did I find something to blog on?

You betcha!

I am one who always practiced organization, and I just find that the stylesheet file that was created in the process is 'mixing' with the code files. I just didn't like that. So in the middle of streamlining the CSS codes, have done some pages already, I moved the stylesheet to the \App_Code folder. There was no objection in the IDE...

So, I completed migrating all the inline and embedded styles into the Stylesheet file, so they are all in one common place, and this gave me a chance to remove all redundant and duplicate styles. Wow! Just think of the junk I created... And that is just in the simple web apps...

Anyway, having done everything, I now proceeded to test if what I did works.

Surprise, surprise!

In IE, it did not work. I am using IE10, running in Windows 7 Enterprise. The fonts and colors are all using the default values.

I tried it in Maxthon, in most likelihood, the closest browser to IE. The same behaviour was observed.

I now tried Firefox, and the styles came forth, shining through!

But since the majority of browsers used in our company is IE, I have a problem...

I tried defining the font in the individual rule sets, since the * { font: ...} rule doesn't seem to work at all.

No change.

I put the font definition in the body { ... } rule, and still, no effect.

At this point, I now thought of doing one thing: search the web. Search the web for similar issues and of course, the possible solution to my problem.

Found one article that mentioned the problem to be related to some server issues, and also on the folder/directory that keeps the stylesheet file. Spaces must be replaced with underscore (_).

Well, mine is having an underscore (\App_Code\), so I ruled it out.

I stopped for a while, and tried to think some more...

Then, out of a wild guess, I thought of moving the stylesheet file out of \App_Code\ folder, and back into the main folder.

Did that work?

Yes, it did!

So it wasn't the folder having spaces, and it wasn't the server behaving erratically, but simply, and I confess I don't know why (I don't understand it), the problem was simply due to where the stylesheet file was located.

So a few more code corrections, putting back all those definitions [ * { font: ... } ], and making sure all sections work, I published my modified web apps.

Hopefully it is much faster now.

Till then!
Enhanced by Zemanta

22 August, 2013

BSOD using Vuze

English: New icon for the Vuze client (formerl...
English: New icon for the Vuze client (formerly Azureus); is a departure from old icon (Photo credit: Wikipedia)
22-August-2013


The laptop I am using isn't one that is perfect, and while it may be blazing fast and surprisingly efficient and can withstand my habit of opening many applications in quick successions with 1 or 2 seconds, it still gives me the blank face of blue screen sometimes, and just spurts our numbers and letters that I don't understand.

However, one very consistent behaviour I know is my use of Vuze.

Searching on the error codes would come out with an endless list of posts and articles, and looking at some, there is a consistency that I found. It is the use of Vuze - due to some setting in Windows 7 network usage (limit). And I for one would like to push things to the limit: I would often open up a lot of torrent files, since my internet service plan is unlimited, and fast, I expect that everything else would be the same: unlimited and fast.

Well, some things would comply, but differently: a fast Blue Screen Of Death response, right after I click on Vuze application shortcut.

Like I said, I found out that the cause is the heavy network traffic, which kicks in when Vuze starts up due to the many torrents currently active.

The suggested solution to tweak some settings, disable some checks, turning on some, blah, blah, blah... well, I can't follow. Not to that level.

So what I did was reinstall Vuze. That required uninstalling Vuze first, and deleting the settings, so whatever uploads and downloads are active will be cleared. And of course, I did a backup before that.

After reinstallation, I put back in torrent files, one after another. And each time, I would close Vuze, then open it again after a while. When the BSOD came back, I noted down the number of active torrents, and set the limit to a number lower, to be safe.

Do I still get BSOD when activating Vuze? You bet I do. But at least, I know why now. And that is something within my control.

Sometimes, it is even with no torrent running but with many other resource-heavy applications and programs, activating Vuze will surely throw out a BSOD. So I just make sure that computer has stabilized for some time before I turn Vuze on.

The thing is, you can't have too many torrents active when opening Vuze. I am able to go over the limit when Vuze is already opened and running stable, only that I have to be sure that these torrents will complete by the time I have to shut down my laptop or before I close Vuze. And that, also, is within my control.

Till then!
Enhanced by Zemanta

XCOPY on paths with space

Xcopy | 17th Feb (3/28)
Xcopy | 17th Feb (3/28) (Photo credit: Rob Hayes.)
22-August-2013


I have missed posting a number of articles, and many things that I should have noted down, I have failed to note down. I would recall that this blog was created with the intent of having my own resource later on, and having it published online, also for others who may be looking for the answer(s) to the same question(s) they have in mind.

I must admit that a lot of the important things that I should have logged down, I have forgotten - now that my web applications are running. And that is, even if I still have the links I to the reference articles and posts from other developers like me. Shame...

So just to break the silence, let me just note this down. And hope it helps many others.

I came across the problem of the need to copy some files to other PCs, and I thought it should be a very normal thing. "Easy," I thought to myself. Well, not so, because the file path of both the source and the destination have spaces. The moment I ran my batch file, I got the error(s).

I searched, "xcopy file path with space", and the top few links, I checked. I got what I wanted. The file path with space is simply needing a double quote enclosure. That is like

C:\Program Files

becoming

"C:\Program Files"

and all other definitions or switches remain the same.

Very simple solution, isn't it?

I should now say, till then!

Reference:
using XCOPY when directory has a space in name
Enhanced by Zemanta