I have this: 2010-04-08T01:01:00Z
I want to remove the 'T' and everything behind it as well.
Also I would like to rewrite the date into this format: 08-04-2010
How can I do this the easiest way?
Thanks
Few questions on over riding.
I am interiting a method openRead from another class, the method is to be overridden so that the scanner class uses the provided delimiter pattern, which is referenced. I need to make use of the scanner class useDelmiter method
method from another class
[code]
public boolean openRead() throws FileNotFoundException
{
sc = new Scanner(new File(fileName));
if (fileName != null)
{
return true;
}
else
{
return false;
}
}
[/code]
delimiter
[code]
protected final String DELIMITERS = "[\s[^'a-zA-Z]]";
[/code]
I'm at a loss to how i over ride this using the constant delimiter.
I have a requirement to implement some kind of dictionary object. Something like MyDict<K,V1, V2). For example if I have a Question as Key(k) then Correct answer is V1 . V2 is user selected answer. Is there a collection that would satisfy this requirement in C#. If I have to design my own type, what interfaces should I implement. ICollection and Ilist ?
class Person holds personal data
Its constructor receives 3 parameters, two Strings representing first and last names and an int representing age
public Person(String firstName, String lastName, int age) {
its method getName has no parameters and returns a String with format "Lastname, Firstname"
its method getAge takes no parameters and returns an int representing the current age
its method birthday increases age value by 1 and returns the new age value
Create the class Person and paste the whole class into the textbox below
public class Person
{
public Person(String first, String last, int age)
{
getName = "Lastname, Firstname";
System.out.print(last + first);
getAge = age + 1;
return getAge;
System.out.print(getAge);
birthday = age + 1;
newAge = birthday;
return newAge;
}
}
im getting errors such as "cannot find symbol - variable getName" but when i declare a variable it still not working, i also wanted to ask if i am heading in the right direction or is it all totally wrong? im using a program called BlueJ to work on.
I need to do a find and replace in Notepad of
Err.Number, canBeAnything, canBeAnything, Err.Description
(where canBeAnything is just what it says)
with
Err.Number, "canBeAnything", "canBeAnything", Err.Description
(basically, put quotes around canBeAnything)
I got as far as the find
Err.Number, .+, .+, Err.Description
But I'm stuck on the replace. Any suggestions?
Some of our friends (University students) are trying to develop a twitter type application, I want to plan for at least 1000 transactions per second (I know it's wishful thinking) for initial launch. This involves several people connecting and getting updates and posting (text + images) to site. In the back end db will server the data and also calculates rankings of what to push to user based on complex algorithm on the fly real-time.
Our group is familiar with Java and Tomcat/MySQL. We can also easily learn/code in PHP/MySQL. What is the best suited platform for our purpose ?
Though Java seem to be easy to implement for us I am afraid that hosting will be a bit difficult. I could find cloud based php hosting services (like rackspace cloudsites) at reasonable cost. Amazon EC2 is a bit over our heads to manage on day-to-day.
Also any recommendation on hosting ? (PHP or Java) We don't have millions in seed money but about $20K to start with.
Any advice on above or any thing in general approach is much appreciated.
I have a commerce application, asp.net mvc.
I want it to be extensible in the sense others can create other payment providers, as long as they adhere to the interfaces.
/blah.core
/blah.web
/blah.Authorize.net (Implementation of a payment provider using interfaces Ipaymentconfig and paymentdata class)
Now the problem is this:
/blah.core
- PaymentData
/blah.core.interfaces
- IPaymentConfig
where Payment Data looks like:
using blah.core;
public class PaymentData
{
public Order Order {get;set;}
}
IPayment data contains classes from blah.core like the Order class.
Now I want to use the actual Authorize.net implementation, so when I tried to reference it in the blah.core project I got a circular dependency error.
How could I solve this problem? Many have said to break out the interfaces into their own project, but the problem is PaymentData references entities that are found in blah.core also, so there doesn't seem to be a way around this (in my head anyhow).
How can I redesign this?
I am new to android and last year i bought two books of android 1.5. But at that time i was busy in my project so was not able to work on android. Now i want to start android again. Should i go for those books or should i buy new editions
Is there any major change regarding basic learnings?
Two books i am having are:-
Pragmatic Hello Android (New addition of this book is available, But still in beta phase)
Apress begining Android (Dont know about this whether new edition is available or not)
Please let me know.
Thanks
EDIT
here i am not asking about the good books of android, as there are lot of questions regarding that. I can find out from them.
My question is purely related to change in version
What do I need to put in a php code so that the user cannot access it even if he specified the correct url for the page they are trying to access. And redirect it to the logon page. I'm really having difficulty in this matter, everytime I click back button on the browser the user can still access the page
I have created a table with the following structure-
$sql = "CREATE TABLE followers
(
uid int UNSIGNED NOT NULL UNIQUE,
PRIMARY KEY(uid),
follower_count int UNSIGNED ,
is_my_friend bool,
status_count int UNSIGNED,
location varchar(50)
)";
I need to find the uid of the person with max(status_count+follower_count) and whose is_my_friend = 1
I wrote the following query but I ain't getting the correct uid.
SELECT p.uid FROM (select uid,is_my_friend,max(follower_count+status_count) from followers) p WHERE p.is_my_friend = 1;
All I can find information on for the URLLoader object in Actionsript 3.0 involves loading XML files, which I don't want to do. I'm trying to load in a .txt file that I want to parse, line by line with each line being delimited by a comma. Anyone know a method of doing this or a place where I can find some information on how to do this? Thanks!
Hi All,
Any ideas on how to speed this up in IE (performs decent in Firefox, but almost unusable in IE). Basically, it's a tag cloud with a filter text box to filter the cloud.
<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#tagFilter').keyup(function(e) {
if (e.keyCode==8)
{
$('#cloudDiv > span').show();
}
$('#cloudDiv > span').not('span:contains(' + $(this).val() + ')').hide();
});
});
</script>
</head>
<body>
<input type="text" id="tagFilter" />
<div id="cloudDiv" style="height: 200px; width: 400px; overflow: auto;">
<script type="text/javascript">
for (i=0;i<=1300;i++)
{
document.write('<span><a href="#">Test ' + i + '</a> </span>');
}
</script>
</div>
</body>
</html>
thanks,
rodchar
is there any way when using a div for a background image- to limit the height to only the content displayed?
im putting the background image in a div because i want it centered via position:relative but the image doesnt show up unless i put a height on the div, and thats not what i want because i dont want to be able to just scroll down to the bottom of the image where theres no content
ive tried putting the background image on the body css but if the browser is less than the width of the image, it just throws it over to the left and you can only see half of it- is there no way to make the background position:relative on the body?
sorry if that doesnt make sense <
thanks
Hi. I have the following HTML:
<div class="box"><img src="pic.jpg" alt="image" /></div>
<div class="box"><img src="pic.jpg" alt="image" /></div>
<div class="box"><img src="pic.jpg" alt="image" /></div>
<div class="box"><img src="pic.jpg" alt="image" /></div>
I am trying to select the div and the child image both at the same time. I need to use $(this) to select the div. I know I can use $(this).children() or $(this).find('img') to get the image. Is there a way to select both the div and image using $(this) for the div.
Hi all,
How can I use WMIUserID, WMIPassword, WMIAlternateCredentials using C#?
Also, is it possible to get remote computer's Administrator-password?
Please try to explain with examples.
Thanks.
I am trying to update a source image with the contents of multiple destination images. From what I can tell using premultiplied alpha is the way to go with this, but I think I am doing something wrong (function below). the image I am starting with is initialized with all ARGB values set to 0. When I run the function once the resulting image looks great, but when I start compositing on any others all the pixels that have alpha information get really messed up. Does anyone know if I am doing something glaringly wrong or if there is something extra I need to do to modify the color values?
void CompositeImage(unsigned char *src, unsigned char *dest, int srcW, int srcH){
int w = srcW;
int h = srcH;
int px0;
int px1;
int px2;
int px3;
int inverseAlpha;
int r;
int g;
int b;
int a;
int y;
int x;
for (y = 0; y < h; y++) {
for (x= 0; x< w*4; x+=4) {
// pixel number
px0 = (y*w*4) + x;
px1 = (y*w*4) + (x+1);
px2 = (y*w*4) + (x+2);
px3 = (y*w*4) + (x+3);
inverseAlpha = 1 - src[px3];
// create new values
r = src[px0] + inverseAlpha * dest[px0];
g = src[px1] + inverseAlpha * dest[px1];
b = src[px2] + inverseAlpha * dest[px2];
a = src[px3] + inverseAlpha * dest[px3];
// update destination image
dest[px0] = r;
dest[px1] = g;
dest[px2] = b;
dest[px3] = a;
}
}
}
I have the following text:
txtAddressSup.Text
I want the Sup to be replaced by Cus while the whole text remains as is. I have many texts that are in this format:
xxxxxxxSup.xxxxx
Hi All,
I have a div that contains many spans and each of those spans contains a single href.
How do I attach a click event to the a tag?
Thanks,
rodchar
I am writing a program that is declaring an array of 100 integer numbers
and filling the array with random numbers using rand().
All I have so far is:
#include <iostream>
using namespace std;
int main()
{
int random_integer = rand();
My strings are of this kind: City (PR) from a Database, where PR stands for Province.
At the end I want two separate variables. City and PR.
I have to do this with C#. Any idea? Thanks.
I want to transform a line that looks like this:
any text #any text# ===#text#text#text#===#
into:
any text #any text# ===#texttexttext===#
As you can see above I want to remove the # between ===# and ===#
The number of # that are supposed to be removed can be any number.
Can I do this with sed?
Hello,
I am trying to increment a INT column by 1 if a certain field is not null on an update request, currently I have this update too columns,
public function updateCronDetails($transaction_reference, $flag, $log) {
$data = array (
'flag' => $flag,
'log' => "$log"
);
$this->db->where('transaction_reference', $transaction_reference);
$this->db->update('sy_cron', $data);
}
What I need to know is how I can check if the value being sent to the log field is NULL and if it is how could I increment a column called count by 1?