Xcode save code folding? - ruby-on-rails

I know it's not directly related to programming, but what better place then stackoverflow right?
So code folding is an awesome feature which I love, but does anyone know if there is a way to get Xcode to remember where you have certain sections collapsed whenever you open a file?
BTW, I'm coding ruby on rails using git version control.

Code folding for a source file is saved in the user file of the project. So if you're just editing a naked Ruby source file, there's no place to store the information. You might just make a dummy Empty Project and add the Ruby files to it just to persist the folding state, scroll position, etc. even if you don't use the project for building or version control.

Related

It's possible to program using RoR in Xcode?? If yes how should I do?

I'm new to programming and I've not understood if I can use RoR in X code or if I can only program throw Swift.
It´s perfectly possible to program Ruby in XCode of course,
You can use the built in git support, .rb files will be automatically recognised for being ruby, you will have syntax highlighting and auto completion (just tested it). You can make use of the project features too, managing multiple source files etc.
Just in case: Source type can be adjusted e.g. in the right sidebar 2nd dropdown named "Type".
I use xcode for c++, python and embedded development. It´s very customisable.

iOS 8 App Extension and Host App in separate project files. Is it possible in Xcode 6?

Currently we're using premake5 to generate our project files, as we develop multi-platform. Obviously we don't need premake to know anything about the extension (as it's iOS8 exclusive feature) but we're facing a problem: Every time we regenerate the main app project file (which happens sometimes) we're forced to manually add all the files and configure the extension, which is dull and error-prone.
Is there a way to add the app extension (a Today Widget) to a separate project? Pbxproj files aren't version control friendly as its contents seem to be shuffled every time you save. So, saving a patch file with all the changes needed doesn't seem like an alternative.
I know this is a broad question about a convenience issue, maybe seasoned Xcode devs know some trickery (or maybe it's just something obvious we're missing here).
Thanks all in advance.

How can I update a file incrementally in iOS. (File patching)

I have a huge text file in my application (version 1.0).
Lets assume that a new version (2.0) of this file was just released.
Most of the file remained the same but the new (2.0) version has a few modifications (some lines removed, others added).
I now wish to update the file (1.0) to the new version (2.0), but do not wish to download the whole file again.
I would love to just patch the file with the changes of the new file, thus saving bandwith from downloading the WHOLE new file from my server.
(Similar to the way versioning systems like git or svn act)
How can I do this programmatically? Are there any iOS libraries available?
Thank you
You need to implement some kind of Binary delta compression such as zdelta, or Remote Differential Compression such as the one in rsync.
Personally I'm not aware of such algorithm implemented specifically for iOS, but I'm sure it's possible to find one that is implemented in C/C++ which can be seamlessly used in the iOS environment.
Edit: I also recommend you to read this.
It's actually a big problem... if your API let you ask the data of a file in a specific range, you can just a ask the data range that you need to replace, and seek the file at the range and overwrite the specific data... this mean that you have to take trace about the changes every time you update the files... and your app update has to know the ranges to request... this is not a solution... I hope will be a start point to implement your own solution
to try to get partial conent in a range you need to add to your request header something like this:
Range: bytes=0-999
I think, you can do this by yourself without third party libraries. To achieve this, all you need is 1)Piece of code which will generate the metadata for joining versions of your file (offsets, lengths, and pointers to the data to be changed in older version); 2)piece of code which will do the hard work: read meta and put the parts on right places. Several days of struggling with offsets, and you are done ;) Good luck!

LyXliteral programming

I keep writing codes in gedit but at the end of the week we need to submit a lyx literal programming file. Copying and pasting or importing is painful, since , we need to keep pressing tabs or enters. Can anyone suggest a simple alternative to this? Please keep in mind that we need to export the c file from the lyx file.
With the help of my friend, i have written a python code to convert the python or c or any other code, as it is to a lyx file. you can later add whatever you want to the lyx file
Here is the link: http://dpaste.com/hold/671718/
The aforementioned link is broken, but here's the original.
The script essentially takes code and creates LyX scrap from it. It requires that scrap and noweb be installed on the machine in question. Also, I believe I'd made this for LyX v.1.6. Not sure how it will hold up against newer versions. Then again, one can select and indent using tab in scrap code in the newer versions, so the OP's problem is somewhat mitigated.

Delphi 7 keeps using old outdated form

Changed, updated, form is not used even though uses and project settings seem fine, old form files removed from disk.
Is this a bug in the IDE? I may just delete the form and copy it into another unit with a new name.
If it's using an old form it has to be getting it from somewhere--it doesn't appear out of thin air. Two scenarios come to mind:
1) It's somewhere where you don't realize. Search your system for files by that name.
2) Unless you do a build Delphi compiles based on timestamps. If the clock was wrong when it was compiled before the .dcu can have a more recent time and thus it gets skipped in compiling. I've hit this more than once with timezones.
A good way to find it is to first move the project to a different new folder and try to compile it. This should produce and error that will help you to find the culprit. If this does not work then it is settings like paths etc in your libraries that are at fault.
Also make sure that you deleted all ".dcu" files in the project before re-compiling.
No, it is not a bug in the IDE.
You are referencing that form in some setting in your project or environment, which you didn't find yet and which takes precedence to options you already tweaked.
Where do you need to go to resolve your problem? Well, that's difficult to say without looking at your development environment and your project settings.
I've had this happen before. It is always something referenced that I wasn't aware of.
You can do a grep for something from the form and see where it shows up.
Thanks for the input. The first one I tried, moving the files, mm2010, showed it was my code that was at fault.
Although the form/unit is not included in the project file (dpr), it is still referenced by some other unit. So the compiler links the res into the application. Look for the unit name you want to remove in other units' uses clauses.

Resources