Wednesday, 4 September 2013

My MVC 4 App fails to load on Azure. How do I find out what is wrong?

My MVC 4 App fails to load on Azure. How do I find out what is wrong?

We have an app that we recently upgraded from MVC 3 to MVC 4 and from
Visual Studio 2010 to 2012. We're trying to deploy it to Azure, but it
doesn't seem to want to run there. It works locally, in IIS Express and
the Azure emulator. We can build the image just fine through Visual Studio
and via our msbuild project on the command line. We deploy just fine as
well.
Then when we browse to our deployment's URL, we get a 500 error, with the
message "There is a problem with the resource you are looking for, and it
cannot be displayed." It's not a YSOD, which leads me to believe the app
can't even start, but the message above is the only feedback I get.
We've tried a bunch of things to get it to work:
Upgraded to the latest Azure SDK
Changed the target framework on the app to .NET 4.5
Deployed on Windows Server 2012 instance
Nothing seems to help. If you know exactly what is wrong, please enlighten
me. But what would help immensely is to find the details on that 500 error
message I get when I browse. How can I get that?

Tuesday, 3 September 2013

Client reloads CSS and JS files automatically everytime the files are modified

Client reloads CSS and JS files automatically everytime the files are
modified

I came across this elegant solution to guarantee that the client browser
always loads the CSS and JS files from the cache, except when the files
are updated.
.htaccess
RewriteEngine on
RewriteRule ^(.*)\.[\d]{10}\.(css|js)$ $1.$2 [L]
PHP
function auto_version($file)
{
if(strpos($file, '/') !== 0 || !file_exists($_SERVER['DOCUMENT_ROOT'] .
$file))
return $file;
$mtime = filemtime($_SERVER['DOCUMENT_ROOT'] . $file);
return preg_replace('{\\.([^./]+)$}', ".$mtime.\$1", $file);
}
HTML
<link rel="stylesheet" type="text/css" href="echo
auto_version('/css/screen.css');" />
It works, and it works pretty good... but i'm having doubts regarding the
constant calling of the file's modification time with the filemtime($file)
function. If I were to have 1 million visits per day, that means 1 million
of -apparently- unnecessary filemtime calls.
What do you think? Any other alternatives for this issue?

This Webpage is not available displaying on iphone - prestashop

This Webpage is not available displaying on iphone - prestashop

I am working on Prestashop website and i am trying the website for
responsive too. so when i check it in my I phone i just saw only this
error "This Webpage is not available"
what kind of problem is this can anyone help me out please

Positioning of HTML elements with css

Positioning of HTML elements with css

HTML Code
<header>
<h1>Event Heading</h1>
<div class="meta">09 JUL 2014</div>
<div class="textblock">Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam
malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper
suscipit, posuere a, pede.</div>
</header>
Issue
I have this HTML structure which I can not edit/rearrange. I would like to
position the h1, div.meta and div.textblock is as in the picture below.
I can't work it out with floats the way I want to because of the sequence
of the HTML.
Illustration

Time dependent unit tests braking when run in parallel, any workarounds?

Time dependent unit tests braking when run in parallel, any workarounds?

I have time dependent unit tests in which I have to simulate "now". I use
JodaTime and when I need to simulate the value of now for purposes of time
dependent testing I use DateTimeUtils.setCurrentMillisFixed(...), as
suggested in the accepted answer in question Time dependent unit tests.
However, this has now caused problems when unit tests are run in parallel
as one test is changing other test's simulated value of now. Proper
solution would be to make all classes obtain current time from a Clock
dependency which could be mocked out in tests (as suggested in most
upvoted answer in Time dependent unit tests). However, I will not have
enough development resources to make that refactoring effort at the
moment.
My question is is there a way to work around this by somehow specifying
which tests may be run in parallel and which may not? Is there a way to
work around this by using DateTimeUtils.setCurrentMillisProvider() ?
Testing framework is JUnit4, tests are run from maven.

Monday, 2 September 2013

Sencha Touch's loadmask customization

Sencha Touch's loadmask customization

Is there any way to customize the loadmask properties without needing to
create a new one? I want to increase the size of the darker grey box (i
think its the inner-mask right?) because i want to use html to make the
loadmask looks better. But with box that has a size like that, there's
little thing that you can do to make the loadmask looks better.
masked: {
xtype: 'loadmask',
message: 'Now Loading..',
}
How would i set that darker grey box size? I tried with height and width
but that one modifies the whole loadmask size, not the darker grey box
area.

ValueError: invalid literal for int() with base 10: HFSS connectivity

ValueError: invalid literal for int() with base 10: HFSS connectivity

I am trying to obtain the sweep analysis results from HFSS by using the
next sentence (from HFSS scripting document)
oModule.ExportNetworkData( ["Setup1:Sweep"], 3,
"C:\Python32\examples\6GHz_filter_on_HFSSDesign1.s2p", ["All"], True, 50,
"S", -1, 0, 15)
but the problem is that I am obtainig this error..... if I launch run
script directly from HFSS it works but if I try via python is not
working.... has somebody any idea? please note the name of the file above
and below in the error, it changed
Unhandled exception while debugging... Traceback (most recent call last):
File "C:\Python32\lib\site-packages\win32com\client\dynamic.py", line 282,
in ApplyTypes result = self.oleobj.InvokeTypes(*(dispid, LCID, wFlags,
retType, argTypes) + args) ValueError: invalid literal for int() with base
10: 'C:\Python32\examples\x06GHz_filter_on_HFSSDesign1.s2p'