Why this program replaces all characters with 'a'

In the program I have a char array. It gets input from the user who enters characters and when the letter b is entered, it should replace it with the letter a. On the contrary, it is replacing all the elements with the letter a instead of just replac

How do I monitor a file asynchronously in Firefox?

I want to monitor a plain text file on windows machine for changes to it. Whenever external application updates the file, my add-on is supposed to read it and act accordingly. Going through quite bit of documentation I could not find a direct facilit

OS X 10.8 - Layout of the syscall address space

I have disabled swapping altogether on my OS X 10.8.2 (which runs x86 LP64 kernel) box for experimental reasons, I know this is a bad idea. When I do a system call from any app what does the address space layout look like ? I.e. Now as entire address

Get the first day of the week in a month with strtotime

I'm trying to figure out the first wednesday of a given month using strtotime, but the "first wednesday" argument fails whenever the first wednesday happens to fall on the 1st. For a more general illustration of this problem, see the following c

A mkdir call failed in Perl

I am trying to create a directory using Perl. But this call fails. However when I try to create the same directory structure in shell prompt, it works fine. Could someone please let me know why I am not able to create the directory in the directory s

Animating the vertical menu with jQuery does not work properly

Basically, I have a <nav> element that should be expanded from left to right on mouseover, but sometimes if you quickly put the pointer over and then out of the element, it will work without animation and that shouldn't be happening. Here is the HTM

ResourceNotFoundException although there is a resource

I'm trying to create a spinner with a non-selectable text displayed when the dropdown is not displayed like "--select option--". I have created a custom spinner adapter and a layout file with a TextView for the "--select option--" usin

Not able to display the day of the week

Possible Duplicate: How do I get the day of the week in Objective-C? I have a uilabel that is connected to a nsstring. However, I am trying to set the nsstring to the day of the week (monday, tuesday, etc.). Every time I run it though, it gives me no

The int compilation error can not be dereferenced

I am getting an error when I try to compile this code saying int cannot be dereferenced What could be causing it? Here is this code I am using: class A { public static void main(String str[]) { int System=22; System.out.println(System); } } By writin

File Playback Lines

I am trying to read strings and integers from a simple text file to my array. But the problem is that I get some random characters in a line in the middle of my list. It probably has to do with a newline problem, but I am not sure. The text file look

How do I view code (specifically C ++) in an HTML page?

How can I show code in a website using HTML? Basically, I have a C++ program that I'd like to share on my website and I want to show it in the page. Is there anyway to show a C++ code in HTML other than using HTML text?You can use SyntaxHighlighter.

Referencing CheckBoxes

the program that is being worked upon is using an api to collect all the information required, thus making the activity very dynamic. Due to this dynamic nature a presentation layout, say x.xml is being used to specify the styling of those elements.

Work for SQL Query 'NOT IN' that takes forever?

I am trying to run a query on an Oracle 10g DB to try and view 2 groups of transactions. I want to view basically anyone who has a transaction this year (2014) that also had a transaction in the previous 5 years. I then want to run a query for anyone

Reach multiple rollover events to click C # for kinect

I am developing a Kinect game in C# where the user needs to click 2 buttons at the same time by hovering over one button with each hand. However, with my current code, when the user hovers with one hand over a button, the other buttons get disabled a

Use a time selector based on the new Android application?

I'm developing an Android app which has target API for Android 6. As you may know, in Android 5 they introduced Material look and feel, and included the Calendar Date picker and Analog Clock time picker. The Android 4 time pickers had individual spin

Delphi problem Streaming

I'm using a blob field in a kbmMemTable to store a custom component that I've developed from TComponent and I use the read and write component stream methods of the TReader to read and write the component to the blob field. The data in the kbmMemTabl

PHP quotes with a similar query

I have gotten myself into a tangled mess with quotes. I am trying to do a like query that looks something like this $myQuery = 'SELECT col1 , col2 from my_table WHERE col_value LIKE '%$my_string_variable%'; But this query would obviously give an erro

How do I use a text box as an entry?

I have a textbox that serves as an input like this: <div class="control-group"> <label class="required"> Enter stuff here....</label> <input type="text" placeholder="Required Field" class="

how to check a picture format with php

i need to verify a lot of images files for an application, the situations is that i have 10 directories with almost 10,000 images on each one, something like 100,000 files. Those files are supposed to be gif files but a lot of them (and really mean a

Big Theta, Big O, Big Omega for a given function

Consider the function F: 2^(3*n) + n^2 Can the function A: 2^(3*n) be used as a Big Theta, Omega or O as a characterisation of F? Why? I'm revising the concepts of Big Omega, Big Theta and Big O and I came across this example but don't know where to

cache cache, cache all files in a directory

I am trying to build a web app for iphone, and I don't understand how to cache all the files under the "images" directory ? and I modify one file on the server like "brandDB.txt", how to make the cache manifest update this file, and th