Daily Archives

Articles indexed Wednesday June 2 2010

Page 15/120 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • How to make a piece of WPF content take up the entire application window

    - by Bojin Li
    I'm working on an application that contains a number of content areas. I want to implement a behavior such that in response to user input, any of these content areas can be toggled to fit the entire application window, and optionally back to its original position again. I experimented with several approaches and none of them seem optimal for me. Here's what I tried to do: Use the ClipToBoundsProperty on the content I want to make "Full Screen": Doesn't work because only the CanvasPanel seems to fully respect this property. The application need to be localized so I would really like to avoid the CanvasPanel. Use a Grid and collapse the other content areas, such that only the one I want to see is visible, hence taking up the entire screen: This will probably work but doesn't seem easy to implement nor maintain. The "Full Screen" content area could be several levels deep, for example residing inside a Tabcontrol, so I would have to hide the tab headers too etc. Reconstruct the content area in a separate view and display it while hiding the rest: Seems easy enough to do with DataTemplates and my ViewModel objects, but any GUI/View only states are not preserved using this approach. Somehow "lift" the GUI/View I want to "Full Screen" into the separate view and display it while hiding the rest: I don't know how to do this or even if this is possible. Anyway if anyone knows a better approach I would love to know about it. Thanks a lot!

    Read the article

  • Importing war file into eclipse and build path problem

    - by Todd
    Hi, I am facing some weird problem when importing .war file into eclipse. The problem is, the build folder does not contain any necessary class folder. So when I try to set the build path, eclipse reports "Error while adding to build path. Reason: cannot nest output folder 'projectName/build/class' inside 'projectName/build'. From what I understand, 'build' folder is what classes get collected(as build version) right? I tried to ignore build path and just export .war file into tomcat server, but somehow servlet file keeps showing old code, which I changed in eclipse. So, I am thinking without proper build folder, exported .war will not contain modified servlect code.( I am sorry if this doesn't sound clear) What can I do to fix this problem? I already tried to create a whole new workspace and restarted eclipse several times and it didn't solve the problem.

    Read the article

  • In LaTeX, how can one add a header/footer in the document class Letter?

    - by Brian M. Hunt
    In LaTeX, how can one create a document using the Letter documentclass, but with customized headers and footers? Typically I would use: \usepackage{fancyhdr} \pagestyle{fancy} \lhead{\footnotesize \parbox{11cm}{Custom left-head-note} } \lfoot{\footnotesize \parbox{11cm}{\textit{#2}}} \rfoot{\footnotesize Page \thepage\ of \pageref{LastPage}} \renewcommand\headheight{24pt} \renewcommand\footrulewidth{0.4pt} However, with \documentclass{letter}, this doesn't work at all. Suggestions are duly appreciated. EDIT: Here is sample code that doesn't work (for any apparent reason): \documentclass[12pt]{letter} \usepackage{fontspec}% font selecting commands \usepackage{xunicode}% unicode character macros \usepackage{xltxtra} % some fixes/extras % page counting, header/footer \usepackage{fancyhdr} \usepackage{lastpage} \pagestyle{fancy} \lhead{\footnotesize \parbox{11cm}{Draft 1} } \lfoot{\footnotesize \parbox{11cm}{\textit{2}}} \cfoot{} \rhead{\footnotesize 3} \rfoot{\footnotesize Page \thepage\ of \pageref{LastPage}} \renewcommand{\headheight}{24pt} \renewcommand{\footrulewidth}{0.4pt} \begin{document} \name{ Joe Laroo } \signature{ Joe Laroo } \begin{letter}{ To-Address } \renewcommand{\today}{ February 16, 2009 } \opening{ Opening } Content of the letter. \closing{ Yours truly, } \end{letter} \end{document}

    Read the article

  • Binding DataTable To GridView, But No Rows In GridViewRowCollection Despite GridView Population?

    - by KSwift87
    Problem: I've coded a GridView in the markup in a page. I have coded a DataTable in the code-behind that takes data from a collection of custom objects. I then bind that DataTable to the GridView. (Specific problem mentioned a couple code-snippets below.) GridView Markup: <asp:GridView ID="gvCart" runat="server" CssClass="pList" AutoGenerateColumns="false" DataKeyNames="ProductID"> <Columns> <asp:BoundField DataField="ProductID" HeaderText="ProductID" /> <asp:BoundField DataField="Name" HeaderText="ProductName" /> <asp:ImageField DataImageUrlField="Thumbnail" HeaderText="Thumbnail"></asp:ImageField> <asp:BoundField DataField="Unit Price" HeaderText="Unit Price" /> <asp:TemplateField HeaderText="Quantity"> <ItemTemplate> <asp:TextBox ID="Quantity" runat="server" Text="<%# Bind('Quantity') %>" Width="25px"></asp:TextBox> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Total Price" HeaderText="Total Price" /> </Columns> </asp:GridView> DataTable Code-Behind: private void View(List<OrderItem> cart) { DataSet ds = new DataSet(); DataTable dt = ds.Tables.Add("Cart"); if (cart != null) { dt.Columns.Add("ProductID"); dt.Columns.Add("Name"); dt.Columns.Add("Thumbnail"); dt.Columns.Add("Unit Price"); dt.Columns.Add("Quantity"); dt.Columns.Add("Total Price"); foreach (OrderItem item in cart) { DataRow dr = dt.NewRow(); dr["ProductID"] = item.productId.ToString(); dr["Name"] = item.productName; dr["Thumbnail"] = ResolveUrl(item.productThumbnail); dr["Unit Price"] = "$" + item.productPrice.ToString(); dr["Quantity"] = item.productQuantity.ToString(); dr["Total Price"] = "$" + (item.productPrice * item.productQuantity).ToString(); dt.Rows.Add(dr); } gvCart.DataSource = dt; gvCart.DataBind(); gvCart.Width = 500; for (int counter = 0; counter < gvCart.Rows.Count; counter++) { gvCart.Rows[counter].Cells.Add(Common.createCell("<a href='cart.aspx?action=update&prodId=" + gvCart.Rows[counter].Cells[0].Text + "'>Update</a><br /><a href='cart.aspx?action='action=remove&prodId=" + gvCart.Rows[counter].Cells[0].Text + "/>Remove</a>")); } } } Error occurs below in the foreach - the GridViewRowCollection is empty! private void Update(string prodId) { List<OrderItem> cart = (List<OrderItem>)Session["cart"]; int uQty = 0; foreach (GridViewRow gvr in gvCart.Rows) { if (gvr.RowType == DataControlRowType.DataRow) { if (gvr.Cells[0].Text == prodId) { uQty = int.Parse(((TextBox)gvr.Cells[4].FindControl("Quantity")).Text); } } } Goal: I'm basically trying to find a way to update the data in my GridView (and more importantly my cart Session object) without having to do everything else I've seen online such as utilizing OnRowUpdate, etc. Could someone please tell me why gvCart.Rows is empty and/or how I could accomplish my goal without utilizing OnRowUpdate, etc.? When I execute this code, the GridView gets populated but for some reason I can't access any of its rows in the code-behind.

    Read the article

  • How Session Works?

    - by learner
    Any body can explain me how session works in PHP. for eg. 3 users logged into gmail. how the server identifies these 3 uers. what are the internel process behind that.

    Read the article

  • How do i create these borders in the middle?

    - by Nitesh Panchal
    Hello, I know how to generate rounded corners using images. But please have a look at the link :- http://roundedbox.andreas-kalt.de/ The rounded corners on all four corners are all images, but my question is how are those borders in the middle done? Those green color borders that surround the whole div. The tutorial is given but it is German :(. Also i don't want to use Css3 like -webkit-border-radius etc as they are not yet supported in IE Thanks in advance :)

    Read the article

  • Simple MultiThread Safe Log Class

    - by Robert
    What is the best approach to creating a simple multithread safe logging class? Is something like this sufficient? public class Logging { public Logging() { } public void WriteToLog(string message) { object locker = new object(); lock(locker) { StreamWriter SW; SW=File.AppendText("Data\\Log.txt"); SW.WriteLine(message); SW.Close(); } } }

    Read the article

  • Drawing Mirrored Text

    - by Jeff
    I'm trying to draw mirrored (as in, it looks like you held it up to a mirror) text, and I want to do it the easiest way possible. It is possible to do a transform on a UILabel? Or do I have to use Quartz and do CGContextShowTextAtPoint() ?

    Read the article

  • How to detect tab key pressing in C#?

    - by user342325
    I want to detect when tab key is pressed in a textBox and focus the next textbox in the panel. I have tried out keyPressed method and keyDown method. But when I run the program and debug those methods are not calling when the tab key is pressed. Here is my code. private void textBoxName_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Tab) { textBoxUsername.Focus(); } } private void textBoxName_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar==(char)Keys.Tab) { textBoxUsername.Focus(); } } Please correct me.Thank you.

    Read the article

  • AjaxControlToolkit TabContainer with weird rendering behavior

    - by sohum
    I've built a web application that contains a page that uses the AjaxControlToolkit's TabContainer/TabPanel objects. I've developed a custom stylesheet, as well. I'm developing using Visual Studio 2010. The following is the behavior of my application: VS2010 Development Server (localhost:XXXXX): Works as expected with the custom stylesheet. Local IIS: The TabContainer rendered but the stylesheet wasn't applied. I fixed this by doing a CTRL+F5. It seems that IIS caches stylesheets pretty aggressively. Remote Server: The TabContainer and TabPanel are completely hidden. Looking at the HTML, all of them have their visibility set to hidden. The way I got my files onto my remote server were as follows (I haven't yet set up WebDAV or remote publishing because the server is a Windows 7 box and as far as I am aware does not support FrontPage Extensions): The entire solution is under source code control (SVN). Checked in all pending changes (including projects, aspx files, css, AjaxControlToolkit binaries) Synced on the server. Rebuilt everything on server. Deployed to local IIS on server (which is externally accessible). Both on the local IIS on the server and the development server on the server, the TabContainers are completely hidden. Looking at the SVN status on the server project, only the "AjaxControlToolkit.dll" is under source-code control. All the locale-specific DLLs are not on the server. Could this be a potential issue? I'm not sure what's going on and would appreciate any help. Thanks!

    Read the article

  • Memory usage in Flash / Flex / AS3

    - by ggambett
    I'm having some trouble with memory management in a flash app. Memory usage grows quite a bit, and I've tracked it down to the way I load assets. I embed several raster images in a class Embedded, like this [Embed(source="/home/gabriel/text_hard.jpg")] public static var ASSET_text_hard_DOT_jpg : Class; I then instance the assets this way var pClass : Class = Embedded[sResource] as Class; return new pClass() as Bitmap; At this point, memory usage goes up, which is perfectly normal. However, nulling all the references to the object doesn't free the memory. Based on this behavior, looks like the flash player is creating an instance of the class the first time I request it, but never ever releases it - not without references, calling System.gc(), doing the double LocalConnection trick, or calling dispose() on the BitmapData objects. Of course, this is very undesirable - memory usage would grow until everything in the SWFs is instanced, regardless of whether I stopped using some asset long ago. Is my analysis correct? Can anything be done to fix this?

    Read the article

  • MQ Connection - 2009 error

    - by user171523
    am connectting the MQ with below code. I am able connected to MQ successfully. My case is i place the messages to MQ every 1 min once. After disconnecting the cable i get a ResonCode error but IsConnected property still show true. Is this is the right way to check if the connection is still connected ? Or there any best pratcices around that. I would like to open the connection when applicaiton is started keep it open for ever. public static MQQueueManager ConnectMQ() { if ((queueManager == null) || (!queueManager.IsConnected)||(queueManager.ReasonCode == 2009)) { queueManager = new MQQueueManager(); } return queueManager; }

    Read the article

  • Execute PHP without leaving page

    - by Dylan Taylor
    Okay. I have a form - textarea (named "su") and submit button. When the form is submitted, I need to run a PHP script without refreshing/leaving page "echo" or somehow print a return on the screen I'm pretty sure this works via some kind of ajax request thing. but I have no idea what I'm talking about. I'm not big on ajax or javascript, but this is a function i use very frequently and I'd like to learn how it works so I can implement it when i need to now and in the future. Like i said I'm uneducated with ajax or java. a quick example would be wonderful. thanks for taking the time to read!

    Read the article

  • Send mail via gmail with PowerShell V2's Send-MailMessage

    - by Scott Weinstein
    I'm trying to figure out how to use PowerShell V2's Send-MailMessage with gmail. Here's what I have so far. $ss = new-object Security.SecureString foreach ($ch in "password".ToCharArray()) { $ss.AppendChar($ch) } $cred = new-object Management.Automation.PSCredential "[email protected]", $ss Send-MailMessage -SmtpServer smtp.gmail.com -UseSsl -Credential $cred -Body... I get the following error Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at At foo.ps1:18 char:21 + Send-MailMessage <<<< ` + CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpException + FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage Am I doing something wrong, or is Send-MailMessage not fully baked yet (I'm on CTP 3)? Edit - two additional restrictions I want this to be non-interactive, so get-credential won't work The user account isn't on the gmail domain, but an google apps registered domain

    Read the article

  • Modifying jQuery ajax request Connectino header

    - by Pat
    I'm trying to modify the Connection header with the following code with no success jQuery.ajax ( { url: URL, async: boolVariable, beforeSend: function(xhr) { xhr.setRequestHeader("Connection", "close"); } } ) The request headers via Firebug show: Connection keep-alive X-Requested-With XMLHttpRequest Any odd bugs/problems with setting this particular header known? Or is there something I'm doing wrong?

    Read the article

  • DCVS + hosting for a startup commercial multiplatform phone app

    - by AG
    I'm in lean startup mode, working on a simple phone app that will be published initially as a iThingy app and an Android app with, possibly, Blackberry and Symbian versions to follow. I'm about to go from no repository to needing a central repository that up to 4 very part-time resources will be sharing. Two of us have no version control background, one has used Subversion, and I've used most of the major centralized VCS systems. I'm not going to be pushing the technical limitations of any VCS for a long time; I'm sure that any of the major systems would work fine. And the hosting accounts I've looked at seem reasonable. So I'm really focussed on minimizing the downside risks. That is, I'd like to find a stable setup that is easy to learn in general, easy to use from Windows/Eclipse, and won't paint me into any obvious corners for the next 12 months or so. A quick search of the web had led me to consider the following pairs of DVCS and hosting service, with what I think I'm hearing as their strengths and weaknesses (for my purposes): Bazaar/Launchpad -- My initial choice since I need to get more familiar with this pair for the Google Summer of Code mentoring I'm doing. But, whatever the technical merits, a non-starter for me because they are purely open source, no private repositories plans to purchase that I can see. Git/GitHub -- Git: Fast, light, ultimately flexible, but relatively less Windows friendly, Eclipse plugin (eGit) available but relatively young, GitHub: widely used, pricing is fine Mercurial/BitBucket -- Mercurial: a little less flexible, a little more Windows friendly, Eclipse plugin seems a bit more mature, BitBucket: widely used, pricing is fine, includes a wiki and an issue tracker that we might be able to use instead of something like BaseCamp, at least for a while. Mercurial/BitBucket seem like the winning pair so far for my particular situation; at least two of us are definitely going to be working mostly from Eclipse on Windows and reducing my own learning curve is a priority. ;-) But I have two specific questions: 1) Am I wrong about Bazaar/Launchpad and is there a viable, secure way to use them for proprietary code? 2) Any reason to think that the Mecurial/Bitbucket pair will end up being a headache for my Mac developer, soon, or for Blackberry or Symbian developers a little later? ag

    Read the article

  • MongoDB vs CouchDB (Speed optimization)

    - by Edward83
    Hi! I made some tests of speed to compare MongoDB and CouchDB. Only inserts were while testing. I got MongoDB 15x faster than CouchDB. I know that it is because of sockets vs http. But, it is very interesting for me how can I optimize inserts in CouchDB? Test platform: Windows XP SP3 32 bit. I used last versions of MongoDB, MongoDB C# Driver and last version of installation package of CouchDB for Windows. Thanks!

    Read the article

  • drupal views block arguments

    - by slimcady
    I currently have a view (Drupal 6 using Views2) that properly aggregates a custom content type (videos) and filters them for a page display. When I create a block display, it previews the results in live preview just great, but when i go to the page expecting to see the block it doesn't appear. I'm fairly certain the argument I'm attempting to pass it fails because when I select "Display all results" for "Action to take if argument does not validate:" the block shows up on the page just fine. Any advice definitely appreciated.

    Read the article

  • Difference between $().click(fn), $().bind(‘click’,fn), $().live('click',fn) and $().delegate('td',

    - by I Like PHP
    Hello All, i know there are a lot of question similar to this, but i want to know clear difference between all of these jQuery function together on this page with example , so that it will be very helpful for me to understand the mechanism of all of these function. i have also read the reference on jQuery main site, but there is no comparison. Please do not refer any link if there is a part of question belong to that. please describe how all four function exactly works in different manner . and which should be prefer in which situation. note: if there are any other function with same functionality/mechanism , then please share. Thanks a lot

    Read the article

  • Performance implications of finalizers on JVM

    - by Alexey Romanov
    According to this post, in .Net, Finalizers are actually even worse than that. Besides that they run late (which is indeed a serious problem for many kinds of resources), they are also less powerful because they can only perform a subset of the operations allowed in a destructor (e.g., a finalizer cannot reliably use other objects, whereas a destructor can), and even when writing in that subset finalizers are extremely difficult to write correctly. And collecting finalizable objects is expensive: Each finalizable object, and the potentially huge graph of objects reachable from it, is promoted to the next GC generation, which makes it more expensive to collect by some large multiple. Does this also apply to JVMs in general and to HotSpot in particular?

    Read the article

  • About hide toolbar in iphone app

    - by Jagie
    I have a navigationController which root viewController has no toolbar,but the root viewController navigates to a viewController which has a always visible toolbar.I must assure the root viewController's toolbar is hidden whether it is presented first or its above viewController is poped in the navigationController stack.So,I use the following code in the root viewController: - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.navigationController setToolbarHidden:YES animated:YES]; } is this the best sulotion?or I should use "hidesBottomBarWhenPushed" etc?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >