I'm using pagination on a values from a set. So what this results in is me needing to get values from x to x + 20 which can be in the middle of a set with 50,000 entries. Is it possible that I can fetch these values by grabbing by the space in the set?
Would it make more sense to do
result = []
my_dict = dict(very_big_set)
for i in range(30000, 30020)
result.append(my_dict[i])
I want to do some metaprogramming in a statically typed language, where both my programs and my meta-programs will be typed. I mean this in a strong sense: if my program generator compiles, I want the type system to be strong enough that only type-correct programs can be generated.
As far as I know, only metaocaml can do this. (No, neither Template Haskell nor C++ templates fit the bill -- see this paper).
Long and short of the story is, whilst reading John Resig's blog (specifically http://ejohn.org/blog/javascript-trie-performance-analysis/) I came across a line which makes absolutely no sense to me whatsoever. Essentially it boils down to
object = object[key] = something;
(this can be found in the first code block of the article I've linked.)
This has proven rather difficult to google, so if anyone can offer some insight / a good online resource for me to learn for myself, I'd much appreciate it.
I happens to find that, when a live space page is loaded, inline images are fetched by https protocol instead of http protocol.
This doesn't make sense. The text part of live space is not fetched by https, why images are fetched with https? I bet the https way to fetch image just make the page loaded slower.
Is there any special advantage to choose https over http in this case?
Hello i'm consfused using the Messenger class of MVVM Light.
I have a ProductsViewModel that can get initialized a number of times.
In the constructor of ProductsViewModel I have this code:
Messenger.Default.Register(this, n = MessageBox.Show(n.Test));
The problem is, if I have 2 instances of ProductsViewModel, then Messenger gets registered twice.
Is is bad to Register the Messenger in a constructor?
Hope this makes sense!
"C://test/test/test.png" -> blub
blub = blub.Replace(@"/", @"\");
result = "C:\\\\test\\test\\test.png"
how does that make sense? It replaces a single / with two \
?
Something weird that I've been seeing, a web application written in ASP.Net (C#) that got the source code on the production server and compile that way. So when I deploy to the server I deploy the source code.
Why does .Net have this functionality? Doesn't make sense.
I'm currently trying emacs coming from vim. There is only one thing I desperately miss : tabs (in a GUI sense). I know TabBarMode but it doesn't keep the division of windows (with C-x 3 for example) from tab to tab while Vim does it. Is there any plugin for emacs that handle tabs in a more vim-like way?
One thing that I've always noticed with my unit tests is that they get to be kind of verbose; seeing as they could also be not verbose enough, how do you get a sense of when your unit tests are the right size?
I know of a good quote for this and it's:
"Perfection is achieved, not when
there is nothing left to add, but when
there is nothing left to remove."
- Antoine de Saint-Exupery.
I'm currently doing some data analysis on population data, so reporting the standard errors in the tables of parameter coefficients just doesn't really make statistical sense. I've done a fair bit of searching and can't find any way to customize the xtable output to remove it. Can anyone point me in the right direction?
Thanks a lot, I didn't post this lightly; if it's something obvious, I apologize for having wasted time!
I've coded a C# executable that uses xcopy (cmd.exe /Q /D /C xcopy [args]) to duplicate some files.
If I run the .exe by double-clicking it, the xcopy operation works every time.
If I run the .exe by double-clicking a shortcut to the .exe, the xcopy works only if the shortcut is in the same folder as the .exe.
This makes absolutely no sense to me, I wouldn't even know where to begin to find the answer.
So, you know, help.
Hi
I am using the forms.ModelForm to create my form. I want to be able to show the manytomany field in both model forms, how do I do this?
If the manytomany relationship is defined in the model it is fine and just appears but if it is not in the model (but is still linked via the other model) it does not appear.
Hope this makes sense. How can I make it show up?
Thanks
Hello all,
I need to apply IP restrictions to a site in IIS v6.0 using a range of IPs.
So for example i only want the below RANGE of IPs to be able to access the site:
From 123.111.22.3 -- 123.111.66.234
Has anyone got any idea on how this can best be achieved?
Hope this all make sense and all help is massively appreciated.
Thanks,
Elliott
Because of CDI (and its implementation Weld), every POJO in JEE6 can be annotated with @Named, which makes the POJO accessible to the view.
Does that mean that ManagedBeans are completely obsolete now?
Or do i miss something where @ManagedBean still makes sense?
The CakePHP Cookbook states that a Model can use a file (csv for example) instead of an actual database table but I couldn't find any implementation for it.
I was wondering if it is possible to use an Array of data as a model in CakePHP since I have a fairly static set of data which is important to me in a relationship with another table but it doesn't make a whole lot of sense to create a complete table for it.
Is it possible to implement a CakePHP Model using an Array?
While studying about JMX, I have seen one of the important feature of it is that it can manage a JVM itself, which i didn't understand about in what sense it can manage JVM. So can anybody elaborate this with some examples.
I have a range of modules running on generator.yml. In some of those I would like to hide records by default of Status: CLOSED (being the last of a range of Statuses). OF course if the user filters for CLOSED i want to show these records.
I thought it would make sense to apply andWhere('status_id=?',Status::CLOSED) in a specific table_method , but how do I access the filters of the module from within the model?
Is there a better way to do this?
I have a list:
list<Unit *> UnitCollection;
containing Unit objects, which has an accessor like:
bool Unit::isUnit(string uCode)
{
if(this->unitCode == uCode)
return true;
else
return false;
}
How do I search my UnitCollection list by uCode and return the corresponding element (preferably it's index).
I have looked at the find() method, but i'm not sure you can pass a boolean method in instead of a searched item parameter if that makes sense.
Hi everyone ,
i want to acces an Element of an XML. But somehow. i get null as the Result and that does not make any sense to me.
Can you find the mistake ?
Hi there.
Once I read an MSDN article that encouraged the following programming paradigm:
public class MyClass
{
public void Method1()
{
NewCustomException();
}
public void Method2()
{
NewCustomException();
}
void NewCustomException()
{
throw new CustomException("Exception message");
}
}
Do you think this paradigm makes sense? Wouldn't it be enough to store the exception message in a static const field and then pass it to the exception's constructor, instead of encapsulating the whole exception throw?
We are currently discussing the Best Practice for placing the @Transactional annotations in our code.
Do you place the @Transactional in the DAO classes and/or their methods or is it better to annotate the Service classed which are calling using the DAO objects? Or does it make sense to annotate both "layers"?
Seems like making a website CSS/XHTML/Web 2.0 compliant and highly search-engine optimized is as simple as nesting each and everything inside UL/LI tags. Is there a genuine reason for web designers/developers to use UL and LI tags even when it does not make any sense?
I am defining a primary key in MongoMapper.
class B
key :_id, string
key :externalId, string
end
The problem is that everything i add a new record in B, it appears that I need to explicity specify the _id, when it is already defined in the external id
B.new(:_id=>"123", :external_id=>"123 )
That does not quite make sense. There should be a way to specify externalId as the primary key, no?
I'm looking for a fast IDE for Linux that has Find&Replace. I'm currently using Geany and I've tried NetBeans, and Aptana doesn't have a PHP plugin for 2.0. I prefer one that has a sense of projects. Does anyone have any suggestions?