Daily Archives

Articles indexed Tuesday May 4 2010

Page 9/117 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Flex Builder 3 Unclosable Editor Windows

    - by Sam Goldman
    See: http://i.imgur.com/pQNQh.png Somehow I made this happen and I don't know how to undo it. The image linked above shows my Flex Builder session. The largest section of the window is the editor. Initially, there was a blank window on the screen so I tried closing it, but I couldn't. Then I tried dragging it and realized I could drag it into a corner of itself, hence all the nested windows. I have no idea how to close these windows or simply reset the view. I went to the preferences under General Perspectives, but the "reset" button was disabled for every available perspective. Help?

    Read the article

  • Update n number of records using JPA with Optimistic locking

    - by Jacques René Mesrine
    I have a table with a column called "count" and I want to run a cron job that will trigger a statement that performs a SQL like this: update summaryTable set count=4; Note that there might be concurrent threads reading & changing the value for "count" when this cron job is triggered. The table has a version column to support Optimistic Locking. What's an efficient way to update the count in JPA ?

    Read the article

  • Visual Studio 2010 Keyboard Shortcut Posters Available

    - by Jim Duffy
    I’m a firm believer in the productivity gains you experience when using keyboard shortcuts in Visual Studio. If you’re not using keyboard shortcuts while coding then your productivity is suffering. Some of my favorites (omitting the obvious ones like F5 to start debugging) as are: Ctrl+K, C – Comment section of code Ctrl+K, U – Uncomment section of code Ctrl+K, D – Format the current document (indentation, etc.) Shift+Alt+C – Add new class to a project Shift+Alt+A – Add existing item to a project Ctrl+Shift+A – Add new item to a project The good news is all of these and a TON of others are all documented in the Visual Studio Keyboard Shortcut Posters (available as PDFs). The only problem is there are so many you need a printer capable of printing on larger paper because while you can read them all on 8 1/2 x 11 paper in landscape mode, for them to be a valuable quick reference on your cubicle wall you’re going to need to print them on large paper. If you don’t have a printer capable of producing large sized printouts head down to Office Depot, Staples, FedEx Office, or your favorite print shop and have them print one for you. Oh and one last thing, I’d really like Microsoft to take those people’s picture off them. Really? Do we need to look at these people when trying to improve our productivity? Have a day. :-|

    Read the article

  • Nginx Rewrite to Previous Directory

    - by ThinkBohemian
    I am trying to move my blog from blog.example.com to example.com/blog to do this I would rather not move anything on disk, so instead i changed my nginx configuration file to the following: location /blog { if (!-e $request_filename) { rewrite ^.*$ /index.php last; } root /home/demo/public_html/blog.example.com/current/public/; index index.php index.html index.html; passenger_enabled off; index index.html index.htm index.php; try_files $uri $uri/ @blog; } This works great but when i visit example.com/blog nginx looks for: /home/demo/public_html/blog.example.com/current/public/blog/index.php instead of /home/demo/public_html/blog.example.com/current/public/index.php Is there a way to put in a rewrite rule so that I can have the server automatically take out the /blog/ directory? something like ? location /blog { rewrite \\blog\D \; }

    Read the article

  • how can i randomly print an element from a list in python

    - by lm
    So far i have this, which prints out every word in my list, but i am trying to print only one word at random. Any suggestions? def main(): # open a file wordsf = open('words.txt', 'r') word=random.choice('wordsf') words_count=0 for line in wordsf: word= line.rstrip('\n') print(word) words_count+=1 # close the file wordsf.close()

    Read the article

  • Mobile Video Detection

    - by aaroninfidel
    Hi, I'm using DeviceAtlas to detect mobile phones, I was wondering if anyone had some good resources in terms of standard codecs, video dimensions that are used and how you go about serving video to mobile devices. Thanks! -Aaron

    Read the article

  • Custom model in ASP.NET MVC controller: Custom display message for Date DataType

    - by Rita
    Hi I have an ASP.NET MVC Page that i have to display the fields in customized Text. For that I have built a CustomModel RequestViewModel with the following fields. Description, Event, UsageDate Corresponding to these my custom Model has the below code. So that, the DisplayName is displayed on the ASP.NET MVC View page. Now being the Description and Event string Datatype, both these fields are displaying Custom DisplayMessage. But I have problem with Date Datatype. Instead of "Date of Use of Slides", it is still displaying UsageDate from the actualModel. Anybody faced this issue with DateDatatype? Appreciate your responses. Custom Model: [Required(ErrorMessage="Please provide a description")] [DisplayName("Detail Description")] [StringLength(250, ErrorMessage = "Description cannot exceed 250 chars")] // also need min length 30 public string Description { get; set; } [Required(ErrorMessage="Please specify the name or location")] [DisplayName("Name/Location of the Event")] [StringLength(250, ErrorMessage = "Name/Location cannot exceed 250 chars")] public string Event { get; set; } [Required(ErrorMessage="Please specify a date", ErrorMessageResourceType = typeof(DateTime))] [DisplayName("Date of Use of Slides")] [DataType(DataType.Date)] public string UsageDate { get; set; } ViewCode: <p> <%= Html.LabelFor(model => model.Description) %> <%= Html.TextBoxFor(model => model.Description) %> <%= Html.ValidationMessageFor(model => model.Description) %> </p> <p> <%= Html.LabelFor(model => model.Event) %> <%= Html.TextBoxFor(model => model.Event) %> <%= Html.ValidationMessageFor(model => model.Event) %> </p> <p> <%= Html.LabelFor(model => model.UsageDate) %> <%= Html.TextBoxFor(model => model.UsageDate) %> <%= Html.ValidationMessageFor(model => model.UsageDate) %> </p>

    Read the article

  • Looking for books

    - by robblot
    When I was learning Visual Basic.net 2008 I found a book that not only taught the basics but by the end of the book I had developed a fully working database application. Does anyone know where I might find a simular book but using Visual C++?

    Read the article

  • defining class relationships in c# and visual studio 2010

    - by andy
    Hey guys, in Visual Studio 2010 I can point to a bunch of classes and create a diagram. However, the diagram by default doesn't recognize any relationships between the classes, except inheritance and implementations. Is there a way, ideally by using Attributes, to define class and property relationships and associations in such a way that it is picked up by a new Class Diagram automatically? cheers!

    Read the article

  • Drupal: how to set theme language programmatically?

    - by takpar
    How can i change drupal default language programmatically somewhere in code (like template.php)? (i need to overwrite default language set by admin in some cases.) i'm using drupal 6. PS: please read my own answer for more detail. and if you may help solve that PS: later i saw a module that was what i wanted. make sure take a look at it: Administration Language Drupal Module

    Read the article

  • Rails, RSpec and Webrat: Expected output matches rendered output but still getting error in view spe

    - by Anthony Burns
    Hello all, I've just gotten started using BDD with RSpec/Cucumber/Webrat and Rails and I've run into some frustration trying to get my view spec to pass. First of all, I am running Ruby 1.9.1p129 with Rails 2.3.2, RSpec and RSpec-Rails 1.2.6, Cucumber 0.3.11, and Webrat 0.4.4. Here is the code relevant to my question config/routes.rb: map.b_posts 'backend/posts', :controller => 'backend/posts', :action => 'backend_index', :conditions => { :method => :get } map.connect 'backend/posts', :controller => 'backend/posts', :action => 'create', :conditions => { :method => :post } views/backend/posts/create.html.erb: <% form_tag do %> <% end %> *spec/views/backend/posts/create.html.erb_spec.rb:* describe "backend/posts/create.html.erb" do it "should render a form to create a post" do render "backend/posts/create.html.erb" response.should have_selector("form", :method => 'post', :action => b_posts_path) do |form| # Nothing here yet. end end end Here is the relevant part of the output when I run script/spec: 'backend/posts/create.html.erb should render a form to create a post' FAILED expected following output to contain a <form method='post' action='/backend/posts'/> tag: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><form action="/backend/posts" method="post"> </form></body></html> It would appear to me that what have_selector is looking for is exactly what the template generates, yet the example still fails. I am very much looking forward to seeing my error (because I have a feeling it is my error). Any help is much appreciated!

    Read the article

  • Page replace with RJS

    - by Jiang
    Hi all, I try to implement a vote feature in one of my rails projects. I use the following codes (in vote.rjs) to replace the page with a Partial template (_vote.rhtml). But when I click, the vote number can not be updated immediately. I have to refresh the page to see the change. vote.rjs page.replace("votes#{@foundphoto.id}", :partial="vote", :locals={:voteable=@foundphoto}) The partial template is as follows: _vote.rhtml " <%= link_to_remote "+(#{voteable.votes_for})", :update="vote", :url = { :action="vote", :id=voteable.id, :vote="for"} % / <%= link_to_remote "-(#{voteable.votes_against})", :update="vote", :url = { :action="vote", :id=voteable.id, :vote="against"} % any ideas? Thanks.

    Read the article

  • Bind a SL4 TreeView to an IGrouping using Caliburn

    - by illdev
    I am just starting in the SL world and am trying to use the Caliburn NavigationShell as my starting point. I converted the solution to SL4 and use Caliburn from the trunk . To create the basic navigation, I am a bit unsure (well, quite), how I can display the original StackPanel of Buttons as a collapsible Treeview. I changed ITaskBarItem to own a simple GroupName property public interface ITaskBarItem : IEntryPoint { BitmapImage Icon { get; } string DisplayName { get; } string GroupName { get;} } then, I expose this in ShellViewModel to the View: public IEnumerable<IGrouping<string, ITaskBarItem>> TaskBarItems { get { return _taskBarItems.GroupBy(t => t.GroupName); } } How can I do the xaml markup so that I get a simple hierarchy? How can I bind Actions with out the use of Buttons? GroupName DisplayName DisplayName DisplayName GroupName DisplayName DisplayName DisplayName ... Mind, this is MVVM, so I am not going to use code behind or events to do that...

    Read the article

  • pyobj access to iTunes application

    - by jldupont
    Let's say I managed to get the dictionary opened for iTunes in the Applescript editor: How would I access the "search" commands using Python with pyobjc? I know I get can hold of the iTunes application using: iTunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes") but after I do a dir on it, I don't see the search command in the returned dictionary. Help please!

    Read the article

  • JavaScript regex refactoring

    - by JamesBrownIsDead
    I'm performing this on a string: var poo = poo .replace(/[%][<]/g, "'<") .replace(/[>][%]/g, ">'") .replace(/[%]\s*[+]/g, "'+") .replace(/[+]\s*[%]/g, "+'"); Given the similar if these statements, can these regexs be comebined somehow?

    Read the article

  • Trying to find books

    - by robblot
    When I was learning Visual Basic.net 2008 I found a book that not only taught the basics but by the end of the book I had developed a fully working database application. Does anyone know where I might find a simular book but using Visual C++?

    Read the article

  • How to make softkeyboard candidate view not block application view?

    - by Cedric
    Hi, I am playing with the Demo SoftKeyboard the comes with the Android SDK. In portrait mode when the candidate view is shown, it doesn't move the app up as the default android keyboard does. Hence it covers part of the application view. What should be changed in order to make the candidate view in the demo softkeyboard behave as the default android keyboard does? I've also looked at the source of the android keyboard from git but found nothing related to this behavior.

    Read the article

  • How to call constructor of the current class and parent class at the same time?

    - by Siegfried
    public class A{ public A(int a, int b) {...} } public class B : A{ List a; List b; public B(){...} //constructor1 public B(int a, int b) : base(a,b){...} //constructor2 } My question is I need to initialize both list a and b in class B. If I put them in the constructor1, how can I call constructor1 in constructor2? I don't want to rewrite the initialization statements in constructor2 again. Thanks!

    Read the article

  • WFP: How do you properly Bind a DependencyProperty to the GUI

    - by Robert Ross
    I have the following class (abreviated for simplicity). The app it multi-threaded so the Set and Get are a bit more complicated but should be ok. namespace News.RSS { public class FeedEngine : DependencyObject { public static readonly DependencyProperty _processing = DependencyProperty.Register("Processing", typeof(bool), typeof(FeedEngine), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender)); public bool Processing { get { return (bool)this.Dispatcher.Invoke( DispatcherPriority.Normal, (DispatcherOperationCallback)delegate { return GetValue(_processing); }, Processing); } set { this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate { SetValue(_processing, value); }, value); } } public void Poll() { while (Running) { Processing = true; //Do my work to read the data feed from remote source Processing = false; Thread.Sleep(PollRate); } // } } } Next I have my main form as the following: <Window x:Class="News.Main" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converter="clr-namespace:News.Converters" xmlns:local="clr-namespace:News.Lookup" xmlns:rss="clr-namespace:News.RSS" Title="News" Height="521" Width="927" Initialized="Window_Initialized" Closing="Window_Closing" > <Window.Resources> <ResourceDictionary> <converter:BooleanConverter x:Key="boolConverter" /> <converter:ArithmeticConverter x:Key="arithConverter" /> ... </ResourceDictionary> </Window.Resources> <DockPanel Name="dockPanel1" SnapsToDevicePixels="False" > <ToolBarPanel Height="37" Name="toolBarPanel" Orientation="Horizontal" DockPanel.Dock="Top" > <ToolBarPanel.Children> <Button DataContext="{DynamicResource FeedEngine}" HorizontalAlignment="Right" Name="btnSearch" ToolTip="Search" Click="btnSearch_Click" IsEnabled="{Binding Path=Processing, Converter={StaticResource boolConverter}}"> <Image Width="32" Height="32" Name="imgSearch" Source="{Resx ResxName=News.Properties.Resources, Key=Search}" /> </Button> ... </DockPanel> </Window> As you can see I set the DataContext to FeedEngine and Bind IsEnabled to Processing. I have also tested the boolConverter separately and it functions (just applies ! (Not) to a bool). Here is my Main window code behind in case it helps to debug. namespace News { /// <summary> /// Interaction logic for Main.xaml /// </summary> public partial class Main : Window { public FeedEngine _engine; List<NewsItemControl> _newsItems = new List<NewsItemControl>(); Thread _pollingThread; public Main() { InitializeComponent(); this.Show(); } private void Window_Initialized(object sender, EventArgs e) { // Load current Feed data. _engine = new FeedEngine(); ThreadStart start = new ThreadStart(_engine.Poll); _pollingThread = new Thread(start); _pollingThread.Start(); } } } Hope someone can see where I missed a step. Thanks.

    Read the article

  • Simplify CASE in VB.net code

    - by StealthRT
    Hey all, i am looking here to see if anyone would have a better way to acomplish this task below in less code. Select Case mainMenu.theNumOpened Case 1 Me.Text = "NBMsg1" Me.SetDesktopLocation(My.Computer.Screen.WorkingArea.Width - 302, 5) Case 2 Me.Text = "NBMsg2" Dim hwnd As IntPtr = FindWindow(vbNullString, "NBMsg1") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, Me.Height + 10, 0, 0, 1) Me.SetDesktopLocation(My.Computer.Screen.WorkingArea.Width - 302, 5) Case 3 Me.Text = "NBMsg3" Dim hwnd As IntPtr = FindWindow(vbNullString, "NBMsg2") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, Me.Height + 10, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg1") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 2) + 15, 0, 0, 1) Me.SetDesktopLocation(My.Computer.Screen.WorkingArea.Width - 302, 5) Case 4 Me.Text = "NBMsg4" Dim hwnd As IntPtr = FindWindow(vbNullString, "NBMsg3") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, Me.Height + 10, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg2") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 2) + 15, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg1") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 3) + 20, 0, 0, 1) Me.SetDesktopLocation(My.Computer.Screen.WorkingArea.Width - 302, 5) Case 5 Me.Text = "NBMsg5" Dim hwnd As IntPtr = FindWindow(vbNullString, "NBMsg4") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, Me.Height + 10, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg3") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 2) + 15, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg2") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 3) + 20, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg1") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 4) + 25, 0, 0, 1) Me.SetDesktopLocation(My.Computer.Screen.WorkingArea.Width - 302, 5) Case 6 Me.Text = "NBMsg6" Dim hwnd As IntPtr = FindWindow(vbNullString, "NBMsg5") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, Me.Height + 10, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg4") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 2) + 15, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg3") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 3) + 20, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg2") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 4) + 25, 0, 0, 1) hwnd = FindWindow(vbNullString, "NBMsg1") SetWindowPos(hwnd, 0, My.Computer.Screen.WorkingArea.Width - 302, (Me.Height * 5) + 30, 0, 0, 1) Me.SetDesktopLocation(My.Computer.Screen.WorkingArea.Width - 302, 5) Case Else Me.Close() Me.Dispose() End Select What it does is pass to it now many windows are currently already opened. So if one then of course it goes to case 1. If there are 2 opened then it moves the oldest down and puts the newest on top. etc etc. I have set it so that a max of 6 boxes can only be opened at one time. If anyone knows how i could also "slide" them down (kinda like an effect of jQuery) then that would also be, well awesome to know! :o) Any help/suggestions would be great! :o) David

    Read the article

  • VS2010 Database Compare. How do you create a *.DBSchema extensioned file?

    - by George
    I'd like to take a snapshot of my database, make some changes and then use the db compare functionality to identify the changes, and who knows, maybe even generate scripts to make the change. I'd like to avoid having to backup the current db and restore it as a separate db just to have a "before" snapshot. I'm guessing I shouldn't have to. Obsviously, I'm clueless about db projects and am looking to be pointed in the right direction. ty!

    Read the article

  • Jquery UI Autocomplete widget conflict qith jqeury.menu widget - how can I solve it?

    - by JK
    My app already has a completed menu using jquery.menu.js found at http://wiki.jqueryui.com/Menu. I'm now also trying to add the jquery autocomplete widget from jquery ui 1.8.1 - but both of these have a .menu() function that conflicts with each other. If I put jquery-ui-1.8.1.custom.js first in the head, then autocomplete works but the menu does not. If I put jquery-menu.js first in the head, then the menu works but autocomplete doesnt. Is there a way to solve this without editing either plugin? (If I edit, I will probably lose those changes the next time either plugin is upgraded)

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >