Daily Archives

Articles indexed Wednesday May 5 2010

Page 15/119 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Transparent proxying leaves sockets with SYN_RCVD in MacOS X 10.6 Snow Leopard (and maybe FreeBSD)

    - by apenwarr
    I'm trying to create a transparent proxy on my MacOS machine in order to port the sshuttle ssh-based transproxy VPN from Linux. I think I almost have it working, but sadly, almost is not 100%. Short version is this. In one window, start something that listens on port 12300: $ while :; do nc -l 12300; done Now enable proxying: # sysctl -w net.inet.ip.forwarding=1 # sysctl -w net.inet.ip.fw.enable=1 # ipfw add 1000 fwd 127.0.0.1,12300 log tcp from any to any And now test it out: $ telnet localhost 9999 # any port number will do # this works; type stuff and you'll see it in the nc window $ telnet google.com 80 # any host/port will do # this *doesn't* work! After the latter experiment, I see lines like this in netstat: $ netstat -tn | grep ^tcp4 tcp4 0 0 66.249.91.104.80 192.168.1.130.61072 SYN_RCVD tcp4 0 0 192.168.1.130.61072 66.249.91.104.80 SYN_SENT The second socket belongs to my telnet program; the first is more suspicious. SYN_RCVD implies that my SYN packet was correctly captured by the firewall and taken in by the kernel, but apparently the SYNACK was never sent back to telnet, because it's still in SYN_SENT. On the other hand, if I kill the nc server, I get this: $ telnet google.com 80 Trying 66.249.81.104... telnet: connect to address 66.249.81.104: Connection refused telnet: Unable to connect to remote host ...which is as expected: my proxy server isn't running, so ipfw redirects my connection to port 12300, which has nobody listening on it, ie. connection refused. My uname says this: $ uname -a Darwin mean.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386 Does anybody see any different results? (I'm especially interested in Snow Leopard vs Leopard results, as there seem to be some internet rumours that transproxy is broken in Snow Leopard version) Any advice for how to fix?

    Read the article

  • Should a database server be in a different VM instance as an application?

    - by orokusaki
    I'm setting up a database server as a separate VM in my server so that I can control resources, and make backups of just that instance. I own a server that will reside in a colo soon. Is this the best way to approach my DB regarding scalability? Are there any security concerns? Do I listen at localhost still, even though it's a separate instance? And, is there any benefit to running your DB (PostgreSQL in my case) in the same machine as your application (web based SAAS application in my case)?

    Read the article

  • How to Use WinMerge as the Diff tool for Mercurial

    - by quanticle
    I'm using the Mercurial distributed version control system, and I'm wondering how I can configure it to use WinMerge instead of its own internal diff tool. I've already got WinMerge as the merge tool, but I want Mercurial to use WinMerge when I type: hg diff Is there any way of doing that, or am I stuck with Mercurial's internal diff tool?

    Read the article

  • How to catch an expected (and intended) 302 Ajax response?

    - by Anthony
    So, if you look back at my previous question about Exchange Autodiscover, you'll see that the easiet way to get the autodiscover URL is to send a non-secure, non-authenticated GET request to the server, ala: http://autodiscover.exchangeserver.org/autodiscover/autodiscover.xml The server will respond with a 302 redirect with the correct url in the Location header. I'm trying out something really simple at first with a Chrome extension, where I have: if (req.readyState==4 && req.status==302) { return req.getResponseHeader("Location"); } With another ajax call set up with the full XML Post and the user credentials, But instead Chrome hangs at this point, and a look at the developer panel shows that it is not returning back the response but instead is acting like no response was given, meanwhile showing a Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101 in the error log. The way I see it, refering to the exact response status is about the same as "catching" it, but I'm not sure if the problem is with Chrome/WebKit or if this is how XHR requests always handle redirects. I'm not sure how to catch this so that I can get still get the headers from the response. Or would it be possible to set up a secondary XHR such that when it gets the 302, it sends a totally different request? Quick Update I just changed it so that it doesn't check the response code: if (req.readyState==4) { return req.getResponseHeader("Location"); } and instead when I alert out the value it's null. and there is still the same error and no response in the dev console. SO it seems like it either doesn't track 302 responses as responses, or something happens after that wipes that response out?

    Read the article

  • How to trigger Mouse-Over on iPhone?

    - by Andrew
    This might seem like a really dumb question, but I am writing an application and I have come across where my mouse-over, mouse-click and mouse-hover need different events bound to them. Now on Internet Explorer, Firefox, and Safari. It all works as expected. However, on my iPhone the actions will not trigger. Now my question is are their any specific ways I can have the Mouse-Over essentially be fired when I hold my finger down and trigger an event? An example where this doesn't work is right on this website when you hover over a comment it is supposed to display the +1 or flag icon. I am using jquery.

    Read the article

  • Build XML document using Linq To XML

    - by JasonDR
    Given the following code: string xml = ""; //alternativley: string xml = "<people />"; XDocument xDoc = null; if (!string.IsNullOrEmpty(xml)) { xDoc = XDocument.Parse(xml); xDoc.Element("people").Add( new XElement("person", "p 1") ); } else { xDoc = new XDocument(); xDoc.Add(new XElement("people", new XElement("person", "p 1") )); } As you can see, if the xml variable is blank, I need to create the rood node manually, and append the person the root node, whereas if it is not, I simple add to the people element My question is, is there any way to generically create the document, where it will add all referenced node automatically if they do not already exists?

    Read the article

  • Write a sql for searching with multiple conditions

    - by Lu Lu
    Hello everyone, I have a table Student with 2 fields: Name: nvarchar(256) Age: int User will use a WinForm application to input a Name and a Age for searching. If inputted Name is empty, sql will not query Name field. If inputted Age is 0, sql will not query Age field. If Name is Null and inputted Name is empty - record is matched. If Name is Null and inputted Name is not empty - record is not matched. And also similar for Age field. My problem is that how to write a sql like this. P/S: I use SQL Server 2005. Please help me. Thanks.

    Read the article

  • Add column from another table matching results from first MySQL query

    - by Nemi
    This is my query for available rooms in choosen period: SELECT rooms.room_id FROM rooms WHERE rooms.room_id NOT IN ( SELECT reservations.room_id FROM reservations WHERE ( reservations.arrivaldate >= $arrival_datetime AND reservations.departuredate <= $departure_datetime) OR ( reservations.arrivaldate <= $arrival_datetime AND reservations.departuredate >= $arrival_datetime ) OR ( reservations.arrivaldate <= $departure_datetime AND reservations.departuredate >= $departure_datetime ) ); How to add average room price column for selected period(from $arrival_datetime to $departure_datetime) from another table (room_prices_table), for every room_id returned from above query. So I need to look in columns whos name is same as room_id... room_prices_table: date room0001 room0002 room0003 ... Something like SELECT AVG(room0003) FROM room_prices_table WHERE datum IS BETWEEN $arrival_datetime AND $departure_datetime ??

    Read the article

  • CSS Child selectors in IE7 tables

    - by John
    I'm trying to use the CSS child selector in IE7, and it doesn't seem to work. I have nested tables. My outer table has a class name "mytable", and I want the td's of the outer table to show borders. I don't want the inner table td's to have borders. I think I should be able to have CSS that looks like this: .mytable { border-style: solid } .mytable>tr>td { border-style: solid } But the second line seems to have no effect. If I change the second line to make it less specific, it applies to all the td's - I see too many borders. td { border-style: solid } So I think it really is just an issue with the selectors. Pages like this suggest that IE7 should be able to do what I want. Am I doing something silly? Here's the whole HTML file: <html> <head> <style type="text/css"> .mytable { border-style: solid; border-collapse: collapse;} td { border-style: solid; } </style> </head> <body> <table class="mytable"> <tr> <td>Outer top-left</td> <td>Outer top-right</td> </tr> <tr> <td>Outer bottom-left</td> <td> <table> <tr> <td>Inner top-left</td> <td>Inner top-right</td> </tr> <tr> <td>Inner bottom-left</td> <td>Inner bottom-right</td> </tr> <table> </td> </tr> <table> </body> </html>

    Read the article

  • General ORM design question

    - by Calvin
    Suppose you have 2 classes, Person and Rabbit. A person can do a number of things to a rabbit, s/he can either feed it, buy it and become its owner, or give it away. A rabbit can have none or at most 1 owner at a time. And if it is not fed for a while, it may die. Class Person { Void Feed(Rabbit r); Void Buy(Rabbit r); Void Giveaway(Person p, Rabbit r); Rabbit[] rabbits; } Class Rabbit { Bool IsAlive(); Person pwner; } There are a couple of observations from the domain model: Person and Rabbit can have references to each other Any actions on 1 object can also change the state of the other object Even if no explicit actions are invoked, there can still be a change of state in the objects (e.g. Rabbit can be starved to death, and that causes it to be removed from the Person.rabbits array) As DDD is concerned, I think the correct approach is to synchronize all calls that may change the states in the domain model. For instance, if a Person buys a Rabbit, s/he would need to acquire a lock in Person to make a change to the rabbits array AND also another lock in Rabbit to change its owner before releasing the first one. This would prevent a race condition where 2 Persons claim to be the owner of the little Rabbit. The other approach is to let the database to handle all these synchronizations. Who makes the first call wins, but then the DB needs to have some kind of business logics to figure out if it is a valid transaction (e.g. if a Rabbit already has an owner, it cannot change its owner unless the Person gives it away). There are both pros/cons in either approach, and I’d expect the “best” solution would be somewhere in-between. How would you do it in real life? What’s your take and experience? Also, is it a valid concern that there can be another race condition the domain model has committed its change but before it is fully committed in the database? And for the 3rd observation (i.e. state change due to time factor). How will you do it?

    Read the article

  • Association with Searchlogic

    - by fivetwentysix
    Hi I have a post model that :has_many :reply, when using searchlogic, doing Post.reply_content_like("search"), returns a result for every reply under that post, I only want it to return once. Anyone know a way to solve this

    Read the article

  • WCF Custom Delegation/Authentication without Kerberos

    - by MichaelGG
    I'm building a simple WCF service, probably exposed via HTTPS, using NTLM security. Since not all users are going to be capable of using the service directly, we're writing a simple web front-end for the service. Users will auth with HTML to the web front-end. What we want is a way to delegate the user of the web site all the way to the WCF service. I understand Kerberos delegation can do this, but that's not available to us. What I want to do is make the web front-end account a specially trusted account, so that if a request hits the WCF service authenticated as "DOMAIN\WebApp", we read a WCF message header containing the real identity, then switch the principal to that and continue as normal. Is there any "simple" way of achieving this? Should I give up entirely on this idea, and instead make users "sign-in" to the WCF app and then do complete custom auth? The WCF extensibility and security options seem so vast, I'd like to get a heads up on which path to start heading down.

    Read the article

  • Lucene document Boosting

    - by athreyar
    Hello, I am having problem with lucene boosting, Iam trying to boost a particular document which matches with the (firstname)field specified I have posted the part of the codeenter code hereprivate static Document createDoc(String lucDescription,String primaryk,String specialString){ Document doc = new Document(); doc.add(new Field("lucDescription",lucDescription, Field.Store.NO, Field.Index.TOKENIZED)); doc.add(new Field("primarykey",primaryk,Field.Store.YES,Field.Index.NO)); doc.add(new Field("specialDescription",specialString, Field.Store.NO, Field.Index.UN_TOKENIZED)); doc.setBoost ((float)(0.00001)); if (specialString.equals("chris")) doc.setBoost ((float)(100000.1)); return doc; } why is this not working?enter code herepublic static String dbSearch(String searchString){ List pkList = new ArrayList(); String conCat="("; try{ String querystr = searchString; Query query = new QueryParser("lucDescription", new StandardAnalyzer()).parse(querystr); IndexSearcher searchIndex = new IndexSearcher("/home/athreya/docsIndexFile"); // Index of the User table-- /home/araghu/aditya/indexFile. Hits hits = searchIndex.search(query); System.out.println("Found " + hits.length() + " hits."); for(int iterator=0;iterator Thank you in advance Athreya

    Read the article

  • Is there an API available to retrieve raw Wiktionary Data?

    - by Armentage
    I want to build a simple application that looks up words against Wiktionary to see if they exist. Is there a standard API supported by the Wiktionary software that would let me do this? Alternatively, is there any way I can pull down the dictionary data that backs a Wiktionary? There are many international variants who's data I would love to put a different front-end around.

    Read the article

  • Why does refreshing a page with a google map often fail?

    - by Shawn
    I'm working on a website that needs google maps, and testing is being a bitch because refreshing the page very often fails (hangs endlessly) so I need to go to a different page and come back in order to test the new version of the code. I have noticed that refreshing the page only fails on pages with maps, so I'm guessing these are related. Does anyone have a clue?

    Read the article

  • Xcode 3.2 + LLVM = no local symbols when debugging

    - by glebd
    I have a project for Mac OS X 10.5 that I'm building on 10.6 using Xcode 3.2. When I use GCC 4.2 for Debug build and hit a breakpoint, Xcode debugger displays local variable information normally. If I choose LLVM GCC 4.2 or Clang LLVM, when I hit breakpoint, local symbols are not available, and GDB says No symbol 'self' in current context if I try to print self or any other local symbol. In all cases Generate debug info option is set. The Debug configuration is set to $(NATIVE_ARCH) and 10.5 SDK, Build active architecture only option is set. When GDB starts, I can see it is being configured as x86_64-apple-darwin. I must be missing something obvious. How do I make GDB show local symbols when using a LLVM compiler?

    Read the article

  • A debbugging test, suggestions needed.

    - by flash
    I am having a debugging test, as part of an interview.. I thought if any one can help with the approach, when I am faced with a large code base and have to find bugs inside that within an hour or two.This is going to be Core java based app (I guess) on Eclipse 3.2+

    Read the article

  • C# - Dynamic Keyword and Interface Implementations

    - by Adam Driscoll
    I'm assuming this isn't possible but before digging further is there a way to do something like this: public void ProcessInterface(ISomeInterface obj) {} //... dynamic myDyn = GetDynamic<ISomeInterface>() ProcessInterface(myDyn); I've seen a post arguing for it but it sounds like it wasn't included. A little context: .Net assembly exposed through COM - Silverlight app consuming interface-implementing classes. Would be nice to refer to the objects by interface. I really don't expect that this was what was intended...

    Read the article

  • Sys.WebForms.PageRequestManagerServerErrorException: .... The status code returned from the server w

    - by webnoob
    Hi All, I have seen a few posts regarding this issue but not one specific to my problem and I have no ideas as to what I need to do to debug this. I have some combo boxes on an aspx pages, when I select a value from the first one, it fills the second with value and so on with the third and fourth. This works with no problems until I wrap an asp.net UpdatePanel around the combo boxes and try to "ajaxify" the whole process so the page isn't dancing around. The exact error I get is: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404 Some things to note: I am using URL rewriting - This is what I think is causing the problem The error will occur whenever I choose a selection for a SECOND time. This means that I could select a value from the first combo box and get the same error (so it is happening on the second postback - No matter which combo box it's from). I have tried setting the EnablePartialRendering="false" on teh scriptmanager but as I said, it works when not using ajax, so I don't know how to debug the issue. My server is Windows 2008 running IIS& with ASP.NET 2.0. I would really appreciate your help Thanks in advance.

    Read the article

  • SWT Browser Drag and Drop

    - by scottalas
    I'm trying to use drag-n-drop with an embedded SWT Browser, so that my application can drag hyperlinks from the Browser to another Control. I've been able to set up the destination to receive data from an external browser, but the internal does not seem to participate in the drag-n-drop. Any ideas? I would guess that I need something like a selection listener to track when something is grabbed in the browser, or some way to ask the browser what is currently selected, perhaps using javascript. My current setup of the Browser is simplistic, looking like this: browser = new Browser(top, SWT.NONE); // MOZILLA createDragSource(browser); // below // a selection listener never receives events: browser.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { System.out.println("Selection listener event"); } }); ... private void createDragSource(final Browser browser) { Transfer[] types = new Transfer[] { URLTransfer.getInstance(), HTMLTransfer.getInstance(), TextTransfer.getInstance(), ImageTransfer.getInstance(), }; int mode = DND.DROP_COPY | DND.DROP_LINK | DND.DROP_MOVE; DragSource dragSource = new DragSource(browser, mode); dragSource.setTransfer(types); dragSource.addDragListener(new DragSourceListener() { public void dragStart(DragSourceEvent event) { System.out.println("source.dragStart"); } public void dragSetData(DragSourceEvent event) { System.out.println("source.dragSetData"); // Is there a way to get the Browser's drag item here? } public void dragFinished(DragSourceEvent event) { System.out.println("source.dragFinished"); //do nothing } }); } Thanks for any help!

    Read the article

  • IE 7 CSS problem with detecting mouse over on div

    - by BeaverProj
    I have a div inside an li as part of a top navigation for a website. I'm having trouble with IE 7 having "holes" in the box such that the drop down disappears when the user is still on the drop down. I started with a pure CSS solution (li:hover) and that works awesome in all browsers except IE 7. So I've now added a jQuery/javascript solution to detect when the mouse enters and exits the nav li and then add a class to show the drop down. It works better, but if the mouse is not over an image, p, h3, or a tag then it doesn't think I'm over the div that is the drop down. Very frustrating. I can post some test code, but the issue can be viewed here: http://davincidays.org/ Anyone have any ideas? I've been working on this for waaaay too long already and need some fresh things to try.

    Read the article

  • How to configure a OCUnit test bundle for a framework?

    - by GuidoMB
    I've been developing a Mac OS X framework and I want to use OCUnit in my XCode 3.2.1 project. I've followed several tutorials on how to configure a OCUnit test bundle. The problem is that when I create a test case that uses a function that is defined in one of the framework's sources, I get a building error telling me that the symbol is not found. I made the test bundle dependent of my project's target as the tutorial said, but that doesn't seem to be problem. First I thought that I could solve this problem by dragging the framework's source files into the compile sources section within the Test bundle target, but then all the symbols referenced from that source file started to show up in the build errors, so that seems to not be a good solution/idea. How can I configure my unit test bundle so it builds properly?

    Read the article

  • Crystal Reports error 7 "Out of memory"

    - by pwee167
    Hi guys, I have a VB6 application, reportwriter, that runs a crystal report and outputs a pdf. I have a .net 3.5 asp application that calls the reportwriter dll. I am getting an error saying 7 "Out of memory", when trying to load the report. I have 4gb of memory and running windows 7 (64 bit). I also have Crystals Reports 11 with service pack 4 installed. I have registered the dll and referenced it in my project. I have run out of ideas what could be causing this. I need some help. Any advice will be very much appreciated. I suspect it has nothing to do with Crystal Reports, but I cannot be sure. Has anyone come across this error message/issue? Also, I have a friend running the identical project in almost identical PC (bar a few different personal applications installed). It works for him. Cheers.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >