Search Results

Search found 328 results on 14 pages for 'carlos liu'.

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

  • SQL server availability issue: large query stops other connections from connecting

    - by Carlos
    I've got a high-spec (multicore, RAID) server running MS SQL 2008, with several databases on it. I have a low throughput process that periodically needs a small amount of information from one of the DBs, and the code seems to work fine. However, sometimes when one of my colleagues does a huge query against one of the other DBs, I see full CPU usage on the machine, and connections from my app time out. Why does this happen? I would have thought the many cores and harddisks would somehow (together with cleverly written DB server) be able to keep at least some of the resources free for other apps? I'm pretty sure he doesn't use multiple connections for his query. What can I do to prevent this?

    Read the article

  • TCP Keepalive and firewall killing idle sessions

    - by Carlos A. Ibarra
    In a customer site, the network team added a firewall between the client and the server. This is causing idle connections to get disconnected after about 40 minutes of idle time. The network people say that the firewall doesn't have any idle connection timeout, but the fact is that the idle connections get broken. In order to get around this, we first configured the server (a Linux machine) with TCP keepalives turned on with tcp_keepalive_time=300, tcp_keepalive_intvl=300, and tcp_keepalive_probes=30000. This works, and the connections stay viable for days or more. However, we would also like the server to detect dead clients and kill the connection, so we changed the settings to time=300,intvl=180,probes=10, thinking that if the client was indeed alive, the server would probe every 300s (5 minutes) and the client would respond with an ACK and that would keep the firewall from seeing this as an idle connection and killing it. If the client was dead, after 10 probes, the server would abort the connection. To our surprise, the idle but alive connections get killed after about 40 minutes as before. Wireshark running on the client side shows no keepalives at all between the server and client, even when keepalives are enabled on the server. What could be happening here? If the keepalive settings on the server are time=300,intvl=180,probes=10, I would expect that if the client is alive but idle, the server would send keepalive probes every 300 seconds and leave the connection alone, and if the client is dead, it would send one after 300 seconds, then 9 more probes every 180 seconds before killing the connection. Am I right? One possibility is that the firewall is somehow intercepting the keepalive probes from the server and failing to pass them on to the client, and the fact that it got a probe makes it think that the connection is active. Is this common behavior for a firewall? We don't know what kind of firewall is involved. The server is a Teradata node and the connection is from a Teradata client utility to the database server, port 1025 on the server side, but we have seen the same problem with an SSH connection so we think it affects all TCP connections.

    Read the article

  • running a web server with encrypted file system (all or part of it)

    - by Carlos
    Hi, I need a webserver (lamp) running inside a virtual machine (#1) running as a service (#2) in headless mode (#3) with part or the whole filesystem encrypted (#4). The virtual machine will be started with no user intervention and provide access to a web application for users in the host machine. Points #1,#2 and #3 are checked and proved to be working fine with Sun VirtualBox, so my question is for #4: Can I encrypt the all filesystem and still access the webserver (using a browser) or will grub ask me for a password? If encrypting the all filesystem is not an option, can I encrypt only /home and /var/www ? will apache/php be able to use files in /home or /var/www without asking for a password or mounting these partitions manually? Thanks

    Read the article

  • Cannot read/write a second drive in MBP 13

    - by Carlos
    I changed my original HDD for a SDD earlier this year and I just got one more SSD for my MBP 13 (2012) that I used to replace DVD drive. I'm using Mountain Lion. The SSD looks to be recognized allright, but I can't format it. Then I removed the main drive and tried the new one as the main drive and did the boot using a USB drive with MAC OS and everyhing worked as it should (like I just had one drive). However when I bring the first drive back together with the second they both show up but I can't use it. Seems like I have no permission, but when I look at it's properties it says I can read and write to it. Any ideas? Thanks a lot!

    Read the article

  • How do you find all dependencies of a database table?

    - by Carlos
    In MS SQL 2005, is it possible to find out which tables/columns are being used either as keys in another table, or as part of a stored procedure? The reason is I'm trying to clean up some old stored procs and tables, some of which can be removed, some of which can have columns pruned. But obviously I don't want to remove stuff which is being used.

    Read the article

  • VS2010 on multiple monitors

    - by Carlos
    I'm using VS2010, which has the cool feature of allowing you to drag panels out of the main IDE window. I like to drag some of the panels off to one of my other monitors. Unfortunately, after each run/debug session, VS2010 seems to forget where I had the panels, and dumps them right in the middle of the IDE window, and I have to move it again. Does anyone know what to do about this?

    Read the article

  • Getting back the old alt-tab windows switching behavior in Windows 7?

    - by Carlos A. Ibarra
    When you run more than 6 applications on Windows 7 and you press alt-TAB, icons representing the first 6 applications and the desktop appear on the first row of the grid and you can cycle with alt-TAB-TAB... through the 6 most recently used windows the usual way, but the 7th and other less recently used windows don't follow the same rules. Instead they get grouped together according to their application but disregarding whether they were recently used or not. This new behavior is mentioned here. I am very used to the old way of cycling and the new system is driving me crazy. I tend to have 20 or so windows open at one time and I frequently need to alt-tab to the 7th or 8th window on the stack but it doesn't work the same anymore. Does anyone know how to put back the old behavior, so that alt-tab-tab-tab... goes through the whole list in most-recent to least-recent order?

    Read the article

  • Is there something like bsdiff/Courgette for jar files?

    - by Ken Liu
    Google uses bsdiff and Courgette for patching binary files like the Chrome distribution. Do any similar tools exist for patching jar files? I am updating jar files remotely over a bandwidth-limited connection and would like to minimize the amount of data sent. I do have some control over the client machine to some extent (i.e. I can run scripts locally) and I am guaranteed that the target application will not be running at the time. I know that I can patch java applications by putting updated class files in the classpath, but I would prefer a cleaner method for doing updates. It would be good if I could start with the target jar file, apply a binary patch, and then wind up with an updated jar file that is identical (bitwise) to the new jar (from which the patch was created).

    Read the article

  • Using regexkitlite with strings containing % signs

    - by David Liu
    So I'm using RegexKitLite in my iPhone app, and I'm basically grabbing out a bunch of URLs and names from within a web page. The problem is that whenever it comes across a URL with URL encoded characters like %22 for a double quote or %27 for a single quote, the captured string basically gives me a jumbled overflowed string, containing garbage and even method names. I'm really not doing anything particularly special within the regex, just your basic "startdelimiter(.*)enddelimiter" regex.

    Read the article

  • SVN client on windows without administrator rights

    - by Liu Chang
    I am trying to install an svn client on a friend's work windows laptop without much success. It seems that everyone is using TortoiseSVN nowadays, which unfortunately doesn't install without administrator access. Is there any way around it or another client I can try? I don't need anything fancy - just basic http/https, but a GUI is very much preferred over a command line client. Thanks!

    Read the article

  • Passcode functionality for iPhone app?

    - by David Liu
    I was thinking about putting in PIN number functionality within my iPhone app (various examples can be seen here http://forums.mint.com/showthread.php?t=5956 ), but I was kinda stumped how to go about it. Should I just go with a hidden textfield and simulate the inputs with images?

    Read the article

  • Hibernate: can I override an identifier generator using XML with a custom generator?

    - by Ken Liu
    I want to use a custom sequence generator in my application, but the entity is located in a domain model jar that is shared with other applications. Apparently entity annotations can be overridden in orm.xml but I can't figure out the proper XML incantation to get this to work. I can modify the annotation in the entity like this this: @GenericGenerator(name = "MYGEN", strategy = "MyCustomGenerator") @GeneratedValue(generator = "MYGEN") But I need to somehow map this to orm.xml in order to override the original annotation. Looking at the orm.xml schema here it appears that I can't even specify a generation type besides "sequence" and "table".

    Read the article

  • CATransitionFade not working on newly added subviews

    - by David Liu
    For some reason, fading in new buttons using CATransition isn't working for me when it's a newly added button. The fade animation, however, is working on existing subviews. Code: // Add new button. CATransition *animation = [CATransition animation]; [animation setDuration:0.5]; [animation setType:kCATransitionFade]; [[button layer] addAnimation:animation forKey:@"fadeIn"]; [self.view addSubview:button]; // Enable previous button (Enabling fades in different type of background) if(toolbar.buttons.count != 0){ UIButton * prevButton = [toolbar.buttons objectAtIndex:(toolbar.buttons.count - 1)]; prevButton.enabled = YES; [[prevButton layer] addAnimation:animation forKey:@"fadeIn"]; }

    Read the article

  • How to write scripts that can run in bash and csh?

    - by Victor Liu
    I'm not sure if this is even possible, but is there a way to write shell scripts that can be interpreted by both the Bourne shell as well as C shell? I want to avoid simply checking for the shell and running a shell-specific code. If this is possible, are there any guides on how to do it? I have always written my scripts for Bourne shell syntax, and I know next to nothing about csh, so this may be a stupid question. I have Google'd for the differences between shells, but there is little information (as far as I can tell) on its implications for scripting.

    Read the article

  • NavigationBar from UINavigationController not positioned correctly

    - by David Liu
    So, my iPad program has a pseudo-split view controller (one that I implemented, not base SDK one), and was working correctly a while ago. It has the basic layout (UINavController for master, content view controller for detail on right), but I have it so the master view doesn't disappear when rotated into portrait view. Recently, I added in a UITabBarController to contain the entire split view, which has made the navigation bar go wonky, while all the other views are positioned fine. In addition, the navigation bar only gets mispositioned when the program starts up while the iPad is in landscape, or upside-down portrait. If it starts out in portrait, everything is fine. Relevant Code: RootViewController.m: - (void)loadView { navController = [[NavigationBreadcrumbsController_Pad alloc] init]; ABTableViewController_Pad * tableViewController = [[ABTableViewController_Pad alloc] initWithNibName:@"ABTableView"]; master = [[UINavigationController_Pad alloc] initWithRootViewController:tableViewController]; [tableViewController release]; // Dummy blank UIViewcontroller detail = [[UIViewController alloc] init]; detail.view = [[[UIView alloc] init] autorelease]; [detail.view setBackgroundColor:[UIColor grayColor]]; self.view = [[[UIView alloc] init] autorelease]; self.view.backgroundColor = [UIColor blackColor]; [self positionViews]; [self.view addSubview:navToolbarController.view]; [self.view addSubview:master.view]; [self.view addSubview:detail.view]; } // Handles the respositioning of view into it's current orientation -(void)positionViews{ CGFloat tabBarOffset = 0; if(self.tabBarController){ tabBarOffset = self.tabBarController.tabBar.frame.size.height; } if(self.interfaceOrientation == UIInterfaceOrientationPortrait || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { self.view.frame = CGRectMake(0, 0, 768, 1004); navController.view.frame = CGRectMake(0,0,768,44); //adjust master view [master.view setFrame:CGRectMake(0, 44, 320, 1024 - 44 - 20 - tabBarOffset)]; //adjust detail view [detail.view setFrame:CGRectMake(321,44, 448, 1024 - 44 - 20 - tabBarOffset)]; } // Landscape Layout else{ self.view.frame = CGRectMake(0, 0, 748, 1024); navToolbarController.view.frame = CGRectMake(0,0,1024,44); //adjust master view [master.view setFrame:CGRectMake(0, 44, 320, 768 - 44 - 20 - tabBarOffset)]; //adjust detail view [detail.view setFrame:CGRectMake(321,44, 1024 - 320, 768 - 44 - 20 - tabBarOffset)]; } }

    Read the article

  • NSZombieEnabled hides EXC_BAD_ACCESS error entirely

    - by David Liu
    So I have a subclass of a UIView that starts causing EXC_BAD_ACCESS errors when I go through a specific set of conditions (run on iPad instead of iPhone or simulator, first login only). It throws the exception when the UIView subclass gets deallocated, during the last line, where I have [super dealloc]. I heard about using NSZombieEnabled, so I tossed that on to see if I could get any more information about it, but now it hides the error completely! Does anyone know a bit more about this type of situation? I thought NSZombie would start spewing stuff into my console like before, but I'm hoping that the nonexistance of errors would tell me some sort of information as well.

    Read the article

  • SQL Query in Ruby: Only select the changes

    - by JJ Liu
    Suppose I have a table (PriceHistory) like this, every time I change anything in the row, I will record the whole row again in the table. id | buy_price | sell_price | change_date 1 | 2 | 2 | 2012-06-22 2 | 3 | 2 | 2012-06-20 3 | 2 | 6 | 2012-06-15 4 | 5 | 5 | 2012-06-15 5 | 5 | 7 | 2012-06-15 6 | 4 | 8 | 2012-06-12 I only care about the change of BuyPrice, Is there a way to just select row 1, 2, 3, & 5? Here is the Ruby code I come up with, but it does not only select the changed rows PriceHistory.select("id, BuyPrice, change_date"). order("change_date DESC") Both Ruby and SQL answers are fine.

    Read the article

  • One off errors with NSLog and NSString stringWithFormat

    - by David Liu
    Does anyone know why there would be one-off errors with NSLog and NSString? It works fine in 99% of my program, but for some reason this error appears in one of my model's description method: Example code: localFileId = 7; type = 2; localId = 5; NSLog(@"CachedFile localId=%d, 2=%d, localFileId=%d, type=%d, path=%@", localId, 2, localFileId, type, self.path); Example Result: CachedFile localId=5, 2=0, localFileId=2, type=7, path=(null) Notice the "0" that gets inserted in there, where it should be "2=2". This happens with NSString stringWithFormat as well.

    Read the article

  • Is it bad practice to make a setter return "this"?

    - by Ken Liu
    Is it a good or bad idea to make setters in java return "this"? public Employee setName(String name){ this.name = name; return this; } This pattern can be useful because then you can chain setters like this: list.add(new Employee().setName("Jack Sparrow").setId(1).setFoo("bacon!")); instead of this: Employee e = new Employee(); e.setName("Jack Sparrow"); ...and so on... list.add(e); ...but it sort of goes against standard convention. I suppose it might be worthwhile just because it can make that setter do something else useful. I've seen this pattern used some places (e.g. JMock, JPA), but it seems uncommon, and only generally used for very well defined APIs where this pattern is used everywhere. Update: What I've described is obviously valid, but what I am really looking for is some thoughts on whether this is generally acceptable, and if there are any pitfalls or related best practices. I know about the Builder pattern but it is a little more involved then what I am describing - as Josh Bloch describes it there is an associated static Builder class for object creation.

    Read the article

  • UITableViewCell is transparent when not supposed to be

    - by David Liu
    My UITableViewCell is being transparent when it's not supposed to be. My table view has a background color and it shows through the table cell, even though they're supposed to be opaque. I'm not sure why this is. Relevant code: UITableViewCell *cell = [table dequeueReusableCellWithIdentifier:emptyIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:emptyIdentifier] autorelease]; } cell.textLabel.text = @"Empty"; cell.textLabel.textAlignment = UITextAlignmentCenter; cell.textLabel.backgroundColor = [UIColor whiteColor]; return cell;

    Read the article

  • return an ArrayList method

    - by Bopeng Liu
    This is a drive method for two other classes. which i posted here http://codereview.stackexchange.com/questions/33148/book-program-with-arraylist I need some help for the private static ArrayList getAuthors(String authors) method. I am kind a beginner. so please help me finish this drive method. or give me some directions. Instruction some of the elements of the allAuthors array contain asterisks “*” between two authors names. The getAuthors method uses this asterisk as a delimiter between names to store them separately in the returned ArrayList of Strings. import java.util.ArrayList; public class LibraryDrive { public static void main(String[] args) { String[] titles = { "The Hobbit", "Acer Dumpling", "A Christmas Carol", "Marley and Me", "Building Java Programs", "Java, How to Program" }; String[] allAuthors = { "Tolkien, J.R.", "Doofus, Robert", "Dickens, Charles", "Remember, SomeoneIdont", "Reges, Stuart*Stepp, Marty", "Deitel, Paul*Deitel, Harvery" }; ArrayList<String> authors = new ArrayList<String>(); ArrayList<Book> books = new ArrayList<Book>(); for (int i = 0; i < titles.length; i++) { authors = getAuthors(allAuthors[i]); Book b = new Book(titles[i], authors); books.add(b); authors.remove(0); } Library lib = new Library(books); System.out.println(lib); lib.sort(); System.out.println(lib); } private static ArrayList<String> getAuthors(String authors) { ArrayList books = new ArrayList<String>(); // need help here. return books; } }

    Read the article

  • JavaFx 2.1, 2.2 TableView update issue

    - by Lewis Liu
    My application uses JPA read data into TableView then modify and display them. The table refreshed modified record under JavaFx 2.0.3. Under JavaFx 2.1, 2.2, the table wouldn't refresh the update anymore. I found other people have similar issue. My plan was to continue using 2.0.3 until someone fixes the issue under 2.1 and 2.2. Now I know it is not a bug and wouldn't be fixed. Well, I don't know how to deal with this. Following are codes are modified from sample demo to show the issue. If I add a new record or delete a old record from table, table refreshes fine. If I modify a record, the table wouldn't refreshes the change until a add, delete or sort action is taken. If I remove the modified record and add it again, table refreshes. But the modified record is put at button of table. Well, if I remove the modified record, add the same record then move the record to the original spot, the table wouldn't refresh anymore. Below is a completely code, please shine some light on this. import javafx.application.Application; import javafx.beans.property.SimpleStringProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.HPos; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.text.Font; import javafx.stage.Modality; import javafx.stage.Stage; import javafx.stage.StageStyle; public class Main extends Application { private TextField firtNameField = new TextField(); private TextField lastNameField = new TextField(); private TextField emailField = new TextField(); private Stage editView; private Person fPerson; public static class Person { private final SimpleStringProperty firstName; private final SimpleStringProperty lastName; private final SimpleStringProperty email; private Person(String fName, String lName, String email) { this.firstName = new SimpleStringProperty(fName); this.lastName = new SimpleStringProperty(lName); this.email = new SimpleStringProperty(email); } public String getFirstName() { return firstName.get(); } public void setFirstName(String fName) { firstName.set(fName); } public String getLastName() { return lastName.get(); } public void setLastName(String fName) { lastName.set(fName); } public String getEmail() { return email.get(); } public void setEmail(String fName) { email.set(fName); } } private TableView<Person> table = new TableView<Person>(); private final ObservableList<Person> data = FXCollections.observableArrayList( new Person("Jacob", "Smith", "[email protected]"), new Person("Isabella", "Johnson", "[email protected]"), new Person("Ethan", "Williams", "[email protected]"), new Person("Emma", "Jones", "[email protected]"), new Person("Michael", "Brown", "[email protected]")); public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Table View Sample"); stage.setWidth(535); stage.setHeight(535); editView = new Stage(); final Label label = new Label("Address Book"); label.setFont(new Font("Arial", 20)); TableColumn firstNameCol = new TableColumn("First Name"); firstNameCol.setCellValueFactory( new PropertyValueFactory<Person, String>("firstName")); firstNameCol.setMinWidth(150); TableColumn lastNameCol = new TableColumn("Last Name"); lastNameCol.setCellValueFactory( new PropertyValueFactory<Person, String>("lastName")); lastNameCol.setMinWidth(150); TableColumn emailCol = new TableColumn("Email"); emailCol.setMinWidth(200); emailCol.setCellValueFactory( new PropertyValueFactory<Person, String>("email")); table.setItems(data); table.getColumns().addAll(firstNameCol, lastNameCol, emailCol); //--- create a edit button and a editPane to edit person Button addButton = new Button("Add"); addButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { fPerson = null; firtNameField.setText(""); lastNameField.setText(""); emailField.setText(""); editView.show(); } }); Button editButton = new Button("Edit"); editButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { if (table.getSelectionModel().getSelectedItem() != null) { fPerson = table.getSelectionModel().getSelectedItem(); firtNameField.setText(fPerson.getFirstName()); lastNameField.setText(fPerson.getLastName()); emailField.setText(fPerson.getEmail()); editView.show(); } } }); Button deleteButton = new Button("Delete"); deleteButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { if (table.getSelectionModel().getSelectedItem() != null) { data.remove(table.getSelectionModel().getSelectedItem()); } } }); HBox addEditDeleteButtonBox = new HBox(); addEditDeleteButtonBox.getChildren().addAll(addButton, editButton, deleteButton); addEditDeleteButtonBox.setAlignment(Pos.CENTER_RIGHT); addEditDeleteButtonBox.setSpacing(3); GridPane editPane = new GridPane(); editPane.getStyleClass().add("editView"); editPane.setPadding(new Insets(3)); editPane.setHgap(5); editPane.setVgap(5); Label personLbl = new Label("Person:"); editPane.add(personLbl, 0, 1); GridPane.setHalignment(personLbl, HPos.LEFT); firtNameField.setPrefWidth(250); lastNameField.setPrefWidth(250); emailField.setPrefWidth(250); Label firstNameLabel = new Label("First Name:"); Label lastNameLabel = new Label("Last Name:"); Label emailLabel = new Label("Email:"); editPane.add(firstNameLabel, 0, 3); editPane.add(firtNameField, 1, 3); editPane.add(lastNameLabel, 0, 4); editPane.add(lastNameField, 1, 4); editPane.add(emailLabel, 0, 5); editPane.add(emailField, 1, 5); GridPane.setHalignment(firstNameLabel, HPos.RIGHT); GridPane.setHalignment(lastNameLabel, HPos.RIGHT); GridPane.setHalignment(emailLabel, HPos.RIGHT); Button saveButton = new Button("Save"); saveButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { if (fPerson == null) { fPerson = new Person( firtNameField.getText(), lastNameField.getText(), emailField.getText()); data.add(fPerson); } else { int k = -1; if (data.size() > 0) { for (int i = 0; i < data.size(); i++) { if (data.get(i) == fPerson) { k = i; } } } fPerson.setFirstName(firtNameField.getText()); fPerson.setLastName(lastNameField.getText()); fPerson.setEmail(emailField.getText()); data.set(k, fPerson); table.setItems(data); // The following will work, but edited person has to be added to the button // // data.remove(fPerson); // data.add(fPerson); // add and remove refresh the table, but now move edited person to original spot, // it failed again with the following code // while (data.indexOf(fPerson) != k) { // int i = data.indexOf(fPerson); // Collections.swap(data, i, i - 1); // } } editView.close(); } }); Button cancelButton = new Button("Cancel"); cancelButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { editView.close(); } }); HBox saveCancelButtonBox = new HBox(); saveCancelButtonBox.getChildren().addAll(saveButton, cancelButton); saveCancelButtonBox.setAlignment(Pos.CENTER_RIGHT); saveCancelButtonBox.setSpacing(3); VBox editBox = new VBox(); editBox.getChildren().addAll(editPane, saveCancelButtonBox); Scene editScene = new Scene(editBox); editView.setTitle("Person"); editView.initStyle(StageStyle.UTILITY); editView.initModality(Modality.APPLICATION_MODAL); editView.setScene(editScene); editView.close(); final VBox vbox = new VBox(); vbox.setSpacing(5); vbox.getChildren().addAll(label, table, addEditDeleteButtonBox); vbox.setPadding(new Insets(10, 0, 0, 10)); ((Group) scene.getRoot()).getChildren().addAll(vbox); stage.setScene(scene); stage.show(); } }

    Read the article

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