Search Results

Search found 6715 results on 269 pages for 'preg match'.

Page 168/269 | < Previous Page | 164 165 166 167 168 169 170 171 172 173 174 175  | Next Page >

  • Including a Django app's url.py is resulting in a 404

    - by 828
    I have the following code in the urls.py in mysite project. /mysite/urls.py from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^gallery/$', include('mysite.gallery.urls')), ) This results in a 404 page when I try to access a url set in gallery/urls.py. /mysite/gallery/urls.py from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^gallery/browse/$', 'mysite.gallery.views.browse'), (r'^gallery/photo/$', 'mysite.gallery.views.photo'), ) 404 error Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^gallery/$ The current URL, gallery/browse/, didn't match any of these. Also, the site is hosted on a media temple (dv) server and using mod_wsgi

    Read the article

  • Refining Solr searches, getting exact matches?

    - by thebluefox
    Afternoon chaps, Right, I'm constructing a fairly complex (to me anyway) search system for a website using Solr, although this question is quite simple I think... I have two search criteria, location and type. I want to return results that are exact matches to type (letter to letter, no exceptions), and like location. My current search query is as follows ../select/?q=location:N1 type:blue&rows=100&fl=*,score&debugQuery=true This firstly returns all the type blue's that match N1, but then returns any type that matches N1, which is opposite to what I'm after. Both fields are set as textgen in the Solr schema. Any pointers? Cheers gang

    Read the article

  • Testing file uploading and downloading speed using FTP

    - by Toman
    Hi all, I am working in a desktop application using java. In my application i have to perform a speed test which will show the file uploading and downloading speed. For uploading test i am uploading a small test file to a FTP server and based on time taken i am calculating the file upload speed. similarly i am downloading a test file form server and calculating download speed. But result i am getting doesn't match with actual FTP file uploading and downloading speed.it seems that the establishing connection to FTP server is increasing the time, hence the resultant speed i am calculating is less. Could you suggest any link or some way to get nearest uploading and downloading speed. i thanks to all your valuable suggestion.

    Read the article

  • __doPostBack is undefined on DotNetNuke website for IE 10

    - by nick
    I have a DotNetNuke site, and today a customer called in and said it wasn't working on IE 10. Specifically the login and register links weren't working, but they do in compatibility mode. I took a look on our test windows 8 machine and saw that it was failing because __doPostBack was undefined. I've been searching for a fix for the last 6ish hours, and what I've been able to find is that apparently the IE10 user agent is covered in the ie.browser file and that I should install this hotfix and reboot the server. That didn't work. I haven't noticed any changes, even though I think the new ie.browser file should match the new user agent. What other steps can I take to fix the problem? Note: the server is running .NET 3.5 with service pack 1 on Windows server 2003. The site is running DotNetNuke 05.06.02. Any suggestions would be greatly appreciated.

    Read the article

  • what this `^` mean here in solr

    - by Rahul Mehta
    I am confuse her but i want to clear my doubt. I think it is stupid question but i want to know. Use a TokenFilter that outputs two tokens (one original and one lowercased) for each input token. For queries, the client would need to expand any search terms containing upper case characters to two terms, one lowercased and one original. The original search term may be given a boost, although it may not be necessary given that a match on both terms will produce a higher score. text:NeXT ==> (text:NeXT^10 OR text:next) what this ^ mean here . http://wiki.apache.org/solr/SolrRelevancyCookbook#Relevancy_and_Case_Matching

    Read the article

  • adodb .FIND question

    - by every_answer_gets_a_point
    i am using excel to connect to a mysql database i am doing this: rs.Find "rowid='105'" If Not rs.EOF Then cn.Execute "delete from batchinfo where rowid='105'" and it works well however, i need to be able to match data on multiple columns for example like this: rs. find "rowid='105'" and "something='sometext'" and "somethingelse='moretext'" i need to know whether or not rs.find matched ALL of the data. how can i do this? according to this i can't: http://articles.techrepublic.com.com/5100-10878_11-1045830.html# however perhaps there's a way i can rs.execute "some select statement" can someone help with this? would this do the trick for me and then i would check EOF: rs.Filter "LastName='Adams' and FirstName='Lamont'"

    Read the article

  • jQuery AJAX & Multiple sp Result Sets

    - by Kevin
    Is it possible to use a stored procedure that returns multiple result sets in json format and process them as part of one request using ajax calls in jquery? In other words, I have a stored procedure that returns several result sets that are to be used with a series of select boxes that are all being filtered by the same criteria. If any of the select boxes is chosen that value is then passed to the stored procedure and all the subsequent select box updates reflect only results that match the filtered criteria. I don't want to have to call the same sp multiple times to process the results and was trying not to create multiple queries, so I'm wondering if it's possible to store more than one json result in a single request and then store and process them on the client side.

    Read the article

  • How to generate msdn documentation from javascript? preferably using sandcastle

    - by melaos
    hi is there a tool that i can use to generated msdn type documentation? i recently just started playing with sandcastle and i found that there used to a tool called scriptdoc but it has been absorbed into aptana and i don't really want to use aptana studio. what i could find so far is jsdoc which is a perl script which extracts comments from javascript files but i'm still looking for a better fit. from my initial testing it seems that the xml generated from jsdoc doesn't match completed with sandcastle or maybe i'm missing something there... any help?

    Read the article

  • LuaInterface - how to register overloaded methods?

    - by JeffreySadeli
    Hello world! I'm trying to integrate Lua to my C# app when I hit a little snag. I was hoping someone with more expertise could help point me to the right direction. Let's say I have the following C# methods: public void MyMethod(int foo) { ... } public void MyMethod(int foo, int bar) { ... } I would like to register it to my Lua script environment so that I can do something like this: -- call method with one param MyMethod(123) -- call method with two params MyMethod(123, 456) I tried RegisterFunction("MyMethod", this, this.GetType().GetMethod("MyMethod")) but it reasonably complains about ambiguous match. Any ideas?

    Read the article

  • About Googe map

    - by vishal
    Hello everyone I am PHP Developer and developing website .in that i used Google map with the facility of select state and city. for select state and city i put two drop down.so now my problem is when i select state then i can not get value of city and both time whenever use select state and city i refresh the page and so after refreshing the page the value i got is incorrect and does not match the state with city... i clarify again Step 1:- select state (here page will refresh and then i will get value) Step 2:- select city (here also will refresh and then i will get value)) problem :- on the base getting state id and city id i fire the query but result will unknown b'cz city id that does not in selected state actually that city is there

    Read the article

  • Why does my regex fail when the number ends in 0?

    - by Russell C.
    This is a really basic regex question but since I can't seem to figure out why the match is failing in certain circumstances I figured I'd post it to see if anyone else can point out what I'm missing. I'm trying to pull out the 2 sets of digits from strings of the form: 12309123098_102938120938120938 1321312_103810312032123 123123123_10983094854905490 38293827_1293120938129308 I'm using the following code to process each string: if($string && $string =~ /^(\d)+_(\d)+$/) { if(IsInteger($1) && IsInteger($2)) { print "success ('$1','$2')"; } else { print "fail"; } } Where the IsInterger() function is as follows: sub IsInteger { my $integer = shift; if($integer && $integer =~ /^\d+$/) { return 1; } return; } This function seems to work most of the time but fails on the following for some reason: 1287123437_1268098784380 1287123437_1267589971660 Any ideas on why these fail while others succeed? Thanks in advance for your help!

    Read the article

  • Trouble assigning a tr1::shared_ptr

    - by Max
    I've got a class that has a tr1::shared_ptr as a member, like so: class Foo { std::tr1::shared_ptr<TCODBsp> bsp; void Bar(); } In member function Bar, I try to assign it like this: bsp = newTCODBsp(x,y,w,h); g++ then gives me this error no match for ‘operator=’ in ‘((yarl::mapGen::MapGenerator*)this)->yarl::mapGen::MapGenerator::bsp = (operator new(40u), (<statement>, ((TCODBsp*)<anonymous>)))’ /usr/include/c++/4.4/tr1/shared_ptr.h:834: note: candidates are: std::tr1::shared_ptr<TCODBsp>& std::tr1::shared_ptr<TCODBsp>::operator=(const std::tr1::shared_ptr<TCODBsp>&) in my code, Foo is actually yarl::mapGen::MapGenerator. What am I doing wrong?

    Read the article

  • Callback for When jqGrid Finishes Reloading?

    - by James
    Hi, I am using the jqGrid plug-in and at one point I need to refresh the grid and set the selected row to match the record that I am showing in detail on another section of the page. I have the following code but it does not work: $("#AllActions").trigger("reloadGrid").setSelection(selectedRow); The selectedRow parameter comes from an event handler that gets called when the data is changed and the grid needs to be updated. I'm pretty sure that the problem is that the grid is not loaded when the selection is being set, because if I put a call to alert() between the calls to trigger() and setSelection(), it works. I would be grateful for any advice. [Edit]Looks like http://stackoverflow.com/questions/2529581/jqgrids-setselect-does-not-work-after-reloadgrid is related but did not get resolved.[/Edit]

    Read the article

  • Extract anything that looks like links from large amount of data in python

    - by Riz
    Hi, I have around 5 GB of html data which I want to process to find links to a set of websites and perform some additional filtering. Right now I use simple regexp for each site and iterate over them, searching for matches. In my case links can be outside of "a" tags and be not well formed in many ways(like "\n" in the middle of link) so I try to grab as much "links" as I can and check them later in other scripts(so no BeatifulSoup\lxml\etc). The problem is that my script is pretty slow, so I am thinking about any ways to speed it up. I am writing a set of test to check different approaches, but hope to get some advices :) Right now I am thinking about getting all links without filtering first(maybe using C module or standalone app, which doesn't use regexp but simple search to get start and end of every link) and then using regexp to match ones I need.

    Read the article

  • Rename files to increment filenumber using PowerShell?

    - by Frode Lillerud
    Hi, I've got a bunch of files named attachment.023940 attachment.024039 attachment.024041 attachment.024103 etc... I need to rename the files by incrementing the filenumber by a given number. (So that they match the right ID in a database) I guess I could write a C# application that uses RegEx to parse the filename, but I assume this is a task that could be accomplished in PowerShell as well? I've found several other threads on SO about using PowerShell to rename files, but none of them handled incrementing a filenumber. I'm on Win7, so PowerShell 2.0 is available.

    Read the article

  • Get ANSI-colored output from external command

    - by German Rumm
    I am writing a small script for watchr that runs my PHP unit tests. Current script runs tests using system() and displays them colored. I am trying to add libnotify functionality, but for that I need to parse the output and match against regexp, so that notification will either display green or red. system() doesn't return output, %x does return, but puts p doesn't display colors, which I need to quickly see which test failed. One option would be to run tests twice - once for display in terminal window, and second time for checking which notification to show, but I would rather avoid it.

    Read the article

  • Rails: Routing to a different controller based on request format

    - by Jimmy Cuadra
    I'm writing an app where I want all requests for HTML to be handled by the same controller action. I have some other routes that are JSON-specific. Here's what my routes look like: Blog::Application.routes.draw do constraints format: :json do resources :posts end match "(*path)" => "web#index" end The problem is that constraints is being interpreted as "this route only works with the specified format" rather than "skip this route and try the next one if the request is not in the specified format." In other words, navigating to /posts in the browser gives me a 406 Not Acceptable because the URL is constrained to the JSON format. Instead, I want it to fall through to web#index if the request is for HTML, and hit the resourceful route if the request is for JSON. How can this be achieved? (Using Rails 3.2.9.)

    Read the article

  • Select distinct... in fulltext search

    - by lam3r4370
    <?php session_start(); $user =$_GET['user']; $conn = mysql_connect("localhost","...","..."); mysql_select_db("..."); $sql= "SELECT filter FROM userfilter WHERE user='$user'"; $mksql = mysql_query($sql); while($row =mysql_fetch_assoc($mksql)) { $filter=$row['filter']; $sql2 = "SELECT DISTINCT * FROM rss WHERE MATCH(content,title) AGAINST ('$filter')"; $mksql2 = mysql_query($sql2) or die(mysql_error()); while($rows=mysql_fetch_assoc($mksql2)) { echo ..... } ?> If I have two rows content that contains the $filter ,it outputs me that content but it's repeating. For example: title|content asd |This is a sample content ,number one das |This is a sample content ,number two .... And if my keywords are "sample" and "number" ,it outputs me twice the title and the content.How to prevent that?

    Read the article

  • How do I model a has_many :through and with aggregation in Rails?

    - by Angela
    How do I model having multiple Addresses for a Company and assign a single Address to a Contact? Contacts belong_to a Company. A Company has_many Contacts. A Company also has_many Addresses. And each Contact belongs_to an Address. How do I model this? I have Model/Contacts.rb belong_to :Company belong_to :Address (?) Model/Company.rb has_many :Contacts has_many :Addresses Address is an aggregation of :street1, :street2, :city, :state, :zip so not clear exactly what to do there. So what would I do in my _form so that when I have a contact/new I am able to either default to a main address or select one of the others? If none of them match, adding for a Contact makes that address available to any subsequent contact?

    Read the article

  • Conditional Batch file renaming with mysql data

    - by Paul Stevens
    Hello, I wonder if anyone knows how could I rename multiple files, all of them originally named with same structure, and add some data extracted from a mysql DB according to specifics rules. For example I have 500 files named with this vars: ID NAME ADDRESS PHONE.wav = 1234567 PAULSIMON WESTDR122 9942213456.wav Now I need to rename files taking some data from the databases for each file, and append the data from a query appended to the filename. For example add the data resulting from a query Where some conditions match, and the data to build the query is taked from original file name, as ID or NAME. i other words, lets say that I want to build a query taking ID & NAME from file 1234567 PAULSIMON WESTDR123 9942213456.wav as WHERE statements to take another value as BirthDATE and add this to new filename, so final result should be: ID NAME ADDRESS PHONE BIRTHDATE.wav I will appreciate any help on this. I need this to be done on a LINUX server.

    Read the article

  • Creating an OpenID provider with DotNetOpenAuth

    - by user1652616
    I'm trying to implement an OpenID provider with DotNetOpenAuth. I supply an OpenID url, and the consumer discovers my endpoint. I log into my provider, and the provider returns a Claimed Identifier and a Local Identifier to the consumer. But the consumer response has the following exception: The OpenID Provider issued an assertion for an Identifier whose discovery information did not match. Assertion endpoint info: ClaimedIdentifier: http://localhost/OpenIDUser.aspx/myuser ProviderLocalIdentifier: http://localhost/OpenIDUser.aspx/myuser ProviderEndpoint: http://localhost/OpenIDAuth.aspx OpenID version: 2.0 Service Type URIs: Discovered endpoint info: [] http://localhost/OpenIDAuth.aspx is my endpoint. http://localhost/OpenIDUser.aspx/myuser is my user identifier url, and I can browse to it successfully. It has a link to the endpoint in the header as follows: <link rel="openid.server" href="http://localhost/OpenIDAuth.aspx"></link> No matter what I try, the "Discovered endpoint info: []" part of the exception is always an empty array. Can anyone please help?

    Read the article

  • Algorithm design: can you provide a solution to the multiple knapsack problem?

    - by MalcomTucker
    I am looking for a pseudo-code solution to what is effectively the Multiple Knapsack Problem (optimisation statement is halfway down the page). I think this problem is NP Complete so the solution doesn't need to be optimal, rather if it is fairly efficient and easily implemented that would be good. The problem is this: I have many work items, with each taking a different (but fixed and known) amount of time to complete. I need to divide these work items into groups so as to have the smallest number of groups (ideally), with each group of work items taking no longer than a given total threshold - say 1 hour. I am flexible about the threshold - it doesnt need to be rigidly applied, though should be close. My idea was to allocate work items into bins where each bin represents 90% of the threshold, 80%, 70% and so on. I could then match items that take 90% to those that take 10%, and so on. Any better ideas?

    Read the article

  • PHP: creating a smooth edged circle, image or font?

    - by Chad Whitaker
    I'm making a PHP image script that will create circles at a given radius. I used: <?php imagefilledellipse ( $image, $cx, $cy, $w, $h, $color ); ?> but hate the rough edges it produces. So I was thinking of making or using a circle font that I will output using: <?php imagettftext ( $image, $size, $angle, $x, $y, $color, 'fontfile.ttf', $text ); ?> So that the font will produce a circle that has a smooth edge. My problem is making the "font size" match the "radius size". Any ideas? Or maybe a PHP class that will produce a smooth edge on a circle would be great! Thank you.

    Read the article

  • Java: calculate linenumber from charwise position according to the number of "\n"

    - by HH
    I know charwise positions of matches like 1 3 7 8. I need to know their corresponding line number. Example: file.txt Match: X Mathes: 1 3 7 8. Want: 1 2 4 4 $ cat file.txt X2 X 4 56XX [Added: does not notice many linewise matches, there is probably easier way to do it with stacks] $ java testt 1 2 4 $ cat testt.java import java.io.*; import java.util.*; public class testt { public static String data ="X2\nX\n4\n56XX"; public static String[] ar = data.split("\n"); public static void main(String[] args){ HashSet<Integer> hs = new HashSet<Integer>(); Integer numb = 1; for(String s : ar){ if(s.contains("X")){ hs.add(numb); numb++; }else{ numb++; } } for (Integer i : hs){ System.out.println(i); } } }

    Read the article

< Previous Page | 164 165 166 167 168 169 170 171 172 173 174 175  | Next Page >