To clearly separate the Controller and View layers, I do not longer want to pass full objects to my views. Instead I want to pass only arrays and objects that contain the data but do not have any methods. Otherwise a view script would be able to delete Doctrine records or traverse in the object tree to data that was not intended for the view.
Hi. I have been working on a jQuery photo slideshow. It scales the images to the browser size, and slides them left and right. There is no pre-determined size or aspect ratio, the script does everything on the fly. It requires that all images be fully loaded, so it can custom resize each individual image based on it's own aspect ratio ( width():height(), etc ), calculate the width of containing div, and calculate the slide distance from one image to another.
As a stand-alone, it works pretty well (despite my lack of skills)! I simply hide the slideshow containing div at (document).ready, allow the images to load, then run the slideshow prep scripts at (window).load. Once this is done, it only then makes the slideshow divs, images, etc appear, properly sized, positioned and ready to roll.
The ultimate goal is to be able to load in any number of slideshows without refreshing the page. The point of this is to be able to play uninterrupted background music. I know music on websites is annoying, but the target market likes it, a lot!
I am using
(target).load(page.php .element, function prepInsertNewShow() {
//Prepare slideshow
resizeImages();
slideArray();
//Show slideshow
(target).fadeIn();
});
and it definitely works! The problem is that I cannot find a way to hold off on preparing and showing the new content until the images have finished loading. It is running the slideshow prep scripts (which are totally dependent on the images being fully loaded), before the images are loaded. This results in a completely jacked up show! What I want to do is this -
(target).load(page.php .element, function prepInsertNewShow() {
//Wait until images are loaded
$('img').load( function() {
//Prepare slideshow
resizeImages();
slideArray();
//Show slideshow
(target).fadeIn();
}
});
But this doesn't seem to work, the new content is never shown.
You can see a live version here.
The initial gallery loads correctly, everything looks good. The only nav link that works is Galleries Engagement, which will load a new show (a containing div with multiple <img> tags). You will see that the images are not centered, the containing div and slide distances are much too small, as they were calculated using images that were not actually loaded.
Is there any way I can delay handling and showing new content until it is fully loaded? Any suggestions would be most appreciated, thanks for your time!
PS - It just occurred to me while typing this that a decent solution may be to insert "width=x" height="x" into the <img> tags, so the script can work from those values, even if the images have not loaded...hmm...
How do you even look at the web.config file? I don't know where to go to turn custom errors off...help!
I tried command prompt and java script....can any one help me?
Is there an easy way (without downloading any plugins) to connect to a MySQL database in Python?
Also, what would be the difference from calling a PHP script to retrieve the data from the database and hand it over to Python and importing one of these third-parties plugins that requires some additional software in the server.
Dear all,
I want to create multiple thumbnails using GD library in php, and I already have a script to do this, the question is what is better for me .. is it better to create thumbnail on the fly? or create a physical file on my server each time I want a thumb?? and Why?
Please, consider time consuming and storage capacity and other disadvantages for both
None of the scribe examples I've seen actually mention the best way to take logs/logfiles and send them to scribe. I could configure a logrotate script that has a postrotate section that "cats" the rotated file to scribe (but then I get minutes latency at best).
The other option is to keep a "tail -f= | my_scribe_sender" and hope that the process never gets killed. However then you really can't guarantee that you're not missing/duplicating data.
I have a php script that has the following requirement command: require_once 'HTTP/OAuth.php'; the file HTTP/OAuth.php is in php's include_path that is .:/usr/lib/php.
Nevertheless in Eclipse the require_once line is marked with the following warning: Include filename: 'HTTP/OAuth.php' doesn't exist in project:
How can I make my project see the include_path so it can find the require_once file?
Thanks
ldj
when i use rspec with capybara to test my rails js page , I got the following error:
"Selenium::WebDriver::Error::WebDriverError: Could not find Firefox binary (os=linux). "
Actually my rails script are all written on the linux server, where there is on brower installed, and any desktop software is not supported on the server (since no X11 is installed).
How can I test js in this situation. Or is there and brower that works without X11 installed like wget? Thanks.
I need to find out what variables and values are being POSTed to a script that I'm debugging. It's doing something strange to them, and it needs to start a session so I can't ouput them right at the beginning. I'm hoping to find a plug-in for Firefox that will show me what they are directly from the browser. Does anyone know of such a thing?
Is there a good way to do this? I'm writing an extension that interacts with a website as a content script and saves data using localstorage. Are there any tools, frameworks, etc. that I can use to test this behavior? I realize there are some generic tools for testing javascript, but are those sufficiently power to test an extension? Unit testing is most important, but I'm also interested in other types of testing (such as integration testing).
I there a way how to take photos on laptop built-in camera controlling its control using flash? Our designer is making an application to take photos using flash action script or anything PL if not possible in flash.
Hello
i just wander where can i find a tool that takes in my case java script string that is
unescape and converting it to escaped string so i could use it as string value in c++
for example characters like " i need to convert it to \"
i need something smart and not just replace all function .
My development PC has windows installed. And I've experienced weird php behaviour:
<?php
file_put_contents('c:/q', microtime(1) . "\r\n", FILE_APPEND);
sleep(10);
When I run this script in browser simultaneously in two different tabs I get such results
1294713622.125
1294713632.2188
which obviously is not what I expected, although in CLI everything is fine.
So the question: what can block execution? (session.auto_start is Off)
hi,
I developed a application using asp.net and uploaded the site in online it is working fine.
after few days i am getting parser error like this..........
"" this script is generating in every page in the bottom of the page in source code in the site. it is automatically generating.
when i remove it is work fine after few days it is again generating.
Hey, well right now I have a script to send text messages, and I'm looking to modify the Mail() function to also send attachments.
Does anyone have any ideas?
right now this is the format I'm using :
mail ($to, $subject, $message, $headers);
Hi All. I tried with the following but it doesn't work
var txtlat=document.getElementById('TextBox1').value=GMap1.getCenter().lat();
var txtlong=document.getElementById('TextBox2').value=GMap1.getCenter().lng();
It gives a java script error as "Object Doesn't support this property or method".
How can i do this????
I really need help...
Thank you!
I'm trying to calculate the width of the string based on the font style and size. The user will provide the string, the font style and the font size, and then after giving all the data the user will hit the submit button and the function will trigger. Basically this script works but only when the submit button is hit twice or the font is selected twice,. I mean if you selec DNBlock as a font, it will not work for first time, but the second time you hit submit, it will then work. I'm not sure where is the problem here, but when I used the default font style like Arial, times new roman etc it works perfectly fine. Any Idea on this? I suspected that the font style is not being rendered by the script or something. Correct me if I'm wrong. Thanks
//Repeat String
String.prototype.repeat = function( num )
{
return new Array( num + 1 ).join( this );
}
//Calculate the width of string
String.prototype.textWidth = function() {
var fntStyle = document.getElementById("fntStyle").value;
if(fntStyle == "1")
{
var fs = "DNBlock";
}
else if(fntStyle == "2")
{
var fs = "DNBlockDotted";
}
else if(fntStyle == "3")
{
var fs = "DNCursiveClassic";
}
else if(fntStyle == "4")
{
var fs = "DNCursiveDotted";
}
else if(fntStyle == "5")
{
var fs = "FoundationCursiveDots-Regul";
}
var f = document.getElementById("fntSize").value.concat('px ', fs),
o = $('<div>' + this + '</div>')
.css({'position': 'absolute', 'float': 'left', 'white-space': 'nowrap', 'visibility': 'hidden', 'font': f})
.appendTo($('body')),
w = o.width();
o.remove();
return w;
}
//Trigger the event
$("#handwriting_gen").submit(function () {
var rptNO = parseInt($('#rptNO').val());
$("[name='txtLine[]']").each(function(){
alert(this.value.repeat(rptNO).textWidth());
if(this.value.repeat(rptNO).textWidth() > 1000)
{
$(this).focus();
$(this).css({"background-color":"#f6d9d4"}).siblings('span.errorMsg').text('Text is too long.');
event.preventDefault();
}
});
});
Hello
after doing the parsing with a script in Haskell I got a file with the 'appearance' of lists of strings. However when I call the file content with the function getContents or hGetContents, ie, reading the contents I get something like: String with lines (schematically what I want is: "[" aaa "," bbb "" ccc "]" - ["aaa", "bbb" "ccc"]). I have tried with the read function but without results. I need to work with these lists of strings to concatenating them all in a single list. Thanks.
I'm using launching firefox from the command line in a script to get snapshots of pages. These pages have basic http authentication. When using:
firefox http://user:[email protected]
Either a dialog appears, or authentication doesn't work at all.
Is there any option to make firefox open the page without showing the dialog?
I would like to know about the debugging capabilities of ANT using eclipse. Basically
I have an ANT build script written by a colleague and I wanted to step
through each target to see what are the various tasks that are beings
called.
I am using combination of php+jQuery for captcha validation and later sending mails and do other stuff. The pseudo code is something like this:
captcha_code = jQuery.post(.....execute captcha script and get status)
if(captcha_code == "correct"){
send_mail_using_php_script;
}
Now I have no idea whether spammers can directly execute the "send_mail_using_php_script". Do they? If yes, then shall I move captcha validation in send_mail_using_php_script to make it more safer? Is there any other safer method?
Prashant
I am using codeigniter. I want to know how to set up a cron job to check a table for expiring users and insert data in to another table with the list of expiring users. How to do that.
When i tried to write a script with controller and model to insert the table
:
Content-type: text/html
Fatal error: Class 'Controller' not found in /home/content/html/test/live/application/controllers/cron.php on line 2