|
|
I'm sorry, but it's extremely unlikely that anybody here is going to download a file from an unknown source.
|
|
|
|
|
Hi, it just from google docs.
how can i attach here?
Socheat
|
|
|
|
|
I know Google docs. You, I don't know.
|
|
|
|
|
Nope, I'm with Pete on this: anonymous files from unknown people equals no download. Particularly when the person in question names him self "soCHEAT.net". Not promising...
Instead, why not describe what the file is supposed to contain. What file type is it? .DOC, .XLS, .XXX? What application would normally open it? What app created it?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Do you know Huawei Switch? that file is generated from MSC it is CDR. it stored call record for phone number
Socheat
|
|
|
|
|
Presumably you can get the specifications from Huawei then, or an API. I'd be really surprised if they didn't have this information available.
|
|
|
|
|
Yes they have description and format of that file, but i don know how to decode that file in C#. That why i posted that file here.
If anyone can't decode, there nothing
Thanks,
Socheat
|
|
|
|
|
So, they have the description and format of the file available. Well, you're going to have to figure it out for yourself I'm afraid - come back and ask questions if you get stuck on particular parts.
|
|
|
|
|
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.
|
|
|
|