Hello there!
If I have a code like this:
$file = basename($filename);
How do i get the file extension of $file? The variabel file could contain any kind of file, like index.php or test.jpeg.
I have a recursive function reading a "table of contents" of documents from a database.
I would like to print numbering with the document that reflects where the item is in the tree, e.g.
First item,
1.1 Child of first item,
1.1.1 Child of child of first item,
1.2 Child of first item,
Second item,
2.1 Child of second item,
etc.
Rather stumped…
I've made a static class to hold a number of configuration values (and also swap these values out in unit tests).
If I initialise it in the Global.asax, the code runs correctly but the page doesn't load at all, and trying to navigate to a specific page fails.
I can't initialise the values in a constructor or inline on the field declarations,…
Brand new to droid programming, but would love to learn as much as possible, so I finally got my emulator working correctly, I even got a hello world button to work,
I'm attempting to make this button display a random number, I've googled this and came up with this code:
Random generator = new Random();
int n = generator.nextInt(n);
I fixed…
I do a lot of ASP.NET MVC 2 development, but I'm tackling a small project at work and it needs to be done in PHP.
Is there anything built-in to PHP to do model binding, mapping form post fields to a class? Some of my PHP code currently looks like this:
class EntryForm
{
public $FirstName = "";
public $LastName = "";
}
…
I have a rather unusual application that isn't working the way I need, and I hope someone here will have some suggestions or at least a direction to investigate.
We have a museum exhibit that has a computer at the entrance driving two small receipt printers. There are two buttons on a console, wired to the left and right buttons of a…
I want to run an update query.
The query will be run against multiple databases - not every database will have the table.
I don't want the update to be attempted if the table does not exist. I don't want any error to be thrown - I just want the update to be ignored.
Any ideas?
EDIT: just to be clear - the query is executed in an…
1) Has anyone used Plastic SCM? Is it reliable?
2) How does it compare with Mercurial? (It seems like this is a good candidate for DVCS on Windows. I tried Git and really didn't like it.)
3) I really like TortoiseSVN. I like a central model because of the piece of mind that if it's in the respository it's "safe" and tracked. …
Hi Everyone!
I've spent ages on this, all I'm trying to do is extract the "title" contents from an rss feed, everything else can be ignored. I've looked into simplepie, magpie and all that stuff, but I feel its kind of overkill for what I need to do. I realise there are google gadgets that are made that can do this, but I didn't…
Hi,
For some reason I've having problems reading this session variable within an ajax document, I've got this inside online.php:
`
session_start();
if (isset($_SESSION['username']))
{
$username = $_SESSION['username'];
}
`
For some Reason this is not setting username even when the session var is being used on the host…
Hello!
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" defaultLanguage="C#">
<!-- this is a comment -->
</compilation>
</system.web>
</configuration>
What's the simplest XSLT you can think of to transform the…
Oracle 9i has not BOOLEAN data type. CheckBoxes in ASP.NET are BOOLEAN controls are they not?
So using a CHAR(1) column with Y or N values in the Oracle table, how do I bind to a CheckBox or CheckBoxList or RadioButton or RadioButtonList control on an ASP.NET 2.0 web form?
I'm using VB, 'specially since I'm a noobie.
Hi Everyone! I have some javascript which runs a timer that animates something on the website.
It all works perfectly but I want to get an image to change when the animation is run, It uses jquery:
if(options.auto && dir=="next" && !clicked)
{
timeout = setTimeout(function(){
if…
So a form is submitted on my site, with form action equal to itself.
I want the user to be able to refresh the page without sending the same variables again.
I thought unset($_POST); would accomplish this for some reason it doesn't is there another way to accomplish this?
I am creating a new ASP MVC order application in the Amazon (AWS) cloud with the persistence layer at my local datacenter. I will be using the CQRS pattern. The goal of the project is high availability using Queue(s) to store and forward writes (commands/events) that can be picked up and handled…
I really enjoy software development. I've done it for going on 3 years now full-time for a small company and still find it interesting and exciting. I haven't had much server/network experience but have an opportunity to work for a large IT company dealing with server setups, configurations,…
Using Visual Studio 2008, I need to create a custom web form that when picked acts like the web content form, by providing a dialog that lets you pick a master page. I have looked through the webform.zip template and thought I had a clue, but trying different combinations has baffled me as…
Hi Everyone! I have a form where I've got three checkboxes like this:
<td>Wireless <input type="checkbox" name="services[]" value="wireless" /></td>
</tr>
<tr>
<td>Cellular <input type="checkbox" name="services[]" value="cellular"…
Forgive me if this is a simple problem but I can't seem to find why this code:
function create_content(c)
{
var html = "<div id='header'>"+c+"</div>";
if(c == "links")
{
var ul = "<ul><li><a…
Hello,
I have a problem with a html select object and its options in IE.
My html
<select id="Select1" onchange="closeMenu1(this.value)">
<option></option>
…
I'm looking for resources on internationalisation in .NET for the more recent technologies - ie, WPF, Silverlight, .NET 4.0 etc. Does anyone know any good blogs, websites, or books on this subject?
Since cloud solutions (Google AppEngine, Amazon, etc.) do more for you, at the end of the day do they cost significantly more than doing it "yourself" with co-location hosting, etc.
Not just starting out, but when the website is mature and getting many page views a day.
I need to create links using dynamic values for both the URL and the anchor text.
I have column called URL, which contains URL's, i.e., http://stackoverflow.com, and I have a column called Title, which contains the text for the anchor, i.e., This Great Site.
I figure…
I personally like the 'exclusive or' operator when it makes sense in context of boolean checks because of its conciseness. I much prefer to write
if (boolean1 ^ boolean2)
{
//do it
}
than
if((boolean1 && !boolean2) || (boolean2 && !boolean1))
{
…
I want to parse a c# file. The only thing I want is to determine if it contains a property with a specific name; just a simple true/false response. Or rather, since I'd checking for more than one property in each run, extracting a list of property names could be…