Daily Archives

Articles indexed Thursday January 13 2011

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

  • Need Help in PHP Regex

    - by amateurs
    I am studying about regex, i figured out some about matching one or more character, but i have a case, but don't know how to solve this.. For example i have: $data = "bla bla -start- blu blu blu -end- bla bla"; $pattern = "/\-start\-[\w]\-end\- /"; preg_match($pattern, $data, $matches); print_r($matches); i intend to take anything between '-start-' and '-end-', so i expect to get ' blu blu blu '. any suggestion ?

    Read the article

  • Need help finding a good curriculum/methodology for self-teaching to program from scratch

    - by BrotherGA2
    My friend and I have both dedicated ourselves to learning the essentials of programming by June of this year from nearly no programming experience. I have done some research and have come to the conclusion that using the Python language will be the best for us, but I am open to suggestions with good reasoning behind them. My motives for learning programming are: Potential Career Path to be able to create programs that can: solve problems; entertain, i.e. useful applications and games. Online college lectures + book (which I am willing to purchase) sounds like a good combination, but I do not know which would be most suitable for me. tl;dr: What I would like to find from the excellent people here is the following: a good, potentially best, programming course and/or book that is well structured and uses good pedagogy so that a person dedicated to learn programming may do so by following its curriculum (or use it to develop a curriculum) over the course of a few months. Thanks! (I apologize if this type of question is not considered proper etiquette, but I haven't found a consensus on this, and would like some guidance beyond the research I've already done)

    Read the article

  • Doubt about constructor in JAVA

    - by Harry Joy
    I have few doubts regarding constructor in java Can a constructor be private? If yes then in which condition? Constructor is a method or not? If constructor does not return anything then why we are getting a new Object every time we call it. Whats the default access modifier of a constructor if we did not specify. Thanks & Regards Edit---------- Answer for 1 & 3 are very clear. But still doubt about 2&4 as i'm getting different answers for them.

    Read the article

  • Backtracking infinite loop

    - by Greenhorn
    This is Exercise 28.1.2 from HtDP. I've successfully implemented the neighbors function and all test cases pass. (define Graph (list (list 'A (list 'B 'E)) (list 'B (list 'E 'F)) (list 'C (list 'D)) (list 'D empty) (list 'E (list 'C 'F)) (list 'F (list 'D 'G)) (list 'G empty))) (define (first-line n alist) (cond [(symbol=? (first alist) n) alist] [else empty])) ;; returns empty if node is not in graph (define (neighbors n g) (cond [(empty? g) empty] [(cons? (first g)) (cond [(symbol=? (first (first g)) n) (first-line n (first g))] [else (neighbors n (rest g))])])) ; test cases (equal? (neighbors 'A Graph) (list 'A (list 'B 'E))) (equal? (neighbors 'B Graph) (list 'B (list 'E 'F))) (equal? (neighbors 'C Graph) (list 'C (list 'D))) (equal? (neighbors 'D Graph) (list 'D empty)) (equal? (neighbors 'E Graph) (list 'E (list 'C 'F))) (equal? (neighbors 'F Graph) (list 'F (list 'D 'G))) (equal? (neighbors 'G Graph) (list 'G empty)) (equal? (neighbors 'H Graph) empty) The problem comes when I copy-paste the code from Figure 77 of the text. It is supposed to determine whether a destination node is reachable from an origin node. However it appears that the code goes into an infinite loop except for the most trivial case where the origin and destination nodes are the same. ;; find-route : node node graph -> (listof node) or false ;; to create a path from origination to destination in G ;; if there is no path, the function produces false (define (find-route origination destination G) (cond [(symbol=? origination destination) (list destination)] [else (local ((define possible-route (find-route/list (neighbors origination G) destination G))) (cond [(boolean? possible-route) false] [else (cons origination possible-route)]))])) ;; find-route/list : (listof node) node graph -> (listof node) or false ;; to create a path from some node on lo-Os to D ;; if there is no path, the function produces false (define (find-route/list lo-Os D G) (cond [(empty? lo-Os) false] [else (local ((define possible-route (find-route (first lo-Os) D G))) (cond [(boolean? possible-route) (find-route/list (rest lo-Os) D G)] [else possible-route]))])) Does the problem lie in my code? Thank you.

    Read the article

  • Inheritance in tables - structure problem

    - by Naor
    I have 3 types of users in my system. each type has different information I created the following tables: BaseUser(base_user_id, username, password, additional common data) base_user_id is PK and Identity UserType1(user_id, data related to type1 only) user_id is PK and FK to base_user_id UserType2(user_id, data related to type2 only) user_id is PK and FK to base_user_id UserType3(user_id, data related to type3 only) user_id is PK and FK to base_user_id Now I have relation from each type of user to warehouses table. Users from type1 and type2 should have only warehouse_id and users from type3 should have warehouse_id and customer_id. I thought about this structure: WarehouseOfUser(base_user_id,warehouse_id) base_user_id is FK to base_user_id in BaseUser WarehouseOfTyp3User(base_user_id,warehouse_id, customer_id) base_user_id is FK to base_user_id in BaseUser The problem is that such structure allows 2 things I want to prevent: 1. add to WarehouseOfTyp3User data of user from type2 or type1. 2. add to WarehouseOfUser data of user from type3. what is the best structure for such case?

    Read the article

  • data structure for counting frequencies in a database table-like format

    - by user373312
    i was wondering if there is a data structure optimized to count frequencies against data that is stored in a database table-like format. for example, the data comes in a (comma) delimited format below. col1, col2, col3 x, a, green x, b, blue ... y, c, green now i simply want to count the frequency of col1=x or col1=x and col2=green. i have been storing the data in a database table, but in my profiling and from empirical observation, database connection is the bottle-neck. i have tried using in-memory database solutions too, and that works quite well; the only problem is memory requirements and quirky init/destroy calls. also, i work mainly with java, but have experience with .net, and was wondering if there was any api to work with "tabular" data in a linq way using java. any help is appreciated.

    Read the article

  • Setting spring bean property value using ref-bean

    - by Apache Fan
    Hi, I am trying to set a property value using spring. <bean id="velocityPropsBean" class="com.test.CustomProperties" abstract="false" singleton="true" lazy-init="false" autowire="default" dependency-check="default"> <property name="properties"> <props> <prop key="resource.loader">file</prop> <prop key="file.resource.loader.cache">true</prop> <prop key="file.resource.loader.class">org.apache.velocity.runtime.resource.loader.FileResourceLoader</prop> <prop key="file.resource.loader.path">NEED TO INSERT VALUE AT STARTUP</prop> </props> </property> </bean> <bean id="velocityResourcePath" class="java.lang.String" factory-bean="velocityHelper" factory-method="getLoaderPath"/> Now what i need to do is insert the result from getLoaderPath into file.resource.loader.path. The value of getLoaderPath changes so it has to be loaded at server startup. Any thoughts how i can inset the velocityResourcePath value to the property?

    Read the article

  • iPhone/iPad - issues with NavigationBar button ?

    - by user532445
    I my application i have added button in NavigationBar like this.. UIBarButtonItem *more=[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"search-25by25.png"] style:UIBarButtonItemStylePlain target:self action:@selector(SelectMission:)]; self.navigationItem.rightBarButtonItem = more; When i am clicking on button application get's shutdown... If i am doing same thing with normal button it's working fine can any one help me why it's behaving like this?

    Read the article

  • Connecting the Dots (.NET Business Connector)

    - by ssmantha
    Recently, one of my colleagues was experimenting with Reporting Server on DAX 2009, whenever he used to view a report in SQL Server Reporting Manager he was welcomed with an error: “Error during processing Ax_CompanyName report parameter. (rsReportParameterProcessingError)” The Event Log had the following entry: Dynamics Adapter LogonAs failed. Microsoft.Dynamics.Framework.BusinessConnector.Session.Exceptions.FatalSessionException at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsSession.HandleException(Stringmessage, Exception exception, HandleExceptionCallback callback) We later found out that this was due to incorrect Business Connector account, with my past experience I noticed this as a very common mistake people make during EP and Reporting Installations. Remember that the reports need to connect to the Dynamics Ax server to run the AxQueries., which needs to pass through the .NET Business Connector. To ensure everything works fine please note the following settings: 1) Your Report Server Service Account should be same as .NET Business Connector proxy account. 2) Ensure on the server which has Reporting Services installed, the client configuration utility for Business Connector points to correct proxy account. 3) And finally, the AX instance you are connecting to has Service account specified for .NET business connector. (administration –> Service accounts –> .NET Business Connector) These simple checkpoints can help in almost most of the Business Connector related  errors, which I believe is mostly due to incorrect configuration settings. Happy DAXing!!

    Read the article

  • Need help completing this Powershell script with some Exchange 2010 commands.

    - by Pure.Krome
    Hi folks. the following powershell script lists all the email aliases I have for a single mailbox. >$mbx = Get-Mailbox myuser >$mbx.EmailAddresses and that lists all the addresses. eg. SmtpAddress : [email protected] AddressString : [email protected] ProxyAddressString : smtp:[email protected] Prefix : SMTP IsPrimaryAddress : False PrefixString : smtp SmtpAddress : [email protected] AddressString : [email protected] ProxyAddressString : smtp:[email protected] Prefix : SMTP IsPrimaryAddress : False PrefixString : smtp SmtpAddress : [email protected] AddressString : [email protected] ProxyAddressString : SMTP:[email protected] Prefix : SMTP IsPrimaryAddress : True PrefixString : SMTP Now to add a new email address, I do the following poweshell command :- $mbx.EmailAddresses += "myEmailAddress.com" $mbx | Set-Mailbox So i'm not sure how i can use the foreach to remove each address? I tried:- @mbx.EmailAddresses | foreach { $mbx.EmailAddresses -= $._SmtpAddress } and that failed miserably. That's my first attempt of PS script, ever :P Can anyone help?

    Read the article

  • Weblogic Threads Usage

    - by Hila
    I have an application deployed on WebLogic 10.3, which exhibits a strange behavior. I am running a constant (not too high) load on my application (20 concurrent users, running a light activity). The response time is reasonable (well below 100ms after the application stabilizes) Memory consumption seems fine (My application creates a lot of short-living objects, but they are garbaged collected so the overall memory consumption stays under 500 mb). Threads stats seem healthy as well: And yet, after I leave my test running for a while, more and more execute threads ("[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'") are created, until eventually the application crashes: This test hasn't been running for a long time (All the new threads that you don't see in the first screenshot were created while I was writing this question), and I've seen much more threads being created. Any idea why these threads are being created?

    Read the article

  • Recovering data from failed Raid configuration with 4 drives and two raid sets (Asus P6T / Intel ICH10r)

    - by user56365
    I've added the complete detailed version for my question below for those who can help, but want to quickly summarize my question first. I setup two Raid arrays using (4) WD Raptors, a striped set for the OS and 1+0 set for crucial data. After booting once out of the 50 times a cable fell out, the drive wasn't recognized in the array anymore. After trying to fix it, another drive did the same. I now have two drives remaining, luckily with the parity information. I know the striped set is gone, but I need the data on the other set. Can anyone recommend anything to recover the data, or fix the two drives that doesn't allow the raid controller to recognize the drives, even though they are listed on the utility screen as still apart of the configuration but that they are not found? More Details I recently upgraded to a ASUS P6T motherboard with an Intel ICH10R raid controller and changed my previous 4 drive raid array from strictly a Raid 1+0 set to a Raid 0 for the OS/Page/Scratch drive and a Raid 1+0 set for crucial data. I never had problems after upgrading with my configuration, even when a drive died and was replaced. I managed to rebuild the array fine. Unfortunately this time around, a cable came unattached and I booted my system up until the raid status screen with the degraded error. This shouldn't have been a problem, but after I attached the drive it was no longer recognized as a member in the array. Both drives actually show up as a non-member disk. I've spent a very, very long time online trying to find information or support and haven't had much luck. After spending time trying to scan the drive for errors, damaged partition info, etc.. another drive in the set decided it didn't want to be recognized as a part of the array. At this point, I have two out of the four drives still functioning, but the Raid 1+0 array went from degraded to failed and I must find a way to retrieve that data. I think the two drives still in the array have the parity information because they show up as OS (110GB),BACKUP(80GB) and OS:1(110GB),BACKUP(80GB) under windows data management. The other two are simply 74gb Raw unallocated Is it possible recover the data using those two drive only, and which tool would I use? Could it be a simple partition table or any other error that is repairable with hard drive utilities out there? I know the Raid 0 set is done for, but I would assume because the correct drives failed in a 1+0 config to save the data I can retrieve it some how.

    Read the article

  • copy files created in one folder to multiple other folders on linux

    - by Keith
    I'm looking for a way to copy photos that are uploaded to one folder to many other folders and visa versa. Example: a photo is uploaded to folder 1, it is then copied to folders 2-5. And if a photo is uploaded to folder 2 it is copied to folders 1 and 3-5. I'm running CentOS 5. All of these folders are on the same server. I came across another post on here that talked about incron, but that type of programming is over my head.

    Read the article

  • Database or website of kernel config files ?

    - by Kami
    I've experienced some kernel panic after trying to compile gentoo kernel for a Sun UltraSPARC T5120 Server. The kernel panic came from a missing support for the SAS disk controller in the menu config. I've wasted so much time because I had no clue about the hardware I was using. I know that the kernel config depends on what you plan to do with your machine but I want to have a configuration file that at least match my hardware ! Is there a website or database that provides menuconfig's kernel configuration files for known or branded hardware like Dell Server or Apple computers ?

    Read the article

  • mysql cmd promt import data.sql

    - by udhaya
    i wanna import sql using cmd prompt. first open windows cmd prompt, navigate to xampp/mysql/bin folder & run mysql this error occurs D:\Program Files\xampp\mysql\bin>mysql ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: N O) D:\Program Files\xampp\mysql\bin>mysql -u root -p -h localhost dev1base < dev1b ase.sql Enter password: D:\Program Files\xampp\mysql\bin> D:\Program Files\xampp\mysql\bin>mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 104 Server version: 5.0.51a Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> mysql> -h localhost dev1base < dev1base.sql -> -> -> ->

    Read the article

  • Laptop Hard Drive Cable

    - by Josh Pennington
    I am about to have to dig into my wifes laptop to pull the hard drive out to pull the data off since the rest of it is close to dieing. I am curious what I should expect to have to deal with to get data off the hard drive. I am assuming its a SATA drive. Do I need a special cable to connect a laptop SATA hard drive to the computer or should I be able to connect it to my desktop computer without issue? Thanks Josh Pennington

    Read the article

  • Anyone experiencing audio issues with VirtualBox on Linux and has a solution?

    - by DoxaLogos
    I've been using Virtualbox (now at 3.0.2) on Kubuntu (now at 9.04) for a while now, and I seem to have a problem when running Windows. Sometime after a while the audio will cut out in Kubuntu. The only way I can get it to recover is to make sure VirtualBox is completely shutdown and either going into multimedia under "system settings" and test the audio or restart. I'm wondering if anyone else here has experienced similar issues and has come up with a more elegant solution. I can't seem to find a reasonable one at virtualbox.org.

    Read the article

  • Adjust Mac OS X's colors

    - by Seth
    I downloaded an app several months ago for the Mac that enabled me to adjust the colors of the monitor to work with different light sources. There was a filter for daylight, incandescent, fluorescent, etc. After re-installing I can't seem to locate it again. Does anyone know this application? UPDATE Never mind, after all that Googling and asking here I found it. It's called Flux http://www.stereopsis.com/flux/ Highly recommended if you have any eye strain.

    Read the article

  • Mercurial says hgrc is untrusted in Emacs, but works fine from the command line

    - by Ken
    I've got some Mercurial checkouts in a directory that was mounted by root. Mercurial is usually suspicious of files that aren't mine, but I'm the only user here, so I put: [trusted] users = root groups = root in my ~/.hgrc, and now I can use hg from the command line with no warnings or errors about anything being untrusted. So far, great. But when I try to run, say, vc-annotate in Emacs, I get an Annotate buffer that says: abort: unknown revision 'Not trusting file /home/me/.../working-copy/.hg/hgrc from untrusted user root, group root Not trusting file /home/me/.../working-copy/.hg/hgrc from untrusted user root, group root 7648'! The message area says: Running hg annotate -d -n --follow -r... my-file.c...FAILED (status 255) I don't have anything in my .emacs related to vc or hg. Other commands, like vc-diff, work fine. What am I missing here?

    Read the article

  • itunes not showing latest episodes in podcast

    - by andersonbd1
    iTunes is stuck showing old episodes that are no longer in this feed (2010-12-16 to 2010-12-22). http://www.catholic.com/audio/podcast/podcaster.php The actual feed looks fine. I've tried unsubscribing, deleting, adding the feed via Advanced-subscribe to podcast, through the store (which also shows the latest episodes), etc. But for some reason it seems itunes has a cached version of the feed which it refuses to update. Any ideas?

    Read the article

  • Find the model of my motherboard without opening the computer [closed]

    - by Code
    Possible Duplicate: Find out what the motherboard on my computer is I need to find the model of my motherboard so I can find what soundcard/chip it uses so I can get some drivers for it. Is there anyway to get this from inside XP? I looked through device manager but haven't seen anything that would tell me. I built the system over a year ago and don't have any receipts to check what it was.

    Read the article

  • What is the most secure way to "Grandfather In" existing users of a paid iOS app that will go free?

    - by coneybeare
    The title pretty much says it all, but I can elaborate. I have a paid iOS app that has plenty of existing customers. I think i want to convert to a free app now, and allow full upgrade via in-app-purchase. The problem is, I don't want to make my existing customers buy the app again to use it, nor do I want to make it easy for hackers to just flip a switch and get the pro version. What is the most secure way to "Grandfather In" existing users of a paid iOS app that will go free?

    Read the article

  • Is there a way to group 2 or 3 gui windows so that they don't get lost behind other open windows?

    - by Gonzalo
    For instance floating panels and main window in Gimp are independent windows. If I change focus to a full window (e.g. Firefox by doing Alt-Shift) and go back to the main Gimp window I don't get back the floating panels also (I have to change to them as well in order to see them). It would be great if the 3 windows can be "tied" (or linked) together in order that they don't get lost behind other open windows when I change back to (make active window) any of them? I think this configuration (if it exists) should show itself more obviously in the gnome environment. This question seems to address the same problem but it doesn't seem to be accurately answered.

    Read the article

  • Call function from object instantiated in one class in another

    - by Dk43
    I have two classes, both of which need to be able to call the same instance of entitymanager class Engine { EntityManager::Entitymanager EManager; } And I need to add an object to a vector contained by this particular instance of Engine. What I want to do is be able to add a bullet spawned by the player to the vector that contains all my entities. class Player : Entity { void SpawnBullet() {Engine::EManager.Add(BULLET);} } The above returns this error: error: object missing in reference to ‘Engine::EManager’ How do I resolve this? Any help or pointers in the right direction would be much appreciated!

    Read the article

  • How can I move deleting photos to the background with delayed_job and paperclip

    - by Tam
    I let my users create photo albums with many photos. Relationship as follows: has_many :album_photos, :dependent => :destroy i upload photos to S3 When the user delete album I want to delete all photos as the relationship shows but it takes time if the user has many photos. Can I automatically set photo deletion to happen in the background (delayed_job) without having to manually call 'send_later' on every photo?

    Read the article

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