MySQL : retrieve a large select by chunks

You could try using the LIMIT feature. If you do this: SELECT * FROM MyTable ORDER BY whatever LIMIT 0,1000 You’ll get the first 1,000 rows. The first LIMIT value (0) defines the starting row in the result set. It’s zero-indexed, so 0 means “the first row”. The second LIMIT value is the maximum number … Read more

How do I get the coordinate position after using jQuery drag and drop?

I just made something like that (If I understand you correctly). I use he function position() include in jQuery 1.3.2. Just did a copy paste and a quick tweak… But should give you the idea. // Make images draggable. $(“.item”).draggable({ // Find original position of dragged image. start: function(event, ui) { // Show start dragged … Read more

save numpy array in append mode

The build-in .npy file format is perfectly fine for working with small datasets, without relying on external modules other then numpy. However, when you start having large amounts of data, the use of a file format, such as HDF5, designed to handle such datasets, is to be preferred [1]. For instance, below is a solution … Read more

How can I save HICON to an .ico file?

You can save HICONs with the IPicture::SaveAsFile() method. Here’s a sample C++ program that uses it: #include “stdafx.h” #include <windows.h> #include <olectl.h> #pragma comment(lib, “oleaut32.lib”) HRESULT SaveIcon(HICON hIcon, const wchar_t* path) { // Create the IPicture intrface PICTDESC desc = { sizeof(PICTDESC) }; desc.picType = PICTYPE_ICON; desc.icon.hicon = hIcon; IPicture* pPicture = 0; HRESULT hr … Read more

iPhone: How do I get the file path of an image saved with UIImageWriteToSavedPhotosAlbum()?

I finally found out the answer. Apparently the UIImage methods strip out metadata and so using UIImageWriteToSavedPhotosAlbum is no good. However in ios4 Apple put in a new framework to handle the photo library called the ALAssetsLibrary. First you need to right click on the Targets and in the build part, add the AlAsset Framework … Read more

How to Save/Reload data in vb.net after .exe close?

Consider serialization. For this, a class is more in order than an old fashioned Struct: <Serializable> Class Animal Public Property Name As String Public Property Coloring As String Public Property VaccinesUpToDate As Boolean Public Property Species As String Public Property DateOfBirth As DateTime Public ReadOnly Property Age As Integer Get If DateOfBirth <> DateTime.MinValue Then … Read more

How to save workbook without showing save dialog with Excel interop?

All of the arguments to WorkBook.SaveAs() are optional, but you can just use Type.Missing for most of them if you want to. The typical call would look like: wbook.SaveAs(“c:\\temp\\blah”, Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault, Type.Missing, Type.Missing, false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); wbook.Close(); Note that I didn’t include the file extension; Excel will set that for you. … Read more

Best method of saving data

If your data are pretty simple, like just collections of collections of strings or numbers, I would use json. What JSON is, is a string representation of simple data types and combinations of simple data types. Once you use the json module to convert your data to a string, you write it to a file … Read more