|
The .CDR file formats I know of are Corel Draw, and a Mac ISO equivalent.
The chances are that it is a propriatry format, and without looking at the data content, it is impossible to say. There are two options here:
1) Post a data fragment - not too large - and hope we can work it out from that (depends on how "interesting" people find it since it isn't something we will be able to use elsewhere).
2) Contact Huawei directly and ask them. There is a good chance they will tell you or have software to decode it available to download.
I would start with the second option, and try the first if that fails.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
|
First thing I would do is see if I could open the file in Notepad. You'll quickly see how it fits together. If it is a binary file (probably is) it probably has some header part and a contents part. The company owning this format should be able to give you detailed information about this. If it is a binary file try to read it in the bytes and use different encoding/decoding (ASCII, UTF, ...) to see if you can make sense of it then.
You can check out the Encoding class[^] to get you started.
Hope this helps.
V.
|
|
|
|
|
OK, thk, i ll try to understand about it.
that file is binary
Socheat
|
|
|
|
|
First queue of a fixed capacity is used for in mem storage of the objects.
Second one is its snaphot serialized from time to time or during app close to a binary file.
How to join deserialized queue with its in mem version?
During program run initially in mem queue is empty. New objects can be added.
Then a first synchronization event happen in the in mem queue there only objects that are not present in its previous serialization snapshot.
Later it contains newly added objects and the ones present in its serialized snapshot.
Чесноков
|
|
|
|
|
Consider the merge sort algorithm. It might be good enough for merging the two queues.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Console.WriteLine("sat={0}", x);
why we are using this {0}
console.WriteLine("sat",x);
|
|
|
|
|
If you want to print "I am from India", where India is user provided string
you will write it : Console.WriteLine("I am from " + strMsg)
where strMsg = India
It can also be written as : Console.WriteLine("I am from {0}", strMsg)
where {0} is for strMsg.
It is a very useful notation used in C# when you want to show some string where lots of things are dynamic. (Like user provided)
In Turbo c we used to use %d, %s etc for this.
e.g.
Console.WriteLine("I am from {0}, I am {1}. I work in {2}", strCountry, strQualification, strCompany)
without using {0}, {1} it will look like
Console.WriteLine("I am from " + strCountry + ", I am " + strQualification + ". I work in " + strCompany)
It is a bit complicated.
|
|
|
|
|
Just to add to what Pravin said, the "{0}" also allows for formatting of the data.
For example, you can right justify a string, by using "{0,10}" to left pad it to ten characters.
Or you can specify you want an integer in hex with "{0:x4}"
Or you can specify what date format you want.
There are a lot of examples on the net, but there is an MSDN overview here.[^]
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
You are too good....awesome answer..
|
|
|
|
|
Aw, shucks!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
|
|
I need to load a dataset with data from a list of items.
That is to say, I have an excel spreadsheet with a list of category id numbers. I need to load all data into a dataset that matches that list of categories. What is the best way to go about this?
Right now it is easy enough to do, load the spreadsheet into memory, load the dataset for the first category id, process, and the move to the next item in the spreadsheet, but I don't want to reload the data set 60 times. I want something that looks like this for a datatable:
select item from itemsTable
where intCategoryId in @categories
What is the best way to do this? Do I need to loop through my spreadsheet and reload the dataset for each item? Or should I build my spreadsheet information into a comma separated list or something of the sort.
Thoughts?
Cheers, --EA
|
|
|
|
|
Traversing an Excel worksheet, cell by cell is very slow to start with. It is a lot quicker to read a range of cells into memory and then work from there.
And you only need to read to values once and store the DataTable as a static variable so you can continue to reference the DataTable instead of continuously reading from the worksheet.
Hope that helps.
Architecture is extensible, code is minimal.
|
|
|
|
|
It is a good point about the actual datasheet / table, but it actually is outside the scope of my question. The bigger question is one of how to load information into my data table based on the values in the spreadsheet.
Example:
Spreadsheet might look like this
Column1
---------
123
125
129
133
135
And the query for the datatable should look something like this:
select category, item from itemsTable
where itemId = @itemId
At this point I could loop through the values in Column1, whether they are loaded into a datatable, looping through a spreadsheet, whatever. The end result is that I need a datatable that contains the category and item from the items table for every itemId value in the spreadsheet. So the question is whether it is acceptable to use the IN keyword in my dataset query and supply it a list of values as a variable (e.g. instead of where itemId = @itemId, where itemId in (@itemId)) maybe a variable comma separated list?
Or do I need to loop through the source (datatable, excel spreadsheet, whatever) and reload the items datatable for each distinct value in the spreadsheet and process? I am not sure I am getting the point across very well. I guess the real question here is whether you can use the IN keyword and supply an array or comma separated string when loading data with a table adapter or whether you can only use equality with a single value.
|
|
|
|
|
Sorry I got focused on the fact you were reading from excel exclusively. I'm still not quite sure what you are after but that's probably just me
Are you looking for something more along the lines of:
select category, item from itemsTable
where itemId IN (select distinct itemId from sourceTable)
Architecture is extensible, code is minimal.
|
|
|
|
|
That is the general idea. Normally when you load a datatable you feed it an argument like so:
this.tableadapter.fillbyarg(this.dataset.datatable, arg1);
That would load all of the items with category = arg1. Well, I want to load all items from items where category is = arg1 where arg1 is (1,2,3,4,5, etc...). So yes, the IN keyword would be what I would use in a SQL query. My question is twofold. 1) Can you use In and supply the argument like so:
int[] myInt = new int[3];
myInt[0] = 1;
myInt[1] = 2;
myInt[2] = 3;
this.tableadapter.fillbyarg(this.dataset.datatable,myInt);
You see the crux of my dilemma at this point I think?
The second question is whether using In is a good approach or whether there is something I am not considering here.
An alternative is to load the myInt values into a datatable and do something like this:
this.tableAdapter.fillbyarg(this.dataset.datatable, valuefromtable);
Adding that line in a loop through the datatable from the Excel spreadsheet.
|
|
|
|
|
I now understand but my knowledge of TableAdapter these days is vague at best. Sorry, hopefully someone else can help
Architecture is extensible, code is minimal.
|
|
|
|
|
First off, DataSets are rubbish and you shouldn't use them, but...
Isn't there a Filter property you can set after loading all the data?
What are you trying to accomplish?
|
|
|
|
|
I could filter the datatable, yes. Why do you say that datasets (ADO.Net) are rubbish? What would you suggest in alternate? Keep in mind I am using a MSSQL 2000 server, so EF and nHibernate are not good options.
|
|
|
|
|
eddieangel wrote: Why do you say that datasets (ADO.Net) are rubbish?
First off, ADO.net in general is not rubbish. DataSets, DataAdapters, and DataGridViews are. I just use DataTables and DataReaders.
eddieangel wrote: EF and nHibernate
I've never used them.
|
|
|
|
|
An array is defined to be a Jeffian array if it contains at least one prime number and the minimum prime number in the array is equal to the count of all the prime numbers in the array. Recall that a prime number is an integer greater than 1 whose only factors are 1 and itself. For example, the array {3, 6, 7, 10, 5} is a Jeffian array because:
1. it contains at least one prime number
2. its minimum prime number is 3 and that is the count of the number of primes (3, 7, 5) in the array
modified on Wednesday, January 26, 2011 5:20 PM
|
|
|
|
|
Well, good luck. I'm pleased that you've posted this for us to share in. Although, I am confused as to why you are wasting your time posting here when you should be doing your exam. Oh wait, you aren't asking us to write this for you are you? That would be, what's the word I'm looking for, oh yes - cheating and I'm sure that an honest chap like yourself wouldn't condone cheating.
Anyway. Good luck with your exam.
|
|
|
|
|
dude, that's pretty simple, but we're not here to do your homework for you.
you need to try and post what you tried and maybe we can give you pointers.
given the description you should first write a function that answers whether a number is prime or not.
then another function isJeffian that iterates over the given array and counts the number of primes in the array.
if that count is equal to the first argument of the array (and the first argument is prime) then it's a Jeffian array, so return true, otherwise return false.
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|