|
Hi
You've missed the timefield switch /T
So I reckon you want
DIR . /B /O:-D /T:C
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]
[drive:][path][filename]
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date/time (oldest first)
G Group directories first - Prefix to reverse order
/T Controls which time field displayed or used for sorting
timefield C Creation
A Last Access
W Last Written
|
|
|
|
|
|
Thank you mate, you've helped a lot and you sound like an expert in DOS so I thought maybe you can assist with this..
The file to be copies has a name format of "PO 123.2011.txt"
Now it is copied, is it possible to generate the next name (i.e. "PO 124.2011") probably using an expression for the math, concatenation and storing it into a temporary variable??
I'm using this for now..
FOR /F "delims=" %%I IN (
:END
START /MAX new.txt
Many thanks mate!
|
|
|
|
|
Yes, I'd say it's possible to generate the next filename using batch commands but probably not advisable as it is going to be difficult to guarantee any kind of robustness. Here's something that will do it but you'll find out that it's a bit of a train wreck with anything other than the expected input format.
@echo off
REM generate next PO NNN.2011.txt where NNN is a number
SET FILENAME=PO 156.2011.txt
REM SET FILENAME=PO ABC.2011.txt
ECHO Initial filename %FILENAME%
REM get 2nd token using '.' and ' ' delimiters
for /F "tokens=2 delims=. " %%a in ("%FILENAME%") do SET /a NNN=%%a
REM what did we get
ECHO NNN %NNN%
REM Increment the value
SET /a NNN=%NNN% + 1
ECHO NNN+1 = %NNN%
SET FILENAME=PO %NNN%.2011.txt
ECHO New filename %FILENAME%
PAUSE
We can do a little bit better by attempting to check if the extracted token is actually numeric and then bailing out if something really bad has happened.
@echo off
REM generate next PO NNN.2011.txt where NNN is a number
SET FILENAME=PO 156.2011.txt
REM SET FILENAME=PO ABC.2011.txt
ECHO Initial filename %FILENAME%
REM get 2nd token using '.' and ' ' delimiters
REM Store token as both number and text
for /F "tokens=2 delims=. " %%a in ("%FILENAME%") do SET /a NNN=%%a & SET TEXT=%%a
REM what did we get
ECHO NNN %NNN% TEXT %TEXT%
REM Should be the same if the token is a decimal number
IF %NNN%==%TEXT% (
ECHO Yippee, got a number
REM Increment the value
SET /a NNN=%NNN% + 1
ECHO NNN+1 = %NNN%
SET FILENAME=PO %NNN%.2011.txt
ECHO New filename %FILENAME%
) ELSE (
ECHO Darn it, got a non numeric token
)
PAUSE
Have fun!
Alan.
|
|
|
|
|
Thank you Alan! That was very helpful.
|
|
|
|
|
How to code prime read code using a while loop?
|
|
|
|
|
Google: .net filestream examples[^]
Is a good place to start, but this link shows where you'd use the while loop
Filestream and while loop[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Hi Everyone,
In Windows OS, if I used UDP protocol to transfer data through only one router (one path), is there a possibility that the packages are out of sequence on the receiver side?
For my application, I want to stay with UDP. I just wonder if I need buffer the data and re-order them on the receiver side.
Thanks a lot!
zipliu
|
|
|
|
|
Yes, it's possible, but highly unlikely. This would be due router misconfiguration, possible buffering issues inside the router, memory failure in the router, ...
It's not just the router that can cause problems. You can also run into issues with switches causing problems where packets would drop or misroute.
If you really are worried about packets arriving in the wrong order, use TCP.
You're making the huge mistake of coding your app to fit a specific network configuration. Don't! How long is it going to be before another router or switch is added to the network? How about if the company moves locations and reconfigures the network for a new location??
|
|
|
|
|
Hi Dave,
Thanks a lot. I will consider that.
The reason for me to stay with UDP is that I will need to broadcast the message to multiple PCs. Using TCP, it takes more efforts to do so.
Thanks.
zipliu
|
|
|
|
|
Well, it looks like you're going to have to study up on multicasting then.
|
|
|
|
|
At any rate, UDP won't guarantee you delivery of a packet, so out-of-order is not your only concern.
|
|
|
|
|
Hello
Any one with recommendation for chart controls library? I've used Infragistics WPF suite - XamDataGrid is great (Drag group by drill down filtering... etc, but no inline update), but must say their Charts - and support sucks.
dev
|
|
|
|
|
Microsoft acquired some Dundas code and released Microsoft Chart Controls. They are great when you think you are getting them for free.
"You get that on the big jobs."
|
|
|
|
|
I've got a UserControl that contains a panel, that is meant to contain other controls but only of a certain type.
This type is another UserControl that implements a specific interface.
Now I can add this child UserControl and it displays ok.
But none of controls on the child user control display, and when I update a property of one of those controls (say the .Text) my parent control stops being drawn (big red cross , the child UserControl is still drawn though.
Any ideas...I think its either a setting on Parent UserControl, or maybe an interface I'm missing.
|
|
|
|
|
Are you doing any drawing yourself or just relying on the controls to draw themselves??
If your code is taking too long to do anything during a repaint, you can get the Big Red X.
If your code is doing custom drawing, then you either didn't use the Graphics object that was passed in through the PaintEventArgs or, you borked up the Graphics object somehow, or your code took too long to draw, or ... this list goes on and on.
Without seeing your drawing code, it's pretty much impossible to pinpoint what went wrong.
|
|
|
|
|
I think it was a mix of not passing the PaintEventArgs Graphics, and not calling InitaliseComponent() on the child control, which doesn't help!
|
|
|
|
|
Hi All,
I need to create a .exe file from visual studio(Windows Application).
I already have .exe file in bin folder...but I want to have exe file which should be deployed with release mode.
note: i dont want setup.exe file i want only .exe meaning if I click the exe file it should execute immediately.
Please Advice.
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Just build the code in Release/Any CPU mode. It will create the exe and other required files in bin/release folder. You can use that.
Update (Thanks to Rob): Make sure you copy all the files in the folder to the client machine. Moreover, the application still may or may not work on the client computer. For instance, if you are using ODP.Net (Oracle Data Access provider), it must be installed on the client computer. Copying plain exe will not work here.
Make sure you have properly analyzed and considered most of the possibilities before you distribute the exe and associated files.
"The worst code you'll come across is code you wrote last year.", wizardzz[ ^]
modified on Friday, July 22, 2011 4:06 AM
|
|
|
|
|
As D@nish says but you need to copy all the files from the release bin folder and you also need to make sure the client PC has the correct version of .NET Framework. There is no guaranteed it will work.
"You get that on the big jobs."
|
|
|
|
|
Good point. I missed it in my reply. Updated it. Thanks.
"The worst code you'll come across is code you wrote last year.", wizardzz[ ^]
|
|
|
|
|
This doesn't directly answer your question, but we used to deploy applications at our company like that, then we finally switched our deployment to ClickOnce.
We have our internal software deployed on an XP Pro box, no bells and whistles, and it handles the deployment fine. You'll have to set up your IIS first, but if you do updates to alot of machines, it really is worth looking into.
Good luck!
|
|
|
|
|
Hello, I am half way through developing a graphing control. It includes the normal things like pan/zoom/multiple y axes. It is intended to be populated by reading data from a CSV file or something like that, but I can change that to whatever later if I need to - it's just a datasource.
The trouble I am having is with the amount of data. Lets say I have 131200 data records to plot, and only 1000 pixels to plot them in. Now I have two options:
1. Plot the record for each pixel.
2. Plot every record, using PointF's and letting windows sort it out.
The downsides are (respectively):
1. Data is missed, or stepped over. If we zoom in the data changes, this doesn't look good.
2. It takes ages drawing a 131200 points of data, and when zooming/panning it's slow. I have thought about plotting the data onto a offscreen bitmap so that panning is fast, but that doesn't help zooming.
Please don't suggest using transformations - they are slow when using large data sets.
A bitmap of the data size would also be unusable ( e.g. 131200x600x24 bit is about 250 Mb).
Any help on how I could plot the image for both speed and accruacy.
Many thanks,
|
|
|
|
|
Hi, I am curious to ask you if you have come up with a strategy for your solution yet, and, have you considered doing this in WPF rather than WinForms.
I think a critical factor here would the latency of time-to-display you, or the end-user, would be willing to tolerate. Can the end-user manipulate the size of the view-port ?
You mention having "1000 pixels to plot them in:" I'm trying to infer from that number a possible size of view-port, and ... assuming 3 bytes per pixel for color information, or 4 for color + alpha ... I come up with a very small view-port: unless each virtual-pixel is 'magnified' into a chunk of many screen pixels.
A final question: can you assume that you are dealing with a 'static' data-set here, or, are you getting real-time changes ?
The discussion here[^] may give you some ideas for strategy. My guess is you are going to need 'unsafe' access to the 'raw' bytes.
... edit 1 ...
Can you assume the consumer of your application has a certain amount of memory available ?
The discussion here[^] (particularly the comments by MusiGeneis and Hans Passant) may be useful to understand some 'misleading' aspects of the GDI+ "out of memory" Exception, and Passant's answer provides a useful Enum of GDI+ error codes you can use.
... end edit 1 ...
best, Bill
"Reason is the natural order of truth; but imagination is the organ of
meaning." C.S. Lewis
modified on Monday, July 18, 2011 3:05 AM
|
|
|
|
|
I am in the end way of solving hooked process and related problem. I have extracted the controls some how of other managed processes and simulate those controls on the some other seperate process. Now after somehow drawn those controls on other processes exactly on those position at which they were inside the original processes, I want to send input to those actual processes , which do occur on the simulator process'es simulated controls. So that If somehow the simulator's control (e.g Button) recieve "click" , it should transfer to actual process button control's event handler
Let say I have managed process(TestProcess-A) having several controls (e.g Buttons,TextBox,TextAreas,Grids) and I have transferred all the properties associated with each controls to some other remote process (let say Simulator Process B) and drawn these controls exactly at the same position where it was in actual process after reading these properties.
I want now, if some how the click occured on these simulated controls, it must flown towards actual controls drawn on actual process. i.e if some SIMULATED Button recieve click on Simulator's process, it should occurred and on the actual process (Test Process A)'s actual Button.
So that if some functionality written in that buttons's event handler, it should be executed after there in actual process (Test Process-A).
Note:
I am developing .NET automated testing framework, for that I need to automate all managed processes those having GUIs.
|
|
|
|