Search Results

Search found 2210 results on 89 pages for 'stupid phil'.

Page 58/89 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • Can you in any way interface Ruby Gems with PHP, Python, etc.?

    - by Chad Johnson
    Stupid question, and forgive me for asking, but someone is asking me, and I am not a super expert with Rails yet. Suppose I have some Rails gem I write. Now suppose a customer has some other framework, like Django or CakePHP, and I want to provide the functionality offered by my gem (eg. CRUD for automotive data) to them as a module in their framework. Could I somehow make it so they could interface my gem with Django or CakePHP? Obviously I could do something with some API magic--and I'll probably end up going that route. But I just want to know whether there is a way to directly interface with Gems from a non-Rails application.

    Read the article

  • Django template tag basic question

    - by ninja123
    It looks like this template tag works like a charm for most people: http://blog.localkinegrinds.com/2007/09/06/digg-style-pagination-in-django/ For some reason I get this error: Caught an exception while rendering: 'is_paginated' I use this template tag in my template like so: {% load digg_paginator %} {% digg_paginator %} Where digg_paginator.py is in my app/templatetags folder and the included template context digg_paginator.html is in my app/templates folder. The queryset that needs pagination is called 'destinations'. If i just specify {% digg_paginator %}, how does it know what variable to paginate?? I feel I am missing something important here or just plain stupid :P Someone please help, or explain to me how this should be done. Thanks

    Read the article

  • Is gzip compression useful for mobile devices?

    - by Savageman
    Hi SO, I'm wondering if anyone has a clue on whether the gzip compression is as much useful on mobile devices than it is on a desktop computer. Will the phone use more battery? Or will it save some because of the bandwidth saving? Will the page page load faster or is the uncompress process slow on those limited devices? Does the compressed data actually reach the end-user or is it uncompressed somewhere by the 3G provider? (this may be a stupid question, sorry). Thank you.

    Read the article

  • C++: Avoid .cpp files with only an empty (de)constructor

    - by Martijn Courteaux
    Hi, When I have a header file like this: #ifndef GAMEVIEW_H_ #define GAMEVIEW_H_ #include <SDL/SDL.h> class GameView { public: GameView(); virtual ~GameView(); virtual void Update() = 0; virtual void Render(SDL_Surface* buffer) = 0; }; #endif /* GAMEVIEW_H_ */ I need to create a .cpp file like this: #include "GameView.h" GameView::~GameView() { } GameView::GameView() { } This is a bit stupid. Just a .cpp file for an empty constructor and deconstructor. I want to implement that method simply in the header file. That is much cleaner. How to do this?

    Read the article

  • Paging Recordsets from SQL Serverside

    - by Jonno
    I've been banging my head off this one for a while. I want to call 1k records from a SQL database and page them per 100. In classic ASP (where I'm moving from) this was dead easy to do with ADODB but with VB using ADO.net I can't find a single way that doesn't involve stored procs (which I want to avoid for now). It seems really stupid to call all 1k and sort it programmatically. Edit: It's SQL Server 2005 / .net 4.0 / Visual Studio 2010. Edit 2: Just to reiterate, I have Googled extensively and don't want to use stored procedures. There are many ways to get paged data but everything I see involves paging the data in the program rather than from the server.

    Read the article

  • threading.Event wait function not signaled when subclassing Process class

    - by user1313404
    For following code never gets past the wait function in run. I'm certain I'm doing something ridiculously stupid, but since I'm not smart enough to figure out what, I'm asking. Any help is appreciated. Here is the code: import threading import multiprocessing from multiprocessing import Process class SomeClass(Process): def __init__(self): Process.__init__(self) self.event = threading.Event() self.event.clear() def continueExec(self): print multiprocessing.current_process().name print self print "Set:" + str(self.event.is_set()) self.event.set() print "Set:" + str(self.event.is_set()) def run(self): print "I'm running with it" print multiprocessing.current_process().name self.event.wait() print "I'm further than I was" print multiprocessing.current_process().name self.event.clear() def main(): s_list = [] for t in range(3): s = SomeClass() print "s:" + str(s) s_list.append(s) s.start() raw_input("Press enter to send signal") for t in range(3): print "s_list["+str(t)+"]:" + str(s_list[t]) s_list[t].continueExec() raw_input("Press enter to send signal") for t in range(3): s_list[t].join() print "All Done" if __name__ == "__main__": main()

    Read the article

  • How to load the whole content of a page into another window?

    - by Cristian Castiblanco
    I'm building a Dashboard and for some stupid reasons my boss wants to load it in a frame on the homepage (yes a frame, he still lives in the 1990s). Anyway, sometimes the dashboard needs some room so that it can show all charts correctly, so I want to add a feature to load the content of the dashboard into a new window. The problem is that, if the user has had some interaction with the dashboard, it will contain modal dialogs, new images, etc... so I want to load all the dashboard content into a new window without reloading its content. Of course, the user should be able to continue browsing the dashboard without problems. How can I do that? I'm using jQuery as my JavaScript framework.

    Read the article

  • Is there a fast concat method for linked list in Java?

    - by rocker
    How can I concat two linked lists in O(1) with Java via jdk, google or apache commons collection or whatever? E.g. in jdk there is only the addAll method which is O(n). Another feature I miss is to concat two lists where each of them could be in inverse order. To illustrate this assume two lists a-b-c and e-f-g could merged into a-b-c-e-f-g a-b-c-g-f-e c-b-a-e-f-g c-b-a-g-f-e Do you know of such a list implemenation or do I have to implement my own linked list? It would be also helpful to know how to tweak existing solutions (e.g. the jdk LinkedList has a lot of private methods only). These features seems to me very obvious, hopefully I am not missing something stupid.

    Read the article

  • Developing web app, question for mobile developers

    - by Stephen Kellett
    I'm going to develop a web app that I expect some people will also end up wanting to view on their phones. The UI will be fairly straightforward (no frames, just CSS/HTML). May have a bit of Flash, but not for the first version. My question is, for testing viewing of the web app on mobile devices what devices would you recommend that I test on (and thus, most likely, have to purchase)? Windows Mobile iPhone Android Other? or can I use emulators for any/all of these? Note that I'm not developing a platform (android, iPhone) specific app, just a web application that I expect will also be accessed from a mobile phone. I apologise if this seems like a niave/stupid question, but this hobby project is totally away from my commercial experience and I just don't know the answers to these questions, hence asking here. Thanks for reading.

    Read the article

  • Handler not yet determined error

    - by SourceC
    Hello, I don’t know anything about deploying a website, so I probably made some stupid mistake. Anyways, I opened IIS 7 manager, created new virtual directory ( via Add Application ) and pointed it to physical directory where Visual studio saved my Web project. But when I tried to request an .aspx page, browser reported the following error (I won’t post the whole error, but just the interesting bits): Handler: Not yet determined Config Error: Cannot read configuration file due to insufficient permissions Logon User: Not yet determined A) why is handler not yet determined? As far as I know, IIS7 does have Asp.Net handler registered?! B) Why wouldn’t IIS have sufficient permissions? Does that mean I should give IIS higher privileges? Or does Asp.Net runtime have insufficient permissions? C) Could the error also be due to the fact that perhaps it expected the user to authenticate itself? I’m assuming this due to Logon user not yet being determined? D) And finally, any ideas how to make it work? thanx

    Read the article

  • Newbie question attribute from associated table not showing up in index view

    - by Lauren
    Hi I know this is something simple I am doing wrong. I have three tables, installation, neighborhood, schools Installation: has_many :schools has_many :neighborhoods Neighborhood: has_many :installations has_many :schools Schools: belongs_to :installations belongs_to :neighborhoods I can't figure out how to show the name of the neighborhood the school is located in on the index view. I can get it to show on the show view once I have the school id. But on the index view I can't figure out what to put in the controller that will allow me to access the neighborhood name from the neighborhood_id that is in the School model. I am sure this is so easy and I am screwing up something stupid. HELP!

    Read the article

  • php array regular expressions

    - by bell
    I am using regular expressions in php to match postcodes found in a string. The results are being returned as an array, I was wondering if there is any way to assign variables to each of the results, something like $postcode1 = first match found $postcode2 = second match found here is my code $html = "some text here bt123ab and another postcode bt112cd"; preg_match_all("/([a-zA-Z]{2})([0-9]{2,3})([a-zA-Z]{2})/", $html, $matches, PREG_SET_ORDER); foreach ($matches as $val) { echo $val[0]; } I am very new to regular expressions and php, forgive me if this is a stupid question. Thanks in advance

    Read the article

  • mySQL & Relational databases: How to handle sharding/splitting on application level?

    - by Industrial
    Hi everybody, I have thought a bit about sharding tables, since partitioning cannot be done with foreign keys in a mySQL table. Maybe there's an option to switch to a different relational database that features both, but I don't see that as an option right now. So, the sharding idea seems like a pretty decent thing. But, what's a good approach to do this on a application level? I am guessing that a take-off point would be to prefix tables with a max value for the primary key in each table. Something like products_4000000 , products_8000000 and products_12000000. Then the application would have to check with a simple if-statement the size of the id (PK) that will be requested is smaller then four, eight or twelve million before doing any actual database calls. So, is this a step in the right direction or are we doing something really stupid?

    Read the article

  • Click events not working in Rails view

    - by Fdr
    I have following view (html.erb): <h3>My view</h3> <script> function test() { alert("hello"); } </script> <input type="button" onClick="test();" value="test" /> For reasons I cannot understand the onClick event never gets fired when I access the view through rails(tried static apache hosting - no problems there). Here is rendered html: http://pastebin.com/LmGysgUG I feel quite stupid, is this something to do the way Rails renders views?

    Read the article

  • abstract class need acces to subclass atribute

    - by user1742980
    I have a problem with my code. public abstract class SimplePolygon implements Polygon { ... public String toString(){ String str = "Polygon: vertices ="; for(int i = 0;i<varray.length;i++){ str += " "; str += varray[i]; } return str; } } public class ArrayPolygon extends SimplePolygon { private Vertex2D[] varray; public ArrayPolygon(Vertex2D[] array){ varray = new Vertex2D[array.length]; if (array == null){} for(int i = 0;i<array.length;i++){ if (array[i] == null){} varray[i] = array[i]; } ... } Problem is, that i'm not allowed to add any atribute or method to abstract class SimplePolygon, so i'cant properly initialize varray. It could simply be solved with protected atrib in that class, but for some (stupid) reason i'cant do that. Has anybody an idea how to solve it without that? Thanks for all help.

    Read the article

  • Creating parameterized type object using annonymous class

    - by Andrei Fierbinteanu
    This might be a stupid question, but I just saw a question asking how to create a Type variable for a generic type. The consensus seemed to be that you should have a dummy method returning that type, and then use reflection to get it (in this case he wanted Map<String, String>). Something like this : public Map<String, String> dummy() { throw new Error(); } Type mapStringString = Class.forName("ThisClass").getMethod("dummy").getGenericReturnType(); My question is, not having used reflection that much, couldn't you just do something like: Type mapStringString = new ParameterizedType() { public Type getRawType() { return Map.class; } public Type getOwnerType() { return null; } public Type[] getActualTypeArguments() { return new Type[] { String.class, String.class }; } }; Would this work? If not, why not? And what are some of the dangers/problems if it does (besides being able to return some Type like Integer<String> which is obviously not possible.

    Read the article

  • How to look up an NHibernate entity's table mapping from the type of the entity?

    - by snicker
    Once I've mapped my domain in NHibernate, how can I reverse lookup those mappings somewhere else in my code? Example: The entity Pony is mapped to a table named "AAZF1203" for some reason. (Stupid legacy database table names!) I want to find out that table name from the NH mappings using only the typeof(Pony) because I have to write a query elsewhere. How can I make the following test pass? private const string LegacyPonyTableName = "AAZF1203"; [Test] public void MakeSureThatThePonyEntityIsMappedToCorrectTable() { string ponyTable = GetNHibernateTableMappingFor(typeof(Pony)); Assert.AreEqual(LegacyPonyTableName, ponyTable); } In other words, what does the GetNHibernateTableMappingFor(Type t) need to look like?

    Read the article

  • Facebook email Permission, oath2, doesnt work?

    - by Mathias Eklöf
    since the new Auth Dialog from Facebook (for my App & homepage), I cannot get the dialog to show that my homepage/app needs the users email when connection to my homepage/app. In the Auth-section of my app I've added "email" to the User & Friend Permissions. Also I've added it to the referal when someone clicks the "Login with facebook"-button. When someone clicks the Facebook-button, he/she redirects to a page which has the PHP-code with Facebook SDK PHP (latest). Here's how I generate the send-to-url for the dialog: $login_url = $facebook-getLoginUrl(array('req_perms' = 'email,publish_stream')); header("Location: ".$login_url); But when the Dialog pops up, the only permission request it does is "basic information". I need to request the Email. Am I stupid or is it a bug somehow? I've also recreated the App.

    Read the article

  • Dynamically create class attributes

    - by ahojnnes
    Hi, I need to dynamically create class attributes from a DEFAULTS dictionary. defaults = { 'default_value1':True, 'default_value2':True, 'default_value3':True, } class Settings(object): default_value1 = some_complex_init_function(defaults[default_value1], ...) default_value2 = some_complex_init_function(defaults[default_value2], ...) default_value3 = some_complex_init_function(defaults[default_value3], ...) I could also achive this by having sth. like __init__ for class creation, in order to dynamically create these attributes from dictionary and save a lot of code and stupid work. How would you do this? Thank you very much in advance!

    Read the article

  • How does compiling circular dependencies work?

    - by Fabio F.
    I've made the example in Java but I think (not tested) that it works in other (all?) languages. You have 2 files. First, M.java: public class MType { XType x; MType() {x = null;} } Second, another file (in the same directory), XType.java: public class XType { MType m; public XType(MType m) {this.m = m;} } Ok it's bad programming, but if you run javac XType it compiles: compiles even MType because XType needs it. But ... MType needs XType ... how does that work? How does the compiler know what is happening? Probably this is a stupid question, but I would like to know how the compiler (javac or any other compilers you know) manages that situation, not how to avoid it. I'm asking because i'm writing a precompiler and I would like to manage that situation.

    Read the article

  • Help Fix a bug - Unexpected T_STRING

    - by thecoshman
    So I have just rebuilt my server, just on local network. Stick my site back on it, try to run the code, and I get a anice T_STRING error. This is all very strange, as I have not changed the code :S <?php $window_ID = -1; if(isset($_POST["window_ID"]) AND $_POST["window_ID"] != null){ $window_ID = trim($_POST["window_ID"]); } ?> This is the start of the file, apter this rather loverly snipit of PHP the rest is just XMl, yet on line 6 appertnlty there is an unexpected T_STRING, which is strange considering all that is on that line is the ?>, then the XML starts up... Any one got any ideas what has gone wrong here? Any chance it ould be magic quotes? I had turned it of before, but I want to now update my code to check for the magic quotes and avoid its stupid actions.

    Read the article

  • OOP question about functions that struck me all of a sudden.

    - by Nitesh Panchal
    Hello, May be my question is stupid. But i would like to get it cleared. We know that functions are loaded in memory only once and when you create new objects, only instance variables gets created, functions are never created. My question is, say suppose there is server and all clients access a method named createCustomer(). Say suppose all clients do something which fired createCustomer on server. So, if the method is in middle of execution and new client fires it. Will the new request be put on wait? or new request also will start executing the method? How does it all get managed when there is only one copy of function in memory? No book mentions answers to this type of questions. So i am posting here where i am bound to get answers :).

    Read the article

  • basename() returning int?

    - by EB
    Probably something stupid I'm missing but, why am I getting this warning? static void foo(char *path) { char *bname; char *path2 = strdup(path); bname = basename(path2); (line with basename() call): warning: assignment makes pointer from integer without a cast Indeed, if I change to this, the warning goes away: bname = (char *)basename(path2); man 3 basename tells me: char *basename(char *path); Both dirname() and basename() return pointers to null-terminated strings. What gives?

    Read the article

  • Django Forms: TimeField Validation

    - by Tom
    I feel like I'm missing something obvious here. I have a Django form with a TimeField on it. I want to be able to allow times like "10:30AM", but I cannot get it to accept that input format or to use the "%P" format (which has a note attached saying it's a "Proprietary extension", but doesn't say where it comes from). Here's the gist of my form code: calendar_widget = forms.widgets.DateInput(attrs={'class': 'date-pick'}, format='%m/%d/%Y') time_widget = forms.widgets.TimeInput(attrs={'class': 'time-pick'}) valid_time_formats = ['%P', '%H:%M%A', '%H:%M %A', '%H:%M%a', '%H:%M %a'] class EventForm(forms.ModelForm): start_date = forms.DateField(widget=calendar_widget) start_time = forms.TimeField(required=False, widget=time_widget, help_text='ex: 10:30AM', input_formats=valid_time_formats) end_date = forms.DateField(required=False, widget=calendar_widget) end_time = forms.TimeField(required=False, widget=time_widget, help_text='ex: 10:30AM', input_formats=valid_time_formats) description = forms.CharField(widget=forms.Textarea) Any time I submit "10:30AM", I get a validation error. The underlying model has two fields, event_start and event_end, no time fields, so I don't think the problem is in there. What stupid thing am I missing?

    Read the article

  • How to load the content of a page into another window?

    - by Cristian Castiblanco
    I'm building a Dashboard and for some stupid reasons my boss wants to load it in a frame on the homepage (yes a frame, he still lives in the 1990s). Anyway, sometimes the dashboard needs some room so that it can show all charts correctly, so I want to add a feature to load the content of the dashboard into a new window. The problem is that, if the user has had some interaction with the dashboard, it will contain modal dialogs, new images, etc... so I want to load all the dashboard content into a new window without reloading its content. Of course, the user should be able to continue browsing the dashboard without problems. How can I do that? I'm using jQuery as my JavaScript framework.

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >