|
|
Thanks, though I was not able to follow the link (500 error).
Tanks for your support
Pat O
<a href="http://currentchaos.blogspot.com/">Blog</a>
_ _ _
|
|
|
|
|
I was able to make it work. The unfortunate assembly load error was a result of invalid command line arguments. Here is the syntax for those that are interested:
libcheck -full C:\temp\CNX_2.0 -store full 2.0.59.0
libcheck -full C:\temp\CNX_2.1 -store full 2.1.150.0
libcheck -compare 2.0.59.0 2.1.150.0
In this example the 2.0.59.0 and 2.1.150.0 are the build numbers of the 2.0 and 2.1 releases respectively.
Pat O
Tanks for your support
Pat O
<a href="http://currentchaos.blogspot.com/">Blog</a>
_ _ _
|
|
|
|
|
Hey, I have created an array by reading in information from a text file and parsing it. The information follows different patterns and are difficult to parse completely in one go. However there are repeating patterns with keywords that I can use to set up different grammar structures such as line type (each different type of line starts with A,B,C,D, or E. I would like to use something like <if array ="A" then call AGrammarStructure> but I have no idea how to pass the rest of the array on to the method. Even then if i get that far, how do i say stop to the AGrammarStructure and move back to the original comparison?
This is my code so far, its all experimental so doesnt do a lot:
static void Main(string[] args)
{
string filename;
//This just allows me to change file name with different structures
do
{
Console.WriteLine("enter filename ");
filename = Console.ReadLine();
//calls the parsing method
//args inlcluded cause i cant use filestream without
parse(args, filename);
}
while (filename != "STOP");
static void parse(string[] args, string filenameload)
{
char[] delimiterChars = { ',' }; //set parse parameters
string fileextenstion = ("e:\\" + filenameload + ".txt");
//Opens the log file
FileStream file = new FileStream(fileextenstion
, FileMode.OpenOrCreate, FileAccess.Read);
//Reads in
StreamReader sr = new StreamReader(file);
string readlength = sr.ReadToEnd();
string Text = readlength;
sr.Close();
file.Close();
string[] words = Text.Split(delimiterChars); //parse contents
FileStream endfile = new FileStream("e:\\endfile.txt", fileMode.OpenOrCreate, FileAccess.ReadWrite);
StreamWriter sw = new StreamWriter(endfile);
if (words[1] == "A")
Console.WriteLine("AGRAMMAR");
if (words[1] == "B")
Console.WriteLine("AGRAMMAR");
|
|
|
|
|
Do you really want to remove the first element of the array?
I can guarantee you that you will not like any of the ways in which you could do that.
I'd recommend you just pass the entire to the other function, if the number of elements that you wanted to drop from the beginning of the array is variable - just pass an index to the function so it will know where to start looking.
|
|
|
|
|
To be perfectly i dont know what i want to do with this... I want to be able to select different grammars depending on the inputs given. All I am looking for is the best way to first determine what structure does a line/lines follow (ABCDE), then parse according to the structure, then set different variables to what is left. What With only adding the following code, not changing original I receive an error message
if (words[0] == "A")
Console.WriteLine("AGRAMMAR");
AGrammar(words, Text);
if (words[0] == "B")
Console.WriteLine("AGRAMMAR");
BGrammar(words, Text);
public void AGrammar(String[] AType, string Text)
{
char[] delimiterCharsA = { '4','5','6'}; //set parse parameters
AType = Text.Split(delimiterCharsA);
Console.WriteLine("Next line should repeat");
Console.Write("123 ");
}
public void BGrammar(String[] BType, string Text)
{
char[] delimiterCharsB = { '1', '2', '3' }; //set parse parameters
BType = Text.Split(delimiterCharsB);
Console.WriteLine("Next line should repeat");
Console.Write("456 ");
}
If the file has "A123456" then the output should be "123 123"
If the file has "B123456" then the output should be "456 456"
But i get the error an object references is required for the non-static field, method, or property
|
|
|
|
|
alwaysthinking wrote: But i get the error an object references is required for the non-static field, method, or property
You tried to call a non-static method from without a static function.
The best way to fix that, would in this case be making the functions AGrammar and BGrammar static.
|
|
|
|
|
You can use an index and pass it with a reference (use the ref keyword)
Natza Mitzi
|
|
|
|
|
Hi guys!
I am very new to web programming and I desperately need your help.
I have created a webform with a grid that pulls data from the database on a daily basis, today's data is different from tomorrows data. Here is my problem if I open the form today it will pull the data and then if I open it tomorrow unless I hit the refresh button it still pulls "Yesterday" data. Is there something I am missing that would refresh the form on load everytime.
Please help!!
Sameer
|
|
|
|
|
Not sure how you are passing the date from UI to underlaying database layer, but you should verify that you are passing the correct date by debugging.
|
|
|
|
|
Saamir wrote: Is there something I am missing that would refresh the form on load everytime.
How about the form's load event, or maybe a timer
|
|
|
|
|
|
I see you are storing the selected values in Session, so you can use that value from the second page.
e.g.
Summary.aspx
protected void Page_Load(object sender,EventArgs e)
{
if(!Page.IsPostBack)
{
Pool pool = Session["POOL"] as Pool;
if(pool!=null)
{
string selectedYear = pool.Pool_Year;
string selectedCategory = pool.Pool_Category;
}
}
}
I hope I have not misunerstool your question.
Second thing you can also pass this parameters as querystring, if there is no security concerns.
Response.Redirect("Summary.aspx?year" +ddlYear.SelectedValue + "&category=" + dlCategory.SelectedValue);
|
|
|
|
|
Thank you, that is what I was looking for. However, I'm not sure how to pass the value into the query because the gridview that I am using is a user control that is already populated with all of the data. I need to restrict this to just show the data that meets the criteria of the user selection, so I need to change the datasource. Any ideas on how to do this would be greatly appreciated!
Thanks
|
|
|
|
|
Terick wrote: I am using is a user control that is already populated with all of the data.
Why are you prepopulating the gridview. I think you should populate it when you have the user selection criteria. When you get the user selection criteria, in page load bind the gridview with selection criteria.
OR Can't you rebind the gridview again when you get the user selection criteria?
[Edit]
By rebinding I mean clear the current datasource and set the new datasource. I hope I make it clear.
[/Edit]
|
|
|
|
|
Not long ago I posted on Code Project that I was developing my own game and now I just need one crucial code that attaches Autodesk Maya to C# so users can login and start playing the game. I really hope you can help as it would make me much happier to know I have a code to finish the project off.
Thanks very much
Andrew
Andrew McIntyre
|
|
|
|
|
I've not heard of this so assuming you've searched, there may not be a ready made solution.
According to this page[^]
'all your work can be scripted or programmed using a well-documented and comprehensive API'
get this API and you should be able to code it yourself.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Where can I find this API from and is it available to download and place the code in C#.
Andrew McIntyre
|
|
|
|
|
Contact Autodesk themselves.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
What should I tell them
Andrew McIntyre
|
|
|
|
|
How about asking for the Maya API so you can write you own code against it?
|
|
|
|
|
There is so many e-mail address for Autodesk and don't know what one to select. I think I will contact support and do it that way.
Andrew McIntyre
|
|
|
|
|
I was hoping someone could help me out in my search to code a calculator that would allow me to create something similar to a national debt calculator. I'm referring to the never-ending calculation of a nation's debt. See this link for an example: http://www.babylontoday.com/national_debt_clock.htm
The use I require this for is a bit different, but the principal is the same. All data entered would be calculated and continuously added to the displayed total. My purpose is an increased pollution meter.
A quick explanation: my local city council is removing two lanes of traffic from a bridge to use for bicycles and it's going to tie up traffic like crazy. I'm trying to put together a campaign to change the bridge back and this calculator will be integral to any success we could have.
Here is a breakdown of the calculation and data I will use to calculate the total I would like displayed as it increases.
a*b*c=d
a = number of cars per hour, minute or second that use the bridge. There will be 16 different hourly totals per day for all 7 days of each week. I will change these totals as traffic numbers are calculated by the city. To start they would be fixed, but I would require the ability to enter as often as I need to change them as traffic patterns change.
b = increase in minutes of each car's commute through the area. This as well will be input once per hour for 16 hours for all 7 days each week. Volunteers in their cars will supply their time which will then be input by myself. So, before the changes an average commute may take 10 minutes to get through the area. After the changes, if the commute is now 18 minutes, 8 minutes would be entered for b.
c = average carbon emissions by minute (0.048kg or 0.11 pounds/minute). This will be the only fixed number, in lieu of having drop down menus for each year/make/model of cars as found on carbon footprint sites.
d = total and needs to count continuously like the national debt calculator for a more dramatic effect.
Also, rather than having the calculator display a unit of measure, which in this case is carbon, I'd just like none. The reason being that I'd like to use this same calculator 2x, and change the 'c' in the equation to total the extra gas tax the government is making by increasing people the amount of gas wasted as they sit in their cars stuck in traffic. So the second calculator would be monetary.
I see this project would have two parts (front and back ends), one for me to input the numbers as I get them, while the second is the continuous tally and would be displayed for all to see on a web site built for the campaign. The tally meter needs to have a web 2.0 modern look as this will get HUGE attention in the media in my city.
I've had a tough time finding anything close to what I need on the net, and my thoughts are that my internet searches have been fruitless because I'm unaware of the proper name for such a calculator.
Not sure what language would be best for this application or where to begin. Need help and advice.
Anyone............thanks in advance.
|
|
|
|
|
lenboy10 wrote: a*b*c=d
Great - you're nearly there if you have the algorithm sorted - now you just need to provide the UI and use this in the code behind.
lenboy10 wrote: use this same calculator 2x, and change the 'c' in the equation
Create an interface IMySaveThePlanetCalculator and create two classes that provide their own implementations of it.
lenboy10 wrote: sure what language would be best for this application
Well C# is likely to be the answer seeing as this is posted in the C# forum!
For your information so you don't get flamed in future... have a go, and post when you get stuck at specific points providing the relavent code. General 'concept' issues, especially without even the language decided, shouldn't be placed in any language specific forum.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Thanks Dave,
Not sure is you're an administrator, so if you are feel free to remove my post and put in another category. I'm really not sure what language is best suited for this. I'm a novice if you can't tell.
|
|
|
|