Posts

c# - ASP.NET: resize (height and width) an image uploaded to server -

How can I change the size of an image on the server that I just uploaded? I am using C # with .NET Framework 3.5 SP1. Thank you! Try the following method: public string ResizeImageAndSave (Intest Width , Int height, string image url, string destPath) {System.Drawing.Image fullSizeImg = System.Drawing.Image.FromFile (imageUrl); Double width width = (dual) full seismogram With / (double) width; Double height RTE = (Dual) Full sysigram. Height / (double) height; Dual ratio = Math Maximum (width, height, height); Int newWidth = (int) (fullSizeImg.Width / ratio); Int Nighth = (Int) (Full Size Img. High / Ratio); // system Drawing Image. GetThumbnailImageAbort Dummy Callback = New System. Dropping Image. GetThumbnailImageAbort (thumbnail callback); System.Drawing.Image thumbNailImg = fullSizeImg.GetThumbnailImage (New Width, newHeight, New System.Dogging ImageGetThumbnailImageAbort (thumbnail callback), IntPtr.Zero); // Date time MyDate = DateTime.Now; // String Mysterrine = Me...

sql - How to maintain referential integrity with common great-parent table? -

Let's say I have a table with "group of questions" GroupID | Price -------- + ------ 42 | How often do you work 9071 | Other questions ... And, for each group's questions I have "question" and "possible answer" group | Question ID | Price ------ + ------------ + ------ 42 | 5 | ... brush your teeth? 42 | 89 | ... go to the movies? 9071 | 70 9 ... another question ... ... group | Answer: Price ------ + -------- + ------ 42 | 134 | Many times per day 42 | 135 | Twice a day 42 71 | Once a day 42 803 | Every other day 42 8 | Once a week 42. 666 | Once in a month ... Now, in PHP / HTML, I do a complete cross product of one (virtual) questions and to make 42-answer possible replies to a 2-entry table where the user They will select / answer () how often do you do. N / D | 2 / D 1 / D D * 2 | 1 / w | 1 / m | ---------------------- + ----- + ----- +----- + ----- + --- - + ----- + ... brush your teeth? | () | (X) | () | () | () | () | ... go...

windows installer - HOWTO and best working installation (MSI) chainer +/ bootstrapper -

There are several products in our product that customers can establish as separate installation packages (MSI). We Show a UI with progress Allow the user to choose which facilities / packages to install has the ability to distribute one feature in another (like removing or adding effects) Support single height (UAC) Auto updating Good for ability (should not be) Support command line + silent installation Package different installations Increase the error / error for the need for error Support patch with time and major upgrades Today, we do all the above work using MSI with nested installation which is poor practice and we face many issues in our solution. / P> I know there are several bootstraps (M $ generic bootstrap which I think is not good, Burn WIX version that is not mature enough) Do you know about another Know in That worked and tested already? The best way is (without the integration of MSI in an MSI) dotNetInstaller looks promising. I wa...

Dynamic tables from UDF in SQL Server -

How can I fix this problem? Go to SET ANSI_NULLS Go to set QUOTED_IDENTIFIER functions [DBO]. [GetDataById] () Get started as return INT @ quality NVARAR (500) DECLARE @JINT SET @ query = NEEEL * EXEC @ sp_executesql @ quality return @j list When I try to do this one: choose dbo.GetDataById () I get an error message: only functions and Extended stored procedures can be executed from within a function. From the itemprop = "text"> Erland Somersog, SQL Server MVP: You can not use dynamic SQL from the defined function used in T-SQL. The reason for this is that you do not have permission to do anything in the UDF which can change the database status (as the UDF can be applied as part of a question). Since you can do anything with dynamic SQL, including updates, it is clear that dynamic SQL is not allowed.

c# - StreamReader "Could not find a part of the path" issue while debugging -

I'm trying to debug a program, but I'm running into a problem with the Stream Reader function. I'm not getting any part of the path problem while debugging a particular when it kills this function. Being like this I was in the debugger, I checked the variable to make sure Had corrected that path and it solved a valid file, which he did. Typically code streamer fsio = new streamrider (respFileLoc); Where respFileLoc is a string in which the location of the file is located. I have looked around and I'm assuming this error is something with file permissions, but my question is, how do I set up proper permissions? How do programs run by a debugger (which user level) and can I change it? I prefer not to run this program out of the debugger because the nature of the application may be bad I operating environment and I am using breakpoints in the debugger to prevent it from happening. You already checked that the file actually exists, so my next step is...

Measuring Silverlight chart loading time -

I'm trying to measure different Silverlight Charting libraries to load (eg Silverlight Control Toolkit, Visiffer , Teller) how much time it takes on the screen. My problem is that I can only measure till the control gets loaded and the screen starts to appear on the screen, although rendering takes longer because of the animation effects. Is there a chance when some automatic ways can be ascertained when I finish rendering? My problem is that I only got loaded event handler on Silverlight Framework element, which is only informed about rendering. For example, I am currently using Silverlight Control Toolkit for: Public Zero Init () {chart chart = new chart (); // Init chart object DataPointSeries series; (...) // Init series, add multiple points, set data binding charts. Chain. Add (series); Add // Add series to the chart chart. Loaded = new routing and handler (chart_loaded); LayoutRoot.Children.Add (chart); StartTimer (); // Wait for the control to start timer and lo...

java - How do I generate text matching a regular expression from a regular expression? -

Yes, you read that right, I have something like that created random text from regular expression If the text is able to do then the text should be random, but it should be matched with regular expressions. It seems that it is not in existence, but I can be wrong. Just an example: This library will be able to take ' [ab] * c ' as input, and generate samples such as: ABC ABBC BAC etc. Update: I made some of myself: check out Xeger. I have created a library to do this one minute ago. Hosted here: Please read the instructions carefully before using it. (Specifically, which refers to downloading another essential library.); -) The way you use it: string regex = "[ab] {4, 6} c"; Ezzer Generator = New Zigger (Reggae); String result = generator generates (); Claim the result. Matches (reggae);