Daily Archives

Articles indexed Wednesday May 12 2010

Page 12/121 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • What does Error 3112 indicate when compacting an MDB file?

    - by Craig Johnston
    What does Error 3112 indicate when compacting an MDB file? The Error description is "Records can't be read; no read permission on 'xyz123.mdb'" There is a known issue with the Compact function on some versions of Access MDBs. Is the solution in this case to run the Microsoft utility JETCOMP.EXE on this file? What are the other possible causes of this error?

    Read the article

  • Should a Trim method generally in the Data Access Layer or with in the Domain Layer?

    - by jpierson
    I'm dealing with a database that contains data with inconsistencies such as white leading and trailing white space. In general I see a lot of developers practice defensive coding by trimming almost all strings that come from the database that may have been entered by a user at some point. In my oppinoin it is better to do such formating before data is persisted so that it is done only once and then the data can be in a consistent and reliable state. Unfortunatley this is not the case however which leads me to the next best solution, using a Trim method. If I trim all data as part of my data access layer then I don't have to concern myself with defensive trimming within the business objects of my domain layer. If I instead put the trimming responsibility in my business objects, such as with set accessors of my C# properties, I should get the same net results however the trim will be operating on all values assigned to my business objects properties not just the ones that come from the inconsistent database. I guess as a somewhat philisophical question that may determine the answer I could ask "Should the domain later be responsible for defensive/coercive formatting of data?" Would it make sense to have a set accessor for a PhoneNumber property on a business object accept a unformatted or formatted string and then attempt to format it as required or should this responsibility be pushed to the presentation and data access layers leaving the domain layer more strict in the type of data that it will accept? I think this may be the more fundamental question. Update: Below are a few links that I thought I should share about the topic of data cleansing. Information service patterns, Part 3: Data cleansing pattern LINQ to SQL - Format a string before saving? How to trim values using Linq to Sql?

    Read the article

  • How to replace "(" with "\(" in the regexp, Emacs/elisp flavor?

    - by polyglot
    Question as title. More specifically, I'm rather tired of having to type \(, etc. every time I want a parenthesis in Emacs's (interactive) regexp functions (not to mention the \\( in code). So I wrote something like (defadvice query-replace-regexp (before my-query-replace-regexp activate) (ad-set-arg 0 (replace-regexp-in-string "(" "\\\\(" (ad-get-arg 0))) (ad-set-arg 0 (replace-regexp-in-string ")" "\\\\)" (ad-get-arg 0))))) in hope that I can conveniently forget about emacs's idiosyncrasy in regexp during "interaction mode". Except I cannot get the regexp right... (replace-regexp-in-string "(" "\\\\(" "(abc") gives \\(abc instead of the wanted \(abc. Other variations on the number of slashes just gives errors. Thoughts? Since I started questioning, might as well ask another one: since lisp code is not supposed to use interactive functions, advicing query-replace-regexp should be okay, am I correct?

    Read the article

  • A dynamic array of a class, inside another separate class?

    - by pinnacler
    I'm working on a robot localization simulator and I created a class called "landmark". The end result is going to be a robot that is always centered and always faces the top of the screen. As it turns, the birds eye view map will rotate around the robot. To accomplish this, I'm assuming I can rotate one class and have all elements inside rotate as well. So, the landmark class has properties x,y, label, and radius. This is suppose to simulate a tree location in a forest. To test everything, I need "forest data," and I wrote a script to generate 100 trees in a 100m x 100m area. The script automatically generates values within an acceptable range for x,y, radius. The generated data is stored in an object called tempForest and is 100x3. Ideally, I want to create a class called "landmarks" (plural) that has 100 landmark instances inside. How would I instantiate 100 instances of landmark in one instance of landmarks using that randomly generated data? Ideally, I'd just type treeBeacons = landmarks(); and it would randomly populate 100 (user definable, set in config file) instances with x, y, radius data. I'm not sure how to deal with a dynamic array of class "Landmark", inside another single class "landmarks." Any ideas?

    Read the article

  • Find location using only distance and range?

    - by pinnacler
    Triangulation works by checking your angle to three KNOWN targets. "I know the that's the Lighthouse of Alexandria, it's located here (X,Y) on a map, and it's to my right at 90 degrees." Repeat 2 more times for different targets and angles. Trilateration works by checking your distance from three KNOWN targets. "I know the that's the Lighthouse of Alexandria, it's located here (X,Y) on a map, and I'm 100 meters away from that." Repeat 2 more times for different targets and ranges. But both of those methods rely on knowing WHAT you're looking at. Say you're in a forest and you can't differentiate between trees, but you know where key trees are. These trees have been hand picked as "landmarks." You have a robot moving through that forest slowly. Do you know of any ways to determine location based solely off of angle and range, exploiting geometry between landmarks? Note, you will see other trees as well, so you won't know which trees are key trees. Ignore the fact that a target may be occluded. Our pre-algorithm takes care of that. 1) If this exists, what's it called? I can't find anything. 2) What do you think the odds are of having two identical location 'hits?' I imagine it's fairly rare. 3) If there are two identical location 'hits,' how can I determine my exact location after I move the robot next. (I assume the chances of having 2 occurrences of EXACT angles in a row, after I reposition the robot, would be statistically impossible, barring a forest growing in rows like corn). Would I just calculate the position again and hope for the best? Or would I somehow incorporate my previous position estimate into my next guess? If this exists, I'd like to read about it, and if not, develop it as a side project. I just don't have time to reinvent the wheel right now, nor have the time to implement this from scratch. So if it doesn't exist, I'll have to figure out another way to localize the robot since that's not the aim of this research, if it does, lets hope it's semi-easy.

    Read the article

  • Sending mail with a Php with a pdf attachment

    - by Jake
    Hi, I'm trying to send an email from the php mail command. I've been able to what I've tried so far, but can't seem to get it to work with an attachment. I've looked around the web and the best code I've found led me to this: $fileatt_name = 'JuneFlyer.pdf'; $fileatt_type = 'application/pdf'; $fileatt = 'JuneFlyer.pdf'; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); $data = chunk_split(base64_encode($data)); $MAEmail = "[email protected]"; mail("$email_address", "$subject", "$message", "From: ".$MAEmail."\n". "MIME-Version: 1.0\n". "Content-type: text/html; charset=iso-8859-1". "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . "Content-Disposition: attachment;\n" . " filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" .$data. "\n\n" ); There are two problems when I do this. First, the contents of the email dissappear. Second, there is an error on the attachment. "Adobe Reader could not open June_flyer.pdf because it is either not a supported file type or because the file has been damaged (for example it was sent as an email attachment and wasn't correctly decoded)" Any ideas of how to deal with this? Thanks, JB

    Read the article

  • How do you reach a "flow" state while programming?

    - by acrosman
    I'm not talking about program flow, but as in the state of working called flow, the state where you can get great work done the most effectively. I find that my current work environment while good in many ways does not allow me to get into a good state of mind for writing code most of the time (my job includes many other functions). If it's critical to get something done I'll often put on head-phones with classical music and try to drown out the office noise around me (and discourage co-workings from asking me questions). I am best able to get work done late in the evening when the house is quite and I've been thinking about the project for most of the day. What tricks have you found when working in less then perfect office environments?

    Read the article

  • Recent remote desktop connection sources

    - by altendky
    How can I identify the source of recent remote desktop connections to my computer? While at work I connected to my desktop there (XP SP3) from another system with files I want to access. I am now at home and connected to my desktop at work but I do not know the name of the other system there.

    Read the article

  • Adobe AIR & PHP + MySQL

    - by Cudos
    Hello. I am looking for a possibility to run a PHP + MySQL solution on a desktop. Can Adobe AIR accomplish that for me? Will the setup be able to access the COM port of the computer?

    Read the article

  • Performance of looping over an Unboxed array in Haskell

    - by Joey Adams
    First of all, it's great. However, I came across a situation where my benchmarks turned up weird results. I am new to Haskell, and this is first time I've gotten my hands dirty with mutable arrays and Monads. The code below is based on this example. I wrote a generic monadic for function that takes numbers and a step function rather than a range (like forM_ does). I compared using my generic for function (Loop A) against embedding an equivalent recursive function (Loop B). Having Loop A is noticeably faster than having Loop B. Weirder, having both Loop A and B together is faster than having Loop B by itself (but slightly slower than Loop A by itself). Some possible explanations I can think of for the discrepancies. Note that these are just guesses: Something I haven't learned yet about how Haskell extracts results from monadic functions. Loop B faults the array in a less cache efficient manner than Loop A. Why? I made a dumb mistake; Loop A and Loop B are actually different. Note that in all 3 cases of having either or both Loop A and Loop B, the program produces the same output. Here is the code. I tested it with ghc -O2 for.hs using GHC version 6.10.4 . import Control.Monad import Control.Monad.ST import Data.Array.IArray import Data.Array.MArray import Data.Array.ST import Data.Array.Unboxed for :: (Num a, Ord a, Monad m) => a -> a -> (a -> a) -> (a -> m b) -> m () for start end step f = loop start where loop i | i <= end = do f i loop (step i) | otherwise = return () primesToNA :: Int -> UArray Int Bool primesToNA n = runSTUArray $ do a <- newArray (2,n) True :: ST s (STUArray s Int Bool) let sr = floor . (sqrt::Double->Double) . fromIntegral $ n+1 -- Loop A for 4 n (+ 2) $ \j -> writeArray a j False -- Loop B let f i | i <= n = do writeArray a i False f (i+2) | otherwise = return () in f 4 forM_ [3,5..sr] $ \i -> do si <- readArray a i when si $ forM_ [i*i,i*i+i+i..n] $ \j -> writeArray a j False return a primesTo :: Int -> [Int] primesTo n = [i | (i,p) <- assocs . primesToNA $ n, p] main = print $ primesTo 30000000

    Read the article

  • Java Archtecture Decision !!

    - by santiagobasulto
    Hi everybody! I'm developing a medium Java app, and i'm facing a small problem due to my lack of expirience. I've a custom DAO, which gets "Article" objects from the DataBase. I've the Article class, and the DAO has a method called getArticle(int id), this method returns an Article. The Article has a Category object, and i'm using lazy loading. So, when i request for an Article Category (Article a = new Article(); a.getCategory();) the Article class gets the Category from the DAO and then returns it. I'm now thinking to cache it, so when i request multiple times to an Article's category, the database is only queried one time. My question is: where should i put that cache? I can put it on the Article class (in the DTO), or i can put it on the DAO class. What do you say? Thanks!

    Read the article

  • Customising Web-logics default 404 error page

    - by Sean McDaid
    I am running weblogic 9. When I enter an incorrect URL below the application root I redirect 404 request to a customized error page. Eg. http://localhost:7001/myApp/non-existent redirects to my customised error page. Is there a way to do this for all incorrect URLs entered, not necessarily below the application root? Eg. http://localhost:7001/anything_non-existent should redirect to my customized error page, not the web-logic default one? Thanks

    Read the article

  • Integrating JSF with Spring

    - by Abel Morelos
    I haven't implemented any code, I'm still working the overall architecture for a new application and this going to be the first time I use JSF+Spring. I need to put web services in front of the Spring service beans (business logic tier) since these beans could be accessed by other applications besides the presentation tier. While defining the different layers or tiers for the application, I feel unsure about how to integrate JSF (the presentation tier) with Spring (the business tier in this application). I'm considering to define some sort of common tier or service tier in order to provide the glue code for JSF and Spring, but before that I want to hear from others what have they done or if they have used other frameworks to help with the glue code for this scenario (I already checked Spring MVC/Spring Faces, but I'm not sure if that's what I need since I'm thinking of this application more like JSF-centric than Spring-centric, but maybe you could help me about considering another approach). Thanks in advance.

    Read the article

  • Find location using only distance and bearing?

    - by pinnacler
    Triangulation works by checking your angle to three KNOWN targets. "I know the that's the Lighthouse of Alexandria, it's located here (X,Y) on a map, and it's to my right at 90 degrees." Repeat 2 more times for different targets and angles. Trilateration works by checking your distance from three KNOWN targets. "I know the that's the Lighthouse of Alexandria, it's located here (X,Y) on a map, and I'm 100 meters away from that." Repeat 2 more times for different targets and ranges. But both of those methods rely on knowing WHAT you're looking at. Say you're in a forest and you can't differentiate between trees, but you know where key trees are. These trees have been hand picked as "landmarks." You have a robot moving through that forest slowly. Do you know of any ways to determine location based solely off of angle and range, exploiting geometry between landmarks? Note, you will see other trees as well, so you won't know which trees are key trees. Ignore the fact that a target may be occluded. Our pre-algorithm takes care of that. 1) If this exists, what's it called? I can't find anything. 2) What do you think the odds are of having two identical location 'hits?' I imagine it's fairly rare. 3) If there are two identical location 'hits,' how can I determine my exact location after I move the robot next. (I assume the chances of having 2 occurrences of EXACT angles in a row, after I reposition the robot, would be statistically impossible, barring a forest growing in rows like corn). Would I just calculate the position again and hope for the best? Or would I somehow incorporate my previous position estimate into my next guess? If this exists, I'd like to read about it, and if not, develop it as a side project. I just don't have time to reinvent the wheel right now, nor have the time to implement this from scratch. So if it doesn't exist, I'll have to figure out another way to localize the robot since that's not the aim of this research, if it does, lets hope it's semi-easy.

    Read the article

  • New to web development - backend questions

    - by James
    I'm new to web development although I'm confident in the roadmap for the front-end. I need direction on two things: Basic architecture Back-end technologies For architecture, what do I need to get started? From what I know, its: Get a domain name registered (godaddy?) Find a web host ??? anything else? or start developing the site? I don't think its that easy, there must be something I'm missing, right? For the back-end technologies, I have application development experience with Java and Python, but how likely is it to find a back-end hosting site that supports these languages over PHP? Is PHP a better choice? If I stick with what I know for the back-end, am I sabotaging myself later on? If I need help, how is the market for a python/java developer vs. a php developer? What do I need to know about databases? I have some basic SQL experience. Do hosting sites have limitations on the type of databases or bandwidth I need to worry about? I'm working through some of the common sites: StackOverflow, Sitepoint forums, Google, etc...are there other resources I should use?

    Read the article

  • convert table of input values into 2D array or struct?

    - by Henry
    What's the easiest way to convert a table of values (2D grid like Excel), into a 2D array or struct in ColdFusion? Thought of using dot in the name and eval them to become struct, but AFAIK name attribute of input field can only contains alpha numeric and underscore, and first char must be an alpha char.

    Read the article

  • Facebook like box not working on mobile browser

    - by Kelend
    I'm writing a simple splash page for a client to hold a like box widget: <iframe src="http://www.facebook.com/plugins/likebox.php?id=***********&amp;width=238&amp;connections=4&amp;stream=false&amp;header=false&amp;height=200" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:238px; height:200px;" allowTransparency="true"></iframe> The page displays fine, with the like box, but when you click on the like it depresses without prompting the user to logon and does not update facebook. This behavior seems to be on mobile browsers only. On desktop browsers (ie8, firefox, safari) it works just fine. Anyone had this happen, and if so what was their solution?

    Read the article

  • where is HOME and END key for MacBook Pro?

    - by George2
    Hello everyone, I am using a MacBook Pro running Mac OS X 10.5. I am new to this development environment, and previously worked on Windows. I am wondering what is the HOME key (goes to the begin position of a line in text file) and END key (goes to the end position of a line in text file) on the Mac? My MacBook Pro seems to not have these two keys on the keyboard. thanks in advance, George

    Read the article

  • Intel® Core™2 Duo Desktop Processor vs Intel® Core™ i3 Desktop Processor?

    - by metal gear solid
    Intel® Core™2 Duo Desktop Processor vs Intel® Core™ i3 Desktop Processor? Which CPU is better to buy ? Intel® Core™ i3-530 Processor (4M Cache, 2.93 GHz) (it supports DDR3 also) or Intel® Core™2 Duo Processor E7500 (3M Cache, 2.93 GHz, 1066 MHz FSB) (it supports DDR2 only ) Although I do not play games on my PC but I need good performance in Adobe Photoshop, Watching Full HD Movies. I need good performance in Multitasking. Along with any of these CPU I would purchase 2 GB x 2 stick of RAM. and I will use Windows 7. and I will use Microsoft VPC images also with MS Virtual PC.

    Read the article

  • Deleting... dialog box stays on screen for over a minute when deleting one small file

    - by stacey.richards
    Every now and again I log into a Windows Server 2003 box with a remote desktop connection and delete one small file. When I do this, the Deleting... dialog box appears and remains on the screen for well over a minute. After the dialog box disappears, if I delete another small file, the Deleting... dialog box appears then disappears quickly. Why does it take so long to delete the first file after logging into a Windows Server 2003 box with a remote desktop connection? Is there a trick to speeding it up?

    Read the article

  • file_get_contents() returns "failed to open stream" when hitting HTTPS

    - by TMC
    file_get_contents() is returning "failed to open stream" when I call it on an HTTPS URL. Warning: file_get_contents(https://google.com) [function.file-get-contents]: failed to open stream: No error in E:\\htdocs\callback3.php on line 5 Same call will work with a non-SSL URL. At first, I thought it was a security issue with my webhoster, but I have verified with phpinfo() that allow url open is indeed allowed. I have also tried this code and verified it works: Anyone have any ideas why file_get_contents() is failing with an HTTPS URL? update: People correctly pointed out this was an HTTPS issue. My webhoster claims this should work, and has no idea how to resolve this. Anyone have specific directions I can give them for their IIS7 setup?

    Read the article

  • [jquery] e.which code for escape key

    - by Shishant
    I have two functions. When enter is pressed the functions runs correctly but when escape is pressed it doesn't. What's the correct number for the escape key? $(document).keypress(function(e) { if (e.which == 13) { $('.save').click(); } // enter (works as expected) if (e.which == 27) { $('.cancel').click(); } // esc (does not work) });

    Read the article

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