Search Results

Search found 248 results on 10 pages for 'uncle leo'.

Page 2/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • MySQL: "UPDATE command denied to user ''@'localhost'"

    - by Uncle Nerdicus
    For some reason when I installed MySQL on my machine (a Mac running OS X 10.9) the 'root' MySQL account got messed up and I don't have access to it, but I do have access to the standard MySQL account 'sean@localhost' which I use to log into phpMyAdmin. I am trying to reset the 'root' password by starting the mysqld daemon using the command mysqld --skip-grant-tables and then running the following lines in the mysql shell. mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') -> WHERE User='root'; mysql> FLUSH PRIVILEGES; Problem is when I try to run that MySQL string the daemon spits back a ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user' as if I didn't use the -u argument when I started the mysql shell, either though I did. Any help is muchly appreciated as I am lost at this point. :/

    Read the article

  • <li> titles and descriptions align across top

    - by AMC
    Not quite sure how to go about describing what it is I'm trying to achieve, so I have some screenshots.. Basically, I'd like the <h2>s all have their top edges align, as well as the <p>'s. What I currently have: What I would like to have: index.html <div id="services"> <p><span>Services</span></p> <ul> <li><h2>Identity and Logo Design</h2><p>Nulla et diam risus. Praesent vestibulum augue non purus tincidunt placerat. Sed in orci leo. Duis dignissim nibh vitae lacus placerat et posuere</p></li> <li><h2>Branding</h2><p>Nulla et diam risus. Praesent vestibulum augue non purus tincidunt placerat. Sed in orci leo. Duis dignissim nibh vitae lacus placerat et posuere</p></li> <li><h2>Web Design and Development</h2><p>Nulla et diam risus. Praesent vestibulum augue non purus tincidunt placerat. Sed in orci leo. Duis dignissim nibh vitae lacus placerat et posuere</p></li> <li><h2>Social Media</h2><p>Nulla et diam risus. Praesent vestibulum augue non purus tincidunt placerat. Sed in orci leo. Duis dignissim nibh vitae lacus placerat et posuere</p></li> </ul> <div class="next"> <a href="#"><img src="img/next.png" alt="Click for more information" /></a> </div><!-- end next --> </div><!-- end services --> style.css #services { border-top: 1px solid #202020; padding-bottom: 60px; padding-top: 40px; } #services p span { font-family: nevis-webfont; font-size: 112.5%; font-weight: normal; letter-spacing: 1px; text-transform: uppercase; } #services ul li { display: inline-block; padding-left: 100px; width: 160px; } #services ul li:first-child { padding-left: 0px; } #services ul li h2 { padding-top: 20px; text-align: center; } #services .next { float: right }

    Read the article

  • Pyglet vs. PyQt

    - by L. De Leo
    I need to implement a really simple card game. As the game logic is written in Python I chose to stick with some Python framework even if my goal is to develop a Windows only version. I also don't like to work with .NET so I ruled out Iron Python + WPF. I tried to write a simple prototype with Pyglet but soon discovered that I will have to do a lot of stuff by hand: things like detecting mouseover events and finding which card was clicked on and moving it, etc... very low level and unnecessary for my use-case. So I thought it might be easier to do things in PyQt. Do you reckon it would be feasible to use PyQt for implementing a simple card game? Will I have higher level events I can work with?

    Read the article

  • Abstracting away the type of a property

    - by L. De Leo
    In Python luckily most of the times you don't have to write getters and setters to get access to class properties. That said sometimes you'll have to remember that a certain property is a list or whatnot and a property would save you there by abstracting the type and providing a setter to add something to such list for example rather than exposing the list directly. Where do you draw the line between exposing the type directly or wrapping its access in a property? What's the general "pythonic" advice?

    Read the article

  • Unable to either locate any wireless networks nor even connect to wifi

    - by Leo Chan
    I'm new to Linux. I currently have installed ubuntu 12.10. I had a previous problem with my wireless card (see url to see previous problem : How to enable wireless in a Fujitsu LH532?). It now shows Connect to hidden network and create new wireless network but now unfortunately it simply cannot find any wireless connections. I did have a very thorough look around about this problem such as wait a little longer since sometimes it cannot load all the wireless connections available that quickly. My wifi is a hidden network and I have used the connect to hidden network feature but it keeps asking for my wep key which has been checked 4 times (I counted) and it still seems to not work; It keeps asking for the WEP key. I did try both WEP 40/128-bit key and WPA & WPA2 since previously on my windows it worked; My family later decided to use WEP. I only have a quick fix using a usb wireless stick and I wish to have a more solid fix. Thanks Results from sudo iwlist wlan0 scan wlan0 Scan completed : Cell 01 - Address: 00:1E:73:C8:62:BD Channel:6 Frequency:2.437 GHz (Channel 6) Quality=25/70 Signal level=-85 dBm Encryption key:on ESSID:"EnigmaHome" Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s 36 Mb/s; 48 Mb/s; 54 Mb/s Mode:Master Extra:tsf=000000cb3bb10a5c Extra: Last beacon: 696ms ago IE: Unknown: 000A456E69676D61486F6D65 IE: Unknown: 010482848B96 IE: Unknown: 030106 IE: Unknown: 0706484B20010B1E IE: Unknown: 2A0107 IE: Unknown: 32080C1218243048606C IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00 Cell 02 - Address: C8:3A:35:34:C1:60 Channel:6 Frequency:2.437 GHz (Channel 6) Quality=22/70 Signal level=-88 dBm Encryption key:on ESSID:"Tenda" Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 9 Mb/s 18 Mb/s; 36 Mb/s; 54 Mb/s Bit Rates:6 Mb/s; 12 Mb/s; 24 Mb/s; 48 Mb/s Mode:Master Extra:tsf=000001336e70ffdd Extra: Last beacon: 716ms ago IE: Unknown: 000554656E6461 IE: Unknown: 010882848B961224486C IE: Unknown: 030106 IE: Unknown: 32040C183060 IE: Unknown: 0706434E20010D10 IE: Unknown: 33082001020304050607 IE: Unknown: 33082105060708090A0B IE: Unknown: DD270050F204104A0001101044000101104700102880288028801880A880C83A3534C160103C000101 IE: Unknown: 050400010000 IE: Unknown: 2A0106 IE: Unknown: 2D1AEC0117FFFF0000000000000000000000000000000C0000000000 IE: Unknown: 3D1606000500000000000000000000000000000000000000 IE: Unknown: 7F0101 IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK Preauthentication Supported IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00 IE: Unknown: 0B05010089127A IE: Unknown: DD1E00904C33EC0117FFFF0000000000000000000000000000000C0000000000 IE: Unknown: DD1A00904C3406000500000000000000000000000000000000000000 IE: Unknown: DD07000C4304000000 Cell 03 - Address: 00:1E:73:C8:62:BF Channel:6 Frequency:2.437 GHz (Channel 6) Quality=47/70 Signal level=-63 dBm Encryption key:on ESSID:"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s 36 Mb/s; 48 Mb/s; 54 Mb/s Mode:Master Extra:tsf=000000cb3bac614e Extra: Last beacon: 1064ms ago IE: Unknown: 00110000000000000000000000000000000000 IE: Unknown: 010482848B96 IE: Unknown: 030106 IE: Unknown: 050C010200000000000000000000 IE: Unknown: 0706484B20010B1E IE: Unknown: 2A0107 IE: Unknown: 32080C1218243048606C IE: Unknown: DD070050F202000100

    Read the article

  • Game software design

    - by L. De Leo
    I have been working on a simple implementation of a card game in object oriented Python/HTML/Javascript and building on the top of Django. At this point the game is in its final stage of development but, while spotting a big issue about how I was keeping the application state (basically using a global variable), I reached the point that I'm stuck. The thing is that ignoring the design flaw, in a single-threaded environment such as under the Django development server, the game works perfectly. While I tried to design classes cleanly and keep methods short I now have in front of me an issue that has been keeping me busy for the last 2 days and that countless print statements and visual debugging hasn't helped me spot. The reason I think has to do with some side-effects of functions and to solve it I've been wondering if maybe refactoring the code entirely with static classes that keep no state and just passing the state around might be a good option to keep side-effects under control. Or maybe trying to program it in a functional programming style (although I'm not sure Python allows for a purely functional style). I feel that now there's already too many layers that the software (which I plan to make incredibly more complex by adding non trivial features) has already become unmanageable. How would you suggest I re-take control of my code-base that (despite being still only at < 1000 LOC) seems to have taken a life of its own?

    Read the article

  • How atomic is a SELECT INTO?

    - by leo.pasta
    Last week I got an interesting situation that prompted me to challenge a long standing assumption. I always thought that a SELECT INTO was an atomic statement, i.e. it would either complete successfully or the table would not be created. So I got very surprised when, after a “select into” query was chosen as a deadlock victim, the next execution (as the app would handle the deadlock and retry) would fail with: Msg 2714, Level 16, State 6, Line 1 There is already an object named '#test' in the database. The only hypothesis we could come up was that the “create table” part of the statement was committed independently from the actual “insert”. We can confirm that by capturing the “Transaction Log” event on Profiler (filtering by SPID0). The result is that when we run: SELECT * INTO #results FROM master.sys.objects we get the following output on Profiler: It is easy to see the two independent transactions. Although this behaviour was a surprise to me, it is very easy to workaround it if you feel the need (as we did in this case). You can either change it into independent “CREATE TABLE / INSERT SELECT” or you can enclose the SELECT INTO in an explicit transaction: SET XACT_ABORT ON BEGIN TRANSACTION SELECT * INTO #results FROM master.sys.objects COMMIT

    Read the article

  • Patterns to refactor common code in multi-platform software

    - by L. De Leo
    I have a Django application and a PyQt application that share a lot of code. A big chunk of the PyQt application are copied verbatim from the Django application's views. As this is a game, I have already an engine.py module that I'm sharing among the two applications, but I was wondering how to restructure the middle layer (what in Django corresponds to the largest part of the views minus the return HttpResponse part) into its own component. In the web application the components are those of a classic Django application (with the only exception that I don't make any use of models): the game engine the url dispatcher the template the views My PyQt application is divided into: the game engine the UI definition where I declare the UI components and react to the events (basically this takes the place of the template and the url dispatcher in the Django app) the controller where I instantiate the window object and reproduce the methods that map the views in the Django app

    Read the article

  • Lenovo ThinkPad Edge E430 Battery Problem

    - by LEo
    On Ubuntu's Web Page, in the Certified hardware section, it is listed Lenovo. http://www.ubuntu.com/certification/ So I decided to buy a ThinkPad from Lenovo. Just one month after I bought the notebook, the battery got a problem and it does not charge anymore. Now Lenovo won't give me any support because I am using Ubuntu. Lenovo says they will give support only for Windows users because their tools runs on Windows. They refused to change my battery before running the Windows based test. What should I do?

    Read the article

  • Privacy policy and terms of use language

    - by L. De Leo
    I have a Czech registered business with which I'm serving a web app mostly (but not exclusively) targeted to Italian customers. The server is in Amsterdam. The site will be multilingual (with 4 languages supported) but for now it's Italian only. What language should the privacy policy and terms and conditions be? What law should they refer to? Could I just offer these two docs in English? (Easier to write and to maintain)

    Read the article

  • Mouse and keyboard stop working after suspend or screensaver lock

    - by LEo
    If I leave the computer and let it run into screensaver and lock the screen, the mouse left click won't go back to work. If I suspend the computer, the keyboard won't get back to work. It started after upgrading to Ubuntu 11.04. Any tips to solve this problem? The follwing lines I got on dmesg after the problem happened [30536.564415] psmouse.c: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [30536.565725] psmouse.c: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [30536.568466] psmouse.c: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [30536.569790] psmouse.c: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [30536.571123] psmouse.c: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [30536.571126] psmouse.c: issuing reconnect request and that after I tried to plug again my USB mouse: [31570.040088] usb 6-1: USB disconnect, address 2 [31573.490095] usb 6-1: new low speed USB device using uhci_hcd and address 3 [31573.687376] input: Microsoft Basic Optical Mouse as /devices/pci0000:00/0000:00:1d.1/usb6/6-1/6-1:1.0/input/input12 [31573.687544] generic-usb 0003:045E:0084.0002: input,hidraw0: USB HID v1.10 Mouse [Microsoft Basic Optical Mouse] on usb-0000:00:1d.1-1/input0

    Read the article

  • Accessing files in a directory without x-permission?

    - by Leo
    I am having a bit of trouble understanding what the execute permission means for directories. Do I understand it correctly that anything in a directory for which a user does not have x-rights is inaccessible even if the things inside the directory gives specific rights to the user? Or will the user still have direct access to the things in the directory, but simply cannot list what is in the directory? (What I am really trying to understand is how safe a directory is from access from other users if they do not have x-permission for it.)

    Read the article

  • Coming back from (blog) retirement

    - by leo.pasta
    So, it has been more than 3 years without a single blog post. I wished I could have a decent excuse for it, but in the end, I guess it boils down to laziness and procrastination. :-) Even though I learned a lot in that period (and added a feel tricks to my bag), I couldn’t find the will to sit down and write. I hope all my readers (yes mom and dad, I’m talking to you) have not been disappointed. I will try really hard not to let routine take over. I don’t expect I will be the most active blogger in the community, but hopefully a couple of posts per month is a good target to aim.

    Read the article

  • Newbie needs to learn basic file management

    - by Leo in NJ
    I have been using Ubuntu for abut 2 weeks and and still frustrated by simple file operations. I want to find a file called 9.jpg. Every internal command 3-rd party program I have tried also gives me 99.jpg, 999.jpg, lovepotion number9.jpg and a zillion other similar ones. How do you search for an EXACT file name WITHOUT wildcards? This is only my most recent frustration. I'm obviously missing something basic. good tutorial anywhere?

    Read the article

  • Need Sql Server Hosting 50GB or More

    - by Leo
    Hi I am looking for a Hosting solution (Dedicated or Shared) which will allow me to host a SQL Server database service (Not SQL Express but the Web edition). The size of my database might grow to 50GB or more. The web application will offer more reads than write operations. I also need daily backups and raid 1 storage. Is there a reliable and economical hosting company that would provide this? Additional Question: If there is a easy way to host MS SQL on Amazon EC2 service, it will be preferable.

    Read the article

  • Stateless game design

    - by L. De Leo
    I'm facing a challenge understanding how to program a web version of a card game that is completely stateless. I create my object graph when the game begins and distribute cards to PlayerA and PlayerB so I lay them out on the screen. At this point I could assume that HTML and the querystring is what holds at least some of my state and just keep a snapshot copy of the game state on the server-side for the sole purpose of validating the inputs I receive from the web clients. Still it appears to me that the state of the game is by its nature mutable: cards are being dealt from the deck, etc... Am I just not getting it? Or should I just strive to minimize the side-effects of my functions to the objects that I take as my input? How would you design a stateless card game?

    Read the article

  • PyQt application architecture

    - by L. De Leo
    I'm trying to give a sound structure to a PyQt application that implements a card game. So far I have the following classes: Ui_Game: this describes the ui of course and is responsible of reacting to the events emitted by my CardWidget instances MainController: this is responsible for managing the whole application: setup and all the subsequent states of the application (like starting a new hand, displaying the notification of state changes on the ui or ending the game) GameEngine: this is a set of classes that implement the whole game logic Now, the way I concretely coded this in Python is the following: class CardWidget(QtGui.QLabel): def __init__(self, filename, *args, **kwargs): QtGui.QLabel.__init__(self, *args, **kwargs) self.setPixmap(QtGui.QPixmap(':/res/res/' + filename)) def mouseReleaseEvent(self, ev): self.emit(QtCore.SIGNAL('card_clicked'), self) class Ui_Game(QtGui.QWidget): def __init__(self, window, *args, **kwargs): QtGui.QWidget.__init__(self, *args, **kwargs) self.setupUi(window) self.controller = None def place_card(self, card): cards_on_table = self.played_cards.count() + 1 print cards_on_table if cards_on_table <= 2: self.played_cards.addWidget(card) if cards_on_table == 2: self.controller.play_hand() class MainController(object): def __init__(self): self.app = QtGui.QApplication(sys.argv) self.window = QtGui.QMainWindow() self.ui = Ui_Game(self.window) self.ui.controller = self self.game_setup() Is there a better way other than injecting the controller into the Ui_Game class in the Ui_Game.controller? Or am I totally off-road?

    Read the article

  • loss of sound in ubuntu 12.04

    - by Leo Simon
    I'm running Linux E6520 3.2.0-56-generic #86-Ubuntu SMP Wed Oct 23 09:20:45 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux on a Dell Latitude E6530. (This is a new machine; have run the same version of linux on an older machine for a year, without this happening.) I've been losing sound regularly, though have not been able to isolate the trigger for this. I've scoured the web on this subject, in particular https://help.ubuntu.com/community/SoundTroubleshootingProcedure and Audio stopped working suddenly in 12.04 Nothing from the first site seemed to work for me. From the second site, I learned enough to be able to fix the problem when it happens, but nothing on the web has helped me figure out why the problem is happening in the first place. Patching together stuff from the web, and with some blind luck, I've found that the following steps seem to restore sound pulseaudio --kill pulseaudio --start pavucontrol -> output devices Click on the "Mute audio" icon, which mutes audio Click on the "Mute audio" icon, which unmutes audio. This obviously doesn't make sense: audio wasn't muted in the first place, but somehow, magically, toggling mute audio off and on seems to reset something. Can anybody suggest from this information why sound would be disappearing in the first place (it seems as though something is getting muted at the system level, but I don't know what)? a simpler (command-line/script) way of restoring sound, in particular, is it possible to reset pavucontrol from the commandline? Some other pieces of information that may be of use: The problem is clearly happening at the system level, since I've set up a clean new user, and this user has the same problems that I do. So user fixes like deleting the .pulse directory aren't (and don't) help. Sound works fine in Windows (dual-boot) so it's not a hardware problem Any help/suggestions on this would be most appreciated.

    Read the article

  • Offline web app options

    - by L. De Leo
    For a game web app that runs Python on the server side and Javascript / HTML on the client side I'd like to build an offline version that runs in Chrome and on the mobile devices. What is the most convenient way currently available to target Chrome, Win 8 Desktop (with a Win packaged app) and the mobile devices reusing most of the code? Options could be PhoneGap for the mobile devices and PyJs for the offline browser versions or maybe translate Python to Dart manually (because of the closer semantics of the two languages) and compile to Javascript.

    Read the article

  • Why does my co-worker see a different Project file (*.csproj) using Visual Source Safe

    - by Leo Zhang
    Hello everybody, I met a problem which is very strange, my company uses Visual Source Safe to control version,but I found that my team's different member see the same .csproj file in VSS is not the same, it's very strange,can you help me? thanks!! there is a file named IPRA.WinUi.Sal.Sra.csproj in VSS: when Tom log on ,the file 'IPRA.WinUi.Sal.Sra.csproj' is : <Reference Include="Ark.Client.WinUi, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\BusinessFramework\Ark.Client.WinUi.dll</HintPath> </Reference> <Reference Include="Ark.Common.Business, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> <Reference Include="Ark.Controls.Business, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\SystemFramework\Ark.Controls.Business.dll</HintPath> </Reference> But when leo log on,the same file 'IPRA.WinUi.Sal.Sra.csproj' is : <Reference Include="Ark.Client.WinUi, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\BusinessFramework\Ark.Client.WinUi.dll</HintPath> </Reference> <Reference Include="Ark.Common.Business, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\BusinessFramework\Ark.Controls.WinUi.dll</HintPath> <Reference Include="Ark.Controls.Business, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\SystemFramework\Ark.Controls.Business.dll</HintPath> </Reference>

    Read the article

  • Strange WPF ListBox Behavior

    - by uncle-harvey
    I’m trying to bind a List of items to a listbox in WPF. The items are grouped by one value and each group is to be housed in an expander. Everything works fine when I don’t use any custom styles. However, when I use custom styles (which work properly with non-grouped items and as independent controls) the binding doesn’t display any items. Below is the code I’m executing. Any ideas why the items won’t show up in the Expander? Test.xaml: <Window x:Class="Glossy.Test" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Test" Height="300" Width="300"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="..\TestStyles.xaml"/> <ResourceDictionary> <Style x:Key="ContainerStyle" TargetType="{x:Type GroupItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Expander Header="{Binding}" IsExpanded="True"> <ItemsPresenter /> </Expander> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Grid> <ListBox x:Name="TestList"> <ListBox.GroupStyle> <GroupStyle ContainerStyle="{StaticResource ContainerStyle}"/> </ListBox.GroupStyle> </ListBox> </Grid> Test.xaml.cs: public partial class Test : Window { private List<Contact> _ContactItems; public List<Contact> ContactItems { get { return _ContactItems; } set { _ContactItems = value; } } public Test() { InitializeComponent(); ContactItems = new List<Contact>(); ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "ABC"; ContactItems.Last().Name = "Contact 1"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "ABC"; ContactItems.Last().Name = "Contact 2"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "ABC"; ContactItems.Last().Name = "Contact 3"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "ABC"; ContactItems.Last().Name = "Contact 10"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "ABC"; ContactItems.Last().Name = "Contact 11"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "ABC"; ContactItems.Last().Name = "Contact 12"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "RST"; ContactItems.Last().Name = "Contact 7"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "RST"; ContactItems.Last().Name = "Contact 8"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "RST"; ContactItems.Last().Name = "Contact 9"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "XYZ"; ContactItems.Last().Name = "Contact 4"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "XYZ"; ContactItems.Last().Name = "Contact 5"; ContactItems.Add(new Contact()); ContactItems.Last().CompanyName = "XYZ"; ContactItems.Last().Name = "Contact 6"; ICollectionView view = CollectionViewSource.GetDefaultView(ContactItems); view.GroupDescriptions.Add(new PropertyGroupDescription("CompanyName")); view.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); TestList.ItemsSource = view; } } public class Contact { public string CompanyName { get; set; } public string Name { get; set; } public override string ToString() { return Name; } } TestStyles.xaml: <Style TargetType="{x:Type ListBox}"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> <Setter Property="MinWidth" Value="120"/> <Setter Property="MinHeight" Value="95"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ListBox"> <Grid Background="Black"> <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Fill="White"> <Rectangle.OpacityMask> <DrawingBrush> <DrawingBrush.Drawing> <GeometryDrawing Geometry="M65.5,33 L537.5,35 537.5,274.5 C536.5,81 119.5,177 66.5,92" Brush="#11444444"> <GeometryDrawing.Pen> <Pen Brush="Transparent"/> </GeometryDrawing.Pen> </GeometryDrawing> </DrawingBrush.Drawing> </DrawingBrush> </Rectangle.OpacityMask> </Rectangle> <Border Name="Border" Background="Transparent" BorderBrush="Gray" BorderThickness="1" CornerRadius="2"> <ScrollViewer Margin="0" Focusable="false"> <StackPanel Margin="2" IsItemsHost="True" /> </ScrollViewer> </Border> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter TargetName="Border" Property="Background" Value="Gray" /> <Setter TargetName="Border" Property="BorderBrush" Value="DimGray" /> </Trigger> <Trigger Property="IsGrouping" Value="true"> <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="Foreground" Value="Gray"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="FontFamily" Value="Verdana"/> <Setter Property="HorizontalAlignment" Value="Stretch"/> <Setter Property="FontSize" Value="11"/> <Setter Property="Margin" Value="3,1,3,1"/> <Setter Property="Padding" Value="0"/> <Setter Property="FontWeight" Value="Normal"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ListBoxItem"> <Border Name="Border" Padding="2" SnapsToDevicePixels="true"> <ContentPresenter /> </Border> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="true"> <Setter TargetName="Border" Property="Background" Value="Gray"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="White"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <ControlTemplate x:Key="ExpanderToggleButton" TargetType="ToggleButton"> <Border Name="Border" CornerRadius="2,0,0,0" Background="Transparent" BorderBrush="LightGray" BorderThickness="0,0,1,0"> <Path Name="Arrow" Fill="Blue" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z"/> </Border> <ControlTemplate.Triggers> <Trigger Property="ToggleButton.IsMouseOver" Value="True"> <Setter TargetName="Border" Property="Background" Value="Gray" /> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="Border" Property="Background" Value="Black" /> </Trigger> <Trigger Property="IsChecked" Value="True"> <Setter TargetName="Arrow" Property="Data" Value="M 0 4 L 4 0 L 8 4 Z" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="Border" Property="Background" Value="DimGray" /> <Setter TargetName="Border" Property="BorderBrush" Value="DimGray" /> <Setter Property="Foreground" Value="LightGray"/> <Setter TargetName="Arrow" Property="Fill" Value="LightBlue" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> <Style TargetType="{x:Type Expander}"> <Setter Property="Foreground" Value="White"/> <Setter Property="FontFamily" Value="Verdana"/> <Setter Property="FontSize" Value="11"/> <Setter Property="FontWeight" Value="Normal"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Expander"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Name="ContentRow" Height="0"/> </Grid.RowDefinitions> <Border Name="Border" Grid.Row="0" Background="Black" BorderBrush="DimGray" BorderThickness="1" Cursor="Hand" CornerRadius="2,2,0,0" > <Grid HorizontalAlignment="Left"> <Grid.RowDefinitions> <RowDefinition Height="23"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="20" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <ToggleButton IsChecked="{Binding Path=IsExpanded,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ExpanderToggleButton}" Background="Black" /> <Label Grid.Column="1" FontSize="14" FontWeight="Normal" Margin="0" VerticalAlignment="Top" Foreground="White" FontFamily="Verdana"> <ContentPresenter Grid.Column="1" Margin="4,3,0,0" HorizontalAlignment="Left" ContentSource="Header" RecognizesAccessKey="True" /> </Label> </Grid> </Border> <Border Name="Content" Background="Black" BorderBrush="DimGray" BorderThickness="1,0,1,1" Grid.Row="1" CornerRadius="0,0,2,2" > <Grid Background="Black"> <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Fill="White"> <Rectangle.OpacityMask> <DrawingBrush> <DrawingBrush.Drawing> <GeometryDrawing Geometry="M65.5,33 L537.5,35 537.5,274.5 C536.5,81 119.5,177 66.5,92" Brush="#11444444"> <GeometryDrawing.Pen> <Pen Brush="Transparent"/> </GeometryDrawing.Pen> </GeometryDrawing> </DrawingBrush.Drawing> </DrawingBrush> </Rectangle.OpacityMask> </Rectangle> <ContentPresenter Margin="4" /> </Grid> </Border> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsExpanded" Value="True"> <Setter TargetName="ContentRow" Property="Height" Value="{Binding ElementName=Content,Path=DesiredHeight}" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="Border" Property="Background" Value="Gray" /> <Setter TargetName="Border" Property="BorderBrush" Value="DimGray" /> <Setter Property="Foreground" Value="White"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>

    Read the article

  • Replication - syncronizing most of the data some of the time

    - by uncle brad
    I have some data that isn't properly "partitioned" (for lack of a better word). All inserts, processing and reporting happen on the same table. The bulk of the processing happens not long after the insert and not long after that it becomes immutable (we're talking days). I could do all inserts and processing on a new table that I replicate to the old table. When I detect that the data has become immutable I would delete the data from the new table, but I would edit the delete replication stored procedure so that the delete did not replicate. How bad an idea is this? It seems attractive at the moment (I haven't slept on it yet) because it might mitigate a performance problem with only very small changes to the application. It also seems like it might be a good way to shoot myself in the foot.

    Read the article

  • What is the best way to convince management that virtualization isn't always appropriate in producti

    - by uncle brad
    I work for a small company with a .NET product that was acquired by a medium sized company with "big iron" products. Recently, the medium-sized part of the company acquired another small company with a similar .NET product and management went to have a look at their technology. They make heavy use of virtualization in their production environment and it's been decided that we will too. Our product was not designed to be run in a virtual environment, but some accommodations can be made. For instance; there are times when we're resource bound due to customer initiated processes. This initiation is "bursty" by nature, but the processing can be made asynchronous and throttled. This is something that would need to be done for scalability anyway. But there is other processing that we do that isn't so easily modified because we're resource bound for extended periods of time. How do I convince management that heavy use of virtualization is probably not appropriate for us?

    Read the article

  • CSS overflow character not pushing down <div>

    - by Uncle Toby
    I have a <div> called bigbox which contain a <div>called wrapper . The wrapper contain 2 <div> called textbox and checkbox. If the characters inside textbox overflow , it doesn't push the other wrapper below . How can I make the below wrapper go down ? here is the jsfiddle : http://jsfiddle.net/WA63P/ <html> <head> <title>Page</title> <script type="text/javascript" src="jquery-1.9.1.min.js"></script> <style type="text/css"> .bigbox { background-color: #F5E49C; color: #000; padding: 0 5px; width:280px; height:500px; position: absolute; text-align: center;content: "";display: block;clear: both; } .box { background-color: #272822; color: #9C5A3C; height:100px; width:260px; margin-bottom: 10px; position: relative; top:10px; } .textbox { background-color: #FFFFFF; color: #272822; height:100px; width:160px;float:left;text-align: left } .checkbox { background-color: #FFFFFF; height:50px; width:50px; float:right; d } </style> <div class="bigbox"> <div class="box"> <div class="textbox">background background background background background background background background background background background background background background background background background background background background background background </div> <div class="checkbox"> </div> </div> <div class="box"> <div class="textbox"> </div> <div class="checkbox"> </div> </div> </body> </html>

    Read the article

  • Prolog Family tree

    - by Tania
    Hi I have a Question in prolog , I did it but its not showing answers When i ask about the brothers,sisters,uncles,aunts This is what I wrote, what's wrong ? /*uncle(X, Y) :– male(X), sibling(X, Z), parent(Z, Y).*/ /*uncle(X, Y) :– male(X), spouse(X, W), sibling(W, Z), parent(Z, Y).*/ uncle(X,Y) :- parent(Z,Y), brother(X,Z). aunt(X,Y) :- parent(Z,Y), sister(X,Z). sibling(X, Y) :- parent(Z, X), parent(Z, Y), X \= Y. sister(X, Y) :- sibling(X, Y), female(X). brother(X, Y) :- sibling(X, Y), male(X). parent(Z,Y) :- father(Z,Y). parent(Z,Y) :- mother(Z,Y). grandparent(C,D) :- parent(C,E), parent(E,D). aunt(X, Y) :– female(X), sibling(X, Z), parent(Z, Y). aunt(X, Y) :– female(X), spouse(X, W), sibling(W, Z), parent(Z, Y). male(john). male(bob). male(bill). male(ron). male(jeff). female(mary). female(sue). female(nancy). mother(mary, sue). mother(mary, bill). mother(sue, nancy). mother(sue, jeff). mother(jane, ron). father(john, sue). father(john, bill). father(bob, nancy). father(bob, jeff). father(bill, ron). sibling(bob,bill). sibling(sue,bill). sibling(nancy,jeff). sibling(nancy,ron). sibling(jell,ron). And one more thing, how do I optimize the rule of the brother so that X is not brother to itself.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >