Search Results

Search found 15 results on 1 pages for 'ptrn'.

Page 1/1 | 1 

  • java filenames filter pattern

    - by Sergey
    Hello, I need to implement File[] files = getFiles( String folderName, String ptrn ); Where ptrn is a command prompt style pattern like "*2010*.txt" I'm familar with FilenameFilter class, but can't implement public boolean accept(File dir, String filename) because String.matches() doesn't accept such patterns. Thanks!

    Read the article

  • proxy RDP traffic through SOCKS5 proxy, using Windows

    - by ptrn
    I'm having bit of trouble. I have a server at school that's hosting a database. Normally I've been connecting to it through a VPN-connection, but earlier today it went down. I've checked with other people, and it's definitely down, so the fault's probably not at my end. Is there a way I can proxy RDP traffic through a SOCKS5 proxy?

    Read the article

  • JavaScript: catching URI change

    - by ptrn
    I have a site where I'm using hash based parameters, eg. http://url.of.site/#param1=123 What I want When the user manually changes the URI to eg. http://url.of.site/#param1=789 When the user enters this URI, the event is caught by the JavaScript, and the appropriate functions are called. Basically, what I'm wondering about is; is there an event listener for this? Or would I have to periodically check the URI to see if it has been changed? I'm already using the current jQuery API, if that helps. _L

    Read the article

  • using check contraint in MySQL for controlling string length not working

    - by ptrn
    Dear stackoverflow, I'm tumbled with a problem! I've set up my first check constraint using MySQL, but unfortunately I'm having a problem. When inserting a row that should fail the test, the row is inserted anyway. The structure: CREATE TABLE user ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, uname VARCHAR(10) NOT NULL, fname VARCHAR(50) NOT NULL, lname VARCHAR(50) NOT NULL, mail VARCHAR(50) NOT NULL, PRIMARY KEY (id), CHECK (LENGTH(fname) > 3) ); The insert statement: INSERT INTO user VALUES (null, 'user', 'Fname', 'Lname', '[email protected]'); I'm pretty sure I'm missing something basic here.

    Read the article

  • Need a list of all countries in the world, with a longitude and latitude coordinate

    - by ptrn
    I need a list of all the countries in the world, with one lat/long coordinate for the country. I had a look at GeoNames, but all I can seem to find are lists that have the countries as well as cities in the same list. I guess I can just parse it and filter out the countries, but I was hoping to avoid that. Basically, what I need; Country name - Lat/long coordinate (some sort of center of the country) It doesn't need to say anything about continent, but I wouldn't mind if it did. _L

    Read the article

  • assigning variables to DOM event listeners when iterating

    - by ptrn
    I'm thinking there's something basic stuff I'm missing here; for (var i=1; i<=5; i++) { var o = $('#asd'+i); o.mouseover(function() { console.info(i); }); } When hovering over the five different elements, I always get out the last value from iteration; the value 5. What I want is different values depending of which element I'm hovering, all from 1 to 5. What am I doing wrong here?

    Read the article

  • sort outer array based on values in inner array, javascript

    - by ptrn
    I have an array with arrays in it, where I want to sort the outer arrays based on values in a specific column in the inner. I bet that sounded more than a bit confusing, so I'll skip straight to an example. Initial data: var data = [ [ "row_1-col1", "2-row_1-col2", "c-row_1-coln" ], [ "row_2-col1", "1-row_2-col2", "b-row_2-coln" ], [ "row_m-col1", "3-row_m-col2", "a-row_m-coln" ] ]; Sort data, based on column with index 1 data.sortFuncOfSomeKind(1); where the object then would look like this; var data = [ [ "row_2-col1", "1-row_2-col2", "b-row_2-coln" ], [ "row_1-col1", "2-row_1-col2", "c-row_1-coln" ], [ "row_m-col1", "3-row_m-col2", "a-row_m-coln" ] ]; Sort data, based on column with index 2 data.sortFuncOfSomeKind(2); where the object then would look like this; var data = [ [ "row_m-col1", "3-row_m-col2", "a-row_m-coln" ], [ "row_2-col1", "1-row_2-col2", "b-row_2-coln" ], [ "row_1-col1", "2-row_1-col2", "c-row_1-coln" ] ]; The big Q Is there an existing solution to this that you know of, or would I have to write one myself? If so, which would be the easiest sort algorithm to use? QuickSort? _L

    Read the article

  • Using a check contraint in MySQL for controlling string length

    - by ptrn
    I'm tumbled with a problem! I've set up my first check constraint using MySQL, but unfortunately I'm having a problem. When inserting a row that should fail the test, the row is inserted anyway. The structure: CREATE TABLE user ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, uname VARCHAR(10) NOT NULL, fname VARCHAR(50) NOT NULL, lname VARCHAR(50) NOT NULL, mail VARCHAR(50) NOT NULL, PRIMARY KEY (id), CHECK (LENGTH(fname) > 30) ); The insert statement: INSERT INTO user VALUES (null, 'user', 'Fname', 'Lname', '[email protected]'); The length of the string in the fname column should be too short, but it's inserted anyway. I'm pretty sure I'm missing something basic here.

    Read the article

  • order array containing text and numbers

    - by ptrn
    I'm looking for the easiest way to sort an array that consists of numbers and text, and a combination of these. E.g. '123asd' '19asd' '12345asd' 'asd123' 'asd12' turns into '19asd' '123asd' '12345asd' 'asd12' 'asd123' This is going to be used in combination with the solution to another question I've asked here. The sorting function in itself works, what I need is a function that can say that that '19asd' is smaller than '123asd'. I'm writing this in JavaScript.

    Read the article

  • Get countries within range of LAT/LONG coordinates

    - by ptrn
    Trouble! I'm looking for a way to find the countries within a given range of LAT/LONG coordinates. E.g.: When viewing a place in Africa in Google Maps, I get out which countries that are in my current view. This is a bit ambitious, and I think the main problem will be dealing with accuracy of the needed polygons. The accuracy of these don't need to be all that great, the borders can probably be tens of miles off, or even more. This will be needed for the entire world.

    Read the article

  • natural sort of text and numbers, JavaScript

    - by ptrn
    I'm looking for the easiest way to sort an array that consists of numbers and text, and a combination of these. E.g. '123asd' '19asd' '12345asd' 'asd123' 'asd12' turns into '19asd' '123asd' '12345asd' 'asd12' 'asd123' This is going to be used in combination with the solution to another question I've asked here. The sorting function in itself works, what I need is a function that can say that that '19asd' is smaller than '123asd'. I'm writing this in JavaScript. Edit: as adormitu pointed out, what I'm looking for is a function for natural sorting

    Read the article

  • should I use LaTeX and why (not)?

    - by ptrn
    I'm a student, and just finished this last semester. This summer I will be working on a project that will require a lot of documentation and reports, and I'm shivering every time I think of styling in either Word or OpenOffice. I've been wanting to learn LaTeX for a while, but I can't help but think; is it worth it? Does anyone actually use it except for academics? Is it worth taking the time it takes to learn to use it efficiently? What are the pros and cons?

    Read the article

1