Search Results

Search found 8953 results on 359 pages for 'human resources'.

Page 137/359 | < Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >

  • Opening a pdf in .NET

    - by link664
    In the application we are working on we are trying to implement Help. We have a help pdf document and for the moment it has been deemed acceptable that when users click the help button it just opens the pdf. The application is a desktop app and the pdf file needs to be included in the install somehow and installed on the local machine. I essentially need two things: How would I add this pdf to the application so that it is available on the client machine after install? I can either put it in the resources of the project, or else I could put it in the Application Folder of the client setup installer. How would I open this pdf? I can either open this pdf by just launching the default pdf viewer for the file, or I can use the System.WinForms.WebBrowser tool to display it. However if I choose the second option, I am unsure of how to access the file stored in the resources or find it in the install folder. If you could please provide me with the code to do this (either in VB.Net or C#.Net) that would be great.

    Read the article

  • No route matches when trying to edit

    - by mmichael
    Here's the scoop: I've created a test app that allows users to create ideas and then add "bubbles" to these ideas. Currently, a bubble is just text. I've successfully linked bubbles to ideas. Furthermore, when a user goes to view an idea it lists all of the bubbles attached to that idea. The user can even delete the bubble for any given idea. My problem lies in editing bubbles. When a user views an idea, he sees the idea's content as well as any bubbles for that idea. As a result, I've set all my bubble controls (editing and deleting) inside the ideas "show" view. My code for editing a bubble for an idea is <%= link_to 'Edit Bubble', edit_idea_bubble_path %>. I ran rake routes to find the correct path for editing bubbles and that is what was listed. Here's my error: No route matches {:action=>"edit", :controller=>"bubbles"} In my bubbles controller I have: def edit @idea = Idea.find(params[:idea_id]) @bubble = @idea.bubbles.find(params[:id]) end def update @idea = Idea.find(params[:idea_id]) @bubble = @idea.bubbles.find(params[:id]) respond_to do |format| if @bubble.update_attributes(params[:bubble]) format.html { redirect_to(@bubble, :notice => 'Bubble was successfully updated.') } format.xml { head :ok } else format.html { render :action => "Edit" } format.xml { render :xml => @bubble.errors, :status => :unprocessable_entity } end end end To go a step further, I have the following in my routes.rb file resources :ideas do resources :bubbles end So far everything seems to function except when I try to edit a bubble. I'd love some guidance. Thanks!

    Read the article

  • How do I make the manifest available during a Maven/Surefire unittest run "mvn test" ?

    - by Ernst de Haan
    How do I make the manifest available during a Maven/Surefire unittest run "mvn test" ? I have an open-source project that I am converting from Ant to Maven, including its unit tests. Here's the project source repository with the Maven project: http://github.com/znerd/logdoc My question pertains to the primary module, called "base". This module has a unit test that tests the behaviour of the static method getVersion() in the class org.znerd.logdoc.Library. This method returns: Library.class.getPackage().getImplementationVersion() The getImplementationVersion() method returns a value of a setting in the manifest file. So far, so good. I have tested this in the past and it works well, as long as the manifest is indeed available on the classpath at the path META-INF/MANIFEST.MF (either on the file system or inside a JAR file). Now my challenge is that the manifest file is not available when I run the unit tests: mvn test Surefire runs the unit tests, but my unit test fails with a mesage indicating that Library.getVersion() returned null. When I want to check the JAR, I find that it has not even been generated. Maven/Surefire runs the unit tests against the classes, before the resources are added to the classpath. So can I either run the unit tests against the JAR (implicitly requiring the JAR to be generated first) or can I make sure the resources (including the manifest file) are generated/copied under target/classes before the unit tests are run? Note that I use Maven 2.2.0, Java 1.6.0_17 on Mac OS X 10.6.2, with JUnit 4.8.1.

    Read the article

  • WPF: How can I KEEP the same ItemTemplate instance once its created ??

    - by Samir Sabri
    Hello, Here is a cinario: I have a ListView, with ItemsSource = ProjectModel.Instance.PagesModelsCollection; where PagesModelsCollection is an ObservableCollection In the ListView XAML part: <ListView.ItemTemplate> <DataTemplate x:Name="PagesViewDataTemplate"> <DataTemplate.Resources> <Style x:Key="PageHostStyle" TargetType="{x:Type p:KPage}"> </Style> </DataTemplate.Resources> <StackPanel x:Name="MarginStack" Margin="50,50,50,50" > <p:KPage x:Name="PageHost" > </p:KPage> </StackPanel> </DataTemplate> </ListView.ItemTemplate> The problem is the ITemTemplate is re-created each time we refresh the Items. So, if we have 100 Item in the list view, another 100 new ItemTemplate instance will be created if we refresh the items! As a result, if we add UIElements on one of the ItemTemplate intances, those added UIElements will be lost, because the old ITemTemplate is replaced with a new one! How can I KEEP the ItemTemplate instance once its created ??

    Read the article

  • Retrieve a TextBox element dinamically created and Focus it

    - by user335444
    Hi, I have a collection (VariableValueCollection) of custom type VariableValueViewModel objects binded with a ListView. WPF Follow: <ListView ItemsSource="{Binding VariableValueCollection}" Name="itemList"> <ListView.Resources> <DataTemplate DataType="{x:Type vm:VariableValueViewModel}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="180"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBox TabIndex="{Binding Path=Index, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Grid.Column="0" Name="tbValue" Focusable="True" LostFocus="tbValue_LostFocus" GotFocus="tbValue_GotFocus" KeyDown="tbValue_KeyDown"> <TextBox.Text> <Binding Path="Value" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay"> <Binding.ValidationRules> <ExceptionValidationRule></ExceptionValidationRule> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox> </Grid> </DataTemplate> </ListView.Resources> </ListView> My Goal is to add a new row when I press "enter" on last row, and Focus the new row. To do that, I check that row is the last row and add a new row in that case. But I don't know how to focus the new TextBox... Here the KeyPressed method: private void tbValue_KeyDown(object sender, KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) { DependencyObject obj = itemList.ContainerFromElement((sender as TextBox)); int index = itemList.ItemContainerGenerator.IndexFromContainer(obj); if( index == (VariableValueCollection.Count - 1) ) { // Create a VariableValueViewModel object and add to collection. In binding, that create a new list item with a new TextBox ViewModel.AddNewRow(); // How to set cursor and focus last row created? } } } Thank's in advance...

    Read the article

  • Downloading javascript Without Blocking

    - by doug
    The context: My question relates to improving web-page loading performance, and in particular the effect that javascript has on page-loading (resources/elements below the script are blocked from downloading/rendering). This problem is usually avoided/mitigated by placing the scripts at the bottom (eg, just before the tag). The code i am looking at is for web analytics. Placing it at the bottom reduces its accuracy; and because this script has no effect on the page's content, ie, it's not re-writing any part of the page--i want to move it inside the head. Just how to do that without ruining page-loading performance is the crux. From my research, i've found six techniques (w/ support among all or most of the major browsers) for downloading scripts so that they don't block down-page content from loading/rendering: (i) XHR + eval(); (ii) XHR + 'inject'; (iii) download the HTML-wrapped script as in iFrame; (iv) setting the script tag's 'async' flag to 'TRUE' (HTML 5 only); (v) setting the script tag's 'defer' attribute; and (vi) 'Script DOM Element'. It's the last of these i don't understand. The javascript to implement the pattern (vi) is: (function() { var q1 = document.createElement('script'); q1.src = 'http://www.my_site.com/q1.js' document.documentElement.firstChild.appendChild(q1) })(); Seems simple enough: inside this anonymous function, a script element is created, its 'src' element is set to it's location, then the script element is added to the DOM. But while each line is clear, it's still not clear to me how exactly this pattern allows script loading without blocking down-page elements/resources from rendering/loading?

    Read the article

  • ANT propertyfile entry is not resolving to its value

    - by Brian
    I have a value in a properties file that I want to increment while the build is running. The goal is to copy a set of files and append a number to the front of each in order to maintain the order in which they were copied into the directory. I am using the <propertyfile> task as follows: <propertyfile file="jsfiles.properties"> <entry key="file.number" type="int" operation="=" value="10" /> <entry key="file.number" type="int" default="010" operation="+" value="10" pattern="000" /> </propertyfile> Then I do the copy: <copy todir="${js-in.dir}"> <resources> ... </resources> <chainedmapper> <flattenmapper /> <globmapper from="*.js" to="${file.number}-*.js"/> </chainedmapper> </copy> This does exactly what I need it to EXCEPT that instead of the following output: 010-file1.js 020-file2.js 030-file3.js ... I get: ${file.number}-file1.js ${file.number}-file2.js ${file.number}-file3.js ... What am I doing wrong?

    Read the article

  • WPF: Horizontal Alignment

    - by emptyset
    Probably I'm just missing something obvious, but I can't get the image in my DataTemplate to align to the right in the Grid, so that when the window is stretched, the image is "pulled" to the right as well: <Window.Resources> <DataTemplate x:Key="PersonTemplate" DataType="Minimal.Client.Person"> <Border BorderBrush="Purple" BorderThickness="2" CornerRadius="2" Padding="5" Margin="5"> <Grid Margin="10"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" MinWidth="200"/> <ColumnDefinition Width="Auto" MaxWidth="200"/> </Grid.ColumnDefinitions> <StackPanel Grid.Column ="0" Orientation="Horizontal" > <TextBlock FontFamily="Verdana" FontSize="16" FontWeight="Bold" Text="{Binding LastName}" /> <TextBlock FontFamily="Verdana" FontSize="16" Text=", " /> <TextBlock FontFamily="Verdana" FontSize="16" Text="{Binding FirstName}" /> </StackPanel> <StackPanel Grid.Column="1" Orientation="Vertical" HorizontalAlignment="Right"> <Border BorderBrush="Black" BorderThickness="1"> <Image Source="{Binding Picture}" Width="180" Height="150" /> </Border> </StackPanel> </Grid> </Border> </DataTemplate> </Window.Resources> Any suggestions?

    Read the article

  • WPF Buttons Style

    - by Polaris
    I have WPF Form which has many buttons with the same code. Appearance of all buttons must be the same For example, code for one of these buttons <Button x:Name="btnAddRelative" Width="120" Click="btnAddRelative_Click" > <Button.Content> <StackPanel Orientation="Horizontal"> <Image Height="26" HorizontalAlignment="Left"> <Image.Source> <BitmapImage UriSource="images/add.png" /> </Image.Source> </Image> <TextBlock Text=" Add Relative" Height="20" VerticalAlignment="Center"/> </StackPanel> </Button.Content> </Button> How can I create one style and use it for all my buttons. All buttons has the same png image, only their text different. How can I do this. I tried to do this with Style object in Resource Section: <UserControl.Resources> <Style TargetType="Button" x:Key="AddStyle"> <Setter Property="Content"> <Setter.Value> <StackPanel Orientation="Horizontal"> <Image Height="26" HorizontalAlignment="Left"> <Image.Source> <BitmapImage UriSource="images/add.png" /> </Image.Source> </Image> <TextBlock Text=" " Height="20" VerticalAlignment="Center"/> </StackPanel> </Setter.Value> </Setter> </Style> </UserControl.Resources> But this code not work. Can any body know how can I do this?

    Read the article

  • Borderless ImageButtons in WrapPanel

    - by Bill
    I am attempting to create a WrapPanel with seamless ImageButtons containing Artwork. I put together the following ContentTemplate in the hopes that it would provide the seamless look required; however a thin white-line remained around each of the buttons. Can anyone steer me in the right direction? <Button.ContentTemplate> <DataTemplate DataType="{x:Type local:ArtInfo}"> <Border Name="border" BorderThickness="0" BorderBrush="blue" Height="280" Width="250" Background="#262c40"> <StackPanel> <Grid> <Grid.Resources> <local:MyConverter x:Key="MyConverter"></local:MyConverter> <ObjectDataProvider x:Key="Properties.Settings" ObjectType="{x:Type lcl:Properties.Settings}" /> </Grid.Resources> <Image Name="ArtImage" Margin="10,15,0,0" Height="195" Width="195" VerticalAlignment="Top" > <Image.Source> <Binding Path="ArtImage"/> </Image.Source> </Image> </Grid> <TextBlock Text="{Binding Path=ArtClass}" Margin="10,-17,0,0" FontSize="11" Foreground="white" /> <TextBlock Text="{Binding Path=Student}" Margin="10,0,0,0" FontSize="11" Foreground="white" /> <TextBlock Text="1998" Margin="10,0,0,0" FontSize="11" Foreground="white" /> </StackPanel> </Border> </DataTemplate> </Button.ContentTemplate>

    Read the article

  • Docs for auto-generated methods in Ruby on Rails

    - by macek
    Rails has all sorts of auto-generated methods that I've often times struggled to find documentation for. For example, in routes.rb, if I have: map.resources :projects do |p| p.resources :tasks end This will get a plethora of auto-generate path and url helpers. Where can I find documentation for how to work with these paths? I generally understand how to work with them, but more explicit docs might help me understand some of the magic that happens behind the scenes. # compare project_path(@project) project_task_path(@project, @task) # to project_path(:id => @project.id) project_task_path(:project_id => @project.id, :id => @task.id) Also, when I change an attribute on a model, @post.foo_changed? will be true. Where can I find documentation for this and all other magical methods that are created like this? If the magic is there, I'd love to take advantage of it. And finally: Is there a complete resource for config.___ statements for environment.rb? I was able to find docs for Configuration#gem but what attributes can I set within the stubs like config.active_record.___, config.action_mailer.___, config.action_controller.___, etc. Again, I'm looking for a complete resource here, not just a settings for the examples I provided. Even if you can only answer one of these questions, please chime in. These things seem to have been hiding from me and it's my goal to get them some more exposure, so I'll be upvoting all links to docs that point me to what I'm looking for. Thanks! ps, If they're not called auto-generated methods, I apologize. Someone can teach me a lesson here, too :) Edit I'm not looking for tutorials here, folks. I have a fair amount of experience with rails; I'm just looking for complete docs. E.g., I understand how routing works, I just want docs where I can read about all of the usage options.

    Read the article

  • Alternative or succesor to GDBM

    - by Anon Guy
    We a have a GDBM key-value database as the backend to a load-balanced web-facing application that is in implemented in C++. The data served by the application has grown very large, so our admins have moved the GDBM files from "local" storage (on the webservers, or very close by) to a large, shared, remote, NFS-mounted filesystem. This has affected performance. Our performance tests (in a test environment) show page load times jumping from hundreds of milliseconds (for local disk) to several seconds (over NFS, local network), and sometimes getting as high as 30 seconds. I believe a large part of the problem is that the application makes lots of random reads from the GDBM files, and that these are slow over NFS, and this will be even worse in production (where the front-end and back-end have even more network hardware between them) and as our database gets even bigger. While this is not a critical application, I would like to improve performance, and have some resources available, including the application developer time and Unix admins. My main constraint is time only have the resources for a few weeks. As I see it, my options are: Improve NFS performance by tuning parameters. My instinct is we wont get much out of this, but I have been wrong before, and I don't really know very much about NFS tuning. Move to a different key-value database, such as memcachedb or Tokyo Cabinet. Replace NFS with some other protocol (iSCSI has been mentioned, but i am not familiar with it). How should I approach this problem?

    Read the article

  • (nested) user controls within a mvp pattern causing sporadic problems

    - by LLEA
    hi everyone, I have a serious problem with nested user controls (UCs) in WinForms while trying to implement the mvp pattern (passive view). The project consists of one model (designed as a singleton) and a set of different presenters with corresponding view interfaces. To avoid one huge view interface and therefore an overloaded main UI, I decided to make use of a set of different UCs. Each UC has one view interface and one presenter that can access the model. But there are nested UCs: meaning that one specialised UC implements sort of a basic UC. The main UI just represents a container for all those UCs. So far, so good (if not, please ask)?! There are two problems that I am facing now (but I guess both are of the same origin): From time to time it is not possible anymore to load the UCs and test them within the Visual Studio 2008 User Control Test Container. The error message just says that a project with an output type of class library cannot be started directly etc. I can "handle" that by unloading all UC projects and reloading them afterwards. (I guess the references to all mvp components and other UCs are then updated). Assuming that the implementation of my mvp pattern is okay and all those UCs are testable within the VS Test Container at a certain time - there is the biggest problem still left: I am not able to add any UC (even the basic and unnested ones) to a simple Form (UI). The error message: error message.jpg Could it be that my basic UC causes all these Problems?! It consists of two simple ComboBoxes and implements a basic presenter and basic view interface. Whenever I add this UC to a different UC the VS designer adds two references to the public getter methods of the UC as resources. I then manually remove those resources from the resx-file and commend the corresponding lines in the designer file. thx in advance

    Read the article

  • Using SetParent to steal the main window of another process but keeping the message loops separate

    - by insta
    Background: My coworker and I are maintaining a million-line legacy application we inherited. Its frontend is written in VB6, and as we're devoting almost all of our resources to converting it to C#, we are looking for quick & dirty solutions to our specific problem. The application behaves in a plugin-ish manner. There are up to 20ish separate ActiveX controls that can be loaded at once in a grid-style layout. The problem is that the ActiveX controls do all of their processing on their own UI thread, and as a lot of it is blocking waiting on network access, the UI gets very soupy. When our hosting C# app loads these controls, it becomes unresponsive because of how many controls are chewing up UI resources doing nothing. To top it off, the controls are fragile and will crash at the slightest provocation. When they are hosted in the main C# app, it creates serious instability. The best my coworker and I have come up with so far is starting a process per ActiveX control. This process, which we call the proxy, is another winforms app. It uses named pipes to communicate with the hosting process. The hosting process creates a window, loads an ActiveX control of our choice (via some reflections & AxHost magic), and tells the main process what its window handle is via the named pipe. The main process uses a combination of SetParent, and SetWindowPos to move the proxy application into itself to emulate a plugin. Size updates are sent via the named pipe. This works well enough until the ActiveX application does some sort of lengthy process and we click around on the main window while it's working. For awhile the main window is responsive, but eventually it becomes unresponsive as the child window waits for its UI thread. How can we keep the child windows on their own complete thread while still getting the benefits of SetParent? (please let me know if anything isn't clear!)

    Read the article

  • How can I bind another DependencyProperty to the IsChecked Property of a CheckBox?

    - by speedmetal
    Here's an example of what I'm trying to accomplish: <Window x:Class="CheckBoxBinding.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <StackPanel> <CheckBox Name="myCheckBox">this</CheckBox> <Grid> <Grid.Resources> <Style TargetType="ListBox"> <Style.Triggers> <Trigger Property="{Binding ElementName=myCheckBox, Path=IsChecked}" Value="True"> <Setter Property="Background" Value="Red" /> </Trigger> </Style.Triggers> </Style> </Grid.Resources> <ListBox> <ListBoxItem>item</ListBoxItem> <ListBoxItem>another</ListBoxItem> </ListBox> </Grid> </StackPanel> </Window> When I try to run it, I get this XamlParseException: A 'Binding' cannot be set on the 'Property' property of type 'Trigger'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject. So how can I bind a property on the ListBox to the IsChecked property of a CheckBox?

    Read the article

  • How to keep confirmation messages after POST while doing a post-submit redirect?

    - by MicE
    Hello, I'm looking for advise on how to share certain bits of data (i.e. post-submit confirmation messages) between individual requests in a web application. Let me explain: Current approach: user submits an add/edit form for a resource if there were no errors, user is shown a confirmation with links to: submit a new resource (for "add" form) view the submitted/edited resource view all resources (one step above in hierarchy) user then has to click on one of the three links to proceed (i.e. to the page "above") Progmatically, the form and its confirmation page are one set of classes. The page above that is another. They can technically share code, but at the moment they are both independent during processing of individual requests. We would like to amend the above as follows: user submits an add/edit form for a resource if there were no errors, the user is redirected to the page with all resources (one step above in hierarchy) with one or more confirmation messages displayed at the top of the page (i.e. success message, to whom was the request assigned, etc) This will: save users one click (they have to go through a lot of these add/edit forms) the post-submit redirect will address common problems with browser refresh / back-buttons What approach would you recommend for sharing data needed for the confirmation messages between the two requests, please? I'm not sure if it helps, it's a PHP application backed by a RESTful API, but I think that this is a language-agnostic question. A few simple solutions that come to mind are to share the data via cookies or in the session, this however breaks statelessness and would pose a significant problem for users who work in several tabs (the data could clash together). Passing the data as GET parameters is not suitable as we are talking about several messages which are dynamic (e.g. changing actors, dates). Thanks, M.

    Read the article

  • EF 4 Self Tracking Entities does not work as expected.

    - by ashraf
    I am using EF4 Self Tracking Entities (VS2010 Beta 2 CTP 2 plus new T4 generator). But when I try to update entity information it does not update to database as expected. I setup 2 service calls. one for GetResource(int id) which return a resource object. the second call is SaveResource(Resource res); here is the code. public Resource GetResource(int id) { using (var dc = new MyEntities()) { return dc.Resources.Where(d => d.ResourceId == id).SingleOrDefault(); } } public void SaveResource(Resource res) { using (var dc = new MyEntities()) { dc.Resources.ApplyChanges(res); dc.SaveChanges(); // Nothing save to database. } } //Windows Console Client Calls var res = service.GetResource(1); res.Description = "New Change"; // Not updating... service.SaveResource(res); // does not change anything. It seems to me that ChangeTracker.State is always show as "Unchanged". anything wrong in this code?

    Read the article

  • Have you considered doing revenue sharing to fund development of a mobile app? How would you do it?

    - by Brennan
    I am looking to build multiple mobile apps which leverage existing content and resources by enabling these mobile apps with web services. I will duplication much of the same features which are also in place and add more features that are possible on a mobile device like address book, maps and calendar integration to make the service much more useful. To fund these projects I see that I have 2 options. First I could simply quote them for the project based on my hourly rate and the estimate in hours that I will take the to complete the job. That may be a high number. The second option would be to do shared revenue with ads placed in the app. I could then take a percentage of any revenue that is generated from the app. There is also a hybrid where I might charge for a percentage of the estimated quote and then take a percentage of the revenue sharing. So my question is how much should I propose for the revenue sharing? Should it be 30%? Or maybe I should make it 70% up to a point that a certain dollar amount is reached? And should the revenue sharing agreement be for 12 months, 24 months or more? Should I include in the proposal an agreement that they will help promote this app with their content and resources? Ultimately this system will benefit both sides because it extends their reach into the mobile space instead of where they are currently with just print and web. I have tried to find some examples with a few Google searches but I keep hitting content about the Google and Apple revenue sharing models. I would like to get some solid examples that are working to compare against so that my proposal do build these apps is not completely off base.

    Read the article

  • How to get application context path in spring-ws?

    - by Dhaliwal
    I am using Spring-WS to create a webservice. In my project, I have created a Helper class to reads sample response and request xml file which are located in my /src/main/resource folder. When I am unit-testing my webservice application 'locally', I use the System.getProperty("user.dir") to get the application context folder. The following is a method that I created in the Helper class to help me retrieve the file that I am interested in my resource folder. public static File getFileFromResources(String filename) { System.out.println("Getting file from resource folder"); File request = null; String curDir = System.getProperty("user.dir"); String contextpath = "C:\\src\\main\\resources\\"; request = new File(curDir + contextpath + filename); return request; } However, after 'publishing' the compiled WAR file to the ../webapps folder to the Apache Tomcat directory, I realise that System.getProperty("user.dir") no longer returns my application context path. Instead, it is returning the Apache Tomcat root directory as shown C:\Program Files\Apache Software Foundation\Tomcat 6.0\src\main\resources\SampleClientFile I cant seem to find any information about getting the root folder of my webservice. I have seen examples on Spring web application where I can retrieve the context path by using the following : request.getSession().getServletContext().getContextPath() But in this case, I am using a Spring web application where there is a servlet context in the request. But the Spring-WS, my entry point is an endpoint. How can I get the context path of my webservice application. I am expecting a context path of something like C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\clientWebService\WEB-INF\classes Could someone suggest a way to achieve this?

    Read the article

  • Optimizing an embedded SELECT query in mySQL

    - by Crazy Serb
    Ok, here's a query that I am running right now on a table that has 45,000 records and is 65MB in size... and is just about to get bigger and bigger (so I gotta think of the future performance as well here): SELECT count(payment_id) as signup_count, sum(amount) as signup_amount FROM payments p WHERE tm_completed BETWEEN '2009-05-01' AND '2009-05-30' AND completed > 0 AND tm_completed IS NOT NULL AND member_id NOT IN (SELECT p2.member_id FROM payments p2 WHERE p2.completed=1 AND p2.tm_completed < '2009-05-01' AND p2.tm_completed IS NOT NULL GROUP BY p2.member_id) And as you might or might not imagine - it chokes the mysql server to a standstill... What it does is - it simply pulls the number of new users who signed up, have at least one "completed" payment, tm_completed is not empty (as it is only populated for completed payments), and (the embedded Select) that member has never had a "completed" payment before - meaning he's a new member (just because the system does rebills and whatnot, and this is the only way to sort of differentiate between an existing member who just got rebilled and a new member who got billed for the first time). Now, is there any possible way to optimize this query to use less resources or something, and to stop taking my mysql resources down on their knees...? Am I missing any info to clarify this any further? Let me know... EDIT: Here are the indexes already on that table: PRIMARY PRIMARY 46757 payment_id member_id INDEX 23378 member_id payer_id INDEX 11689 payer_id coupon_id INDEX 1 coupon_id tm_added INDEX 46757 tm_added, product_id tm_completed INDEX 46757 tm_completed, product_id

    Read the article

  • UIImageView Centering Problem.

    - by sagar
    To understand my problem let's follow this steps. Open - XCode - New Project - View based application. Open View Controller.xib file. Drag an image-view into viewController's view. Place that image view on center of viewController's view. Apply size of 125x125 to image-view. Take any image with dimension of 320 width & 460 height. Drag that image into your application resources directory. Now, Again back to .xib File & select image-view Set image (which is in your resources) to image-view Set Image-view Mode to - Center Ok. Let me explain the situation now. after performing all above steps - image-view has an image which is larger than image-view's size. However, Image-view places that image on center & in View controller image-view is looking proper ( not scaled ). But When you run your application, image-view will be displayed in size of 320x460. ( but it is not actually scaled. ) Now, I can't find the reason, why interface builder is displaying something else & simulator/iphone is displaying something else ? My Query. I want the image's center portion within image-view no matter what image size is. Thanks in advance for sharing your knowledge. Sagar.

    Read the article

  • How can I bind a List as ItemSource to ListView in XAML?

    - by Jonas
    I'm learning WPF and would like to have a collection similar to a LinkedList, to where I can add and remove strings. And I want to have a ListView that listen to that collection with databinding. How can I do bind a simple list collection to a ListView in XAML? My idea (not working) is something like this: <Window x:Class="TestApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <LinkedList x:Key="myList"></LinkedList> //Wrong <Window.Resources> <Grid> <ListView Height="100" HorizontalAlignment="Left" Margin="88,134,0,0" Name="listView1" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Source={StaticResource myList}}"/> //Wrong </Grid> </Window> All my code (updated version, not working): <Window x:Class="TestApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <TextBox Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" Name="textBox1" VerticalAlignment="Top" Width="120" /> <Button Content="Button" Height="23" HorizontalAlignment="Right" Margin="0,12,290,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" /> <ListView Height="100" HorizontalAlignment="Left" Margin="88,134,0,0" Name="listView1" VerticalAlignment="Top" Width="120" ItemsSource="{Binding myList}"/> </Grid> </Window> C#-code: namespace TestApp { public partial class MainWindow : Window { ObservableCollection<string> myList = new ObservableCollection<string>(); public MainWindow() { InitializeComponent(); myList.Add("first string"); } private void button1_Click(object sender, RoutedEventArgs e) { myList.Add(textBox1.Text); textBox1.Text = myList.Count+"st"; } } }

    Read the article

  • How do I keep from running out of memory on graphics for an Android app?

    - by user279112
    I've been working on an Android app in Eclipse, and so far, my program hasn't really grown past midget size. However I've already run into an issue with an Out of Memory error. You see, I've been using graphics comprised solely of bitmaps and PNGs in this program, and recently, when I tried to add a little bit more functionality to the program (mainly including a few more bitmaps and causing an extra sprite to be created), it started crashing in the graphics thread's constructor - sprite's constructor. When I tracked the problem down, it turned out to be an Out of Memory error that is seemingly caused by adding too many picture files to the program and creating Drawables out of them. This would be a problem, as I really don't have that many picture resources worked into that program...maybe 20 or so. I haven't even started to include sound yet. These images aren't all that fancy. My questions are this: 1) Are programs for the Android phone really that limited on how much memory they can employ, or is it probably something other than the 20-30 resource pictures causing that error? 2) If the memory for Android apps is so awful it can't even handle 20-30 picture resources being loaded into Drawables that exist at the same time, then how in the world are you supposed to make decent graphics and sound for that thing? Thanks.

    Read the article

  • Using POST or SESSION to capture data

    - by Karinne
    Hi all! I'm currently working on web application using VB in ASP.NET. Right now I have 1 page with panels that we are using to show/hide depending on the flow. When the user first comes in, he/she is presented with a gridview containing a list of clients. Then the user, clicks a link from a row and is presented a form where he/she can update the clients' info. Originally, I had a HYPERLINKFIELD that put the clientId in the url, then I'd grab the url and do the code appropriately <asp:HyperLinkField Text='<%$ Resources:Resource, ManageClient %>' DataNavigateUrlFields="CLIENT_ID" DataNavigateUrlFormatString="~/clients/manage.aspx?clientId={0}" /> Now, I'm rethinking that and wondering if it's better to use SESSIONs to grab the clientID via this instead <asp:TemplateField Visible="false"><ItemTemplate><asp:Label runat="server" ID="hidClientId" Text='<%# Bind("CLIENT_ID")%>' Visible="false" /></ItemTemplate></asp:TemplateField> <asp:ButtonField Text='<%$ Resources:Resource, ManageClient %>' CommandName="Manage" /> Or use the POST method, which I'm not sure how it works in .NET (but I've used it in PHP) Any help would be greatly appreciated.

    Read the article

  • Java applet loading images from external jars

    - by Mathias
    I have a jar on a server, and users should be able to develop extensions for it. Therefore the jars main class should be extended and some resources should be added to a second user created jar which will be loaded from another server or locally. Now I have problems accessing the resources (images) from the user loaded jars. Heres is the structure: My Server: game.jar containing game.class images.class ... image1.png (...) Local: user.jar containing: user.class extends game userimage.png The extension is loaded via Greasemonkey, it modifies the "archive" attribute to "/home/username/user.jar, game.jar" and the "code" attribute to "user.class". The user should be able to overwrite already defined images. If the image does not exist in game.jar, it is loaded correctly from user.jar. But the images loaded early in the game are always loaded from the game.jar, others seem to be overwritten correctly by the user. Is there a way to make sure they are always loaded in the correct order? This might be because of some caching mechanism. Because Greasemonkey removes the game from the page, changes the archive and code and reinsert it, the game is loaded without a mod for a brief second. In that time, images are loaded as expected from game jar, but those are the ones not being overwritable by the user. But how to avoid it? Another thing: If I overwrite the "run" method in user.class, the game is unable to load any image at all. Not from the user.jar and not from the game.jar. Java doesn't find the image, as the URL object "getClass().getResource(imagename)" returns with null. I tried to overwrite the image.class, but that doesn't fix the problem, unless I overwrite every class from game.class involved into calling the image.class

    Read the article

< Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >