Fórum o programování v .NETu - Visual C#, Visual Basic, Visual J#, Visual C++ .NET http://www.dotnetforum.cz Fórum o programování v .NETu - Visual C#, Visual Basic, Visual J#, Visual C++ .NET cs-cz ales.dokoupil@email.cz ales.dokoupil@email.cz http://feed2.w3.org/docs/rss2.html 60 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Re: BindingSource.AddingNew Event http://www.dotnetforum.cz/viewtopic.php?f=53&t=1208&view=unread#p6865 od: blasius v 19. 5. 2012 <br /> Tak jsem s tím dlouho zápasil, až jsem přišel na řešení, které snad funguje. Bindnout to ne se selectem, ale s listem ze selectu a zdá se že to funguje: [code:17a7zpv3] void FormInvoiceLoad(object sender, EventArgs e) { bsMain.DataSource = (from a in db.Dokuments orderby a.DoYear, a.DoNumber where (a.DoDokument == ClassDocuments.DcInvoice) //nechceme aby se zobrazovali jiné doklady než faktury select a).ToList(); } [/code:17a7zpv3] <hr> 2012-05-19 06:22:56 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Re: BindingSource.AddingNew Event http://www.dotnetforum.cz/viewtopic.php?f=53&t=1208&view=unread#p6864 od: Phobos v 18. 5. 2012 <br /> Dej si breakpoint do event handleru AddingNew a podivej se na typ bsMain.List. Mne podobny kod funguje at je kolekce prazdna nebo plna... Je mozne, ze jsi vyvolal pridani [b:26ouzp81]pred tim[/b:26ouzp81], nez jsi jakkoliv nastavil bsMain.DataSource? Zkus hned prvni nastavit bsMain.DataSource = nejakaDbLinqQuery; <hr> 2012-05-18 15:51:22 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Re: resize obrazku a jeho premiestnenie http://www.dotnetforum.cz/viewtopic.php?f=53&t=1210&view=unread#p6863 od: Phobos v 18. 5. 2012 <br /> Pro maximalni kvalitu pouzij:[code:il5auovs] Image source = Image.FromFile("file.jpg"); float resizeRatio = 1.5f; int resizedW = (int)Math.Round(source.Width * resizeRatio); int resizedH = (int)Math.Round(source.Height * resizeRatio); using (Bitmap resized = new Bitmap(resizedW, resizedH)) { using (Graphics g = Graphics.FromImage(resized)) { g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; g.DrawImage(source, 0, 0, resizedW, resizedH); } // Proved cokoliv s bitmapou... }[/code:il5auovs] <hr> 2012-05-18 15:46:01 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
.NET Developer BRNO http://www.dotnetforum.cz/viewtopic.php?f=21&t=1211&view=unread#p6862 od: Lukkii v 18. 5. 2012 <br /> Nabízím skvělou příležitost v prosperující SW společnost, která intenzivně podporuje vzdělávání a rozvoj svých zaměstnanců. Můžete si dokonce vybrat, jakým směrech se chcete dále ubírat. Baví Vás spíše vývoj na CRM, nebo vývoj větších podnikových aplikací a kontakt se zákazníkem? Stačí Vám 1-3 roky praxe a chuť učit se novým věcem. Neváhejte mě kontaktovat: lukas@colorbee.eu tel:774 988 140 <hr> 2012-05-18 14:12:51 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Re: resize obrazku a jeho premiestnenie http://www.dotnetforum.cz/viewtopic.php?f=53&t=1210&view=unread#p6861 od: blasius v 18. 5. 2012 <br /> Moc do obrázků nedělám, ale tohle jsi zkoušel? [url:1w53wxm3]http://www.switchonthecode.com/tutorials/csharp-tutorial-image-editing-saving-cropping-and-resizing[/url:1w53wxm3] myslím ten konec: [code:1w53wxm3]private static Image resizeImage(Image imgToResize, Size size) { int sourceWidth = imgToResize.Width; int sourceHeight = imgToResize.Height; float nPercent = 0; float nPercentW = 0; float nPercentH = 0; nPercentW = ((float)size.Width / (float)sourceWidth); nPercentH = ((float)size.Height / (float)sourceHeight); if (nPercentH < nPercentW) nPercent = nPercentH; else nPercent = nPercentW; int destWidth = (int)(sourceWidth * nPercent); int destHeight = (int)(sourceHeight * nPercent); Bitmap b = new Bitmap(destWidth, destHeight); Graphics g = Graphics.FromImage((Image)b); g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(imgToResize, 0, 0, destWidth, destHeight); g.Dispose(); return (Image)b; }[/code:1w53wxm3] <hr> 2012-05-18 13:40:56 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
resize obrazku a jeho premiestnenie http://www.dotnetforum.cz/viewtopic.php?f=53&t=1210&view=unread#p6860 od: Macej v 18. 5. 2012 <br /> Ahojte, potreboval by som funkciu, ktorá by bola schopná načítať obrázok do pamate, zmeniť jeho veľkosť so zachovanim pomerom stran (napr. dlhšia strana 800px) a následne ho odoslat na určné miesto. Vedeli by ste mi prosím poradiť? Googlil som asi hodinu rôzne sposoby som našiel no každá mala chybu vďaka ktorej to nešlo...diki vopred chlapci. <hr> 2012-05-18 12:57:34 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
BindingSource.AddingNew Event http://www.dotnetforum.cz/viewtopic.php?f=53&t=1208&view=unread#p6858 od: blasius v 18. 5. 2012 <br /> Tak mám zase problém :-) Pokud přidávám položku do tabulky pomocí obsluhy události BindingSource.AddingNew a tabulka je v danou chvíli prázdná, dojde k chybovému hlášení: [quote:2r7aic55]System.InvalidOperationException: Objects added to a BindingSource's list must all be of the same type.[/quote:2r7aic55]Pokud je v tabulce již alespoň jeden záznam k chybě nedojde. Co s tím? Pár úryvků z kódu pro upřesnění situace. v Designer mám:[code:2r7aic55] this.bsMain.DataSource = typeof(Dokuments); [/code:2r7aic55]Ve zdrojích formuláře (zjednodušeno):[code:2r7aic55] void FormInvoiceLoad(object sender, EventArgs e) { bsMain.DataSource = from a in db.Dokuments orderby a.DoYear, a.DoNumber where (a.DoDokument == ClassDocuments.DcInvoice) //nechceme aby se zobrazovali jiné doklady než faktury select a; } void BsMainAddingNew(object sender, System.ComponentModel.AddingNewEventArgs e) { Dokuments a = new Dokuments(); a.DoID = Utilities.NewGUID(); e.NewObject = a; db.Dokuments.InsertOnSubmit(a); //záznam je nutno zapsat do tabulky... } [/code:2r7aic55]K chybě dojde po opuštění metody BsMainAddingNew. Řádek s InsertOnSubmit tam musí být, jinak nedojde k zápisu do tabulky, vyjímka je vyvolána i v případě, že je tento řádek zakomentován. Po pravdě nerozumím tomu proč tu musí být, ale bez něho mi nedojde k zápisu do tabulky, předpokládal jsem, že o vložení do tabulky se postará BindingSource bsMain. Tady je kompletní znění chybového hlášení debbugeru [quote:2r7aic55]System.InvalidOperationException: Objects added to a BindingSource's list must all be of the same type. at System.Windows.Forms.BindingSource.Add(Object value) at System.Windows.Forms.BindingSource.AddNew() at System.Windows.Forms.BindingNavigator.OnAddNew(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at myrmica.Program.Main(String[] args) in c:\projects\myrmica\myrmica\Program.cs:line 27 [/quote:2r7aic55] <hr> 2012-05-18 11:03:53 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Re: Algoritmus pro zjištění výherní kombinace v pokeru http://www.dotnetforum.cz/viewtopic.php?f=53&t=1207&view=unread#p6857 od: bartsimpon v 16. 5. 2012 <br /> díky moc, snad se tím nějak poperu <hr> 2012-05-16 20:36:41 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Re: Algoritmus pro zjištění výherní kombinace v pokeru http://www.dotnetforum.cz/viewtopic.php?f=53&t=1207&view=unread#p6856 od: Phobos v 16. 5. 2012 <br /> Aha, tyhle kombinace :) 1. Cislo nedavej jako enum, ale jako int. Pripadne enum s explicitnimi hodnotami. Napr. Eso = 1. Jinak postupku apod. nezjistis. Pouzil bych [url=http://msdn.microsoft.com/en-us/library/bb359438.aspx:3hc531ei]tridu Hashset<T>[/url:3hc531ei]. Zjisteni, jestli hrac ma nejakou vyherni kombinaci, se da jednoduse udelat takto:[code:3hc531ei] public static class Kombinace { public static Hashset<Karta> RoyalFlushPiky = new HashSet<Karta>(); static Kombinace() { Hashset<Karta> royalFlushPiky = new HashSet<Karta>(); royalFlushPiky.Add(PikoveEso); royalFlushPiky.Add(PikoveK); royalFlushPiky.Add(PikoveJ); royalFlushPiky.Add(PikoveQ); royalFlushPiky.Add(PikoveDeset); } public static bool JeRoyalFlush(Hashset<Karta> kartyHrace) { return royalFlushPiky.IsSubsetOf(kartyHrace) || royalFlushKary.IsSubsetOf(kartyHrace) || ...; } public static bool JePostupka(Hashset<Karta> kartyHrace) { List<Karta> karty = kartyHrace.ToList(); karty.Sort((k1, k2) => k1.Cislo.CompareTo(k2.Cislo)); int cislo = karty[0].Cislo; for(int i = 1; i < karty.Count; i++) if (++cislo != karty[i].Cislo) return false; return true; } }[/code:3hc531ei] Postupku samozrejme muzes udelat i tak, ze si nacachujes vsechny mozne kombinace posloupnosti: tj. 1-5, 2-6, 3-7, ... Trojice, dvojice apod. zjistis tak, ze ziskas pocty vsech karet:[code:3hc531ei] Dictionary<int, int> pocty = new Dictionary<int, int>(5); foreach (Karta k in kartyHrace); { if (pocty.ContainsKey(k.Cislo)) pocty[k.Cislo]++; pocty[k.Cislo] = 1; }[/code:3hc531ei] A ve hre se zeptas[code:3hc531ei] if (Kombinace.JePostupka(kartyHrace)) /*je postupka*/; else /*neni postupka*/;[/code:3hc531ei] Atd. <hr> 2012-05-16 20:21:17 [phpBB Debug] PHP Notice: in file /rss.php on line 37: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /rss.php on line 38: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Re: Při TextBox Binding se ztrácí hodnoty int http://www.dotnetforum.cz/viewtopic.php?f=53&t=1206&view=unread#p6855 od: blasius v 16. 5. 2012 <br /> Pořádně jsem si prošel všechny možnosti návrhu bindingu v Design mode a je tam vše co potřebuji včetně formátování. Podstatně se mi zjednodušil kód, který musím doplňovat do formuláře pro editaci tabulky. Takže ještě jednou děkuji za [b:3hhayii2]bsMain.DataSource = typeof(Part)[/b:3hhayii2]. <hr> 2012-05-16 19:12:46