Posts

C# LINQ - sort and group a Dictionary<string,DateTime> by date with maximum group size -

i looking created batches dictionary<string, datetime> following constraints: all items in batch share same date there can no more x items in single batch. if there more items same date, batch must created. i have worked out following logic, wondering if there other more succinct way of doing linq. using system; using system.collections.generic; using system.linq; using system.text; namespace dictionary_sort_by_value_test { class program { static void main(string[] args) { int maxbatchsize = 3; dictionary<string, datetime> secs = new dictionary<string, datetime>(); secs.add("6571 jt", new datetime(2011, 1, 10)); secs.add("6572 jt", new datetime(2011, 1, 12)); secs.add("6573 jt", new datetime(2011, 1, 12)); secs.add("6574 jt", new datetime(2011, 1, 12)); secs.add("6575 jt", new datetime(2011, 1, 10...

asp.net - adding signature in a pdf file -

possible duplicate: adding digital signature pdf file 1). user upload pdf file 2). , upload signatures 3). embed signature in pdf file you going need pdf editing library. i've used pdfsharp in past , works well. http://pdfsharp.com/pdfsharp/

Print defined content using Javascript -

Image
i used the solution question shows url on document. there no way remove url within html page. you'll need change in printing settings of browser - if browser allows to.

Which is the maximum selectables rows in mysql with c#? -

hello developening c# app selecting , comparing data on db, on table has more 500'000 records. using mysql connector, , going : select * table from table. question is: recommended use select * without limit? can process gives problem if select 500000 records @ once, or should user limit selecting records in groups? asking beacause in vb got problems kind of select, makes stops program. thanks all. edit : select function: public object[] queryselect(string query) { idbcommand dbcmd = dbcon.createcommand(); dbcmd.commandtext = query; idatareader reader= dbcmd.executereader(); arraylist result = new arraylist(); while (reader.read()) { hashtable ht = new hashtable(); int fieldcount = reader.fieldcount; (int = 0; < fieldcount; i++) ht.add(reader.getname(i), reader[i]); result.add(ht); } reader.close(); return result.toarray(); } i suppose use sqlcommand.executereader , sqld...

c# - How to encrpyt / decrypt data in chunks? -

i'm quite new c# , encryption please have patience me. want save binary data ("objects" - in fact parts of objects, can't / don't use serialization, binarywriter , similar) , want encrypt in memory , write using filestream. @ first wanted use sort of xor didn't know easy break, changed code use aes. the thing have relatively large files , quite need change or read 32 bytes of data. must capable of encrypting 1 chunk of data , capable of decrypting desired chunks of data. came following solution. when saving data loop through data , inside loop encrypt chunk of data , write file. while reading, have loop reads chunks of data , inside loop have declare decryptor, find inefficient. here's code encryption & saving: //setup file stream saving data filestream fstream = new filestream(filename, filemode.openorcreate, fileaccess.write, fileshare.read, 1024, false); //setup encryption (aes) symmetricalgorithm aes = a...

performance - c# program very slow and hangs mstsc -

i'm building c# program company. when test program company's laptop runs smooth , stable. when run program on microsoft terminal client, on listview can have around 1000 rows , 5 or 6 columns starts slow way down until nothing responds , terminal client unusable. code form 1000 lines. what can improve performance? code inefficent or there limitations on mstsc have take in considiration? you need tune down mstsc experience settings: run mstsc, click on options>> button. goto experience tab. either change connection speed or turn off of options (particularly "menu , window animation") you can save these settings default or save rdp file particular connection don't need tweak these every time.

php - Symfony sfGuardPlugin password recovery -

i supporting site built on symfony. there problems regarding kind of "admin page". while not knowing whole thing reading logs , comparing recent backups think able fix issue (some developer removed route, did not fix template). i not have admin password site, have root access server , super access database (in case postgres). can me how create myself account without knowing current passwords? disclaimer: not have knowledge php's oop interface not programmer, sysadmin. edit : symfony version 1.0.16 try logging server , changing symfony project's root directory. there's "symfony" script/link there (the details depend on os , how symfony's set up; might able run ./symfony rather needing php symfony ). run see whether basics working: php symfony if works, should list of possible tasks can do. if you're using sfguardplugin, should see tasks guard:create-user . to more information on task, try like: php symfony guard:c...