I recently had to restore a MySQL backup. It had been a while since I used MySQL, having switched to Postgresql sometime back. First thing I noticed was the lack of a GUI admin tool that PG spoils you with. Making matters worse, the command line tool isn’t even added to your path; you can’t just run “mysql” like you can in a Unix shell, much less use the redirect shortcut. And I was getting errors.
Here’s what you need to do to restore a MySQL backup on Windows:
- Run the command line tool from the start menu
- Open your backup file in a text editor. Does it start with a command to create or “use” the database? If not
- Create it, if necessary
- Type “use database” filling in your DB name
- Type “source path-to-SQL-file“. BUT, you must follow these rules:
- Use the full source command, not the \. shortcut
- Have no spaces in your path. I copied mine to a root of a drive. Note that spaces in the file name is OK, just not the path.
- Do not quote the file name, even if it has spaces. This gave error 22.
- Use forward slashes in the path, e.g., C:/path/to/filename.sql. Otherwise you’ll get error 2.
- Do not end with a semicolon.
Follow all those rules and it should work fine.
I’m pretty excited about Grails, but am often asked for social proof. Well, by every measure, Groovy is the #1 JVM language after Java, and Grails is the #1 full stack web framework. But for some, that’s not enough. They want to know who is making it #1? Major companies. Below I’ve listed the household names. I could not get details for some companies, but a Google search will verify the claim (e.g., the Disney developer posting a Grails question to a mailing list).
Last update: August 20th, 2015
- Epic Games
- Industrial Light & Magic
- LiveNation – TicketWeb
- Live Gamer
- MTV (and Viacom by extension)
- NBC Universal
- Netflix – Asgard, their Amazon EC2 cloud management app, now open sourced.
- Riot Games (makers of League of Legends)
- Rumble Entertainment (maker of Kings Road)
- Time Warner Cable
- American Express
- Bank of the West
- Credit Suisse
- Federal Reserve Bank of San Francisco
- Federal Reserve Bank of Kansas City
- Fidelity Investments
- First Data Corporation
- Freddie Mac
- H&R Block – mobile site (now defunct)
- Intuit – Intuit Payment Network
- JPMorgan Chase
- PayPal – Bill Me Later
- UBS Wealth Management
- Wells Fargo
- 7-11 (back office systems)
- Big Lots – core site
- Nordstrom (HauteLook)
- Panera Bread
- Walmart – MP3 streaming site (now defunct)
- CollabNet – web interface to SVN server
- Dell – Enstratius
- HP – Application Information Optimizer
- IBM – Kenexa
- Intel – New Devices Group
- Rally Software
- T-Mobile – internal apps
- Toshiba- Toshiba America Business Solutions
- Commission Junction (part of Conversant)
- Condé Nast
- GEICO – mobile web
- HealthPartners – Virtuwell
- Jet Propulsion Laboratory
- Johnson & Johnson
- LinkedIn – Recruiter application
- Lockheed Martin
- Nissan – Leaf site
- Pacific Gas and Electric Company
- Precor – Preva product
- Reinsurance Group of America
- Time Inc.
- Trip Advisor
- UnitedHealth Group
- Virtual Tourist – core site (parent is Trip Advisor)
- Volkswagen – UK site
- The Washington Post
- The XO Group (parent of The Knot / WeddingChannel.com)
- Zynx Health (Hearst Health Group)
These are household names in some countries outside the US:
- MACSF – (France) insurance company, internal systems
- Mercado Libre – (South America) core site
- National Film Board of Canada
- Sky – (UK) TV listings, movies, and showbiz sites
- Vodafone Music – (UK) core site
Colleges and universities:
- Carnegie Mellon University
- Colgate University
- Columbia University
- Harvard University
- NYU (Langone Medical Center)
- University of Alaska
- University of California, Irvine
- University of Hawaii
- University of Minnesota
- University of New Mexico
- University of Oklahoma
- University of Pennsylvania
- University of San Francisco
- Yale University
There are lists of many lesser known companies/apps found here and here. Another good place to check is Find Grails Jobs and indeed.com. I used all of them to compose this piece.
I needed to generate an XML file from database tables and the plan was to use Talend Open Studio. Talend is an ETL tool that generates data integration jobs in Java. The community edition is free and I’d been using it for several other data tasks for an ecommerce client. Overall, I think it’s quicker than hand coding in Java, but you can still dip into Java code if you need to and embed the jobs in other programs.
Unfortunately, it’s not so good when it comes to generating moderately complex XML files. By moderately complex, I mean lists of lists like this:
I recently switched from Eclipse 3.6 to STS 2.7.1 (based on Eclipse 3.7). Ditching my old .project and workspace settings files along with the move has made for a smoother experience; it seems these files get corrupted over time, and I’m too lazy to do the research to fix them. However, the upgrade resulted in performance issues. For instance, it hung for ~10 seconds every time I saved web.xml, and there were various random pauses. It’s not the hardware: I’m on a Core i7 Quad with 6GB RAM running Win7 x64. I realize you are getting more tooling with STS, but performance was much worse than I experienced with 3.6.
Well, it had slipped my mind that I had updated my 3.6 eclipse.ini settings with those I had found in an excellent Stack Overflow answer from VonC on optimal JVM settings for Eclipse. It hasn’t been updated for 3.7 (nor does it mention STS), but after some experimenting and research it appears to work well for it. Here are my settings, and below I add some commentary on what they do, which is missing from the original answer (although I still suggest you read that, as it covers other situations/issues that may affect you). Keep in mind I’m not a JVM tuning expert, YMMV, etc. Here are the contents of my sts.ini:
This is the number of method invocations/branches before compiling. This is normally set to 10,000, so we’re changing it dramatically, but the original suggestion was leading to errors so I raised it. You will notice on startup that it takes longer, and your CPU usage jumps. However, your performance after that is much better. Those 10s save times for web.xml? Gone after this. I’m willing to take a hit at the beginning for better productivity while coding.
Related to the above, I was getting the error “Unhandled event loop exception / out of space in CodeCache for adapters” due to setting the compile threshold to 5. This is another solution to that problem, and may be redundant.
This is stack size, and was previously set to 1MB, now up to 4MB per thread. Doing this will increase the overall memory used.
These enable parallel garbage collection. I saw my CPU utilization reach 100% after this, which is rare on a Core i7 Quad. It felt like I was finally using it to its potential.
Again, I’m not an expert. I’ve found it’s more sluggish at first, but response times quickly improve. For me, it’s a clear net gain. Not documented are the things I turned off in preferences because I wasn’t using them (Maven is disconnected, etc.). Visit Windows >> Preferences and filter on startup, see if there’s anything you can get rid of. Finally, I must give credit to my sources outside the original article:
I was trying to launch a Tomcat instance in Eclipse and it complained that port 8080 was in use. This scared me, since to my knowledge nothing else used that port. Was it spyware? I visited http://localhost:8080 and saw:
Access violation at address 32658D8F in module 'CC3260MT.DLL'. Read of address 00000000
No, it’s not spyware, it’s TiVo. Specifically the TiVo desktop server (Bonjour, I believe it’s called.). Pulling up the interface and pausing the server frees up the port. Shame on TiVo for using a very popular port for developers, but I guess we can change the port in Eclipse/Tomcat/Jetty if we need to. Now back to work…
For some reason, searching for “wincvs revert” in Google doesn’t immediately show http://cvsgui.sourceforge.net/newfaq.htm#reversion, which it absolutely should. It explains what you have to do, but to make it extra clear here is a screen grab:
You can replace HEAD with another version like 1.12.
BTW, if you’re on Windows and using Eclipse, WinCVS is a great support tool for Eclipse’s broken CVS support. I can get history/logs for files and revert to previous versions. Eclipse remote history has been broken for me through several upgrades/reinstalls and will only revert to a tag, not a specified file version.
The only real issue I have with WinCVS is that its help system doesn’t provide any. Expect things like “Merge options dialog allows the user to change the merge options.” Still, I’m grateful for the effort and can’t complain about the price.