This is a pretty simple question- how can I check if a NSURL is linking to a local file?
I know, RTFM, but I checked the documentation and I don't seem to see any methods related to this.
The only methods I did find were -isFileReferenceURL and -isFileURL, but I think these only check if the URL directly links to a file.
note: I'm making an iPhone app, so by "local file" I mean a .html file stored in the project's resources.
Thanks for any help in advance.
Hi all,
What is the current practice like to write user-specific configuration settings into a rails application?
For example, privacy settings in a social networking application.
I know application-wide settings can be stored in a .yml file in config/ but what about users?
If I have large articles that need to be stored in a database, each associated with many tables would a NoSQL option help? Should I copy the 1000 char articles over multiple "buckets", duplicating them each time they are related to a bucket or should I use a normalized MySQL DB with lots of Memcache?
I have document like this:
{
"_id": ObjectId("4d17c7963ffcf60c1100002f"),
"title": "Text",
"params": {
"brand": "BMW",
"model": "i3"
}
}
{
"_id": ObjectId("4d17c7963ffcf60c1100002f"),
"title": "Text",
"params": {
"brand": "BMW",
"model": "i5"
}
}
What i need is the count of every params values. like:
brand
---------
BMW (2)
model
---------
i3 (1)
i5 (1)
I think i have to write map/reduce functions. How can i do this? Thanks.
I want to test whether a function invokes other functions properly with minitest Ruby, but I cannot find a proper assert to test from the doc.
The source code
class SomeClass
def invoke_function(name)
name == "right" ? right () : wrong ()
end
def right
#...
end
def wrong
#...
end
end
The test code:
describe SomeClass do
it "should invoke right function" do
# assert right() is called
end
it "should invoke other function" do
# assert wrong() is called
end
end
Hi,
I am using MVC 2 with Area.
To test routing, I am using MvcContrib.
This is the testing code:
[Test]
public void Home()
{
MvcApplication.RegisterRoutes(RouteTable.Routes);
"~/".ShouldMapTo(x = x.Login("Nps"));
}
I am not sure how to call routing definition that are stored in Areas.
Calling AreaRegistration.RegisterAllAreas() is not an option as it gives an exception.
Thanks
Revin
Is it possible to use SpatiaLite database on Android platform (1.6)? I am trying to program a google buzz-like app which need to take advantage of SpatiaLite functions, like calculating distance between 2 points, etc. Any external library needed? Thanks.
I love the IDLE. However, sometimes I have 100-200 line scripts and I want to sort of interactively debug/play with say, functions defined in foo.py instead of just calling python foo.py. Is there a way I can trigger IDLE in the context of my foo.py?
D <- read.csv("sample1.csv", header = FALSE, sep = ",")
D
V1 V2 V3 V4
1 20100316 109825 352120 239065
2 20100317 108625 352020 239000
3 20100318 109125 352324 241065
D[,1]
[1] 20100316 20100317 20100318
In the above example how do I get the data in D[,1] to be read, and stored as date values:
2010-03-16, 2010-03-17, 2010-03-18 ? I have lots of data files in this format.
TIA,
Hi,
I am unable to figure out where my cached fragments are being stored. What is the default location for fragment caching.
Cached fragment hit: views/listed_products (0.1ms)
I cannot find anything in the rails_root/public or rails_root/tmp/cache dirs
thanks,
ash
Hi,
I am scheduled to have an onsite interview so I am preparing few basic questions. According to the company profile, they are big on string manipulation questions. So far i am manually coded these functions:
1) String length, copy, concat, remove white space
2) Reverse
3) Anagrams
4) Palindrome
Please can some can give me a list of more classic string questions which i can practice before going there.
Hi all,
i want to create Stored PROCEDURE with multi statement, and it not working , and Google the problem and found that mysql dose not support Subquery statement "MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'"
My statement like this:
DROP PROCEDURE IF EXISTS proc_Name;
CREATE PROCEDURE `DBName`.`proc_Name`()
BEGIN
SELECT FROM table1 WHERE ORDER BY table1_Colom LIMIT 100;
UPDATE table2 SET table2_colom1 = 1 WHERE ID IN (SELECT ID FROM table2 ORDER BY table2_colom1 LIMIT 100);
END ;
Thanks in Advanced
jQuery Validation plugin has "element" argument for required rule. I know how to use it for inline functions but what if I want to pass it to out-of-line JS function? I tried this:
rules: {
startHours: {
required: startTimeRequired(element)
},
but it didn't work.
Which parts of pipelines are done using CPU and which are done using GPU?
Reading Wikipedia on Graphics Pipeline, maybe my question does not precisely represent what I am asking.
Referring to this question, which "steps" are done in CPU and which are done in GPU?
Edit:
My question is more into which parts of logical high level steps needed to display terrain+3D models are using CPU/GPU instead of which functions.
i populate uipicker's datasource from array built with sqlite database stored data. everythiongs works fine.. for a little while. after 6-7 spinnings, the picker freeze, and I get EXC_BAD_ACCESS. debugger indicates the program stopped in the main () function.
so, how could this happen? working for a while, and then, suddenly exit like that?
thanks
I am actually reading a rails book that is written for rails 2.3.5. I want to test Rails 3 beta as well. Is it possible to have such a setup in my Mac OS leopard?
I have tried with gem list -d rails. There are many versions stored in my mac but I don't know how to use different versions of rails while creating applications using rails command
I'm new to Scheme -- the functional programming language and I like it a lot for its first-class/higher-order functions. However, my data comes from a COM source with an object-oriented API.
I know Scheme and COM belong to different programming paradigms, but I'm wondering if there is any interface or a way for Scheme to connect to a COM source? Thanks.
Hi,
since in mysql datetime field is represented as string (i'm not sure how it works internally), wouldn't be from performance point of view faster to store date as unix timestamp? I don't need to use any mysql native date functions, i'm going for performance of sorting and selecting data.
if there was an index for that column, would be difference between int and datetime?
Thank you
I'm wondering what's the easiest/best way to determine if a sound, being recorded on the iPhone mic, is above a certain frequency.
My guess is that I would need to use the Audio Queue Services since I don't need to record the audio to a file.
I'm using SDK 4.0, so I can use the FFT functions in the Accelerate framework if needed.
I'm speaking of this module:
http://docs.python.org/library/operator.html
From the article:
The operator module exports a set of
functions implemented in C
corresponding to the intrinsic
operators of Python. For example,
operator.add(x, y) is equivalent to
the expression x+y. The function names
are those used for special class
methods; variants without leading and
trailing __ are also provided for
convenience.
I'm not sure I understand the benefit or purpose of this module.
Anybody out there notice anything wrong with this JSON? It validates at JSONLint.com, but neither Chrome nor Firefox's native JSON parse functions will properly parse it.
Any ideas?
{
"result": "{\"players\":[{\"name\":\"User 522\",\"turn\":true,\"score\":0},{\"name\":\"User 925\",\"turn\":false,\"score\":5}],\"enableControls\":false}",
"error": "null",
"id": "7"
}
I have an c# application that uses tables from sqlserver 2008 database (runs on standalone pc with local sqlserver).
Initially i install database on this pc with some initial data (there are some tables that application uses and the user doesn't touch).
The question is - how can i upgrade this database after user created some new data without harming it (i continue developing and can add some new tables or stored procedures or add some columns to existing tables).
Thanks in advance!