I see. I don't have any such buttons.
Mine looks like this...
I see. I don't have any such buttons.
Mine looks like this...
Ok cool, glad to help.
Hi Suzie
Does this help?
using System;
namespace DaniWebDates
{
class Program
{
static void Main(string[] args)
{
string d1 = "2015-04-04 00:06";
Console.WriteLine(ConvertDate(d1));
Console.ReadKey();
}
static DateTime ConvertDate(string s)
{
return Convert.ToInt32(s.Substring(11, 2)) < 5 ? DateTime.Parse(s).AddDays(-1) : DateTime.Parse(s);
}
}
}
Sorry I don't understand how I can try PayPal? I click on the following page:
https://www.daniweb.com/rewards/earnings
It then says I now have over 2000 reward points. But then it also says I cannot cash out as you need at least 500 points.
Where does PayPal come into it?
Thanks
What error do you get?
You have suspicious looking spaces in ' 8req' WHERE id = '3 '
Ok I see now you wanted to get the decimal portion!
Ok I see.
Well first of all I am not a C++ programmer so cannot give you C++ code. I can give you pseudo code though.
Generate a random number between 1 and 9
Store this in a string
Generate another number between 1 and 9 and if this isn't already in the string, store it otherwise repeat. Use a loop for this.
Repeat the above x times or in this case 3 times in total. Wrap the above in a for statement.
Return the string cast to a number
Does that help? This is just one way of coding this off the top of my head.
Hi - give me an example of how this output would look?
I don't think you need to pass in any arguments to generateRandomNo
You really need to be a bit more specific with your question. It is far too general and doesn't make much sense or read well.
Ok nice one, glad to help.
I first learned MVC from some excellent videos by David Finley on http://www.learnvisualstudio.net/
They were really good and easy to follow.
Plural Sign is also really good - http://www.pluralsight.com
Both of these are not free thouhg so depends on your budget. I think PluralSight have a few free ones thouhg.
@wojciech1 - please don't hijack my posts as my problems don't get answered as the thread becomes all about you and people forget about my actual question - eg the CV thread for example.
Thank you.
I'm not sure I understand your question as I think it could be worded slighly better but possibly you need loopback enabled.
Check out http://opensimulator.org/wiki/NAT_Loopback_Routers
I havec1799 reward points but cannot cash out any.
Any ideas?
Youre welcome.
I will struggle with this as I remember vagueley from Maths classes what a Matrix is but my domain knowledge in this area is not good so over to you other guys!
Is this what you want?
using System;
using System.Data.SqlClient;
namespace DaniWeb.Inheritance
{
class Program
{
static void Main(string[] args)
{
IntegerFactory integerFactory = new IntegerFactory();
StringFactory stringFactory = new StringFactory();
SqlCommandFactory sqlCommandFactory = new SqlCommandFactory();
var anInteger = integerFactory.BaseMethod();
var aString = sqlCommandFactory.BaseMethod();
var aCommand = sqlCommandFactory.BaseMethod();
Console.WriteLine("anInteger is type {0} and T is {1}", anInteger.GetType(), anInteger.GenericType);
Console.WriteLine("aString is type {0} and T is {1}", aString.GetType(), aString.GenericType);
Console.WriteLine("aCommand is type {0} and T is {1}", aCommand.GetType(), aCommand.GenericType);
Console.ReadKey();
}
}
public class GenericFactory<T>
{
public virtual string Name { get { return "Base"; } }
public virtual Type GenericType { get { return typeof(T); } }
public virtual GenericFactory<T> BaseMethod()
{
return new GenericFactory<T>();
}
}
public class IntegerFactory : GenericFactory<int>
{
public override string Name { get { return "IntegerFactory"; } }
public override GenericFactory<int> BaseMethod()
{
return this;
}
}
public class StringFactory : GenericFactory<string>
{
public override string Name { get { return "StringFactory"; } }
public override GenericFactory<string> BaseMethod()
{
return this;
}
}
public class SqlCommandFactory : GenericFactory<SqlCommand>
{
public override string Name { get { return "SqlCommandFactory"; } }
public override GenericFactory<SqlCommand> BaseMethod()
{
return this;
}
}
}
Where in my code do you want the "return this" to go?
Just realied I have a typo
Console.WriteLine("watsit is type {0} and T is {1}",
Shoule be
Console.WriteLine("aString is type {0} and T is {1}",
Yes I know that's what you want but its my pc not yours - what if I want to check my email while I am using your application. What gives you the right to dictate how I can use my pc?
Hi
Ok I'm really not clear on what you are asking here.
So I took your code and got it to compile - a few typos etc but got something working. I then renamed things and played around with it to give it more context - I find things easier to understand that way otherwise it all gets a bit abstract and dificult to follow!
I don't know if how I have renamed things and played around with them conveys your intentions or not but it does at least give us a working code baseline from which to start further discussions.
Hope what I have done helps, if not fire away.
using System;
namespace DaniWeb.Inheritance
{
class Program
{
static void Main(string[] args)
{
IntegerFactory integerFactory = new IntegerFactory();
StringFactory stringFactory = new StringFactory();
var anInteger = integerFactory.BaseMethod();
var aString = stringFactory.BaseMethod();
Console.WriteLine("anInteger is type {0} and T is {1}", anInteger.GetType(), anInteger.GenericType);
Console.WriteLine("watsit is type {0} and T is {1}", aString.GetType(), aString.GenericType);
Console.ReadKey();
}
}
public class GenericFactory<T>
{
public virtual string Name { get { return "Base"; } }
public virtual Type GenericType { get { return typeof(T); } }
public virtual GenericFactory<T> BaseMethod()
{
return new GenericFactory<T>();
}
}
public class IntegerFactory : GenericFactory<int>
{
public override string Name { get { return "IntegerFactory"; } }
public override GenericFactory<int> BaseMethod()
{
return new IntegerFactory();
}
}
public class StringFactory : GenericFactory<string>
{
public override string Name { get { return "StringFactory"; } }
public override GenericFactory<string> BaseMethod() …
I can't help you any more. I'm not a python developer and have never written a python program. I am a professional software engineer though and was able to help with your basic issues initially but you now need someone with more python knowledge than me.
Also its good practice once an item has been resolved to mark it solved and if you have any other questions then post them as new threads.
If you don't know why then whey have you marked this as solved?
Youre welcome.
Why would you want to do that? What gives you the right to take over someone's pc!?
Yep Suzie is spot on. I assume by shared place you mean a network share? If so the app doesn't run there, that's just where the file is. The app runs in memory on the users pc.
What data type is ID in your database?
Can you debug your code, copy and paste the SQL statement and execute it directly against the database - in SQL Management Studio for example - and see what happens. This will give you a much clearer idea of what may be wrong.
You already have the 4. Can you reword your quetion, it doesn't make sense.
So is the code stepping into line 15 then?
To make it not case sensitive just lower case your search term and your search text. I don't mean lower your seach text in your document but in code.
Do you need a semi colon?
if x == "yes":
I think you need speechmarks aroynd yes
Eg if x == "yes"
Hmm thats not what I mean by inconsistency. Does it always behave the same for the same search text. If it does not that would be inconsistent and would be very worrying.
I don't think this is doing anything inconsistent - the behaviour is always the same right?
Looks good.
I have some suggestions which are sincerely intended as to be encouraging.
Firstly I would always use the using statement rather than manually calling Dispose eg:
using (SqlDataReader reader = cmd.ExecuteReader())
{
//Somde code here
}
For a few reasons - firstly you won't forget to call Dispose. Secondly it gives nicely structered indentation making it easier on the eye to see what is happening and thirdly because it is the way most developers do it so its a kind of unwritten standard.
I would also be mindful of the S in SOLID. That is single responsibility principle. This method does a lot. I would split it up a bit more. In Visual Studio a great thing to play with is highlighting a block of code that looks like it could be a seperate method or class and then right click and Refactor - try extracting to method - VS will figure out the parameters and does all the work for you.
Smaller, more cohesive methods are easier to maintain, test and debug.
And finanlly in C# we say methods not functions - sorry if that one is too picky!
Sure - either as a string or as a complex xml type
Change to this and then run it
#faq EM
{
/*display: none;*/
}
You can see what it is doing then - I'm just not clear on its intended behaviour.
Are you learning through books or videos?
Your tags are malformed - put the close div at the end.
Dude that's not even a proper sentenace. We cannot help if you cannot express your question in an understandable fashion!
Cables are so much better and you can even go IP over power.
<img src="/arrowimage.gif" />
Use a loop and just add the digit on each time.
This is pretty basic stuff, may I ask if you are able to program at all in php?
You don't have to use var, you can use this instead:
int[] nonZeroData = intScoreTotalsArray.Where(v => v > 0).ToArray();
"I notice that before it was always showing 20 zeros in the msgbox since I have the array size declared for 20. The problem was that it is not recognizing the number of elements that the user actually inputs and to only display those."
I've fixed this though right or am I missing something?
"delete the class variable for score total." I never saw this variable I don't think so can't comment on that.
To do the statistics you could add the two lines below. Put them in your button click event handler.
txtAverage.Text = intScoreTotalsArray.Where(v => v > 0).Average(v => v).ToString();
txtScoreTotal.Text = intScoreTotalsArray.Where(v => v > 0).Sum(v => v).ToString();
Can you not just hard code this:
Dim x As Decimal = 0
x += Convert.ToDecimal(Table1DataGridView.Rows(0).Cells(1).Value)
x += Convert.ToDecimal(Table1DataGridView.Rows(1).Cells(1).Value)
x += Convert.ToDecimal(Table1DataGridView.Rows(3).Cells(1).Value)
Where Cells(1) is the appropriate column?