Daily Archives

Articles indexed Wednesday December 29 2010

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

  • How to manage memory using classes in Objective-C?

    - by Flipper
    This is my first time creating an iPhone App and I am having difficulty with the memory management because I have never had to deal with it before. I have a UITableViewController and it all works fine until I try to scroll down in the simulator. It crashes saying that it cannot allocate that much memory. I have narrowed it down to where the crash is occurring: - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // Dequeue or create a cell UITableViewCellStyle style = UITableViewCellStyleDefault; UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:@"BaseCell"]; if (!cell) cell = [[[UITableViewCell alloc] initWithStyle:style reuseIdentifier:@"BaseCell"] autorelease]; NSString* crayon; // Retrieve the crayon and its color if (aTableView == self.tableView) { crayon = [[[self.sectionArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] getName]; } else { crayon = [FILTEREDKEYS objectAtIndex:indexPath.row]; } cell.textLabel.text = crayon; if (![crayon hasPrefix:@"White"]) cell.textLabel.textColor = [self.crayonColors objectForKey:crayon]; else cell.textLabel.textColor = [UIColor blackColor]; return cell; } Here is the getName method: - (NSString*)getName { return name; } name is defined as: @property (nonatomic, retain) NSString *name; Now sectionArray is an NSMutableArray with instances of a class that I created Term in it. Term has a method getName that returns a NSString*. The problem seems to be the part of where crayon is being set and getName is being called. I have tried adding autorelease, release, and other stuff like that but that just causes the entire app to crash before even launching. Also if I do: cell.textLabel.text = @"test"; //crayon; /*if (![crayon hasPrefix:@"White"]) cell.textLabel.textColor = [self.crayonColors objectForKey:crayon]; else cell.textLabel.textColor = [UIColor blackColor];*/ Then I get no error whatsoever and it all scrolls just fine. Thanks in advance for the help! Edit: Here is the full Log of when I try to run the app and the error it gives when it crashes: [Session started at 2010-12-29 04:23:38 -0500.] [Session started at 2010-12-29 04:23:44 -0500.] GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all Attaching to process 1429. gdb-i386-apple-darwin(1430,0x778720) malloc: * mmap(size=1420296192) failed (error code=12) error: can't allocate region ** set a breakpoint in malloc_error_break to debug gdb stack crawl at point of internal error: [ 0 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (align_down+0x0) [0x1222d8] [ 1 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (xstrvprintf+0x0) [0x12336c] [ 2 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (xmalloc+0x28) [0x12358f] [ 3 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (dyld_info_read_raw_data+0x50) [0x1659af] [ 4 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (dyld_info_read+0x1bc) [0x168a58] [ 5 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (macosx_dyld_update+0xbf) [0x168c9c] [ 6 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (macosx_solib_add+0x36b) [0x169fcc] [ 7 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (macosx_child_attach+0x478) [0x17dd11] [ 8 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (attach_command+0x5d) [0x64ec5] [ 9 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (mi_cmd_target_attach+0x4c) [0x15dbd] [ 10 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (captured_mi_execute_command+0x16d) [0x17427] [ 11 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (catch_exception+0x41) [0x7a99a] [ 12 ] /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/libexec/gdb/gdb-i386-apple-darwin (mi_execute_command+0xa9) [0x16f63] /SourceCache/gdb/gdb-967/src/gdb/utils.c:1144: internal-error: virtual memory exhausted: can't allocate 1420296192 bytes. A problem internal to GDB has been detected, further debugging may prove unreliable. The Debugger has exited with status 1.The Debugger has exited with status 1. Here is the backtrace that I get when I set the breakpoint for malloc_error_break: #0 0x0097a68c in objc_msgSend () #1 0x01785bef in -[UILabel setText:] () #2 0x000030e0 in -[TableViewController tableView:cellForRowAtIndexPath:] (self=0x421d760, _cmd=0x29cfad8, aTableView=0x4819600, indexPath=0x42190f0) at /Volumes/Main2/Enayet/TableViewController.m:99 #3 0x016cee0c in -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] () #4 0x016c6a43 in -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] () #5 0x016d954f in -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow] () #6 0x016d08ff in -[UITableView layoutSubviews] () #7 0x03e672b0 in -[CALayer layoutSublayers] () #8 0x03e6706f in CALayerLayoutIfNeeded () #9 0x03e668c6 in CA::Context::commit_transaction () #10 0x03e6653a in CA::Transaction::commit () #11 0x03e6e838 in CA::Transaction::observer_callback () #12 0x00b00252 in __CFRunLoopDoObservers () #13 0x00aff65f in CFRunLoopRunSpecific () #14 0x00afec48 in CFRunLoopRunInMode () #15 0x00156615 in GSEventRunModal () #16 0x001566da in GSEventRun () #17 0x01689faf in UIApplicationMain () #18 0x00002398 in main (argc=1, argv=0xbfffefb0) at /Volumes/Main2/Enayet/main.m:14

    Read the article

  • GWT Date Picker Format problem when saving a java date through hibernate in postgresql

    - by Noor
    Hi, I am using Java Date and Hibernate which is then being saved in the database (Postgresql). I am not that good in hibernate Part of the Mapping File <property name="DateOfBirth" type="java.util.Date"> <column name="DATEOFBIRTH" /> </property> I am using GWT Date picker Short date format i.e. yyyy-MM-dd. I am getting the value from the date picker using View.getUserDateOfBirth().getValue() But when I am saving the date 2010-11-30 into the datebase it is saving it as 2010-11-30 00:00:00 instead of 2010-11-30 So, I want it to be saved in the database as in this format 2010-11-30?? I have many things such timestamp but i not being able to configure it. I think this part <property name="DateOfBirth" type="java.util.Date"> <column name="DATEOFBIRTH" /> </property> should be changed but I do not know what to change

    Read the article

  • How to make Spinner Editable in Android?

    - by Dhrumil Shah
    I changed the ArrayAdapter method of spinner and i got my custom Spinner. just change the parameter of this method like Spinner spinner = (Spinner) findViewById(R.id.Spinner01); ArrayAdapter<CharSequence> adapter=ArrayAdapter.createFromResource(This,R.array.statename,R.layout.mylayout); spinner.setAdapter(adp); In Which the mylayout file contains <EditText android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/spinnerTarget" android:textColor="#FF8B1500" android:gravity="center" >

    Read the article

  • Is there any real world reason to use throw ex?

    - by Michael Stum
    In C#, throw ex is almost always wrong, as it resets the stack trace. I just wonder, is there any real world use for this? The only reason I can think of is to hide internals of your closed library, but that's a really weak reason. Apart from that, I've never encountered in the real world. Edit: I do mean throw ex, as in throwing the exact same exception that was caught but with an empty stacktrace, as in doing it exactly wrong. I know that throw ex has to exist as a language construct to allow throwing a different exception (throw new DifferentException("ex as innerException", ex)) and was just wondering if there is ever a situration where a throw ex is not wrong.

    Read the article

  • How to build SVN/Git like Diff in WebApp?

    - by 01
    I have XMLs(or Objects) that represents data at some point in a business process. I would like to be able to see what has changed between step1 and step5(two versions of the same XML or Object). Id like to implement this like diff function in version control system. how to do it in web app? P.S. I dont want to just store those files in VCS and than make it do the diff. However if I could somehow emulate VCS without having one that would be cool. P.S. I know there are some JS frameworks that offer diff functionality, but the XML could have 10MB, so I think it should be dont at server side.

    Read the article

  • more efficient version of this?

    - by john connor
    i have this thingy here : function numOfPackets(bufferSize, packetSize) { if (bufferSize <= 0 || packetSize > bufferSize) return 0; if (packetSize < 0) throw Error(); var out = 0; for(;;){ out++; bufferSize = bufferSize - packetSize; if( packetSize > bufferSize ) break; } return out; } which i run at often , can u give me more efficent variant of it?

    Read the article

  • Small gaps in section headers with custom headers - iPhone / Objective-C

    - by zhar
    Hi there! Since I wanted to use the standard section header with a different font size, I just made custom section headers by using an UIImageView with the standard section header as an image. It looks fine at first, but when I scroll the table, there are small gaps below and above the section headers: Since I am not allowed to post images or more than one hyperlink yet, I will have to provide you with one link to those images: Click me! Picture: How it looks like without touching anything Picture: Dragging the table down Picture: Dragging/Scrolling the table up So as you can hopefully see, there is a small empty gap under (2nd pic) and above (3rd pic) the section header. Another thing to mention is, that the standard behaviour of non-custom section headers is, that they don't become transparent when I drag the table down (making the table offset < 0.0). Is there a way to make custom section headers mimic the same behaviour without those annoying gaps? Greetings, Zhar

    Read the article

  • Checking if a file is a directory or just a file.

    - by Jookia
    I'm writing a program to check if something is a file or is a directory. Is there a better way to do it than this? #include <stdio.h> #include <sys/types.h> #include <dirent.h> #include <errno.h> int isFile(const char* name) { DIR* directory = opendir(name); if(directory != NULL) { closedir(directory); return 0; } if(errno == ENOTDIR) { return 1; } return -1; } int main(void) { const char* file = "./testFile"; const char* directory = "./"; printf("Is %s a file? %s.\n", file, ((isFile(file) == 1) ? "Yes" : "No")); printf("Is %s a directory? %s.\n", directory, ((isFile(directory) == 0) ? "Yes" : "No")); return 0; }

    Read the article

  • How to set padding to columns in table layout dynamically

    - by Praveenb
    Hi all, I am trying to create a table layout with buttons dynamically. I am able to get the table layout with buttons. bt i need padding between buttons. How i can get programatically. I tried following code bt private void showCowsTblField() { for (int row = 0; row < numberOfRowsInField-1; row++) { TableRow tableRow = new TableRow(this); tableRow.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT )); for (int column = 0; column < numberOfColumnsInField -1; column++) { blocks[row][column].setLayoutParams(new LayoutParams( LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); blocks[row][column].setPadding(blockPadding, blockPadding, blockPadding, blockPadding); tableRow.addView(blocks[row][column]); tableRow.setPadding(blockPadding, blockPadding, blockPadding, blockPadding); } tblCows.addView(tableRow,new TableLayout.LayoutParams( LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); } } Please let me know.... Thanks.

    Read the article

  • I get a "TypeError: Error #1009: Cannot access a property or method of a null object reference." error on my AIR project for using a button.

    - by Xcore
    So my problem here is, I'm working on my Adobe Air project, so I decided to code some buttons to be able to navigate. The problem here is that I get a error for trying to do so. Here is my code. import flash.events.MouseEvent; this.stop(); play_btn.addEventListener(MouseEvent.MOUSE_DOWN, playButtonClick); function playButtonClick(evt:MouseEvent) { gotoAndPlay(337); } I do not see what is wrong actually, I tried this on a blank non-AIR file, and it worked well. Thanks for helping!

    Read the article

  • Installing Java3D on Eclipse

    - by Matt
    I'm trying to use Java3D in my project. This is the error I receive: 29-Dec-2010 1:01:29 AM javax.media.j3d.NativePipeline getSupportedOglVendor SEVERE: java.lang.UnsatisfiedLinkError: no j3dcore-ogl-chk in java.library.path Exception in thread "main" java.lang.UnsatisfiedLinkError: no j3dcore-d3d in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at javax.media.j3d.NativePipeline$1.run(NativePipeline.java:189) at java.security.AccessController.doPrivileged(Native Method) at javax.media.j3d.NativePipeline.loadLibrary(NativePipeline.java:180) at javax.media.j3d.NativePipeline.loadLibraries(NativePipeline.java:137) at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:948) at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:280) at World.<init>(World.java:10) at Start.main(Start.java:12) I have copied the .jar files into my project's lib folder and linked them in Project - Properties - Add Jar File. There was also a .dll file in the Java3D download that I haven't touched or included in any way. What am I missing?

    Read the article

  • Use parameters with CTL

    - by Hal
    Hi. I am using a CTL file to load data stored in a file to a specific table in my Oracle database. Currently, I launch the loader file using the following command line: sqlldr user/pwd@db data=my_data_file control=my_loader.ctl I would like to know if it is possible to use specify parameters to be retrieved in the CTL file. Also, is it possible to retrieve the name of the data file used by the CTL to fill the table ?I also would like to insert it for each row. I currently have to call a procedure to update previously inserted records. Any help would be appreciated !

    Read the article

  • Moving An Object With Touch

    - by Arman
    for(touch in iPhoneInput.touches) { if(touch.phase == iPhoneTouchPhase.Moved || touch.phase == iPhoneTouchPhase.Began) { transform.position = Camera.main.ScreenToWorldPoint(new Vector3 (touch.position.x, touch.position.y, 10)); } } I have found the above code from tutorial Moving An Object With Touch but its not working when I play game in Unity3D. Can some one please help me.

    Read the article

  • What is the difference between a 32-bit and 64-bit processor?

    - by JJG
    I have been trying to read up on 32-bit and 64-bit processors (http://en.wikipedia.org/wiki/32-bit_processing). My understanding is that a 32-bit processor (like x86) has registers 32-bits wide. I'm not sure what that means. So it has special "memory spaces" that can store integer values up to 2^32? I don't want to sound stupid, but I have no idea about processors. I'm assuming 64-bits is, in general, better than 32-bits. Although my computer now (one year old, Win 7, Intel Atom) has a 32-bit processor.

    Read the article

  • Get company name in android using new API's

    - by HellBoy
    Currently I am getting company name using following code public class ContactsDemo extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Cursor cursor = getContentResolver().query(Contacts.Organizations.CONTENT_URI, null, null, null, null); //ContactsContract.CommonDataKinds. if(cursor!=null){ System.out.println(cursor.getString(cursor.getColumnIndex (Contacts.Organizations.COMPANY))); }}} but I don't want to use deprected API's. & in new API's there is no CONTENT_URI in Organisation class. How to get company name using new API.

    Read the article

  • Block the user from changing the System Date/Time

    - by Ananth
    We have a windows application (C# .net) and we'll be giving installers to client. The requirement is that once the application has been installed , user should not be able to edit the system time/date . This is to make sure that the application generated dates/reports are not manipulated. My target OS is Win-XP What is the best way to do that ? Does OS provide any facility to do that ? Thanks in Advance

    Read the article

  • Reducing Time Complexity in Java

    - by Koeneuze
    Right, this is from an older exam which i'm using to prepare my own exam in january. We are given the following method: public static void Oorspronkelijk() { String bs = "Dit is een boodschap aan de wereld"; int max = -1; char let = '*'; for (int i=0;i<bs.length();i++) { int tel = 1; for (int j=i+1;j<bs.length();j++) { if (bs.charAt(j) == bs.charAt(i)) tel++; } if (tel > max) { max = tel; let = bs.charAt(i); } } System.out.println(max + " keer " + let); } The questions are: what is the output? - Since the code is just an algorithm to determine the most occuring character, the output is "6 keer " (6 times space) What is the time complexity of this code? Fairly sure it's O(n²), unless someone thinks otherwise? Can you reduce the time complexity, and if so, how? Well, you can. I've received some help already and managed to get the following code: public static void Nieuw() { String bs = "Dit is een boodschap aan de wereld"; HashMap<Character, Integer> letters = new HashMap<Character, Integer>(); char max = bs.charAt(0); for (int i=0;i<bs.length();i++) { char let = bs.charAt(i); if(!letters.containsKey(let)) { letters.put(let,0); } int tel = letters.get(let)+1; letters.put(let,tel); if(letters.get(max)<tel) { max = let; } } System.out.println(letters.get(max) + " keer " + max); } However, I'm uncertain of the time complexity of this new code: Is it O(n) because you only use one for-loop, or does the fact we require the use of the HashMap's get methods make it O(n log n) ? And if someone knows an even better way of reducing the time complexity, please do tell! :)

    Read the article

  • Wicket and Spring Intergation

    - by Vinothbabu
    I have a wicket contact form, and i receive the form object. Now i need to pass this object to Spring Service. package com.mysticcoders.mysticpaste.web.pages; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.panel.FeedbackPanel; import com.mysticcoders.mysticpaste.model.Contact; import org.apache.wicket.model.CompoundPropertyModel; import com.mysticcoders.mysticpaste.services.IContact; public class FormPage extends WebPage { private Contact contact; private IContact icontact; public FormPage() { // Add a FeedbackPanel for displaying our messages FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); add(feedbackPanel); Form<Object> form = new Form<Object>("contactForm", new CompoundPropertyModel<Object>(contact)) { private static final long serialVersionUID = 1L; protected void onSubmit(Contact contact) { icontact.saveContact(contact); } }; form.add(new TextField<Object>("name")); form.add(new TextField<Object>("email")); form.add(new TextField<Object>("country")); form.add(new TextField<Object>("age")); add(form); // add a simple text field that uses Input's 'text' property. Nothing // can go wrong here } } I am pretty much sure that we need to do something with application-context xml where i may need to wire out. My Application-context.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <bean id="WicketApplication" class="com.mysticcoders.mysticpaste.web.pages.WicketApplication" /> </beans> My Question is simple. What should i do which can make my onSubmit method call the Spring Service? Could someone let me know what needs to modified in my Application-context.xml so that once the form gets submitted, it contacts the Spring Service class.

    Read the article

  • Can someone tell me why this JavaScript code isn't lining up an array in order?

    - by DarkLightA
    Live code: http://jsfiddle.net/fCUZC/ //INPUT ARRAY: var input = [28,32,21,11,8,2,14,32,64]; //VARIABLE DECLARATION. a = highest number so far, b = position of that number entireLoop: for (var i = 1; i<=input.length; i++) { if(input[i] > input[i-1]) { for(var o = i; o>=0; o--) { if(input[i-1] > input[o]) { input.splice(i,0,input[o]); input.splice((o+1),1); continue entireLoop; } else if(input[o] > input[0]) { input.splice(0,0,input[o]); input.splice((o+1),1); continue entireLoop; } } } } document.write(input); I'm trying to order the array from largest to smallest, but there's a 32 stuck somewhere. I know there's the sort method, but I'm a newbie and want to try this for myself.

    Read the article

  • Wildcard dns as subdomain in localhost using apache

    - by Sankaranand
    Hi, i am developing a web application in Zend Framework running in apache server (xampp). The site can actually be accessed by http://localhost/sitename . It is present in c:/xampp/htdocs/sitename/ I wanted to create wildcard dns so a specific user can access my webpage like username.localhost.... i will fetch the username as parameter and show the customized settings for him.. Can someone help me with it... Do i have to first assign a servername for my localhost/sitename ? and then think about adding subdomain wildcards ? Please enlight me...

    Read the article

  • SMTP redirecting to other port than 25

    - by Roalt
    How can you redirect your smtp traffic to another port than 25? My ISP blocks incoming traffic to port 25. I've been using ZoneEdit.com for this purpose for years (incoming mail traffic goes to another port and I redirect it via my firewall internally to port 25), but with the new system I cannot do it anymore. I'm not sure if I can do this by configuring MX and A records in the right way or if I need a SMTP redirecting service (such as rollernet.us)? I'm not an expert in Zone records but generally I know my way around for website traffic.

    Read the article

  • IIS FTP service - download timeouts and restarts getting the data twice

    - by accel229
    We have an IIS FTP site on a Windows Server 2003 x64 machine. Application Layer Gateway service is disabled (so http://support.microsoft.com/kb/931130 does not apply). Windows Firewall service is disabled as well. Connection timeout for the FTP site (there is only one) is set to 1,200 seconds = 20 minutes. An external client can connect to the site, list directory contents and download small files. When a client attempts to download a large file (eg, if the download continues for 3 minutes, which is still under 20 minutes, but relatively long), the server sends all data, then the connection times out, the client issues REST / RETR commands attempting to restart the download since after the last byte (which I believe should succeed and receive exactly 0 bytes), and the server behaves as if the client tried to restart after byte 0, that is, it sends the entire file all over. Any ideas on how to fix this?

    Read the article

  • Forwarding RDP via a Linux machine using iptables: Not working

    - by Nimmy Lebby
    I have a Linux machine and a Windows machine behind a router that implements NAT (the diagram might be overkill, but was fun to make): I am forwarding RDP port (3389) on the router to the Linux machine because I want to audit RDP connections. For the Linux machine to forward RDP traffic, I wrote these iptables rules: iptables -t nat -A PREROUTING -p tcp --dport 3389 -j DNAT --to-destination win-box iptables -A FORWARD -p tcp --dport 3389 -j ACCEPT The port is listening on the Windows machine: C:\Users\nimmy>netstat -a Active Connections Proto Local Address Foreign Address State (..snip..) TCP 0.0.0.0:3389 WIN-BOX:0 LISTENING (..snip..) And the port is forwarding on the Linux machine: # tcpdump port 3389 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes 01:33:11.451663 IP shieldsup.grc.com.56387 > linux-box.myapt.lan.ms-wbt-server: Flags [S], seq 94663035, win 8192, options [mss 1460], length 0 01:33:11.451846 IP shieldsup.grc.com.56387 > win-box.myapt.lan.ms-wbt-server: Flags [S], seq 94663035, win 8192, options [mss 1460], length 0 However, I am not getting any successful RDP connections from the outside. The port is not even responding: C:\Users\outside-nimmy>telnet example.com 3389 Connecting To example.com...Could not open connection to the host, on port 3389: Connect failed Any ideas? Update Per @Zhiqiang Ma, I looked at nf_conntrack proc file during a connection attempt and this is what I see (192.168.3.1 = linux-box, 192.168.3.5 = win-box): # cat /proc/net/nf_conntrack | grep 3389 ipv4 2 tcp 6 118 SYN_SENT src=4.79.142.206 dst=192.168.3.1 sport=43142 dport=3389 packets=6 bytes=264 [UNREPLIED] src=192.168.3.5 dst=4.79.142.206 sport=3389 dport=43142 packets=0 bytes=0 mark=0 secmark=0 zone=0 use=2 2nd update Got tcpdump on the router and it seems that win-box is sending an RST packet: 21:20:24.767792 IP shieldsup.grc.com.45349 > linux-box.myapt.lan.3389: S 19088743:19088743(0) win 8192 <mss 1460> 21:20:24.768038 IP shieldsup.grc.com.45349 > win-box.myapt.lan.3389: S 19088743:19088743(0) win 8192 <mss 1460> 21:20:24.770674 IP win-box.myapt.lan.3389 > shieldsup.grc.com.45349: R 721745706:721745706(0) ack 755785049 win 0 Why would Windows be doing this?

    Read the article

  • Proper way to rotate Nginx logs

    - by depesz
    I would like to achieve rotation of nginx logs that: would work without any extra software (i.e. - best if without "logrotate") would create rotated files with names based on date Best approach is something like PostgreSQL has - i.e. in it's log_filename config variable I can specify strftime-style %Y-%m-%d, and it will automatically change log on date (or time) change. Another approach from apache - sending logs via pipe to rotatelogs program. As far as I was able to search - no such approach exists. All I can do, is to use logrotate with dateext option, but it has it's own set of drawbacks, and I'd rather use something that works like |rotatelogs or log_filename in PostgreSQL.

    Read the article

  • Apache 2: Mod_Rewrite Help - If/else for directory exists

    - by BHare
    This is my current and sloppy Apache 2 mod_rewrite. Keep in mine the part with site1 site2..etc has about 50 sites. RewriteEngine on RewriteCond %{HTTP_HOST} ^([^.]+)\.mainsite\.org$ RewriteCond /home/%1/ -d RewriteRule ^(.+) %{HTTP_HOST}$1 RewriteRule ^([^.]+)\.mainsite\.org/media/(.*) /home/$1/special/media/$2 RewriteRule ^([^.]+)\.mainsite\.org/(.*) /home/$1/www/$2 RewriteCond %{HTTP_HOST} ^mainsite\.org$ [NC] RewriteRule ^(.*)$ http://www.mainsite.org$1 [R=302] RewriteCond %{HTTP_HOST} (site1|site2|site3|site4)\.(com|net|biz|org|us)$ [NC] RewriteCond %{REQUEST_URI} !^/media/ RewriteRule ^/(.*)$ /home/%1/www/$1 RewriteCond %{HTTP_HOST} (site1|site2|site3|site4)\.(com|biz|net|org|us)$ [NC] RewriteRule ^/media/(.*)$ /home/%1/special/media/$1 RewriteCond %{REQUEST_URI} favicon.ico$ RewriteRule ^(.*)$ /misc/favicon.ico So if someone tries to go to theirusername.mainsite.org it will check if /home/theirusername/ exists, and if it does use their www (/home/theirusername/www/) as the file location for web files. If they try they try to access theirusername.mainsite.org/media/ it will make a special file location to look for the file(s) at /home/theirusername/special/media/ I would like it if the username did NOT have /home/username that it would automatically default to www.mainsite.org. I am having a hard time understanding how to do skips and such. so: If someone went to notrealusername.mainsite.org/forum/ it would auto direct to www.mainsite.org/forum/ Extra: I am using repetitive code for other site for example lets say foobar has a website foobar.com, it goes through the same process as mainsite.org so figured maybe having something like: RewriteCond %{HTTP_HOST} ^([^.]+).(mainsite.org|com|net|biz|org)$ where I could have one major rule for all existing domains who have a /home/

    Read the article

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