Daily Archives

Articles indexed Tuesday November 22 2011

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

  • OnShutdown() not working on XP

    - by Daro
    I have a service registered for shutdown events (.Net 3.5): public ServiceName() { InitializeComponent(); base.CanHandleSessionChangeEvent = true; base.CanHandlePowerEvent = true; base.CanShutdown = true; } protected override void OnShutdown() { try { if (Program.Debug2Eventlog == true) { WriteEventEntry( "Computer is shutting down.", EventLogEntryType.Information, 0, 3); } } catch {} base.OnShutdown(); } Windows 7 logs the event just fine, but XP doesn't. Am I missing something?

    Read the article

  • Developing Bots__Where can I start?

    - by user947659
    i have a pet programming goal: to develop a bot for a game. Now, this won't be anything malicious, and I just want to do this to further my knowledge in programming. Can anyone help me out by pointing to where i can start learning how to develop a bot? the type of bots i want to make are video game bots (online multiplayer, first person shooters, and offline games(like solitaire and such)). Thanks!

    Read the article

  • Prevent empty tooltips at a wpf datagrid

    - by TheCalendarProgrammer
    I am working on a calendar program, which consists mainly of a WPF DataGrid. As there is not always enough space to display all the entries of a day (which is a DataGridCell), a tooltip with all the entries of the day shell appear at mouse over. This works so far with the code snippet shown below. And now the (little) problem: If there are no entries for a day, no tooltip shell pop up. With the code below an empty tooltip pops up. <DataGridTemplateColumn x:Name="Entry" IsReadOnly="True"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Grid> <TextBlock Text="{Binding EntryText}" Foreground="{Binding EntryForeground}" FontWeight="{Binding EntryFontWeight}"> </TextBlock> <TextBlock Text="{Binding RightAlignedText}" Foreground="Gray" Background="Transparent"> <TextBlock.ToolTip> <TextBlock Text="{Binding AllEntriesText}"/> </TextBlock.ToolTip> </TextBlock> </Grid> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> The Databinding is made via myCalDataGrid.Itemssource = _listOfDays; in code behind, where a 'Day' is the view model for a single calendar row.

    Read the article

  • How to display a date time in 16 Nov 2011 15:12 format

    - by Mark
    I have a grid view column in which I give the datefomat as dd MMM yyyy HH:mm and in code behind databound I change the time, the same time in database is not shown in the gridview, because of that the date is not displayed in 16 Nov 2011 15:12 format, it is displayed in 16/11/2011 15:12 format, how can i display it in 16 Nov 2011 15:12 format asp <asp:BoundField DataField="SendDate" ItemStyle-Width="15%" HeaderText="Sent At" DataFormatString="{0:dd MMM yyyy HH:mm}" SortExpression="SendDate" /> c# double timeDifference = Convert.ToDouble(Session["utimezone"].ToString()); e.Row.Cells[5].Text = Convert.ToString(senddate.AddMinutes(timeDifference * 60));

    Read the article

  • fstream stopping math.h from working

    - by CaptainProg
    I am creating a program in C++ in which I need to read a text file in. I have included the fstream header file, which allows me to open the file, but having added the include, I now receive countless errors relating to math.h functions. Examples: 1>c:\program files\microsoft visual studio 10.0\vc\include\cmath(19): error C2061: syntax error : identifier 'acosf' 1>c:\program files\microsoft visual studio 10.0\vc\include\cmath(19): error C2059: syntax error : ';' Is there any way I can include the text file reading functions of fstream without compromising the math.h functions? And why does this conflict occur anyway? /Edit/ It seems the errors are in the cmath standard header file. It is nothing I have access to, but for the sake of completion, here is the code that is causing the errors: using _CSTD acosf; using _CSTD asinf; using _CSTD atanf; using _CSTD atan2f; using _CSTD ceilf; (etcetera)

    Read the article

  • WPF ListView get GridViewColumn from control inside DataTemplate

    - by ragi
    Example: <ListView Name="lvAnyList" ItemsSource="{Binding}"> <ListView.View> <GridView> <GridViewColumn Header="xx" DisplayMemberBinding="{Binding XX}" CellTemplate="{DynamicResource MyDataTemplate}"/> <GridViewColumn Header="yy"> <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding YY}" /> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> </GridView> </ListView.View> </ListView> If I access the TextBlock inside DataTemplate I will have access to information about the bound path. But I don't know how to find (starting from the TextBlock) its containing GridViewColumn (which is in the GridViewRowPresenter columns list) and compare it to the grid's GridViewColumn (from GridViewHeaderRowPresenter column list) to get the header's name. At the end I should have the pairs: xx-XX, yy-YY I can find a list of all TextBlocks inside ListView by using this: GridViewRowPresenter gvrp = ControlAux.GetVisualDescendants<GridViewRowPresenter>(element).FirstOrDefault(); IEnumerable<TextBlock> entb = GetVisualDescendants<TextBlock>(gvrp); I can find a list of all GridViewColumnHeaders: GridViewHeaderRowPresenter gvhrp = ControlAux.GetVisualDescendants<GridViewHeaderRowPresenter>(element).FirstOrDefault(); And I cannot find the connection between the TextBlocks and the GridViewColumns... I hope this is understandable.

    Read the article

  • Add String to adapter

    - by Waggoner_Keith
    I have an adapter and i want to add a string to it but when i run this code it only add the last string in the songstoadd variable ... That is a custom adapter which adds dividers in where neccessary but in the Array Adapter i want to a all of the strings that have the same first letter in their name .... SeparatedListAdapter adapter = new SeparatedListAdapter(this); ArrayList<String> songstoadd = new ArrayList<String>(); Collections.sort(songtitle); int m = 0; while( m <songtitle.size()-1){ if(songtitle.get(m).substring(0, 1) == songtitle.get(m+1).substring(0, 1)){ m++; }else{ songstoadd.clear(); songstoadd.add(songtitle.get(m)); adapter.addSection(songtitle.get(m).substring(0, 1), new ArrayAdapter<String>(getApplicationContext(),R.layout.song, songstoadd)); m++; } } setListAdapter(adapter); }

    Read the article

  • How to select and hide all but first 5 elements in a HTML file (DOM)

    - by Zhen
    I am attempting to use coffeescript/jQuery to do the following: 1) Retrieve all the 'topics' displayed in the html (seen below) 2) Hide all the topics from display except for the first 5 listed. I tried to do the following but is not working //Retrieve the entire list of and hide all but the first 5 topics in the list $(".topics .topic")[5..-1].hide() Can someone advise me on how I can correctly retrieve the list of topics from the HTML document and subsequently hide ALL but the first 5 topics?

    Read the article

  • jQuery date calculator - show/hide IMG

    - by utopicam
    I have a problem with the following code. I tried changing many things (symbols, classes, imgs in the code) but this is killing me and I have no idea how to fix it. Sorry it's so specific, when solved I'll change the title to something more useful. I have two images. My jquery has to calculate the day and show one image or the other depending on that (using a class with display:none). My month has 24 days (it's a xmas thing). This is what I have so far: <script type="text/javascript"> $(document).ready(function(){ var currentTime = new Date() var day = currentTime.getDate(); if (day > 24){ day = 1; } $(".calDate").each(function(){ var curDate = $(this).attr("date"); if (curDate < day){ $(this).addClass("xMasPast"); } else if(curDate==day){ $(this).addClass("xMasActive"); } else { $(this).addClass("xMasInactive"); } }); $(".calDate2").each(function(){ var curDate = $(this).attr("date"); if (curDate > day){ $(this).addClass("xMasInactive"); } else if(curDate==day){ $(this).addClass("xMasActive"); } else { $(this).addClass("xMasActive"); } }); }); </script> But it's showing all the images. What am I missing? (any ideas on making the code simpler are more than welcomed). Thanks for your help! Update: simplified HTML <div><img src="day21.png" which="21"/></a></div> <img id="bola21" class="calDate2" src="day21.png"/>

    Read the article

  • What is the correct way to fix this Javascript closure

    - by sujoe
    I have been familiarizing myself with javascript closures and ran across this article http://blog.morrisjohns.com/javascript_closures_for_dummies.html Due to the closure, Example 5 does not work as expected. How would one modify result.push( function() {alert(item + ' ' + list[i])} ); to make the code work? function buildList(list) { var result = []; for (var i = 0; i < list.length; i++) { var item = 'item' + list[i]; result.push( function() {alert(item + ' ' + list[i])} ); } return result; } function testList() { var fnlist = buildList([1,2,3]); // using j only to help prevent confusion - could use i for (var j = 0; j < fnlist.length; j++) { fnlist[j](); } } testList(); Thanks!

    Read the article

  • Simple search only searching last word of record

    - by bennett_an
    I set up a simple search as instructed in part of railscast #240. in controller @reports = Report.search(params[:search]).order('created_at DESC').paginate(:page => params[:page], :per_page => 5) in model def self.search(search) if search where('apparatus LIKE ?', "%#{search}") else scoped end end in view <%= form_tag reports_path, :method => :get do %> <p> <%= text_field_tag :search, params[:search] %> <%= submit_tag "Search", :name => nil %> </p> <% end %> it all works... but... I have a few records for example, one with "another time test" and another with "last test of time" if i search "test" the first comes up but the second doesn't, and if i search "time" the second comes up but not the first. It is only seeing the last word of the record. what gives?

    Read the article

  • Visual Web Part as a Sandboxed solution

    - by Steve Clements
    You want the RAD wonderfulness of a visual web part, but it needs to be deployed as a Sandboxed solution. Problem? No, SharePoint powertools for visual studio to the rescue!   http://goo.gl/pQ9ct   There are a couple limitations, read the above page, nothing major. e.g. 1. Javascript debugging is not supported 2. Debugging asp.net code is not supported. 3. Use of <% Assembly Src= is not supported   I understand it does it by adding the markup as an embedded resource, but I haven't actually tried it yet!  To come!

    Read the article

  • SilverlightShow for November 14 - 20, 2011

    - by Dave Campbell
    Check out the Top Five most popular news at SilverlightShow for SilverlightShow Top 5 News for November 14 - 20, 2011. Here are the top 5 news on SilverlightShow for last week: Why Adobe had to Kill Flash Player for Mobile; and Silverlight, Flex, HTML5 parallels PhoneGap on Windows Phone Tips 10 tips about porting Silverlight apps to WinRT/Metro style apps (Part 1) Microsoft reportedly rolling out 7740 OS update for Windows Phone The WinRT Genome Project Visit and bookmark SilverlightShow. Stay in the 'Light 

    Read the article

  • Input traffic shaping

    - by whitequark
    I know that I can shape output traffic with tc or a similar tool. However, I want to shape the input traffic now—actually, I want to prioritize downloading of files of certain type through a slow lossy connection. I know the reason tc can only shape output traffic: the host itself has no direct control over the amount of input traffic. On the other hand, TCP has some measures built in it which prevent the TCP traffic from overflowing a slow connection. So, can I mangle something in TCP header so that the remote host will think my connection is slower than it thinks? Suppose that I am able to set the corresponding mark on both types of connections with iptables. Is there any way to reduce the input bandwidth of connections of first type, but only if connections of second type are present?

    Read the article

  • How to get DCOMperm.exe from Microsoft

    - by Doltknuckle
    So I've been trying to solve the "The application-specific permission settings do not grant Local Activation permission" problem and everything I've been reading says I need to get "DCOMperm.exe". There are plenty of links to usage and download links that point to non-MS sources. I'd like to get this direct from Microsoft, but I can't find it there. Some people say that it's part of an SDK, but I'm not sure which one. Does anyone have any experience getting this exe?

    Read the article

  • Adding a CLI for PHP5 on live server

    - by Josua Pedersen
    I want to add command-line support for PHP5 on my server. When I run aptitude install php5-cli I get a message saying that my PHP modules/packages have unmet dependencies. Here is a list of packages that suffer from these "unmet dependencies" and needs and upgrade: php5-gd php5-curl php5-mysql php5-cgi They all depend on php5-common. Can I upgrade the packages just like aptitude suggests without causing any disruptions to the live site? Output from aptitude Reading package lists... Done Building dependency tree Reading state information... Done Reading extended state information Initialising package states... Done The following packages are BROKEN: libapache2-mod-php5 php5-cgi php5-curl php5-gd php5-mysql The following NEW packages will be installed: php5-cli The following packages will be upgraded: php5-common 1 packages upgraded, 1 newly installed, 0 to remove and 123 not upgraded. Need to get 3,511kB of archives. After unpacking 7,803kB will be used. The following packages have unmet dependencies: php5-gd: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed. php5-curl: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed. php5-mysql: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed. php5-cgi: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed. libapache2-mod-php5: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed. The following actions will resolve these dependencies: Upgrade the following packages: libapache2-mod-php5 [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)] php5-cgi [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)] php5-curl [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)] php5-gd [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)] php5-mysql [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)] Score is 340

    Read the article

  • Logging hurts MySQL performance - but, why?

    - by jimbo
    I'm quite surprised that I can't see an answer to this anywhere on the site already, nor in the MySQL documentation (section 5.2 seems to have logging otherwise well covered!) If I enable binlogs, I see a small performance hit (subjectively), which is to be expected with a little extra IO -- but when I enable a general query log, I see an enormous performance hit (double the time to run queries, or worse), way in excess of what I see with binlogs. Of course I'm now logging every SELECT as well as every UPDATE/INSERT, but, other daemons record their every request (Apache, Exim) without grinding to a halt. Am I just seeing the effects of being close to a performance "tipping point" when it comes to IO, or is there something fundamentally difficult about logging queries that causes this to happen? I'd love to be able to log all queries to make development easier, but I can't justify the kind of hardware it feels like we'd need to get performance back up with general query logging on. I do, of course, log slow queries, and there's negligible improvement in general usage if I disable this. (All of this is on Ubuntu 10.04 LTS, MySQLd 5.1.49, but research suggests this is a fairly universal issue)

    Read the article

  • Coldfusion server VERY slow page loads

    - by Kevin
    I inherited a windows server 2003 coldfusion 7 server a few weeks ago. Today a network cable was unplugged by accident from the server. On plugging it back in, pages were NOT loading at all. Rather, we were receiving a generic coldfusion error page. After restarting IIS several times and coldfusion even more than that, we finally got pages to start loading. However, the loading is extremely slow (30+ seconds) on pages that used to load instantly. Loading through the local network (IE localhost/cfide/administrator) does nothing to help the load speed. I am not familiar with IIS or Coldfusion (We're in the process of migrating this to Linux/PHP), so this is all new territory to me. I'm hoping someone may have experienced this issue in the past and can help me solve it. I'm happy to provide any additional information that might be necessary....I'm just not sure what information you might need in order to help. Thanks for your time.

    Read the article

  • How do I disable nginx sending messages to syslog?

    - by altman
    My nginx sends lots of messages to syslog, but I don't need them. In my nginx.conf: error_log /var/log/nginx-error.log notice; ...... server { access_log off; location / { .... } } but, in my /var/log/message you see Nov 22 23:25:09 cache3 nginx: 2011/11/22 23:25:09 [error] 3437#0: *32172530 kevent() reported about an closed connection (60: Operation timed out) while reading response header from upstream, client: , server: , request: "GET http://www.igoido012.com//vk HTTP/1.1", upstream: "http:////vk", host: "www.igoido012.com", referrer: "http://www.baidu.com/" Nov 22 23:25:09 cache3 nginx: 2011/11/22 23:25:09 [error] 3437#0: *32099531 upstream timed out (60: Operation timed out) while reading response header from upstream, client: , server: , request: "GET http://t.web2.qq.com/channel/poll?msg_id=0&clientid=431509&t=1321975433305 HTTP/1.1", upstream: "http://:80/channel/poll?msg_id=0&clientid=431509&t=1321975433305", host: "t.web2.qq.com", referrer: "http://t.web2.qq.com/proxy.html?v=20110331001" How can I prevent nginx sending messages to my syslog?

    Read the article

  • Cisco 1841 Box and Watchguard XTM21-W

    - by Corey
    I have never set one of these up before and need a little assistance. Right now we have a T1 line coming in from Sprint to a Cisco 1841 and then on to our router. However, when I plug the Cisco 1841 into Port 0 and the router into Port 3 it does not work. In Port 1 I have my management computer plugged in. We have one subnet and this must be easy but I cannot figure out how to make this work. When the firewall is plugged in then I get no internet or network access.

    Read the article

  • Remote access to a KVM Ubuntu virtual server

    - by Lee
    I've just setup an ubuntu virtual server and everything seems to be working fine. I used KVM to get it working with a bridged network. I've given the virtual server a static ip address on my network. I don't seem to be able to connect to the virtual machine though from outside my network. If I'm on my own network it all works fine, I can ping the ip and connect to it. The virtual server can ping other machines and sites on the internet. I changed the port forwarding rules on my router to forward any connections on a specific port to the virtual server ip address thinking that was the problem, but it was still the same. Is there something I'm missing here which is blocking outside connections to the virtual machine? Thanks.

    Read the article

  • Recovering database files from a corrupted VHD

    - by Apocalypse9
    We have a SQL server hosted on a virtual machine. Our hosting company updated/restarted the server and for some reason the virtual machines became unbootable. We've spoken to Microsoft and used a few higher level tools to attempt to recover the virtual machines but were unsuccessful. In browsing the file system the database folder doesn't even appear. I'm wondering if there are any lower level tools that might be able to find and copy the database files. As far as I know the physical hard drive is ok, so I'm hoping there may be some way to recover the files themselves even if the rest of the virtual machine file-system is a loss. Obviously we're in a bit of a bind, and any help/ suggestions are very much appreciated.

    Read the article

  • SQL Server 2008 Cluster Installation - First network name always fails

    - by boflynn
    I'm testing failover clustering in Windows Server 2008 to host a SQL Server 2008 installation using this installation guide. My base cluster is installed and working properly, as well as clustering the DTC service. However, when it comes time to install SQL Server, my first attempt at installation always fails with the same message and seems to "taint" the network name. For example, with my previous cluster attempt, I was installing SQL Server as VSQL. After approximately 15 attempts of installation and trying to resolve the errors, e.g. changing domain accounts for SQL, setting SPNs, etc., I typoed the network name as VQSL and the installation worked. Similarly on my current cluster, I tried installing with the SQL service named PROD-C1-DB and got the same errors as last time until I tried changing the name to anything else, e.g. PROD-C1-DB1, SQL, TEST, etc., at which point the install works. It will even install to VSQL now. While testing, my install routine was: Run setup.exe from patched media, selecting appropriate options After the install fails, I'd chose "Remove node from a SQL Server failover cluster" and remove the single, failed, node Attempt to diagnose problem, inspect event logs, etc. Delete the computer account that was created for the SQL Service from Active Directory Delete the MSSQL10.MSSQLSERVER folder from the shared data drive The error message I receive from the SQL Server installer is: The following error has occurred: The cluster resource 'SQL Server' could not be brought online. Error: The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F) Along with hundreds of the following errors in the Application event log: [sqsrvres] checkODBCConnectError: sqlstate = 28000; native error = 4818; message = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. System configuration notes: Windows Server 2008 Enterprise Edition x64 SQL Server 2008 Enterprise Edition x64 using slipstreamed SP1+CU1 media Dell PowerEdge servers Fibre attached storage

    Read the article

  • Monitoring Active Directory (AD) Replication in Windows Server 2008 R2

    - by Kyle Brandt
    With Active Directory, what is a good way to monitor replication? I have multiple sites and multiple locations, so ideally both replication between sites and within sites would be monitored. I'm not really sure if each DC needs to be monitored, each NTDS connection, or each DC * Each NTDS connection. For the purposes of fitting into a standard alerting methodology, perfmon counters that would allow me to alert if replication was behind X minutes seems like it might be ideal.

    Read the article

  • I have a 21TB array but only 16TB is visible from Windows

    - by Relentim
    CONTROLLER Raid Controller: 3Ware 9650SE-24M8 Disks: 21 x 1TB RAID5 Stripe 64KB WINDOWS OS: Windows Server 2003 SP2 32x Disk: Dynamic 19557.44GB Volume: Capacity 15832.19GB I guess my array must have a 4KB block size which is limiting it to 16TB. I think I would have to switch to a 64KB block size to be able to see a maximum of 256TB. Or create another unit on my controller to go above 16TB of storage. Unfortunately I have already added over 16TB, ideally I would like to shrink the array and reclaim the 5 disks that aren't doing anything. I don't think this is possible. More likely, can I change the block size so 20TB becomes visible in windows?

    Read the article

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