I want to use a queue data structure in my Objective-C program. In C++ I'd use the STL queue. What is the equivalent data structure in Objective-C? How do I push/pop items?
I am submitting a Chinese character to my form but once it is submitted it is coming as Unicode character.
For e.g. I am entering this ‘??’ and the value going to my form is ‘星洲’
Any inputs how to convert this Unicode to the Chinese character equivalent.
Hi,
I want to know if there is a short way to do the migrations down equivalent to rake db:migrate (for the migrations up).
Instead of doing : rake db:migrate:up VERSION=1, rake db:migrate:up VERSION=2, ... we can do : rake db:migrate!
But for : rake db:migrate:down VERSION=10, rake db:migrate:down VERSION=..., rake db:migrate:down VERSION=1, is there a shortcut?
Tank you for your help!
Can someone please give the Java equivalent of the below python (which slices a given array into given parts) which was originally written by ChristopheD here:
def split_list(alist, wanted_parts=1):
length = len(alist)
return [ alist[i*length // wanted_parts: (i+1)*length // wanted_parts]
for i in range(wanted_parts) ]
I don't know any python but can really use the above code in my Java app. Thanks
Howdy..
Anybody know if it's possible to enable RFC1323 on a per TCP socket basis in windows?
I know it can be changed system wide via the registry ( http://www.psc.edu/networking/projects/tcptune/OStune/winxp/winxp_stepbystep.html )
Also, it seems like this is possible *nix via:
int on=1;
setsockopt(s,IPPROTO_TCP,TCP_RFC1323,&on,sizeof(on));
Is there a Windows equivalent?
Thanky much!
If Apple doesn't want developers using private APIs in the iPhone SDK, why don't they do something like mark the classes and/or methods with whatever the Objective-C equivalent of C#'s "internal" keyword? If the APIs are spread amongst multiple binaries, Apple could refactor them into dedicated private-API-only binaries to make this easier for them.
I learned everything I know about Rails from Railscasts. Now I want to learn Django but I'm not finding any comprehensive tutorial resources like Railscasts. Does an equivalent not exist in the Django world? If so, is that because there is less to learn?
I'm trying to customise the mark-up of the default search results page in Drupal 6. Specifically I'd like to remove the search box and the title from the page - I know I can hide it with CSS, but I'd rather it wasn't rendered in the first place.
Ideally, in the same why that you theme a particular content type node by copying the node.tpl.php and renaming it to something like node-blog.tpl.php and then amending the mark-up accordingly - is there an equivalent way to do this for the search results page?
What's the simplest and most effective way to selectively redirect HTTP requests to your ASP.NET page to its HTTPS equivalent?
For example, if my page site URL is http://www.somesite.com, I want to redirect some (or all) page requests to https://www.somesite.com.
What's the easiest way to do that?
I am a newcomer to Python and am converting a Perl script. What is the Python equivalent to...
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
Any help is greatly appreciated.
Hi.
I'm working on multilingual Asp.NET MVC application. In url i need to use category name.
Is there any way how to convert i.e japanese text to its url safe equivalent?
Or should i use original text in url(www.example.com/??/? = www.example.com/product/car)?
so in SQL you can do something like:
WHERE title IN('title1','title2','title3')
to test for set membership. how can I do this in VB.NET/C#.NET?
Example:
IF textMyTitle.text IN ("title1","title2","title 3") THEN
'Take Action
End If
Obviously the IN part of that statement doesn't work...whats the logical equivalent in .NET?
In Hibernate 3, is there a way to do the equivalent of the following MySql limit in HQL.
select * from a_table order by a_table_column desc limit 0, 20;
I don't want to use setMaxResults if possible. This definitely was possible in the older version of Hibernate/HQL, but seems to have disappeared.
In a controller action of a CastleMVC application, how can I get the user's IP Address?
I think in asp.net mvc it would be Request.ServerVariables["REMOTE_ADDR"], but I can't find an equivalent in Castle.
(I am aware of potential proxy issue's etc, the address that is reported in the request is fine)
In Scheme, how can I make use of the define/lambda shorthand for nested lambda expressions within my define?
For example given the following procedure...
(define add
(lambda (num1 num2)
(+ num1 num2)))
One can shorten it to this:
(define (add num1 num2)
(+ num1 num2))
However, how can I shorten the following function similarly ?
(define makeOperator
(lambda (operator)
(lambda (num1 num2)
(operator num1 num2))))
;example useage - equivalent to (* 3 4):
((makeOperator *) 3 4)
I'm playing around with css transforms and the equivalent filters in IE, and want to simulate perspective by transforming a 2d rectangle into a trapezium.
Specifically, I want the right hand side of the rectangle to stay the same height, and the left hand side to be say 80% of the height, so that the mid points of both sides are horizontally in line with each other.
I'm familiar with matrix algebra, but can't think how to determine what matrix will do that.
I have (in the past) written cross-platform (Windows/Unix) applications which, when started from the command line, handled a user-typed Ctrl-C combination in the same way (i.e. to terminate the application cleanly).
Is it possible on Windows to send a Ctrl-C/SIGINT/equivalent to a process from another (unrelated) process to request that it terminate cleanly (giving it an opportunity to tidy up resources etc.)?
What's the difference between having keyspace Foo and column families A and B in it vs. having two keyspaces FooA and FooB with one column family in each?
API make it look as if these two were pretty much equivalent.
As a bonus question, how do supercolumns fit into this picture?
In former Mac OS x versions it was possible to call Cocoa methods via the "call method" command in applescript ("Applescript Studio").
E.g. this way:
set theURL to "http://www.apple.com"
set URLWithString to (call method "stringByAddingPercentEscapesUsingEncoding:" of theURL with parameter 30)
The script interpreter in the "Applescript Editor" (10.6) does not understand the command "call method". - Is there an equivalent for "Applescript Editor" (10.6)?
If I want to build a site with PHP, all I have to do is install the PHP package and make sure mod_php is enabled in my apache web server. Voila! a PHP environment.
Now, if I want to build a site with equivalent Java tech, i.e. JSP and Servlets, What do I have to install?
Is this:
($.fn.myFunc = function() {
var Dennis = function() { /*code */ }
$('#Element').click(Dennis);
})();
equivalent to:
($.fn.myFunc = function() {
$('#Element').click(function() { /*code */ });
})();
If not, can someone please explain the difference, and suggest the better route to take for both performance, function reuse and clarity of reading.
Thanks!
Are the following 2 lines completely equivalent? If not what's the difference? I've seen plently of shellscripts utilize number 1 and was just wondering what it gives you compared with number 2.
typeset TARGET="${XMS_HOME}/common/jxb/config/${RUNGROUP}.${ENV}.properties"
TARGET="${XMS_HOME}/common/jxb/config/${RUNGROUP}.${ENV}.properties"
How do you encode a javascript object/hash (pairs of properties and values) into a URL-encoded query string with YUI (2.7.0 or 3.0.0 Beta) ?
I want to do the equivalent of Object.toQueryString() from Prototype:
I need this to encode parameters for GET and POST requests with YAHOO.util.Connect.
It turns out YAHOO.util.Connect has a setForm() method to serialize a form but that still leaves me out cold to encode parameters for GET requests, or the 4th parameter of YAHOO.util.Connect.asyncRequest() to pass post data.