if b/c/ does not exist in ./a/b/c , shutil.copy("./blah.txt", "./a/b/c/blah.txt") will complain that the destination does not exist.
how can i create the path at the same time?
is it possible to in-place replace the entire html document?
i tried jQuery("html").html("....")
but style information does not survive.
i'm trying to avoid using data uri because i do not want the generated document to be stored in the browsers history
If my Rakefile does not find a task with a particular name, I'd like rake to instead create a new task by that name according to certain rules, if a file with the missing task name exists. But if it doesn't, I want to fall back to the default ("Don't know how to build task 'foo'!").
In short, is there a method_missing for Rake?
I have an array like so:
array(
'a'=>array(
'a'=>3,
'f'=>5,
'sdf'=>0),
't'=>array(
'a'=>1,
'f'=>2,
'sdf'=>5),
'pps'=>array(
'a'=>1,
'f'=>2,
'sdf'=>3)
);
Notice how the sub-arrays are the same for each top-level array. If I wanted to, what's the easiest way to combine the sub-arrays so that I'm left with a one-dimensional array like:
array(
'a'=>5,
'f'=>9,
'sdf'=>8
);
How do I declare a variable in C?
P.S. I have a pair of SteelSeries Siberia headphones. I've noticed that when watching some films the voices are completely silent, yet when I unplug the headset and listen through my speakers they are there and sound normal.
I have no other software that could be interfering with it and it happens regardless of the software I use for playback (I've tried VLC, WMP and Quicktime).
It is so strange, and it almost sounds deliberate - the rest of the audio is untouched but voices disappear. The films only have single audio tracks, and it doesn't happen with every film.
Can anyone give me any hints as to what could possibly cause this? I am stumped!
Hey. So this is probably a very noob problem but I'm not good enough to fix it. Basically... I have a gallery that I am loading into the page via AJAX. It looks simply like this:
<div id="gallery">
<a href="Image1.jpg"><img src="Image1Thumb.jpg" /></a>
<a href="Image2.jpg" title=""><img src="Image2Thumb.jpg" /></a>
</div>
But because it's being loaded in as AJAX content, JQuery/Lightbox is not working and I've no idea how can I get the script to run/recognise this newly loaded content.
Thanks!
[Note: The JQuery Lightbox I am using.]
I want to log on to two sites simultaneously to enable a single sign on solution. We have a smallish wiki that is created with Apple wiki and we have an intranet site on a aspx cms system by Elcom. Both use Active Directory for credentials.
Currently they are on different domains, but we could enable a rewrite using our load-balancer (Citrix Netscaler) or IIS. These sites are on different servers, one a mysterious Mac system and the other an IIS v6.0 on windows 2003.
Now I am almost certain that a reverse proxy set up will solve this but I really just need someone to agree that this solves this issue, and if there are things I should look out for what they might be. I just want to have an invisible log on screen in an iframe and enter clone the user name and password using javascript.
This is my Javascript:
$(document).ready(function() {
$('#like').bind('keydown', function(e) {
if(e.keyCode == 13) {
var likeMsg = $('#like').val();
if(likeMsg) {
// Send the AJAX request to like.php
$.ajax({
url: 'like.php',
success: function(data) {
alert('Content: ' + data);
}
});
}
}
});
});
And this is my like.php file:
<?php
echo "It works! :)";
?>
When I press enter on the #like input, it seems the AJAX request is sent and an alert box comes up saying: Content:, but there's no data being sent back from like.php...
I have checked if the file exists and if it's in the same directory and whatever and it is, so I'm pretty much clueless atm.
Does anyone know what could be wrong here? Cheers.
CakePHP Newbie :)
I am having trouble accessing another controller and passing that data to a view in one of my controllers:
In controllers/landings_controller.php:
var $uses = 'User';
function home() {
$userdata = $this->User->read();
$this->set(compact('userdata'));
}
In views/landings/home.ctp:
<?php
echo $this->userdata;
?>
When accessing /landings/home I get the following error:
Notice (8): Undefined property: View::$userdata [APP/views/landings/home.ctp, line 38]
I don't know what I am doing wrong. Any help?
Thanks!
I've looked at git-new-workdir, but I don't want the history to be shared because the branches have a release-main relationship. That is, changes in the release branch I want to propagate to the main line, but changes in the main line I don't want in the release line.
A common pattern for me is to fix a bug in the release line, integrate it to the main line, then start builds in both branches at the same time.
Is there a way to do this with git-new-workdir, do I need to clone, or is there a better solution?
Thanks
I'm not entirely sure what I'm doing wrong, and I can't figure out how to Google it because a common mistake is very prevalent. I have the parent's height explicitly set, but I can't get #main-sub-content 's height to 100%.
Here's the page:
http://coloryourspot.vadremix.com/
And the corresponding CSS:
http://coloryourspot.vadremix.com/styles/primary/main.css
Can anyone spot the issue?
Solved: The problem was the parent element had height:auto!important;
I need to retrieve my data from a ListView control set up in Details mode with 5 columns.
I tried using this code:
MessageBox.Show(ManageList.SelectedItems(0).Text)
And it works, but only for the first selected item (item 0). If I try this:
MessageBox.Show(ManageList.SelectedItems(2).Text)
I get this error:
InvalidArgument=Value of '2' is not valid for 'index'. Parameter name: index
I have no clue how I can fix this, any help?
Edit: Sorry, should have said, I'm using Windows.Forms :)
Hello,
My source table looks like this
Id StartDate
1 (null)
2 12/12/2009
3 10/10/2009
I want to create a select statement, that selects the above, but also has an additional column to display a varchar if the date is not null such as :
Id StartDate StartDateStatus
1 (null) Awaiting
2 12/12/2009 Approved
3 10/10/2009 Approved
I have the following in my select, but it doesn't seem to be working. All of the statuses are set to Approved even though the dates have some nulls
select
id,
StartDate,
CASE StartDate
WHEN null THEN 'Awaiting'
ELSE 'Approved' END AS StartDateStatus
FROM myTable
The results of my query look like :
Id StartDate StartDateStatus
1 (null) Approved
2 12/12/2009 Approved
3 10/10/2009 Approved
4 (null) Approved
5 (null) Approved
StartDate is a smalldatetime, is there some exception to how this should be treated?
Thanks
I would like to find out if anyone has existing work surrounding formatting an IQueryable instance back into a LINQ C# syntax inside a string. It'd be a nice-to-have feature for an internal LINQ-to-SQL auditing framework I'm building. Once my framework gets the IQueryable instance from a data repository method, I'd like to output something like:
This LINQ query:
from ce in db.EiClassEnrollment
join c in db.EiCourse on ce.CourseID equals c.CourseID
join cl in db.EiClass on ce.ClassID equals cl.ClassID
join t in db.EiTerm on ce.TermID equals t.TermID
join st in db.EiStaff on cl.Instructor equals st.StaffID
where (ce.StudentID == studentID) && (ce.TermID == termID) && (cl.Campus == campusID)
select new { ce, cl, t, c, st };
Generates the following LINQ-to-SQL query:
DECLARE @p0 int;
DECLARE @p1 int;
DECLARE @p2 int;
SET @p0 = 777;
SET @p1 = 778;
SET @p2 = 779;
SELECT [t0].[ClassEnrollmentID], ..., [t4].[Name]
FROM [dbo].[ei_ClassEnrollment] AS [t0]
INNER JOIN [dbo].[ei_Course] AS [t1] ON [t0].[CourseID] = [t1].[CourseID]
INNER JOIN [dbo].[ei_Class] AS [t2] ON [t0].[ClassID] = [t2].[ClassID]
INNER JOIN [dbo].[ei_Term] AS [t3] ON [t0].[TermID] = [t3].[TermID]
INNER JOIN [dbo].[ei_Staff] AS [t4] ON [t2].[Instructor] = [t4].[StaffID]
WHERE ([t0].[StudentID] = @p0) AND ([t0].[TermID] = @p1) AND ([t2].[Campus] = @p2)
I already have the SQL output working as you can see. I just need to find a way to get the IQueryable to translate into a string representing its original LINQ syntax (with an acceptable translation loss). I'm not afraid of writing it myself, but I'd like to see if anyone else has done this first.
I am trying to write a script that I can give to user to have it automatically zip certain files of theirs and then load them onto an ftp site.
Anyone know where I could find information on writing a batch file for auto-zipping files using only what is available to a user running windows? I have been looking for quite a bit but I am struggling.
Thanks.
How do you determine what jars are needed for such and such feature of a framework? For example, how what jars would be needed out of all those available for using only dependency injection?
I've created an affilaite system that tracks leads and conversions. The leads and conversions records will go into the millions so I need a good way to store them. Users will need to track the stats hourly, daily, weekly and monthly.
Whats the best way to store the leads and conversions?