\"\nmail($email_to, $email_subject , $message,$headers);"},"language":{"kind":"string","value":"unknown"},"title":{"kind":"string","value":""}}},{"rowIdx":18421,"cells":{"_id":{"kind":"string","value":"d18422"},"partition":{"kind":"string","value":"test"},"text":{"kind":"string","value":"Have you looked at $where clauses in MongoDB? Seems like those would pretty much give you exactly what you're looking for. In PyMongo it would look something like:\ndb.foo.find().where(\"some javascript function that will get applied to each document matched by the find\")"},"language":{"kind":"string","value":"unknown"},"title":{"kind":"string","value":""}}},{"rowIdx":18422,"cells":{"_id":{"kind":"string","value":"d18423"},"partition":{"kind":"string","value":"test"},"text":{"kind":"string","value":"I reckon this'll solve it:\nchar* ptr = (char*)&t;\n*(int*)(ptr+sizeof(string)) = 10;\n\nsizeof will return the size in bytes. Pointer increments will go for the size of the object its pointing at. char is a byte in size.\nIf you want to read up on it: C pointer arithmetic article\nJust to reiterate what I think you've said: you're just hacking around as a point of learning, and you know there's no way you should ever do this in real life... !!\n\nA: Why it doesn't work\nReally just never write code like this. There is a way to set private data and that is via public members on the class. Otherwise, it's private for a reason. This being C++, there are actually non-UB ways of doing this but I'm not going to link them here because don't. \nWhy it doesn't work, specifically\nHint: What does ptr + sizeof(string) actually mean, for ptr being an int*? What is ptr pointing to after this line?\n\nA: The pointer arithmetic should be done with byte pointers, not integer pointers. \n#include \n#include \n\nusing namespace std;\n\nclass Test\n{\nprivate:\n string s;\n int data;\npublic:\n Test() { s = \"New\", data = 0; }\n int getData() { return data; }\n};\n\nint main()\n{\n Test t;\n char* ptr = (char*)&t;\n *(int*)(ptr+sizeof(string)) = 10;\n cout << t.getData();\n return 0;\n}"},"language":{"kind":"string","value":"unknown"},"title":{"kind":"string","value":""}}},{"rowIdx":18423,"cells":{"_id":{"kind":"string","value":"d18424"},"partition":{"kind":"string","value":"test"},"text":{"kind":"string","value":"It is not an entity framework limitation but SQL server limitation. You cannot have more then 2100 parameters for IN statement.\nSELECT * FROM YourTable WHERE YourColumn IN (1,2,....,2101)\n\nSo I see 2 workarounds for it:\n\n\n*\n\n*Split the query in several queries sending each time less then <2100 parameters for the IN statement.\n\n*Insert all the parameters in a special DB Table and then perform your query against that table.\nFor example, you can create a temporary table, insert there more then 2100 parameters and then JOIN your table with this temporary table.\n\n\n CREATE TABLE #temptable (id int);\n INSERT INTO #temptable (id) VALUES (1), (2), (3)\n SELECT * FROM YourTable yt INNER JOIN #temptable tt ON yt.id = tt.id\n\n\nA: I had the same issue, what I did is, removed all the entities from the model and then added them back to model and it's worked."},"language":{"kind":"string","value":"unknown"},"title":{"kind":"string","value":""}}},{"rowIdx":18424,"cells":{"_id":{"kind":"string","value":"d18425"},"partition":{"kind":"string","value":"test"},"text":{"kind":"string","value":"In the first example, since the function uses self (which is set to a reference to the new instance) rather than this, no matter how the function is called/bound, it would always correctly set its own message observable.\nIn the second example, when binding normally to the function like data-bind=\"click: eatSomething\", you would get the same result. Knockout calls the function with the value of this equal to the current data.\nIf you had a scenario where you needed to call the function from a different context (maybe your view model has a child object that you are using with or a template against). then you might use a binding like data-bind=\"click: $parent.eatSomething\". KO would still call the function with this equal to the current data (which would not be $parent), so you would have an issue.\nOne advantage of putting the function on the prototype though, is that if you created many instances of HomeViewModel they would all share the same eatSomething function through their prototype, rather than each instance getting its own copy of the eatSomething function. That may not be a concern in your scenario, as you may only have one HomeViewModel.\nYou can ensure that the context is correct by calling it like: data-bind=\"click: $parent.eatSomething.bind($parent). Using this call, would create a new wrapper function that calls the original with the appropriate context (value of this). Alternatively, you could bind it in the view model as well to keep the binding cleaner. Either way, you do lose some of the value of putting it on the prototype, as you are creating wrapper functions for each instance anyways. The \"guts\" of the function would only exist once on the prototype though at least.\nI tend to use prototypes in my code, but there is no doubt that using the self technique (or something like the revealing module pattern) can reduce your concern with the value of this."},"language":{"kind":"string","value":"unknown"},"title":{"kind":"string","value":""}}},{"rowIdx":18425,"cells":{"_id":{"kind":"string","value":"d18426"},"partition":{"kind":"string","value":"test"},"text":{"kind":"string","value":"Looks like you have the basic idea, but your code is all over the place.\nTry something like:\nsearch_name = raw_input('Please enter the actor to search for: ')\nactors = ['Idris Elba', 'Dwayne Johnson', 'Mel Brooks']\n\nif search_name in actors:\n print search_name + 'is in the movie!'\nelse:\n print search_name + 'is NOT in the movie!'\n\nIf you want to continue asking until the input is a name in the list, use a loop:\nsearch_name = raw_input('Please enter the actor to search for: ')\nactors = ['Idris Elba', 'Dwayne Johnson', 'Mel Brooks']\n\nwhile search_name not in actors:\n print search_name + 'is NOT in the movie!'\n search_name = raw_input('Please enter a different actor's name:')\n\nprint search_name + 'is in the movie!'"},"language":{"kind":"string","value":"unknown"},"title":{"kind":"string","value":""}}},{"rowIdx":18426,"cells":{"_id":{"kind":"string","value":"d18427"},"partition":{"kind":"string","value":"test"},"text":{"kind":"string","value":"Giving this answer for completeness - even though your case was different.\nI've once named my django project test. Well, django was importing python module test - which is a module for regression testing and has nothing to do with my project.\nThis error will occur if python finds another module with the same name as your django project. Name your project in a distinct way, or prepend the path of the parent directory of your application to sys.path.\n\nA: I think mod_python is looking for settings in the MKSearch module which doesn't exist in side the /home/user/django/MyDjangoApp directory. Try adding the parent dir to the PythonPath directive as below:\n\n SetHandler python-program\n PythonHandler django.core.handlers.modpython\n SetEnv DJANGO_SETTINGS_MODULE MKSearch.settings\n PythonOption django.root /MyDjangoApp\n PythonPath \"['/home/user/django/', '/home/user/django/MyDjangoApp,'/var/www'] + sys.path\" \n PythonDebug On\n\n\nOr remove the module name from the DJANGO_SETTINGS_MODULE env var as below:\n\n SetHandler python-program\n PythonHandler django.core.handlers.modpython\n SetEnv DJANGO_SETTINGS_MODULE settings\n PythonOption django.root /MyDjangoApp\n PythonPath \"['/home/user/django/MyDjangoApp,'/var/www'] + sys.path\" \n PythonDebug On\n\n\n\nA: The following example, located in my Apache configuration file, works. I found it very hard to get mod_python to work despite good answers from folks. For the most part, the comments I received all said to use mod_wsgi, instead of mod_python.\nComments I've seen including from the Boston Python Meetup all concur mod_wsgi is easier to use. In my case on Red Hat EL 5 WS, changing from mod_python is not practical. \n\n SetHandler python-program\n PythonHandler django.core.handlers.modpython\n SetEnv DJANGO_SETTINGS_MODULE settings\n PythonOption django.root /home/amr/django/amr\n PythonPath \"['/home/amr/django', '/home/amr/django/amr', '/usr/local/lib\n/site-packages/django'] + sys.path\"\n PythonDebug On\n"},"language":{"kind":"string","value":"unknown"},"title":{"kind":"string","value":""}}},{"rowIdx":18427,"cells":{"_id":{"kind":"string","value":"d18428"},"partition":{"kind":"string","value":"test"},"text":{"kind":"string","value":" 4, \"a\" => 3, \"b\" => 2, \"c\" => 1);\nasort($fruits, SORT_NUMERIC);\nforeach ($fruits as $key => $val) {\n echo \"$key = $val\\n\";\n}\n?>"},"language":{"kind":"string","value":"unknown"},"title":{"kind":"string","value":""}}},{"rowIdx":18428,"cells":{"_id":{"kind":"string","value":"d18429"},"partition":{"kind":"string","value":"test"},"text":{"kind":"string","value":"It's actually unclear what your problem is. If you want the form submit to be idempotent/bookmarkable, then just remove method=\"post\" from the HTML