Search Results

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

Page 159/269 | < Previous Page | 155 156 157 158 159 160 161 162 163 164 165 166  | Next Page >

  • Using the stadard Java logging, is it possible to restart logs after a certain period?

    - by Fry
    I have some java code that will be running as an importer for data for a much larger project. The initial logging code was done with the java.util.logging classes, so I'd like to keep it if possible, but it seems to be a little inadequate now given he amount of data passing through the importer. Often times in the system, the importer will get data that the main system doesn't have information for or doesn't match the system's data so it is ignored but a message is written to the log about what information was dropped and why it wasn't imported. The problem is that this tends to grow in size very quickly, so we'd like to be able to start a fresh log daily or weekly. Does anybody have an idea if this can be done in the logging classes or would I have to switch to log4j or custom? Thanks for any help!

    Read the article

  • How to simplify this Xpath expression ?

    - by Stephan
    Hi , I have the following XML code : <root> <a><l_desc/></a> <b><l_desc>foo</l_desc></b> <c><l_desc>bar</l_desc></c> </root> I want to match the l_desc nodes with a or b nodes as parent. For now, i use this xpath expression : //a/l_desc/.. | //b/l_desc/.. I would prefer writing something like this : //(a|b)/l_desc/.. Unfortunately, this expression is invalid. Do you have any idea for reducing the first expression ? Stéphan

    Read the article

  • Is there a way in PHP to check if a directory is a symlink?

    - by tixrus
    The title says it all. I have symlinks to certain directories because the directories' names have non English characters that I got fed up trying to get apache's rewrite rules to match. There's a bounty on that question http://stackoverflow.com/questions/2916194/trouble-with-utf-8-chars-apache2-rewrite-rulesif anyone wants to go for it, and from the looks of things a lot of people would like to see a general solution to this problem, but meanwhile I made a plain ascii symlink to each of these offending directories. Now the rewrite rules are back to just alpha and _ and - and my security concerns are less and it loads the resources I want. But I still need the actual target directory name for display purposes. I googled "PHP directory info, PHP symlink" but didn't find anything. I need to do something like this: if (is_symlink($myResDirName)) { $realDirName = follow_symlink($myResDirName); }

    Read the article

  • How to check if a Statistics is auto-created in a SQL Server 2000 DB using T-SQL?

    - by The Shaper
    Hi all. A while back I had to come up with a way to clean up all indexes and user-created statistics from some tables in a SQL Server 2005 database. After a few attempts it worked, but now I gotta have it working in SQL Server 2000 databases as well. For SQL Server 2005, I used SELECT Name FROM sys.stats WHERE object_id = object_id(@tableName) AND auto_created = 0 to fetch Statistics that were user-created. However, SQL 2000 doesn't have a sys.stats table. I managed to fetch the indexes and statistics in a distinguishable way from the sysindexes table, but I just couldn't figure out what the sys.stats.auto_created match is for SQL 2000. Any pointers? BTW: T-SQL please.

    Read the article

  • WCF error service error message with shared classes

    - by sevenalive
    Source code: http://code.google.com/p/sevenupdate/source/browse/#hg/Source/SevenUpdate.Base SevenUpdate.Base.Sui cannot be used since it does not match imported DataContract. Need to exclude this type from referenced types. Now I tried unchecking reuse reference types and I was able to get my project to compile. but when sending a collection from the client it was never received or couldn't be deserialized on the server end. I really need this to work. Any help would be appreciated, the fullsource code is provided by google code.

    Read the article

  • Reading Character from Image

    - by Chinjoo
    I am working on an application which requires matching of numbers from a scanned image file to database entry and update the database with the match result. Say I have image- employee1.jpg. This image will have two two handwritten entries - Employee number and the amount to be paid to the employee. I have to read the employee number from the image and query the database for the that number, update the employee with the amount to be paid as got from the image. Both the employee number and amount to be paid are written inside two boxes at a specified place on the image. Is there any way to automate this. Basically I want a solution in .net using c#. I know this can be done using artificial neural networks. Any ideas would be much appreciated.

    Read the article

  • Excel Matching problem with logic expression

    - by abelenky
    (I understand Excel is only borderline programming) I have a block of data that represents the steps in a process and the possible errors: ProcessStep Status FeesPaid OK FormRecvd OK RoleAssigned OK CheckedIn Not Checked In. ReadyToStart Not Ready for Start I want to find the first Status that is not "OK". I have attempted this: =Match("<>""OK""", StatusRange, 0) which is supposed to return the index of the first element in the range that is NOT-EQUAL (<) to "OK" But this doesn't work, instead returning #N/A. I expect it to return 4 (index #4, in a 1-based index, representing that CheckedIn is the first non-OK element) Any ideas how to do this?

    Read the article

  • How do I use a ListProperty(users.user) in a djangoforms.ModelForm on Google AppEngine?

    - by Gabriel
    I have been looking around a bit for info on how to do this. Essentially I have a Model: class SharableUserAsset(db.Model): name = StringProperty() users = ListProperty(users.User) My questions are: What is the best way to associate users to this value where they are not authenticated, visa vi invite from contacts list etc.? Is there a reasonable way to present a list control easily in a djangoforms.ModelForm? Once a user logs in I want to be able to check if that user is in the list for any number of SharableUserAsset class "records", how do I do that? Does user evaluate as a match to an email address or is there a way to look up a valid user against an email address?

    Read the article

  • Unexpected { expected ( ?

    - by Luke
    Parse error: syntax error, unexpected '{', expecting '(' in /home/a7237281/public_html/include/session.php on line 313 this is the error i get, relating to this code //check the emails $field = "email"; //Use field name for email $field2 = "email2"; if(!$subemail || strlen($subemail = trim($subemail)) == 0) { $form->setError($field, "* Email not entered"); } else if { /* Check if valid email address */ $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$"; if(!eregi($regex,$subemail)) { $form->setError($field, "* Email invalid"); } else if ($subemail !== $subemail2) { $form->setError($field2, "* Emails does not match"); } $subemail = stripslashes($subemail); } /* Check if email is already in use */ else($database->emailTaken($subemail)) { $form->setError($field, "* Email address already in use"); } And its referring to the { after the first else if. I have edited with the entire piece of code, what could i do now?

    Read the article

  • ISBNdb Retrieving and Managing Info

    - by Pierre Sylvestre
    Given a set of databases how can one you get information on a book with given price first (which consist of the average of a hidden list of prices coming from different web site) and followed by an optional second option that shows the list of the different web site with their page? To take an example given a query for ISBN 9785554443331 - it returns "Chemistry the central science 11 edition" : new:$50 used good condition:$35 used poor condition:$20 If the return does not match with our product list an option to "click here to visit our partner" appears and which returns: Atextbook: $10 Btextbook: $10 Ctextbook: $9 Dtextbook: $8.50 I understand that the first search would be done simultaneous on the web and our database to determine whether or not we have the book and the web to get the average of the price of a given list of web site. Thank you in advance for the help

    Read the article

  • Permission denied - /tmp/.ruby_inline/Inline_ImageScience_cdab.c

    - by Ikaros
    I have a Ruby on Rails app that I've recently deployed to a remote server (Ubuntu 9.10, nginx, passenger, ruby-enterprise) and I'm getting the error (works fine locally): Permission denied - /var/www/project_name/tmp/.ruby_inline/Inline_ImageScience_cdab.c First, the folder /tmp/.ruby_inline/ is empty - should it be? Is it trying to create Inline_ImageScience_cdab.c or read it? I think I have all the required gems installed: 'gem list' shows image_science and RubyInline installed. libfreeimage3 and libfreeimage-dev are also installed. I've run chmod 755 on /tmp/.ruby_inline/ to match the permissions on surrounding folders but I cannot go any higher than that, however, or I get another error: /var/www/project_name/tmp/.ruby_inline is insecure (40777). It may not be group or world writable. Exiting. And I guess second, why am I getting this error? :) Thanks

    Read the article

  • Connecting PC via Bluetooth SNP

    - by Nicholas
    Hi, I have a widcomm example BluChat "WIDCOMM SDK RFComm Service" running on my PC with an USB dongle (BT-2400P). I would like to connect this chat from my HTC Desire. So I stared with the Java example http://developer.android.com/resources/samples/BluetoothChat/index.html. This is also using BT RFComm. If I'm using my HTC as a server it work's fine, but I would like to use my PC as a server. Then .connect() comes back with "Service Discovery Failure". I have modified the UUID string in the Java example to match the PC-application mmSocket = mmDevice.createRfcommSocketToServiceRecord(UUID.fromString("5fc2a42e-144e-4bb5-b43f-4e61711d1c32")); mmSocket.connect(); What is missing? Any help appreciated. Nicholas

    Read the article

  • How should I store an Java Enum in JavaDB?

    - by Jonas
    How should I store an Java Enum in JavaDB? Should I try to map the enums to SMALLINT and keep the values in source code only? The embedded database is only used by a single application. Or should I just store the values as DECIMAL? None of these solutions feels good/robust for me. Is there any better alternatives? Here is my enum: import java.math.BigDecimal; public enum Vat { NORMAL(new BigDecimal("0.25")), FOOD(new BigDecimal("0.12")), BOOKS(new BigDecimal("0.06")), NONE(new BigDecimal("0.00")); private final BigDecimal value; Vat(BigDecimal val) { value = val; } public BigDecimal getValue() { return value; } } I have read other similar questions on this topic, but the problem or solution doesn't match my problem. Enum storage in Database field, Best method to store Enum in Database, Best way to store enum values in database - String or Int

    Read the article

  • regex in textfield

    - by klox
    dear all..i have this code: <script> var str="KD-R435MUN2D"; var matches=str.match(/(EE|[EJU]).*(D)/i); if (matches) { var firstletter = matches [1]; var secondletter = matches [2]; var thirdletter = matches [3]; alert(firstletter + secondletter + thirdletter); }else{ alert (":("); } </script> i want it can control a textfield <input type="text" id="mod">..how must i do?

    Read the article

  • Jquery find next/prev elements of a certain class but not necessarily siblings

    - by Gnuffo1
    The next, prev, nextAll and prevAll methods are very useful, but not if the elements you are trying to find are not in the same parent element. What I want to do is something like this: <div><span id="click">hello</span></div> <div><p class="find">world></p></div> When the span with the id "click" is pressed, I want to match the next element with the class "find", which in this case is not a sibling of the clicked element so next or nextAll won't work.

    Read the article

  • Is there any .Net JIT Support from chip vendors?

    - by NoMoreZealots
    I know that ARM actually has some support for Java and SUN obviously, but I haven't really references seen any chip vendor supporting a .Net JIT compiler. I know IBM and Intel both support C compilers, as well as TI and many of the embedded chip vendors. When you think of it, all a JIT compiler is, is the last stages of compilation and optimization which you would think would be a good match for a chip vendor's expertize. Perhaps a standardized Plug In compilation engine for the VM would make sense. Microsoft is targeting .Net to embedded Windows platforms as well, so they are fair game. Pete

    Read the article

  • PHP Thumbnail image generator works, but consistently awaits 90% of its loadtime! Why?

    - by Sam
    Hi folks, This is the follow-up question from this general page load speed question. This question which will focus only, entirely and specifically on the thumbnail generator PHP code with the question: What's causing the 97% delays on these tiny thumbnails? Measuring only 3 ~ 5 kb each, this is strange indeed! Even after 7 orso bounty-rounds and 100 upvotes, the images are still doing nothing for over 97% of the time. It works allright, but it could be so much faster! ZAM, my pet robot, was so annoyed by not knowing why, he just pulled out some cords! Silly metal box... (I have asked permission from the original author, to put temporarily segments of the code online that I think could be the problem, after which I will remove all code, except the several lines that were the direct cause of this issue here to match the answer. This will be the free opportunity to perfect/speedup his otherwise already to my opinion vert versatile and userfriendly thumbnail generator.)

    Read the article

  • Rails route, show all elements on the same page

    - by Igor Oliveira Antonio
    I need to show all my elements on the same page. In routes: namespace :nourishment do resources :diets do resources :nourishment_meals, :controller => 'meals' get 'nourishment_meals/show_all_meals' => 'meals#show_all_meals', as: "show_all_meals" end end which will generate: nourishment_diet_nourishment_meals_path GET /nourishment/diets/:diet_id/nourishment_meals(.:format) nourishment/meals#index POST /nourishment/diets/:diet_id/nourishment_meals(.:format) nourishment/meals#create new_nourishment_diet_nourishment_meal_path GET /nourishment/diets/:diet_id/nourishment_meals/new(.:format) nourishment/meals#new edit_nourishment_diet_nourishment_meal_path GET /nourishment/diets/:diet_id/nourishment_meals/:id/edit(.:format) nourishment/meals#edit nourishment_diet_nourishment_meal_path GET /nourishment/diets/:diet_id/nourishment_meals/:id(.:format) nourishment/meals#show PATCH /nourishment/diets/:diet_id/nourishment_meals/:id(.:format) nourishment/meals#update PUT /nourishment/diets/:diet_id/nourishment_meals/:id(.:format) nourishment/meals#update DELETE /nourishment/diets/:diet_id/nourishment_meals/:id(.:format) nourishment/meals#destroy [**THIS**] nourishment_diet_show_all_meals_path GET /nourishment/diets/:diet_id/nourishment_meals/show_all_meals(.:format) nourishment/meals#show_all_meals The problem, when I do this: <%= link_to "Show all meals", nourishment_diet_show_all_meals_path, :class=>"button green" %> This error raise: Problem: Document(s) not found for class NourishmentMeal with id(s) show_all. Summary: When calling NourishmentMeal.find with an id or array of ids, each parameter must match a document Can someone help me?

    Read the article

  • alt-tab sort of web design

    - by sureshgl
    I am thinking of designing a web site having multiple related services. For every action of the user in a service there will be some computation going on in each of the other services. I want to display the service in action (chosen by the user) in the middle of the page in enlarged mode and rest of the services as small sized (shrunk) versions around the enlarged mode. The services which are shown in the shrunk version, should actually show what is happening in that service, at run time as if that was the chosen service. A close match to this sort of behavior I know is in Reliance BigTV, where all the small images of all the channels will be going on, and we can choose the one that we want to watch. After choosing that one image will become big and occupy the screen. Please, let me know if I can do some thing like this using css, html, ajax & php.

    Read the article

  • Jetty RewriteHandler and RewriteRegexRule

    - by Justin
    I'm trying to rewrite a URL for a servlet. The URL gets rewritten correctly, but the context doesn't match after that. Any idea how to get this to work? RewriteHandler rewriteHandler = new RewriteHandler(); rewriteHandler.setRewriteRequestURI(true); rewriteHandler.setRewritePathInfo(true); rewriteHandler.setOriginalPathAttribute("requestedPath"); RewriteRegexRule rewriteRegexRule = new RewriteRegexRule(); rewriteRegexRule.setRegex("/r/([^/]*).*"); rewriteRegexRule.setReplacement("/r?z=$1"); rewriteHandler.addRule(rewriteRegexRule); ContextHandlerCollection contextHandlerCollection = new ContextHandlerCollection(); Context servletContext = new Context(contextHandlerCollection, "/"); servletContext.addServlet(new ServletHolder(new RedirectServlet()), "/r"); So basically /r/asdf gets rewritten to /r?z=asdf. However, the rewritten /r?z=asdf is now not processed by the servlet. Also, /r?z=asdf does work if called directly.

    Read the article

  • Git remove directory

    - by hrickards
    I've got a repository on GitHub (http://github.com/hrickards/PHP-Crypto) for a little project me and a couple of others are working on. My development environment is Aptana Studio, and I use the EGit plugin as Aptana is basically Eclipse underneath. Today the designer sent the HTML and CSS for the website with the images in a folder named img. Previously the images were in a folder called images. Thinking nothing of it and being too lazy to update the CSS and HTML, I simply kept the images in the img directory and commited to Git. However, the GitHub web interface shows both the img and images directories, with the images directory being empty. I've tried deleting the images directory with git rm -r images and git rm images, and even mkdir images; git add images; git rm -r images but whatever I try I get the same result: fatal: pathspec 'images' did not match any files. Has anyone got any advice on how to remove images, or am I misunderstanding Git or something?

    Read the article

  • php using wamp server start up error

    - by mathirengasamy
    i try to install moodle web software...i m using wamp server and sqlserver 2005 version. i install php driver for php5.3.0 thread safe version..i just paste that php_sqlsrv_ts.dll driver file into my php ext directory...i include this line extension=php_sqlsrv_ts.dll in my php.ini file... now i restart my wampserver...i m getting this error... PHP Startup: sqlsrv: Unable to initialize module Module compiled with module API=20060613 PHP compiled with module API=20090626 These options need to match get this error also in my apache log file ADODB Error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified please anybody help me..

    Read the article

  • Rewrite URL in IIS7 .NET MVC

    - by user135498
    Hi, I'm trying to rewrite the url: https://mydomain/phone-append to https://mydomain/Service/PhoneAppend using the following rule: <rewrite> <rules> <rule name="Phone Append"> <match url="phone-append" /> <action type="Rewrite" url="/Services/Index" appendQueryString="true" /> </rule> </rules> </rewrite> The rule works fine if the rewrite url is /Services but when I change it to /Services/PhoneAppend I get a page not found error. I've been pulling my hair out for a couple hours. Any ideas? Thanks, Chris

    Read the article

  • Basic Profanity Filter in Objective C for iPhone

    - by David van Dugteren
    How have you like minded individuals tackled the basic challenge of filtering profanity, obviously one can't possibly tackle every scenario but it would be nice to have one at the most basic level as a first line of defense. In Obj-c I've got NSString *tokens = [text componentsSeparatedByString:@" "]; And then I loop through each token to see if any of the keywords (I've got about 400 in a list) are found within each token. Realising False positives are also a problem, if the word is a perfect match, its flagged as profanity otherwise if more than 3 words with profanity are found without being perfect matches it is also flagged as profanity. Later on I will use a webservice that tackles the problem more precisely, but I really just need something basic. So if you wrote the word penis it would go yup naughty naughty, bad word written.

    Read the article

  • Funny characters in my db

    - by hdx
    My web app is breaking when I try edit a certain content type and I'm pretty sure it is because of some weird characters in my database. So when I do: SELECT body FROM message WHERE id = 666 it returns: <p>⢠<span></span></p><p><br /></p><p><em><strong>NOTE:</strong> Please remember to use your to participate in the discussion.</em></p> However when I try to count how many documents have those characters postgres complains: foo_450_prod=# SELECT COUNT(*) FROM message WHERE body LIKE'%â¢%'; ERROR: invalid byte sequence for encoding "UTF8": 0xe2a225 HINT: This error can also happen if the byte sequence does not match the encodi Does anybody know what the issue is and how I can query for those funny characters? Thanks in advance!

    Read the article

< Previous Page | 155 156 157 158 159 160 161 162 163 164 165 166  | Next Page >