Is there a way to get the 'Visual-Format Language' of AutoLayout XIB? - ios6

I'm slamming into brick walls.
Is it possible to get the Visual-Format Language generated from an AutoLayout XIB?
I wish to emulate the XIB equivalent in code.

When you NSLog constraints, the log displays them in the visual format language.
NSLog(#"%#", self.view.constraints) ;
I created a UIButton in Interface Builder and dragged it to the upper-right corner of a view,
, and here's the NSLog:
"<NSLayoutConstraint:0x75b19f0 H:[UIRoundedRectButton:0x75ae6a0]-(NSSpace(20))-| (Names: '|':UIView:0x75ae560 )>",
"<NSLayoutConstraint:0x75b1a50 V:|-(NSSpace(20))-[UIRoundedRectButton:0x75ae6a0] (Names: '|':UIView:0x75ae560 )>"
They're the same as creating constraints with visual format language:
H:[button]-20-|
V:|-20-[button]
If you're familiar enough with the visual format language, you should be able to express most constraints you can think of in the language, without needing to create them in Interface Builder and reverse-engineer them. Let me know if there's a constraint that you're unable to build in code.

Related

Is it possible to insert unicode strings with input VB6 control's in a SQL Database?

I am trying to Insert Unicode strings into a table using the Internal vb6 controls(text,List,ect..) .
But when I try to do that , VB6 Control's convert that string , and different string is stored.
Am I forgetting something or is it a visual studio issue?
I found a reference to a software package(3rd-party controls) :
http://www.cyberactivex.com/UniSuiteFree.htm
I used This package and it done , but would also be curious to hear feedback from anyone who has used these or other ones :)
Original VB6 forms components did not do a good job with Unicode, although once you get Unicode strings into VB6 code you are mostly ok. You need to use the 'B' forms of string operators, like midb(), lenb() etc if you are doing any string maniputaion. You also may want to check your SQL parameter declarations to ensure you are using the unicode options. Otherwise it is all do-able.
Try the advise at this MS Support article.
Edit: After prompting from #Bob I read the MS Support article I linked to in more detail and take the point that forms2 is not a great bet for VB6 forms unless you have a more-than-usual level of control over the target machines.
In my own case I used a commercial component named Unitools from Woodbridge Associates but I cannot find their website today. Unitools included Unicode-aware label, text box, combo and list controls. Anyone able to provide a link ?

Spreadsheet Gear migration errors

I am migrating Spreadsheet gear of my application from 6.0.3.190 to
7.4.1.104.I am getting my issues with Color property.Can any one help me in this.Now I am using using Color = System.Drawing.Color; and also ToSGColor().This became very hectic to do in all places where ever we use color.I expect we should have some shortcut to do this.Can any one suggest me How can i get all functionalities with few changes only.I am also getting exceptions to c onvert IColorFormat.LineColor to system.drawing.Color.
Note the "Breaking Changes" page in the SpreadsheetGear 2012 documentation, which lists this particular change:
In order to support WPF and Silverlight, the core API has been
separated from the GDI+ and Windows Forms APIs and therefore uses the
new SpreadsheetGear.Color type rather than
SpreadsheetGear.Drawing.Color. SpreadsheetGear.Drawing.Color has been
moved to SpreadsheetGear2012.Drawing.dll. See
SpreadsheetGear.Drawing.Color for an example which uses the implicit
and static converters to convert between SpreadsheetGear.Color,
SpreadsheetGear.Drawing.Color and System.Drawing.Color.
SpreadsheetGear.Colors and SpreadsheetGear.SystemColors provide
helpful predefined colors to replace the use of predefined colors in
System.Drawing.Color.
So you'll need to ensure than any place where you were previously using System.Drawing colors now use SpreadsheetGear.Drawing colors, including API like IColorFormat.LineColor.
There aren't really any "migration" tools to automatically convert such instances to the new API. So you'll need to resolve these errors for each code file. Doing a Find/Replace keyword search for "System.Drawing" and "SpreadsheetGear.Drawing" could possibly speed up the process, though this would depend on what using statements you have added to each code file.

Generate english versions of same content on Drupal?

My website needs to be able to support multiple languages for multiple countries. For example, the US might have English and Spanish, while the UK might only have English. If two countries use the same language, it DOES NOT mean the content is the same.
For this reason, I decided to use the internationalization module (i18n) and I created language codes as follows:
gb-en - UK English
us-en - US English
us-es - US Spanish
I set this up with no issues, but my problem comes in with creating all the default content. For each content type, I want to:
Set the content types default language as "English"
Create translated versions of each content type for each language
I know this will mean that the Spanish content would still be in English, but it's the first step towards translating it.
What is the easiest way to create all these "default" content pages?
You could create a module implementing hook_node_insert(). This module would intercept the creation of a new node (stored with the default language) and create as many copies as needed. Each of these copies should have a different value in the field language. These copies colud be easily stored in the dabase using node_save() function.

Macros in SQL Server Management Studio

