Daily Archives

Articles indexed Monday March 29 2010

Page 7/123 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • winHTTP GET request C++

    - by silverbandit91
    I'll get right to the point. This is what a browser request looks like GET /index.html HTTP/1.1 This is what winHTTP does GET http://site.com/index.html HTTP/1.1 Is there any I can get the winHTTP request to be the same format as the regular one? I'm using VC++ 2008 if it makes any difference

    Read the article

  • WebDAV auto-versioning in Git or Hg or any modern VCS

    - by Marcus P S
    I just recently learned of SVN's auto-versioning feature for WebDAV. Although I understand this is not replacement for proper versioning, with messages documenting change sets, it strikes me as a solid and safe replacement to Dropbox (minus nice GUIs and web pages). However, since commits in auto-versioning are frequent, I'd imagine that Git or Hg would be better suited for this, just because of their more compact databases (although I wonder if the distributed nature of things could make the automation ugly for resolving conflicts). Is this a feature that has been implemented using Git or Hg, as far as anyone knows?

    Read the article

  • Issue resolving names on Hyper-V guest with Routing and Remote Access

    - by John Sheehan
    I've got a Win2k8 standard server running Hyper-V with a Server 2003 web guest instance running. The host is publicly available on the internet. I've created an Internal Private network in the Hyper-V Virtual Network manager. I've set the host IP for that virtual adapter to 192.168.0.1. I've set the IP on the guest to 192.168.0.2. They can ping each other and share files. I can't browse the web on the guest though. NSLOOKUPs are working. I've tried setting the DNS server setting on the guest to 192.168.0.1 and something external like Google's 8.8.8.8 server to no avail. Windows firewall is disabled on the internal virtual network. I've tried it with both DNS installed on the host and without it. I'm not sure which RRAS/NAT settings are relevant to pass on so ask if you need me to clarify anything. How do I get outbound internet working on the guest VM?

    Read the article

  • memcached append() php ubuntu - bad protocol

    - by awongh
    I am running ubuntu gutsy(7.1) , php5 and I am trying to get memcached running locally. I installed everything as per the docs: memcached daemon, php PECL extension, libevent, etc. But now I can only run half of the example script for memcached append(): <?php $m = new Memcached(); $m->addServer('localhost', 11211); $m->setOption(Memcached::OPT_COMPRESSION, false); $m->set('foo', 'abc'); $m->append('foo', 'def'); var_dump($m->get('foo')); ?> the script terminates @ append() with an RES_BAD_PROTOCOL error message. It still runs the get(). I don't know why memcached would otherwise be working fine (connect, set, get - with the correct value of 'abc') and not work for append. it also doesnt work with prepend. I believe I have the setup correct, but I am not sure. Maybe there are compatibility problems between the versions of the dependecies? thanks much

    Read the article

  • What's the best version control system for handling projects with graphics?

    - by acrosman
    I'm part of a small team (usually just two people), I handle the code, he handles the graphic design. In the past I've used CVS to handle version control of the code files, and while we've included the graphics in the repository, he hasn't derived nearly as much value from it as I have. Are there other packages that provide the better features for supporting graphics? The system would need to have an easy to use GUI interface, as I don't think it's fair to expect a graphic designer to learn command-line tools. Additional aspect: The client software needs to run smoothly on OS X (for the designer), and Windows (for the programmer).

    Read the article

  • Catching a python app before it exits

    - by Leopd
    I have a python app which is supposed to be very long-lived, but sometimes the process just disappears and I don't know why. Nothing gets logged when this happens, so I'm at a bit of a loss. Is there some way in code I can hook in to an exit event, or some other way to get some of my code to run just before the process quits? I'd like to log the state of memory structures to better understand what's going on.

    Read the article

  • chess board in java

    - by ranzy
    This is my code below import javax.swing.*; import java.awt.*; public class board2 { JFrame frame; JPanel squares[][] = new JPanel[8][8]; public board2() { frame = new JFrame("Simplified Chess"); frame.setSize(500, 500); frame.setLayout(new GridLayout(8, 8)); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { squares[i][j] = new JPanel(); if ((i + j) % 2 == 0) { squares[i][j].setBackground(Color.black); } else { squares[i][j].setBackground(Color.white); } frame.add(squares[i][j]); } } squares[0][0].add(new JLabel(new ImageIcon("rookgreen.png"))); squares[0][2].add(new JLabel(new ImageIcon("bishopgreen.png"))); squares[0][4].add(new JLabel(new ImageIcon("kinggreen.png"))); squares[0][5].add(new JLabel(new ImageIcon("bishopgreen.png"))); squares[0][7].add(new JLabel(new ImageIcon("rookgreen.png"))); squares[7][0].add(new JLabel(new ImageIcon("rookred.png"))); squares[7][2].add(new JLabel(new ImageIcon("bishopred.png"))); squares[7][4].add(new JLabel(new ImageIcon("kingred.png"))); squares[7][5].add(new JLabel(new ImageIcon("bishopred.png"))); squares[7][7].add(new JLabel(new ImageIcon("rookred.png"))); for (int i = 0; i < 8; i++) { squares[1][i].add(new JLabel(new ImageIcon("pawngreen.png"))); squares[6][i].add(new JLabel(new ImageIcon("pawnred.png"))); } frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } public static void main(String[] args) { new board2(); } } I am trying to create a chess game sort of and I need help with putting labels on all sides of the board to label the rows and columns in either A-H or 1-8. I have no idea how to do it. Also later on I'll be adding a feature to drag and drop the pieces. Is it best to use JLabels? Anyways I would I go about putting the labels on the side? Thanks!

    Read the article

  • WPF: Adorner Hit Testing / MouseDown Event

    - by stefan.at.wpf
    Hello, I have an Adorner which adornes a Border (please see screenshot below). The MouseDown Event for the Adorner is however only raised, when clicking on an element in the adorner. I need the MouseDown Event to be raised, when clicking on any place in the adorner above the adorned element. How can this be done? Do I have to add an transparent control in the adorner or is there another way for this? Thanks for any help! Screenshot and VS 2008 Project: http://cid-0432ee4cfe9c26a0.skydrive.live.com/browse.aspx/%C3%96ffentlich?uc=2 The Code for the adorner: class myAdorner : Adorner { public myAdorner(UIElement element) : base(element) { this.MouseDown += new System.Windows.Input.MouseButtonEventHandler(myAdorner_MouseDown); } void myAdorner_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { MessageBox.Show("ok"); } // Draws two rectangles: one in the upper-left and another one in the lower-right corner protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { Size size = this.AdornedElement.RenderSize; Rect r1 = new Rect(0.5, 0.5, 20, 20); Rect r4 = new Rect(size.Width - 20.5, size.Height - 20.5, 20, 20); SolidColorBrush brush = new SolidColorBrush(Colors.AliceBlue); Pen pen = new Pen(Brushes.Black, 1); drawingContext.DrawRectangle(brush, pen, r1); drawingContext.DrawRectangle(brush, pen, r4); } }

    Read the article

  • Anyone use Distributed VCS in a corporate environment?

    - by Eddie Parker
    I'm curious to hear about people's experiences with distributed version control in a corporate environment. Specifically: Was it difficult to gain adoption? Now that it's in place, is it well liked? What 'model' are you using (hub & spoke? Something else?) Allowing you use hub & spoke, are there any discipline problems with pushing to a central server? I'd like to hear if anyone has non-programmers working within this environment, preferably artists and the like to whom VCS can be a bit daunting. Did it work out for them?

    Read the article

  • AJAX - querying a search engine and returning the number of results

    - by Moddy
    Right, so basically I need to query a selection of search engines in an AJAX app. As there is a number of different search engines - there's no search engine specific API I can use either. My main problem is getting the number of results returned by the search. So far, I have decided it is probably best to use a regexp from the returned search query HTML, and then convert the string of characters to an integer. However, this method just doesn't feel.. clean to me. It seems a bit rough around the edges and I think it could do with improving! I guess not being 100% confident with regular expressions doesn't help; but it just feels like it could be improved. Any ideas on how to implement this would be great cheers! It doesn't seem like that an exotic thing to do, so I was wondering if perhaps any of you guys have done this before and would have a few tips? Note: This is an AJAX app at the moment, but I may be re-writing this functionality in a different app soon - which won't be AJAX. I'm confident I can transfer any AJAX implementation to the other language though.

    Read the article

  • global member creation

    - by Akash
    how the global members can be created in vc++ 6.0 mfc project. if i select globals option in WizardBar(WizardBar C++ class). then (WizardBar C++ members),it display (No members - Create New Class...). How to create the members for this globals class please give the steps to create.

    Read the article

  • ModelVisual3D vs Model3DGroup

    - by bitbonk
    Is there any disadvantage of using ModelVisual3D over Model3DGroup. How much can the resource/performance impact possibly be? ModelVisual3D gives me much more than Model3DGroup does but AFAIK everything that can be done with Model3DGroup can alos be done with ModelVisual3D. So why not just always use ModelVisual3D?

    Read the article

  • SetCurrentDirectory timing out

    - by Callum
    Is it possible for the SetCurrentDirectory() to timeout if there is network slowdown preventing the directory from being accessed for some length of time? (In the order of 15-30 seconds...?) If so is the timeout configurable and where can it be set?

    Read the article

  • issue in property file

    - by devuser
    I want to load the property file when tomcat is starting.so I'm using servletContextListener to do that and i can get values of property file to my web application. But i want to keep the same value after changing the property file once log into web application.But when i change the value of property file and log into system again it change the value to new one.I want to keep the same value that loaded when tomcat was starting.how can i implement this? My coding is as below import javax.servlet.*; import java.io.IOException; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; import java.io.*; import java.util.ResourceBundle; public final class sysProperties implements javax.servlet.ServletContextListener { private static Properties props = new Properties(); private static String file_name = "com/util/contact.properties"; public addSystemProperties() { } public void contextInitialized(ServletContextEvent servletContextEvent) { // Get the context ServletContext servletContext = servletContextEvent.getServletContext(); // Set a context attribute try { // props.load(servletContext.getResourceAsStream(file_name)); props.load(getClass().getClassLoader().getResourceAsStream(file_name)); System.out.println(" Application X is starting"); servletContext.setAttribute("h1",props.getProperty("home.h1")); servletContext.setAttribute("h2",props.getProperty("home.h2")); System.out.println("h1"+servletContext.getAttribute("h1")); System.out.println("h2"+ servletContext.getAttribute("h2")); ; } catch (Exception e) { System.out.println(" Error setting context attribute: " + e.getMessage()); } } public void contextDestroyed(ServletContextEvent servletContextEvent) { // Get the context ServletContext servletContext = servletContextEvent.getServletContext(); // Output the context variable we set earlier System.out.println(" Application X is shutting down"); System.out.println(" Value of h1 is: " + servletContext.getAttribute("h1")); System.out.println(" Value of h2 is: " + servletContext.getAttribute("h2")); // Clean up (not really necessary as the context is being destroyed, but let's be neat) servletContext.removeAttribute(props.getProperty("h1")); servletContext.removeAttribute(props.getProperty("h2")); } }

    Read the article

  • java immutable object question

    - by cometta
    String abc[]={"abc"}; String def[]={}; def=abc; def[0]=def[0]+"changed"; System.out.println(abc[0]); by changing "def" object, my abc object is changed as well. Beside String[] array has this characteristic what other java object has similar characteristic? can explain more? in order to prevent abc from changed when i changed def, i will have to do def = abc.clone();

    Read the article

  • Potential annoyances of tab delimited Python source?

    - by user86432
    I want to start a new project, and I want this to be my first Python project. I was looking through the style guide, http://www.python.org/dev/peps/pep-0008/, which "strongly recommends" using a 4-spaces indentation style for new projects. But I just hate this idea! In my opinion, tabs are better for this purpose. What annoyances could crop up one day if another developer wanted to work on my tab-delimited files?

    Read the article

  • jQuery CSS plugin that returns computed style of element to pseudo clone that element?

    - by Keith Bentrup
    I'm looking for a way using jQuery to return an object of computed styles for the 1st matched element. I could then pass this object to another call of jQuery's css method. For example, with width, I can do the following to make the 2 divs have the same width: $('#div2').width($('#div1').width()); It would be nice if I could make a text input look like an existing span: $('#input1').css($('#span1').css()); where .css() with no argument returns an object that can be passed to .css(obj). (I can't find a jQuery plugin for this, but it seems like it should exist. If it doesn't exist, I'll turn mine below into a plugin and post it with all the properties that I use.) Basically, I want to pseudo clone certain elements but use a different tag. For example, I have an li element that I want to hide and put an input element over it that looks the same. When the user types, it looks like they are editing the element inline. I'm also open to other approaches for this pseudo cloning problem for editing. Any suggestions? Here's what I currently have. The only problem is just getting all the possible styles. This could be a ridiculously long list. jQuery.fn.css2 = jQuery.fn.css; jQuery.fn.css = function() { if (arguments.length) return jQuery.fn.css2.apply(this, arguments); var attr = ['font-family','font-size','font-weight','font-style','color', 'text-transform','text-decoration','letter-spacing','word-spacing', 'line-height','text-align','vertical-align','direction','background-color', 'background-image','background-repeat','background-position', 'background-attachment','opacity','width','height','top','right','bottom', 'left','margin-top','margin-right','margin-bottom','margin-left', 'padding-top','padding-right','padding-bottom','padding-left', 'border-top-width','border-right-width','border-bottom-width', 'border-left-width','border-top-color','border-right-color', 'border-bottom-color','border-left-color','border-top-style', 'border-right-style','border-bottom-style','border-left-style','position', 'display','visibility','z-index','overflow-x','overflow-y','white-space', 'clip','float','clear','cursor','list-style-image','list-style-position', 'list-style-type','marker-offset']; var len = attr.length, obj = {}; for (var i = 0; i < len; i++) obj[attr[i]] = jQuery.fn.css2.call(this, attr[i]); return obj; } Edit: I've now been using the code above for awhile. It works well and behaves exactly like the original css method with one exception: if 0 args are passed, it returns the computed style object. As you can see, it immediately calls the original css method if that's the case that applies. Otherwise, it gets the computed styles of all the listed properties (gathered from Firebug's computed style list). Although it's getting a long list of values, it's quite fast. Hope it's useful to others.

    Read the article

  • I need help with creating a data structure in PHP

    - by alex
    What I need to do is have a data structure that shows jobs organised into 14 day periods, but only when an id is the same. I've implemented all sorts of stuff, but they have failed miserably. Ideally, maybe a SQL expert could handle all of this in the query. Here is some of my code. You can assume all library stuff works as expected. $query = 'SELECT date, rig_id, comments FROM dor ORDER BY date DESC'; $dors = Db::query(Database::SELECT, $query)->execute()->as_array(); This will return all jobs, but I need to have them organised by 14 day period with the same rig_id value. $hitches = array(); foreach($dors as $dor) { $rigId = $dor['rig_id']; $date = strtotime($dor['date']); if (empty($hitches)) { $hitches[] = array( 'rigId' => $rigId, 'startDate' => $date, 'dors' => array($dor) ); } else { $found = false; foreach($hitches as $key => $hitch) { $hitchStartDate = $hitch['startDate']; $dateDifference = abs($hitchStartDate - $date); $isSameHitchTimeFrame = $dateDifference < (Date::DAY * 14); if ($rigId == $hitch['rigId'] AND $isSameHitchTimeFrame) { $found = true; $hitches[$key]['dors'][] = $dor; } } if ($found === false) { $hitches[] = array( 'rigId' => $rigId, 'startDate' => $date, 'dors' => array($dor) ); } } } This seems to work OK splitting up by rig_id, but not by date. I also think I'm doing it wrong because I need to check the earliest date. Is it possible at all to do any of this in the database query? To recap, here is my problem I have a list of jobs with all have a rig_id (many jobs can have the same) and a date. I need the data to be organised into hitches. That is, the rig_id must be the same per hitch, and they must span a 14 day period, in which the next 14 days with the same rig_id will be a new hitch. Can someone please point me on the right track? Cheers

    Read the article

  • What's the best way to replace remote.origin.url in Git?

    - by suzukimilanpaak
    I'm new to Git. Let's say Alice and Bob had been developing their project by using two Git repositories for each. And, Alice at certain times want to set up a new repository to manage their common progress. Do you think what is the best way to replace remote.origin.url in the configuration of Git? to replace by git config --replace to create new repos by git clone MAIN_REPOS or any?

    Read the article

  • Belkin Flip KVM keyboard skip problems

    - by Craig
    I have just bought a Belkin Flip 2 port KVM. Functionally it is almost there except I have a keyboard sticking problem. So if I type the word 'Hello' it will often (about 25% of the time) output 'Hellooooooooooooooooooooo'. If I plug the keyboard directly into the USB on the computer I don't have this problem, only when plugged into the KVM. I feel like it is a USB speed problem. Followup It appears I have the same problem with the mouse, it will jump from one side of the screen to the other as I move it. The mouse is annoying but half as much as the keyboard.

    Read the article

  • Reject recipient in postfix mail relay

    - by galets
    I have about 3 knows email addresses in my domain, which don't exist and to which a lot of spam is sent. Some of this spam is pretty heavy, and I'm wasting a lot of traffic on it, so I don't want to even receive emails if their destination is one of those 3 addresses. Since I know that the users don't exist I would like postfix to reject emails during RCPT TO: negotiation. Basically, all I want is to update some config with those 3 addresses, and every email sent to them must fail to come in. I want to stress out following: postfix works as a relay for domain, there is no local users postfix has no knowledge about validity of other emails within domain, so it cannot simply reject unknown recipients

    Read the article

  • top does not run

    - by Horace Ho
    Sorry that I can't be very specific, only symtoms are provided: Monday morning a CentOS box, 1GB ram, Pentium 4 web server (thin, rails) does not response (too slow) to a browser of another PC ping it, ok ssh into it, ok a few minutes later, the web server is back to normal speed, serving web requests well ping it, ok ssh into it, ok however, top does not run what should I look at, about this 'top does not run' symptom? thx

    Read the article

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