What is the difference between the following 2 ways to allocate and init an object?
AController *tempAController = [[AController alloc] init];
self.aController = tempAController;
[tempAController release];
and
self.aController= [[AController alloc] init];
Most of the apple example use the first method. Why would you allocate, init and object and then release immediately?
I'm trying to animate an object along a path...while it's moving it should continue to "point" towards another object (or CGPoint). What should I be looking for in the framework (Cocoa-Touch) to accomplish this? Maybe something in CAShapeLayer? Though I think that's more for animating the path itself... It's not jumping out at me...
Is there php function to remove the space inside the string? for example:
$abcd="this is a test"
I want to get the string:
$abcd="thisisatest"
How to do that? thanks.
Does anyone know of a program, a utility, or some programmatic library, preferably for Linux, that takes an unformatted SQL string and pretty prints it?
For example I would like the following
select * from users where name = 'Paul'
be changed to something like this
select *
from users
where
name = 'Paul'
The exact formatting is not important.
I just need something to take a large SQL string and break it up into something more readable.
i have the following code
Private Sub select_color_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles select_color.Click
Dim ocolor As New ColorDialog
ocolor.ShowDialog()
Me.BackColor = ocolor.Color
End Sub
and it changes the background color of form to the color i select in colordialogue...
now i want to change the BGColor of shockwaveobject in this way...however i can change the BGColor of shockwave object manually in toolbox but i want to change it by color dialogue how can i do that...
In Visual Studio debug mode it's possible to hover over variables to show their value and then right-click to "Copy", "Copy Expression" or "Copy Value".
In case the variable is an object and not just a basic type, there's a + sign to expand and explore the object. It there a way to copy all that into the clipboard?
Hello,
i got this situation:
- class user with hasMany Roles and belongsTo Roles
- class Role with hasMans User
how can i get the roles belongs to a user, object user is given,
how can i get objects in a many-to-many szanario?
findByX doesn't work, it's affect just one table, but i need a "find" or something else to find Object overall / over many tables.
can anyone help me? and excuse my no propper english^^
Hello,
How do I compress/decompress a string in VB.NET ?
I am trying to send long string through the Network and need them to be as small as possible before sending.
Thanks
I need an simple way to check whether a string that is sent to my function is of the form:
(x + n)(x + m)
//the +'s can be minus'
//n and m represent a double
//x represents the char 'x'
Is there a simple string format that I can use to check that this is the form. As opposed to checking each character singularly.
The whitespace will be removed to save any confusion.
Regards
Lloyd
I have the following list:
[('Steve Buscemi', 'Mr. Pink'), ('Chris Penn', 'Nice Guy Eddie'), ...]
I need to convert it to a string in the following format:
"(Steve Buscemi, Mr. Pink), (Chris Penn, Nice Guy Eddit), ..."
I tried doing
str = ', '.join(item for item in items)
but run into the following error:
TypeError: sequence item 0: expected string, tuple found
How would I do the above formatting?
We can replace strings in a batch file using the following command
set str="jump over the chair"
set str=%str:chair=table%
These lines work fine and change the string "jump over the chair" to "jump over the table". Now I want to replace the word "chair" in the string with some variable and I don't know how to do it.
set word=table
set str="jump over the chair"
??
Any ideas?
I'm seeking a solution to splitting a string which contains text in the following format:
"abcd efgh 'ijklm no pqrs' tuv"
which will produce the following results:
['abcd', 'efgh', 'ijklm no pqrs', 'tuv']
In other words, it splits by whitespace unless inside of a single quoted string. I think it could be done with .NET regexps using "Lookaround" operators, particularly balancing operators. I'm not so sure about Perl.
I would like to extract the number from a string in MSBuild.
How can I do that using the built in tasks or the MSBuild.Community.Tasks? (RegexMatch might do, but how?)
Example: I have the string
agent0076
and I would like to get out the number, without the leading zeros:
76
I'm seeking a solution to splitting a string which contains text in the following format:
"abcd efgh 'ijklm no pqrs' tuv"
which will produce the following results:
['abcd', 'efgh', 'ijklm no pqrs', 'tuv']
In otherwords, it splits by whitespace unless inside of a single quoted string. I think it could be done with .NET regexps using "Lookaround" operators, particularly balancing operators. I'm not so sure about perl.
Is there any advantage to using char*'s instead of std::string?
I know char*'s are usually defined on the stack, so we know exactly how much memory we'll use, is this actually a good argument for their use? Or is std::string better in every way?
Is there a way in objective-c/Cocoa to alloc an object when the class name isn't know until run-time. I seem to remember something about this a while ago, but can't find anything on it now.
Something like:
[[@"MyClass" alloc] init];
I seem to recall a function that would return some kind of class id based on a string that can then be used to alloc the object.
i have a WPF TextBox that user can type number in that . now i am searching for a string format that can separate TextBox number each 3 point (like 0,0) but i want separate text with Slash or Back Slash or another character. and we do not know how much point our number has.
i am searching for string format not Linq solution or etc . i read Microsoft help but cant find any way .
sample = 123456789 == 123/456/789 (good) --- 123,456,789 (bad)
Hello All-
In C# how can I search through a Folder and its Subfolders to find files that match a string value. My string value could be "ABC123" and a matching file might be ABC123_200522.tif. Can an Array collect these? Thanks in advance.
-Josh
So, I have an associative array and the keys in the array are properties of an object. I want to loop through the array and in each interation do something like this:
Object.key
This however does not work and results in returning undefined rather than the value of the property.
Is there a way to do this?
Thanks
Does anybody have a quickie for converting an unsafe stringto an int?
The string typically comes back as: '234\r\n' or something like that.
In this case I want 234. If '-1\r\n', I want -1. I never want the method to fail but I don't want to go so far as try, except, pass just to hide errors either (in case something extreme happens).
Does anyone know how to convert a list to a string in Oz? I have a list of characters I need to convert to a string and I didn't see any concatenation operator in the Oz documentation.
thanks
I'm trying to implement a singleton class, that holds a com object inside it. Class implements IDisposable interface, but when I try to implement a finalization method, I get an exception of access to com object from another thread.
This happens because clr uses a different thread when finalizes objects.
Is there any way to implement such a thing or maybe I just doing something wrong?
Hi,
How to restore the value of a string after using
FormsAuthentication.HashPasswordForStoringInConfigFile()
i have a string s1 = "abc" then
FormsAuthentication.HashPasswordForStoringInConfigFile(s1, "SHA1") =
A9993E364706816ABA3E25717850C26C9CD0D89D
How can i decrypt "A9993E364706816ABA3E25717850C26C9CD0D89D" back to "abc"??
String 14/04/2010 17:12:11.
How to replace the characters to get a string
14%04%2010%17%12%11
I know the method Replace, but its syntax Replace(Char,Char). I have to use it 3 times. How to write shorter? Use regular expressions? Can I do without them?