|
Now you come to mention it...
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
GuyThiebaut wrote: Workflow systems I have seen are generally for sheep who are unable to keep
organised - they kill all creativity and turn workplaces into factories for the
walking dead!
We had one at the last place I worked at, your asessment isn't too far off. Wasn't as cool as a zombipocalypse though.
|
|
|
|
|
My experience was they they are a product of marketting departments.
Because process flows are constantly changing these sorts of workflow applications need constant tweaking and recalibration.
As a consequence they become a good source of revenue for the companies selling them, who need to supply consultants to help tweak the systems, and a good way to keep the imagination and creativity of workers in check.
Call centres are good examples of places that use workflow systems... (when I say good examples the word 'good' is open to interpretation)
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
Now I'm intrigued; wish I could read the post.
|
|
|
|
|
You didn't miss anything, it was just an advert for some squalid enterprise's COTS workflow system
The only thing that distinguished it was a paticularly florid use of English peculiar to Indian marketing departments, if recent evidence is anything to go by.
|
|
|
|
|
GuyThiebaut wrote: into factories for the walking dead!
Working in such a company now, I already thought it was strange that I feel a growing urge to eat my colleague's brain. Guess I need to find something to move on before it is too late !
V.
|
|
|
|
|
Hi,
I'm trying to find a particular node in treeview. I used below code to find out, but not working. Please let me know how to find out. Thanks in advance
approach 1:
treeView1.Nodes.Find("Company", true)
approach 2: it is searching at only one level, not child nodes
foreach ( TreeNode tn in theTreeView.Nodes )
{
if ( tn.Text == "Company" )
{
return tn;
}
}
My treeview:
Business
|__Company
| |__BBS
| |__CBS
|__Prod
|
|
|
|
|
When creating your TreeNode s, did you use the correct version of the Add [^] method, to insert a search key in each one?
The best things in life are not things.
|
|
|
|
|
You will need to use a recursive search. Or if you search often, you may want to also have a Dictionary<string,TreeNode> to help out.
|
|
|
|
|
The Nodes.Find() method searches keys and not text. So, if you want to search for a node, you must have added the node with a key.
treeView1.Nodes.Add("key1", "text1");
TreeNode node1 = treeView1.Nodes.Find("key1", true);
|
|
|
|
|
|
C# WinForms .NET 4.0 Client FrameWork, WinForms TreeView
Hi, Shameel gave you the answer you need ... you need to make sure a TreeNode Name (string) is used as the argument to TreeNodeCollection.Find ... but, since I've been working with the (original WinForms) TreeView this week, I'll include a few notes here from my own recent TreeView "brain top-up" I hope will be useful to you.
0. a Treeview NodeCollection is not a Generic Dictionary: you can have multiple Keys with the same Name (key) as well as Text (value). imho: it would be passing strange/nuts to have duplicate Name/Text (key, value) TreeNode objects with the same Parent node, or being children of the top-level TreeNodes object, but you can do it.
1. the result of TreeNodeCollection.Find will be an array of matching TreeNodes.
2. if you expect zero, one, or a known number, of matches to occur, or you just to plan to handle the first of potentially multiple matches, you can use the length of this array as an indexer for a switch statement.
Of course, if the Nodes of the TreeView are being created, added, on-the-fly, or updated real-time from some DataSource, and you have potentially an unknown number of duplicate Keys, and you need to take action based on all the matches.then you'll need to enumerate the result of Find if #matches > 1 ...
In the history of .NET WinForms, TreeView and its NodeCollection object came before Generic Dictionaries, and, with hindsight, in my humble opinion, it would have been better if the 'Name property of a TreeNode were referred to as the 'Key, and the 'Text property referred to as the 'Value.
With Linq, you can now can use the LookUp special form of Dictionary; for example: LookUp (implementing ILookUp) is the return type of such operators as ToLookUp, which also allows duplicate keys. I intend to add a brief CP 'Tip/Trick' on ToLookUp this week.
best, Bill
"Reason is the natural order of truth; but imagination is the organ of
meaning." C.S. Lewis
|
|
|
|
|
Hello,
I want to make a web service that receive files using MTOM:
[WebMethod]
public void Upload(string FileName, byte[] buffer, long Offset)
{
string FilePath = Path.Combine(UploadPath, FileName);
using (FileStream fs = new FileStream(FilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.Read))
{
fs.Seek(Offset, SeekOrigin.Begin);
fs.Write(buffer, 0, buffer.Length);
}
}
i have this error : System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path 'C:\MTOM\AA' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at MTOM.Service1.Upload(String FileName, Byte[] buffer, Int64 Offset) in C:\Documents and Settings\Administrateur\Bureau\MTOM\MTOM\MTOM.asmx.cs:line 41
|
|
|
|
|
|
A rather philosophical question - "How to optimize the maximum number of threads housed by a thread pool/application process?"
Couple thoughts came to my mind:
OPTION 1: # core x # CPU = # threads
Example, Quad core dual CPUs, 4 x 2 = 8 threads
This way, each core gets assigned a thread? But if work load primarily comprises of execution of SQL stored procedures which actually runs on another machine, makes senses to spin off even more threads so calls are routed/started ASAP.
OPTION 2: Initialize thread pool by setting # threads = # core x # CPU
Then self adjust daily and monitor work completion history/duration.
Self tuning has advantage that it doesn't matter whether actual work is done on *this* server or *another* server or a mix between two, it'd tune autonomously.
But in any case, say Quad core dual CPUs, 4 x 2 = 8 threads ---> We can always allocate more threads but does it make any sense? Remember threads executions really are time slices of avail CPU/system resources.
How do you optimize thread pool size?
dev
|
|
|
|
|
The maximum number of threads which can be executing at once is the number of cores available. (Any more than that and you are time slicing.) Threads which are in waits don't count (including asynchronous UI/network calls). Threads are relatively cheap* to create so there is no problem with having your pool, say, twice the size of the maximum number of simultaneous threads.
Once you start getting into large scale multithreading, though, your performance issues are not related to full use of the CPU, but marshalling shared data, synchronisation between threads and making best use of the cores' caches. Optimising your data partitioning is likely to be a better place to gain speed than the thread count.
(*: Relatively. Don't create 200 threads. But a modern OS can handle 20 threads from your application without noticing.)
|
|
|
|
|
BobJanova wrote: Threads are relatively cheap* to create
Actually, threads are very expensive to create. They take a long to time spin up and, by default in .NET, every thread comes with a price of 1MB of memory for stack space.
|
|
|
|
|
'A long time' is a few milliseconds and 1MB is trivial on a machine with gigabytes to play with. As long as you're using them to actually do something useful, the overhead of starting a thread is irrelevant compared to the time and memory actually processing data. They are 'expensive' on one scale, but in terms of real applications on a typical desktop or server configuration, as long as you don't go nuts (hundreds), they're so cheap it doesn't matter.
If you start dealing with mobile or embedded devices then yes, it suddenly becomes something you must think carefully about again.
|
|
|
|
|
If you're spinning up a few threads, sure, it doesn't really matter.
But when noob's start spinning up a couple of hundred of them, or create threads that take longer to spin up than the code they're executing, or start cranking out threads out of a loop, the costs escale dramatically.
Me, I know enough to use threads out the pool or start up just enough to do the job and recycle them myself.
and not every machine has GBs of RAM to play with. Most of the machines around here where I work are 512MB.
|
|
|
|
|
Then I think we agree . (My initial answer said 'cheap is relative, don't start 200' because yeah, that's dumb.) I think it's better to have a thread pool that is possibly too big by a factor of 2 or so (i.e. 15-20 on an 8 core machine) than risk not making use of all the cores you want, if it's the kind of app where you'd be asking about optimising that number instead of letting the framework pick a good one.
|
|
|
|
|
Yeah, we're on the same page.
I've seen crap code where they're launching thread after thread after thread (one per record!) and wondering why the app performs like crap or ends up crashing the machine entirely.
I tend to preach an over-abundance of caution around here (where I work) when helping people with their code. Spawning/Using a new thread/threadpool should be the last thing you think of if you want your code to run faster.
|
|
|
|
|
Ok, my first time here, don't kill me if I posted in the wrong forum. Anyway.
I have two questions, both regarding sorting a grid in my MVC3 application.
This is what my grid looks like (column names are in swedish):
@(
Html.Grid<ContactListItem>(Model.Contacts)
.Sort(Model.GridSortPageOptions)
.Columns(column =>
{
column.For(x => x.Id).Named("Id").SortColumnName("Id");
column.For(x => x.FirstName).Named("Förnamn").SortColumnName("FirstName");
column.For(x => x.LastName).Named("Efternamn").SortColumnName("LastName");
column.Custom(x =>
{
if (x.Company == null) return "Oknuten kontakt";
else return Html.ActionLink(x.Company.CompanyName, "Show", new { controller = "Company", id = x.Company.Id });
}).Named("Företag").SortColumnName("CompanyName");
column.For(x => x.MobilePhone).Named("Mobil").Sortable(false); ;
column.For(x => x.Telephone).Named("Telefon").Sortable(false); ;
column.For(x => x.Email).Named("E-post").Sortable(false); ;
column.For(x => x.IsContactPerson ? "X" : "").Named("Kontaktperson").SortColumnName("IsContactPerson");
column.For(x => x.IsInvoiceReference ? "X" : "").Named("Fakturareferens").SortColumnName("IsInvoiceReference");
column.For(x => Html.ActionLink("Ändra", "EditContact", new { controller = "Contact", contactId = x.Id, caller = "contactlist" })).Named("Ändra").Sortable(false);
})
)
1) As you might figure, "Company" is a sub property of Contact. When I sort on the Company field, it automatically sorts on the ID property of Company. However, I want it to sort based on the name of the company. How can I use SortColumnName for this? Is it even possible? If it is of any importance, I use Fluent NHibernate. A quick solution would be to add an additional property ("CompanyName") to my domain object, but that would be REALLY ugly.
2) When I hit one of the column names in order to sort, a new label appears next to the column name, saying "(asc)" or "(desc)", depending what way it sorts the items. I would like to be able to change this text to either an other language or to an image (like a tiny arrow pointing up/down).
Thank you!
Edit: spelling >_>
/Erik
What does Abraham mean?
modified on Tuesday, July 26, 2011 6:13 AM
|
|
|
|
|
Ok, so, my second question was answered by a colleague. Simply, these two lines had to be located:
thead th.sort_asc a:after {content: " (asc) ";}
thead th.sort_desc a:after {content: " (desc) ";}
The css property "content" confused me since I had never seen it before. Neither "(asc)" or "(desc)" would show up in the page source in the web browser and I couldn't find it using the developer tools in Chrome. However, the content property is handy and I could simple change the asc/desc text to utf8 arrow symbols
Question no.1 remains unsolved. I think I will have to do quite a bit of hacking to solve it. If I solve it before someone else I'll post my findings here.
Edit: spelling again..
What does Abraham mean?
|
|
|
|
|
Hi,
I'm trying to add new group,
but getting an error:
error (0x80005000)
this is my code-
<br />
public GroupPrincipal CreateNewGroup(string sOU, string sGroupName, <br />
string sDescription, GroupScope oGroupScope, bool bSecurityGroup)<br />
{<br />
PrincipalContext oPrincipalContext = GetPrincipalContext(sOU);<br />
<br />
GroupPrincipal oGroupPrincipal = new GroupPrincipal(oPrincipalContext, sGroupName);<br />
oGroupPrincipal.Description = sDescription;<br />
oGroupPrincipal.GroupScope = oGroupScope;<br />
oGroupPrincipal.IsSecurityGroup = bSecurityGroup;<br />
oGroupPrincipal.Save();<br />
<br />
return oGroupPrincipal;<br />
}<br />
<br />
public PrincipalContext GetPrincipalContext(string sOU)<br />
{<br />
PrincipalContext oPrincipalContext = <br />
new PrincipalContext(ContextType.Domain, sDomain, sOU, <br />
ContextOptions.SimpleBind, sServiceUser, sServicePassword);<br />
return oPrincipalContext;<br />
}<br />
The code thaken from here-
Everything in Active Directory via C#.NET 3.5 (Using System.DirectoryServices.AccountManagement)[^]
i think the error comming from here-
GroupPrincipal oGroupPrincipal = new GroupPrincipal(oPrincipalContext, sGroupName);<br />
what i'm doing wrong?
|
|
|
|
|
You should have received an associated error message. Post it here.
|
|
|
|
|