Is there any way to implement text editing macros in SSMS? I would, e.g. like to convert the the code as shown below, but with a key-press, not a long-winded regex search and replace.
This:
INSERT INTO [TABLE]
([fieldOne]
,[fieldTwo])
VALUES
(<fieldOne, datetime,>
,<fieldTwo, real(24,0))
Must become this:
INSERT INTO [TABLE]
([fieldOne]
,[fieldTwo])
VALUES
(#fieldOne
,#fieldTwo)
I know SSMS doesn't natively support this, but I also know that it is extensible, if undocumented, and there is also room for a totally external application that will take copied text, transform it, and paste it back, without having to open an editor, paste, edit, copy, and paste back to SSMS.
Editing the stored templates is not an option, as these templates are dynamically generated, and using Ctrl+Shift+M is not an option either, as I still have to type each parameter name, but without the convenience of copying and pasting in the query editor.
There is no SSMS solution! I am looking for some sort of external voodoo that can help me do this.
What about an AutoHotKey script?
Depending on the complexity of your templates, you could either
use AutoHotKey to play back the keystrokes
needed for the regex search and
replace, or
copy the template to
the clipboard and manipulate it
directly within AutoHotKey before
pasting it back.
I'm sure the first option will work. I've not tried the second.
This question gives an indication of how an AutoHotKey script can be written to listen for keyboard chords.
If you are using SSMS 2005 upwards it has in built support for templates. It isn't exactly full blown macro's, but non the less it is still pretty useful.
The syntax is exactly as you have shown in your first code snippet and you simply press Ctrl+Shift+M to bring up a dialog box that prompts you for the values to go into your bits enclosed in angle brackets.
SQL server generates script in this format if you right click on a table and select "Script Table as" then pick either the insert, update or delete option.
You can also create your own custom templates, or modify one of the existing built in ones (click on View -> Template explorer to get access to the other inbuilt templates).
There is a short article on MSDN that explains how to get started with templates.
Was looking for something else, but found this question. If you're still looking for something, try SSMS toolpack: http://www.ssmstoolspack.com/ It has macros and a bunch of other neat things. And it's free!
For SSMS 2016 you can use my Visual Commander extension. It supports macros recording/playback and custom C#/VB commands for editor text manipulations.
First code is template from old-good MS Query Analyzer. Shortcut to filling is Ctrl+M (but I'm not sure, maybe it is Ctrl+Shift+M).
There should be same feature in newer SSMS.
I usually copy the code into another editor (Notepad++, or Delphi /RAD Studio editor), do my macro stuff, and then paste it back into SSMS.

Easy to extend IDE for C

I want an simple IDE/editor for C in Linux to which I can add features easily. For example: I want to add a right click menu item and a related action for the editor. It should be easy to extent and add any desirable functionality. I tried eclipse CDT but its to much of learning(I mean knowing the eclipse plug-in architecture and the CDT extension points and stuff) to do for the small modification/s I want to do.
Thanks,
Sachin
I personally use Code::Blocks, which according to their website also has a Linux ditribution. http://www.codeblocks.org/
I don't know whether it's very extendable, but it has all the features you'd expect from an IDE.
QuantumPete
I would try emacs (but the programming you have to do is in LISP. it is easy, when you get the knack with parantheses). you can do the programming depending on context of the buffer (.c other than .h) an it has a very big c-mode which has many of the most need things implemented already.
Example: insert if
;; the indention-thing needs refining
(defun pm-if ()
"generates if stub"
(interactive)
(insert "if () {")
(indent-according-to-mode)
(newline)
(indent-according-to-mode)
(newline)
(indent-according-to-mode)
(insert "} /* endif */")
(indent-according-to-mode)
(newline)
(indent-according-to-mode)
(previous-line 3)
(end-of-line)
(goto-char (- (point) 3))
)
;; bind it to CTRL-c i
(define-key Ctl-C-keymap "i" 'pm-if)
Look at QDevelop - it`s quite simple but featured ide/editor for qt applications. 5 mins look at source files gives me a way to add a right click menu item :) Steps to reproduce:
Download source, try to build - i had no problems with that
Run, right click on some text in editor window - for instance there is a "Goto Implementation" item there
That text is in src/textEdit.cpp file as:
connect(menu->addAction(QIcon(":/treeview/images/cpp.png"), tr("Goto Implementation")), SIGNAL(triggered()), this, SLOT(slotGotoImplementation()) );
So, slotGotoImplementation() - is a func that will be called. Add your actions in a way like all other actions implemented there.
There are some information on a site about writing plugins to the editor - may be it`s a better way to extend features, but adding some pieces code to source seems easier.
Look at codeblocks and how to write plugins for it. It is the simplest way to add new functionality to the current application. This should be a good starting point for doing a plugin for codeblocks.
Acme
http://plan9.bell-labs.com/sys/doc/acme/acme.ps
this is the Linux port
http://swtch.com/plan9port/
Look into Anjuta. It's an IDE for GNOME/Glib type applications and to my knowledge is written in C, and has a plugin framework that should be useful.

Resources