Why does this work:
function myfunction($v) {
$query = $v['host'] == '1';
return ( $query );
}
$output = array_filter($recordset,myfunction);
print_r($output);
Whereas this script, which tries to accomplish the same thing with variables, does not?
$column1 = 'host';
$value1 = 1;
$query1 = '$v[\''.$column1.'\'] == '.$value1;
function…
I'm trying to extract an mp3 from a flash compatible mp4 file and have so far found FFMpeg and a bunch of different wrappers that all claim to be able to do the job.
Ideally, I'd like to not have to rely on shelling to the FFMpeg exe, but none of the wrappers I've tried seem to work....
Has anyone got any code or advice for how to go about…
Hello,
I've read that Delphi was supposed to get a for each loop in Delphi 9. Did this functionality ever make it into the language? My Delphi 2009 IDE doesn't seem to recognize the for each syntax. Here's my code:
procedure ProcessDirectory(p_Directory, p_Output : string);
var
files : TStringList;
filePath : string;
begin
…
Here's my problem: I would like to create two separate instances of the same DLL.
The following doesn't work because Handle1 and Handle2 will get the same address
Handle1 := LoadLibrary('mydll.dll');
Handle2 := LoadLibrary('mydll.dll');
The following works, but I have to make a copy of the DLL and rename it to something else (which…
Working on a service application in Delphi 5 that is intended to run on Windows XP - 7. Most of the application is coming together nicely, but I'm running into one issue. Part of this service application is a form that displays data occasionally (similar to the slider box Avast uses to let you know its updated). When the service shows…
When I drag a particular stored procedure into the VS 2008 dbml designer, it shows up with Return Type set to "none", and it's read only so I can't change it. The designer code shows it as returning an int, and if I change that manually, it just gets undone on the next build.
But with another (nearly identical) stored procedure, I can…
Hi!
I'm a web developer/objective-c (mac) developer and I want to learn C# to code some .NET applications on Windows.
Do you know any good books or online guide about this?
Thanks a lot!
Hi all, I am trying to create a page that shows the user their zip code when they are on my page.
(if any of you are familiar with GeoIP data, thats what I am using. )
I have a conversion that converts the users IP address into an IP number, that conversion is:
ipnum = 16777216*w + 65536*x + 256*y + z
where w.x.y.z are the ip…
I would like to check that I get not more than 3 relations set on a manytomanyfield.
I tried on the clean method to do this :
if self.tags.count()>3:
raise ValidationError(_(u'You cannot add more than 3 tags'))
But self.tags returns not the current updates... only saved objects.
Do you have an idea to access to them ?
…
I am in 11th grade and only one year left when I finish my school. I am sure I want to dedicate my life to programming. In my country the education's level is not so high as in Europe, so I want to emigrate and study not just for a diploma, but for knowledge too. So, what universities would you suggest me which has subject…
Hi Guys,
I have a site on A.com and an iframe on B.com which calls javascript from A.com. This works great in FF. In IE7 / 8 I am getting a
Message: Access is denied.
message. I have checked the HTTP Traffic via Fiddler - and I can see that it isn't blocked in Fiddler ?
Any ideas what could be causing this and how to…
The script I'm using is
if($profile['username'] == $user['username']) {
$db->query("UPDATE users SET newcomments = 0 WHERE username = '$user[username]'");
echo "This is a test";
}
(Note that $db-query is exactly the same as mysql_query)
For some very odd reason, the MySQL query is being performed even if the…
I have a large Javascript codebase to convert to jQuery. The code is structured such that DOM elements are created in Javascript (using a library called DomBuilder), and saved to variables if they will be needed later, before being added to the DOM.
Eg.
var inputs =
{
submitConfirm: INPUT({type: 'button', value:…
I'm using a Java application which allows you to import custom files. On import, these files are loaded into memory.
The problem is that the files I want to import are very big, this causes an OutOfMemory exception. The crash log also informs me that the VM was started with the java parameter "-Xmx512m", I want to…
I'm a .NET programming who is soon moving to the Java EE world. I have plenty of experience with .NET web technologies, web services, WebForms and MVC. I am also very familiar with the Java language, and have written a few servlets and modified a couple of JSP pages, but I haven't touched EE yet.
I'd like to set…
I'm a .NET developer learning Java EE. These two concepts seem to serve the same exact purposes in either system.
So which framework gets credit for inventing them?
I have a SharePoint site that is locked down through standard Windows permissions.
I keep getting an repeated login box prompt, and it appears that it has to do with the Themes images and the CSS style sheets.
Where do I need to update permissions so that these files have the same permissions as the rest of the…
I have an existing Mercurial repository for a C++ application in a small corporate environment. I asked a co-worker to add the setup script to the repository and he added all of the dependency binaries, PDFs, and executable to the repository under an Install directory. I dislike having the binaries and dependencies…
Has anyone got any idea why the menu is rendering below the rotating images on this site in IE7: http://new.coffeelatino.co.uk/.
The z-index is much higher for the menu that it is for the rotating images.
Just another reason why IE is so dreadful.
Hello everybody
I am building a news app for my website. I want to use a sort of tag system. Each news article can have different and multiple tags. All tags are saved in a tag model, and i want to connect the tags to the newsarticle. Now is this possible with: tags = models.ForeignKey( TagsModel ) for one tag,…
Hi,
Trying to get a Dojo datagrid working - have duplicated the first example on the documentation page (http://docs.dojocampus.org/dojox/grid/DataGrid) & it works just fine.
However, when I try to display the grid inside another div (i.e. putting 'gridContainer4' from the example inside any other div)…
I'm trying to add a UIButton to a UIView, but am having some trouble with getting it to respond to touches.
I have a method which returns UIButtons after I provide it with a tag:
- (UIButton*)niceSizeButtonWithTag:(int)tag {
UIButton * aButton = [UIButton buttonWithType:UIButtonTypeCustom];
…