instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
According to this video http://www.facebook.com/video/video.php?v=562087699610 modern browsers break same origin policy so javascript can make ajax calls to whatever domain. Is this true? If yes, does this mean that this will be natural/acceptable whenever necessary eg to fetch data from my partner applications?
stackexchange/codereview
i'm not sure of the term for this problem i'm having, or if it's even an issue to worry about at all. let's say i have a hypothetical situation like this: it seems as though having the link from remix objects back to the the original objects makes for a somewhat complicated structure, especially if i start to add more...
stackexchange/codereview
I have a table id|level|name level can be 1,2 or 3 what I want to get is: id|lvl1name|lvl2name|lvl3name I'm using the following query SELECT L1."name" as lvl1name, L2."name" as lvl2name, L3."name" as lvl3name, L1.id FROM table as L1 JOIN table as L2 ON L1.id = L2.id JOIN table as L3 ON L2.id = L3.id ...
stackexchange/codereview
Is it possible to stub an entire chain using Mocha? For example, I want to stub: User.first.posts.find(params[:id]) such that it returns a predefined post instance instead of accessing the database. Ideally, I'd want to do something like: @post = Post.new User.any_instance.stubs(:posts,:find).returns(@post) As you ca...
stackexchange/codereview
Is it possible to specify explicitly local port that should be used by net.Stream, or to find out what local port is used for connection? According to the documentation, local port cannot be specified: stream.connect(port, host='127.0.0.1')
stackexchange/codereview
I have the following structure. Message (Text) MessageReading (Message, User) I'd like to load messages with corresponding MessageReading if it exists. I can achieve that with HQL: var query = session.CreateSQLQuery( @"SELECT {msg.*}, {mr.*} FROM Message msg LEFT OUTER JOIN MessageReading mr ON (mr.Message_I...
stackexchange/codereview
Works fine with a text link to fire dialog - but lasts for about .5 second if triggered from an html form submit button. Sounds crazy! Yep, just cannot get it to work. Help! $(document).ready(function() { $('#rating-0').click(function() { $('#dialog').dialog('open'); }); $('#dialog').dialog({ autoOpen: false, hei...
stackexchange/codereview
Is it possible to do array broadcasting in numpy with parameters that are vectors? For example, I know that I can do this def bernoulli_fraction_to_logodds(fraction): if fraction == 1.0: return inf return log(fraction / (1 - fraction)) bernoulli_fraction_to_logodds = numpy.frompyfunc(bernoulli_fraction_...
stackexchange/codereview
I am trying to make a Date() class, however I think my variables may not be working correctly or I am breaking some obscure class rule? One clue I got was during debugging...it directed me to the "thread.Class" and displayed the following code: private void exit() { if (group != null) { group.remove(this); ...
stackexchange/codereview
is it possible, in a C/C++ program, to allocate virtual memory (Swap Space) for an specific array, so that the program keeps using RAM for the rest of variables, and maybe getting some benefit at some type of problems??
stackexchange/codereview
I'm curious as to how DownThemAll does this. Do they use Javascript? How can I get a list of all of the urls in a website using Javascript?
stackexchange/codereview
The following works fine in c# (assuming value is an object): if (value is DateTime) What is the equivalent check for VB.NET?
stackexchange/codereview
I have an issue with my WYSIWYG editor. If users copy in outside text, this is seen as something like the following: " p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'; min-height: 13.0px} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Lucida Grande'} Only the variables assigned in the l...
stackexchange/codereview
OK, i have this jQuery script using ajax to load a response from a php file, but i want to do is to load maybe two variables from the php script rather than the whole page. $(document).ready(function() { $.ajaxSetup({ cache: false }); $("#object_area").load("test.php"); var refreshId = setInterval(function() {...
stackexchange/codereview
Hey. Problem with my request is that this website doesn't work with javascript, so i need some kind of embed code, or some alternate to do it. I know it is possible, i just don't know how. I want it to look like Twitter's Twitter Badge thingie, only without the real scripts. Can anyone help? Thanks in advance.
stackexchange/codereview
HI, I want to create a table in android, should contains a lot of rows. Each row has 4 columns, and if i click any view, i want to integrate onClick event for the view. I have developed something similar to the requirement,But didn't got the click view, Here is my code : LinearLayout lLayout1= null; LinearLayout m...
stackexchange/codereview
How can I "dock" a canvas in its parent? I have a UserControl that contains a canvas inside. <UserControl x:Class="MyUC" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup...
stackexchange/codereview
how do I use localization in Silverlight? since there are no local resource files in silverlight like ASP.Net. I am stuck at how would I do this? any ideas?
stackexchange/codereview
How can I clear all cookies in android ? Any sample code provided will be really helpful.
stackexchange/codereview
As I've studied so far, there are 2 ways to draw in xna; using spritebatch or putting items onto the 3d world and then use a camera to render it. Currently, I'm working on my 2.5D game. I'm using a mechanics that makes the deeper sprite translates slower, so that it looks like there is really depth there in the game. H...
stackexchange/codereview
I know you can auto-increment an id by mapping; <id column="user_id" name="id" > <generator class="increment"/> </id> But is it also possible increment a property, what I tried so far didn't work; <property column="numeric_value" name="nr" > <generator class="increment"/> </property>
stackexchange/codereview
How can I change the fading orange color in ExpandableListView while scrolling ? Thanks
stackexchange/codereview
I have the follow line: text.gsub(/,\ /,'| ').first But in addition to the first item, I want to apply it to the second item. How can I do that?
stackexchange/codereview
I'm using these libraries for an email application I'm building. $storage = new Zend_Mail_Storage_Imap($imap); if (strpos($storage->getMessage($i),'chocolate') !== FALSE ) { //Move to chocolate folder here } Also, is there a way to put incoming emails from this sender to automatically go into the chocolat...
stackexchange/codereview
I am trying to implement a low pass filter in Java. My requirement is very simple,I have to eliminate signals beyond a particular frequency (Single dimension). Looks like Butterworth filter would suit my need. Now the important thing is that CPU time should be as low as possible. There would be close to a million samp...
stackexchange/codereview
I've run into a really interesting runtime bug which generates a rogue stack overflow. I've defined a structure as follows: public enum EnumDataType { Raspberry, Orange, Pear, Apple }; public class DataRequest { public long DataSize { get { return 0; } set { DataSize = value; } } ...
stackexchange/codereview
Using the iOS 4.0 SDK, can I build an application for the iPad?
stackexchange/codereview
I'm attempting to format a cell in excel to the currency format. So I go into excel, record a macro of me converting an ordinary cell to a currency format, take a look at the vb script and see that it outputs the following: NumberFormat = "$ #,##0.00" So i take that format and paste it into my code, it works to the ext...
stackexchange/codereview
I've got the following mapping in my application. The mapping is generated, by a custom tool. Other mappings generated work ok, but this one is giving me a strange error which I don't understand. This is the mapping; <?xml version="1.0" encoding="utf-8"?> <!--Generated by NHibernate.Mapping.Attributes on 2010-10-29 08:...
stackexchange/codereview
I am trying to implement content browsing like it is done on Facebook when user is browsing the photos. I guess everyone is familiar with that photo browsing where you can click "next" and "previous" and immediately get the next or previous photo (you can also navigate using arrow keys). When you click "next" for examp...
stackexchange/codereview
I'm confused Does order matter when installing Sphinx Search. If mysql was already installed on my server, can I still install sphinx after or do I have to do them together or Sphinx before?
stackexchange/codereview
i'm using ANTLR (3.2) to parse some rather simple grammar. Unfortunately, I came across a little problem. Take the follwoing rule: exp : NUM | '(' expression OPERATOR expression ')' -> expression+ | '(' (MINUS | '!') expression ')' -> expression ; OPERATOR contains the same minus sign ('-') as is defined with MINU...
stackexchange/codereview
scratching my head over this. i have 350 strings average 90 chars long, all strings are unique. Now, i wanna generate a unique id for each string. i tried the sum of chars in the string wich gave two doubles, the returned sum is not unique enough. Anybody any idea how to approach this? I thought of hash(), is that the ...
stackexchange/codereview
I am setting a path variable with a query-string. What is the easiest way to check if the path (always a directory) exists or not. if(isset($_GET['p'])) { define(PATH, $_GET['p']); So now I have like mydomain.com?p=files/folder/sub and everything works fine, i'm reading the contents of the folder. However, I c...
stackexchange/codereview
I have a div that is being duplicated dynamically. After duping it, I need to remove the name from the hidden input only, but can't seem to be able to select it only. The majority of the file is prototype, but I have jQuery at my disposal (jq). I have managed to get the name to disappear, but it clears them all out, I...
stackexchange/codereview
How do I write this in jquery? I want to display a image 600x400 inside the div block on click? <script> function displayImage() { document.getElementById("demo").innerhtml ="image.jpg"; } </script> <form> <input type="submit" onClick="displayImage()"> </form> <div id="demo"> </div>
stackexchange/codereview
I am working on a Face Recognition system for my internship. I am developing the project in Java right now. I am using OpenCV library, but it does not seem to work correctly in detecting faces. I am at a point, where I capture image from the desktop and store it on the hard drive. All I want now is to detect a face i...
stackexchange/codereview
I have generic structure and I need to search using various generic type's attributes. Let's think of following implementation: public class Person { private int id; private String name; // + getters & setters } Now I have my custom data structure and one of it's method is like: public T search(T data) { ... } ...
stackexchange/codereview
i want to get the sum of quantity from the below query. how i write the group by clause in below mention query. select top 1 EvrId, TimeStamp, Date, BnhTnkMik1 as Quantity, (select TnkCode from Tanklar where TnkId=BnhTnkId) as Tank, FuelCode, InvoiceNo from Evrak join Hareket on (BnhEvrId=EvrId) join Stoklar on (Stok...
stackexchange/codereview
I am learning Swing and wrote an app that lets user select an image file and displays it on a JPanel. It works, but I want to handle situations when user doesn't select any file user selects a non image file In these cases I want to clear the JPanel and show an error message on a text area. I tried to do this as belo...
stackexchange/codereview
I have a process in Perl that creates another one with the system command, I leave it on memory and I pass some variables like this: my $var1 = "Hello"; my $var1 = "World"; system "./another_process.pl $var1 $var2 &"; But the system command only returns the result, I need to get the PID. I want to make something li...
stackexchange/codereview
For further clarification, C# has the '///' directive which invokes the super-secret-styled Comments which allow you to have nice comments built into intellisense. Java has the '@' directive that allows you to have nice comments as well. Does Python have something like this? I hope this question is clear enough, thanks...
stackexchange/codereview
Would anybody be able to recommend any free or paid for services out there to assess and critique a database produced in MS Access? Any help or advice appreciated, cheers Noel
stackexchange/codereview
I created a model that had a string primary_key. The Create action in Ruby on Rails gave me the following error: Couldn't find Theme with ID=0 My Theme table has no ID column, but a string column called name which is the primary key. After searching everywhere, I experimented myself with the Create action inside the th...
stackexchange/codereview
In my application iam using Log4j for logging.Presently I am placing log4j.xml in WEB-INF/classes. Below are the configurations i am using to load log4j.xml file. <!-- language: xml --> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/classes/log4j.xml</param-v...
stackexchange/codereview
Any one please help on sending ATA commands to SATA Drive on Mac OS. As per the Apple docs, its not possible to send it from Application and is recommended to write a Logical Unit Driver. There is not much document on the same for ATA family. Provider class for SATA device is IOAHCIBlockStorageDevice. Please shed some ...
stackexchange/codereview
I am new to Java. I made a new NewJFrame.java. In my current frame, i have a button, how can i link it to NewJFrame.java?
stackexchange/codereview
We're attempting to read in an HTML file that contains certain MS Word characters (such as that long hyphen). The problem is these characters, for example, are showing up as garbage in SQL 2008. The data column is varbinary, and am viewing this data by casting to varchar. Here is the code, verbatim: EDIT: Corrected def...
stackexchange/codereview
I'm trying to evaluate ODAC for using Oracle AQ. The request queue contains JMS objects like these (but without linebreaks and other whitespace): SYS.AQ$_JMS_BYTES_MESSAGE( SYS.AQ$_JMS_HEADER( 'null','null','null','null','null','null', SYS.AQ$_JMS_USERPROPARRAY( SYS.AQ$_JMS_USERPROPERTY('Key1',100,'Valu...
stackexchange/codereview
It seems like, for many javascript widgets, the authors have made a conscious effort to use tiny variable names. For example: // Instead of... this.mousePositions = new Array(); // they use... this.mp = new Array(); My question is this: how important is this in terms of reducing overall javascript file request size? I...
stackexchange/codereview
i am trying to compile example source code which is using the OpenGL, SDL and IL aka DevIL aka OpenIL libraries. OpenGL and SDL are available as native frameworks, but DevIL isn't. So here is what i did: I installed DevIL via homebrew. First i changed the Formula, because i need ILUT: brew edit devil then edited these...
stackexchange/codereview
I have my very own minimal view class with this: - (void) awakeFromNib { NSLog(@"awakeFromNib!"); [self.layer setDelegate:self]; [self.layer setFrame:CGRectMake(30, 30, 250, 250)]; self.layer.masksToBounds = YES; self.layer.cornerRadius = 5.0; self.layer.backgroundColor = [[UIColor redColor] CGC...
stackexchange/codereview
I'm trying to find research/advice on a particular code refactoring pattern, but I'm finding it hard to locate, since I'm not sure whether there's a good name for it. It's very similar to factoring out repeated code, except the code wasn't repeated in the first place: it was just stashed away in a conditional branch o...
stackexchange/codereview
I have an iphone application developed on SDK-3.0. Now i want to port that application to SDK 4.0 because of multitasking, i want to keep my app alive in background. Problem is that i could not find any documentation who teach me where i start from to port my app on to SDK4.0 and brief me how i do multitasking in it.
stackexchange/codereview
I am developing a package in R When I am debugging a particular function or set of functions, what is the best way to test the function? Do I have to either use source('function.R') or R CMD build each time I want to check my changes? (extra credit for associated emacs ess key-bindings)
stackexchange/codereview
Basically, what I would like is a fixed header, frozen pane, table, such as, http://www.cssplay.co.uk/menu/tablescroll.html. However, his tables have one key weakness. The header will not scroll horizontally with a body. Here is a sample, based off the link above. However, the header clearly does not scroll left an...
stackexchange/codereview
Hey guys, so I would like you to help with an issue that I'm having, pretty much what i need is when the checkbox is clicked to append the checkbox value to an li element in a different div. Check the html below. Thanks in advance. <div class="heading"> <p><a href="#">Experiences</a></p> <a href="#" target="_se...
stackexchange/codereview
I have a file named "insert.txt". It can look like this (or uglier): ASDFG?|??|?\/\HJKL<MNBVCXZQWERTYUIOP zxvbnmlkjhgfdsaqwertyuiop 123"'`~4567890987654321!@#$%^&*() @#$%^&*()+_}{":?> And I want to replace a block of text in a target file (target.txt) which is delimited by "STARTSTACKOVERFLOW" to "STOPSTACKOVERFLOW". ...
stackexchange/codereview
I created a project with maven2 on eclipse. After I added the hibernate-annotations dependency, i was trying to create a class using hibernate annotations(@Entity, @Table...), but it was giving me this error : Change project compliance and JRE to 1.5 I fixed it, but cannot understand why it requires this as long as ...
stackexchange/codereview
I am trying to insert an XML file of the following kind: <thing> <name>one</name> <type>metal</type> <type>round</type> </thing> <thing> <name>two</name> <type>round</type> </thing> <thing> <name>three</name> <type>metal</type> <type>round</type> </thing> into an SQL database. There are...
stackexchange/codereview
One thing that has always annoyed me in Visual C++ is the fact that, unlike Visual C#, intellisense does not automatically display when a new line (or equals sign, etc) is entered, so I must press Ctrl+Space every time. Is there any way to change this? It has gotten to the point where I have even considered using somet...
stackexchange/codereview
Ok, here's the deal: I've got two piles of shirts I want to take a random shirt from each pile and put them in a new pile Then get the new pile out And here is the code: mix([],[],_). mix(P1,P2, Pile):- takeshirt(P1,1,Taken1,Rem1), takeshirt(P2,1,Taken2,Rem2), #Take one append(Pile,Taken1,New), appen...
stackexchange/codereview
Given XML where FORMNUMBER can be numeric only; begin with numeric and then include alpha; or follow a numeric alpha numeric pattern: <FORMSLIST> <FORMS> <FORMNUMBER>3 ABC</FORMNUMBER> <FORMSEQ>99900</FORMSEQ> </FORMS> <FORMS> <FORMNUMBER>12 ABC 45</FORMNUMBER> <FORMSEQ>99900...
stackexchange/codereview
I am moving a lot of IIS websites using MSDeploy and I am running into an issue where I am trying to include 3 registry keys as part of the move, but all 3 registry keys don't always exist on each website. So the question is: Is there a way to get MSDeploy to move the registry keys if they are there on the source and s...
stackexchange/codereview
I need to convert some data stored as varchar in a SQL Server database that I want to change from CamelCase to delimiter-separated. I know how to do this trivially in C# but not T-SQL. Any ideas?
stackexchange/codereview
I'm currently building a simple app that overlaps one image on top of another. The top one needs to be draggable and resizable. Initially I thought jQuery UI would be a good idea, there are two main issues with it: For some reason, Chrome doesn't like both behaviors even when they're imposed to different elements. I n...
stackexchange/codereview
Im kinda new to CSS have been using tables for my html for years, Im trying to figure out how I can nest divs or stack them inside the content section of a 3 column layout. with tables I'd just do a new <tr> but if I float another div into the content line line it will appear parallel or vertically, when I want to a...
stackexchange/codereview
I'm not so good on htaccess but was happy with what I had done so far until I noticed my $_post variables were not being processed because of the rewrite signiture within my htaccess file (SIGH) My objective was to read the url and determine it's path and location from php and it's $_SERVER['request_uri'] method, which...
stackexchange/codereview
We have a website which publishes events using NServiceBus. The site is deployed using msdeploy. We also have the NServiceBus.exe which should run as a windows service to subscribe to these events, and we'd like to deploy that as well. Is there any way to package the service as well as the website, so that it can be ...
stackexchange/codereview
Can somebody explain why multiplying by 100 here gives a less accurate result but multiplying by 10 twice gives a more accurate result? ± % sc Loading development environment (Rails 3.0.1) >> 129.95 * 100 12994.999999999998 >> 129.95*10 1299.5 >> 129.95*10*10 12995.0
stackexchange/codereview
I have a bit of a strange problem. For one of my clients I've added some ajax functionality to their website. To get the context; it's a website for a travelagency and pricetables are generates by ajax-calls to reduce serverload and improve user experience. Only now I received an email where they say it is not working...
stackexchange/codereview
Is there any easy way to implement the copy to clipboard option from the output of a shell script ?
stackexchange/codereview
We have some bbcode and I'm trying to setup the ability for a certain code to call a function that loads some images from our photo gallery. So if someone puts in an album number, it pulls 5 of the most recent photos out. When we call this function regularly (on another page, just as a regular php statement), it works ...
stackexchange/codereview
I am working on a Facebook app that will allows users to vote on their favorite pictures, based on their friend's profiles pictures. I know how to display the images, just not how to get the list of the current user's friend's IDs. My application is written in PHP. This is the last thing I need to complete the app. Any...
stackexchange/codereview
In my team, some we help each other with the merges. I.e. my code is merged back to trunk by someone else. It seems like the author info not is fully preserved during a merge. When I do annotate (blame) the merger is shown as the author. Have the merger done something wrong or isn’t the original author preserved in a m...
stackexchange/codereview
With objects especially, I don't understand what parts of the object run before initialization, what runs at initialization and what runs sometime after. EDIT: It seems that parsetime is the wrong word. I guess I should have formulated the question "In the 2-pass read, what gets read the first pass and what gets read t...
stackexchange/codereview
Is it generally accepted that you cannot test code unless the code is setup to be tested? A hypothetical bit of code: public void QueueOrder(SalesOrder order) { if (order.Date < DateTime.Now-20) throw new Exception("Order is too old to be processed"); ... } Some would consider refactoring it into: prote...
stackexchange/codereview
I'm currently using OCUnit that ships with Xcode 3.2.4 for doing unit testing of my application. My workflow is often to set some break points in a failing unittestin order to quickly inspect the state. I'm using Apple's OCUnit setup: http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_develop...
stackexchange/codereview
I have the following class public partial class Contact { public Contact() { } #region Primitive Properties public virtual int Id { get; set; } [Display(ResourceType = typeof(Common), Name = "Person_Name")] [Required(ErrorMessageResourceName = "Validation_Required", ErrorMessageResourceTy...
stackexchange/codereview
I am using chat feature of chat.stackoverflow.com... It's really amazing! I am curious, when I scroll the window, the right side of the chat room(div id="sidebar") didn't respond to the scroll event at all, how that can be achieved?
stackexchange/codereview
I'm writing some code behind some spreadsheets and I need to loop through some code, like getting data from a database doing some formulas and moving the data to a new sheet. My code for getting the data from the database is getting all of the values in multiple columns where the data has not been reported and has the ...
stackexchange/codereview
I am trying to create an ObservableConcurrentDictionary. This object will be used in a multithreaded application, and it's data is used to populate a control via the controls ItemsSource property. This is the implementation i have come up with: public sealed class ObservableConcurrentDictionary<TKey, TValue> : Concurre...
stackexchange/codereview
I have a barCode class that is used to generate an image of a barCode. I create an instance of this class and it works as expected for example: var myBarCodeInstance:barCode = new barCode(); var myBarCodeImg:Image = new Image(); myBarCodeImg.source = myBarCodeInstance; Using this code the image appears and works fine...
stackexchange/codereview
I have a flash movie loaded into my browser.Is there any way that i can pause it and then resume it.I tryed SuspendThread() for all the browser threads but the movie won't freeze
stackexchange/codereview
I'm having problems with cross-domain application hosting with Silverlight. I have an application hosted on a different domain and included with the following HTML code to the page: <script type="text/javascript"> function succ( sender, args ) { console.log("SUCCESS"); console.log(sender); console.log(args)...
stackexchange/codereview
I'm currently developing an additional page to an already existing website. Actually that part isn't really that important - the page performs it's own separate functions. Anyway, originally, this "page" consisted of two pages controlled by one jpdl pageflow. Everything worked correctly, except when referencing the sec...
stackexchange/codereview
I have an Oracle 10g database, and now I need to export, if possible, only the schema. (Only table structures with index etc... without data!) Is this possible with exp/imp or do I need expdp/impdp? Greets
stackexchange/codereview
Hi I am doing papal integration with my django app. i am using latest version of django from svn and python 2.6. However, i found every time when paypal's sandbox accessing my notify url i got 500 [Errno 32] Broken pipe my django stack. Does anyone have similar experience with this ? Cheers, Traceback (most recent call...
stackexchange/codereview
So I have been searching for a simple example to hopefully a simple problem. I have a simple object a List of ListTest (List) public class ListTest{ { public string perName { get; set; } public string perSex { get; set; } public ListTest(string pName, string pSex) { this.perSex = pSex; t...
stackexchange/codereview
I have string "(1,2,3,4,5,6),(1,2,3)" I would like to change it to "('1','2','3','4','5','6'),('1','2','3')" - replase all parts that mathces /([^,)("])/ with the '$1', '$2' etc
stackexchange/codereview
I just started writing a customer application in C#, using Visual Studio design mode for most of it. Bear in mind I only started learning C# yesterday - so if I am making any stupid mistakes then please say so. What I have so far A database; A DataSet which links to the Customer and Agent tables; A BindingSource which...
stackexchange/codereview
Has anyone ever seen an instance where Visual Studio (or possibly SourceSafe) would decide to insert about 9 million non-breaking space characters at the end of a line in an ASPX file? I'm trying to figure out if this could be some weird bug, or if a programmer fell asleep with her head on the space bar, while in desig...
stackexchange/codereview
I've downloaded the GlassFish-Tools-Bundle-For-Eclipse-1.2 and installed it. When I run the eclipse contained in the release I'm unable to start the Glassfish server, which arrived pre-configured with the release. It seems to be looking for the server under c:\ (i.e. c:\glassfishv3\glassfish) when in reality it's under...
stackexchange/codereview
Shortly i decided to go for the Dependency Injection technique for a new PHP application i am about to write. However, I am not entirely sure i understand it enough. My problem is, the baseClass has a dependency on various items, while a lot of different classes will need to extend it. For example: namespace system; ...
stackexchange/codereview
I'm trying to make an http request using httplib2: import httplib2, time, re, urllib` conn = httplib2.Http(".cache") page = conn.request(u"http://www.mydomain.com/search?q=cars#p=100","GET") The response is ok, but the "#p=100" does not get passed over. Does anyone know how to pass this over with httplib2? thanks
stackexchange/codereview
Code below takes a directory and creates an array of folder names appearing under the directory. How can order the folder names inside the array by alpha? function get_dirs($dir) { $array = array(); $d = dir($dir); while (false !== ($entry = $d->read())) { if($entry!='.' && $entry!='..') { $e...
stackexchange/codereview
Hey, Today I tried to do a binary diffing of NDIS.sys, and I noticed something weird. I took a function, and began to diff it. The first 30 bytes were the same on the disk(using IDA) and on memory(using WinDbg). Then, something have changed. I saw something like "jmp _imp_XXXXX". the JMP bytes were the same, but the ad...
stackexchange/codereview
I'm looking for interesting programming puzzles, problems or challenges suitable for a class of chemistry majors learning C as their first programming language. Do you have any recommendations?
stackexchange/codereview
This a bit of a weird question so please let me know if you need more information. For a side project I am working on I need to ability to generate advertising on a specific page based on a specified domain. I have looked a bit and haven't found anything that really fits this so I'm hoping someone here has a service li...
stackexchange/codereview
Browsing the net for better fault handling in C#, I've com across the following to implementation strategies. The first one is natural to me, while the other implementation I'm not certain what its advantages are? 1) static void Fault(Action protectedBlock, Action faultHandler) { try { protectedBlock...
stackexchange/codereview