instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I've just started learning winsock through the "Beej's guide to network programming" book. I'm programming under windows and running it through gcc. This is just a start to writing my first server program but it gives me these errors when I try to compile. /* Server */ #include <iostream> #include <windows.h> #include ...
stackexchange/codereview
i'm using a simple alert to display a long message and i handle the alert in the following way: bool hold_alert = true; UIAlertView * malert = [[UIAlertView alloc]....create the alert [malert show]; while(hold_alert) {//hold the application focus on the alert, when alert triggers the function with "clickedButt...
stackexchange/codereview
I found this example on the MySQL Tutorial: SELECT article, dealer, price FROM shop WHERE price=(SELECT MAX(price) FROM shop); My question: is the subquery (SELECT MAX(price) FROM shop) done once a time, or it is done repeatedly until the max price for the query is found? In terms of performance is this other solut...
stackexchange/codereview
A page has a list of articles. Clicking "more" button, more articles will be loaded via AJAX I need to make newly added articles appearing smoothly. I can do it with jQuery.fadeIn() method. The problem is - how to handle such event, when new elements was added to jQuery element in question. I don't want to call custom ...
stackexchange/codereview
Caldav calendar can be grouped by Locations/Groups and events can have people joining them so it would be nice to use those infos for project planning, is there anyone who has already done this and/or knows how to do that in some kind of programming language in a way that I can integrate the result in a web page?
stackexchange/codereview
I have used BeautifulSoup in the past but I am up against something new; incredibly generic/minimal HTML table markup... My goal is to grab each value and it's label (each in there own td) and print them out... They can be merged, I don't care, I just want to make sure each label is applied to the correct value. Here i...
stackexchange/codereview
I get the following error under a certain scenario When a different thread is populating a lot of users via the bulk upload operation and I was trying to view the list of all users on a different web page. The list query, throws the following timeout error. Is there a way to set this timeout so that I can avoid this ti...
stackexchange/codereview
When I try to use this in chrome to access a simple API I wrote, it throws this error: XMLHttpRequest cannot load http://67.19.91.186/~needsed/api/get/ZEZrBZYIynQ. Origin http://bestofyoutube.com is not allowed by Access-Control-Allow-Origin. From the reading I've been doing, it looks like it's an issue with XSS. Is i...
stackexchange/codereview
I have successfully been able to run my own .Net code by following the steps posted here Execute .NET 3.0 code from Office 2003 Is there a way to use the standard .Net libraries without having to write a wrapper? This way we can avoid having to register and install a custom DLL into the GAC on the client's machine. I'v...
stackexchange/codereview
I am trying to extend the "android.content.Intent" class by adding a private attribute of a custom class. My goal is to send complex objects from the main Activity to a background Service. The extension itself is not a problem, the class gets compiled without any errors and the project runs. The only problem is that t...
stackexchange/codereview
I am trying to use a forum with my website. Those who haven't registered with my site can register only with the forum. But, those who have an account with my site must be automatically logged in to the forum as well. How is that to be done...???
stackexchange/codereview
I draw 3d-scene with primitives like this: glLoadIdentity(); glColor4f(model[i][8], model[i][9], model[i][10], 1.0); glTranslatef(current_x, current_y, current_z); glVertexPointer(3, GL_FLOAT, 0, &squareVertices[0]); glEnableClientState(GL_VERTEX_ARRAY); glShadeModel(GL_FLAT); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);...
stackexchange/codereview
When I run app on simulator(4.0), iAd is appearing as Test advertisements. But when I deployed the app on ipod(4.0) , iAd is not appearing, even as Test advertisements. Please help me out as early as possible... I m from India... Regards...
stackexchange/codereview
in c#, after I add a object to a collection, if another copy(deep copy) is always created?
stackexchange/codereview
I have a WPF intranet app running in Trusted mode (local only). I would like the users to be able to upload an image and attach it to an article on my newsletters section. I am having trouble deciding where these images will be stored. Please provide me with your opinions. At present I have a few ideas myself; I could ...
stackexchange/codereview
i am making a geometry library and i am confused, what should be the return type of a function which calculates the intersection of a segment with another segment. The returned value would sometimes be a point and sometimes be a segment (overlap case) and sometimes be an empty set. As per my thinking there could be 3 w...
stackexchange/codereview
My last question helped me get data from a form into an array. The array is fairly different in structure to anything I've used before. I have multiple records with a textbox and checkbox each. Here is the form data: array(4) { ["product"]=> array(4) { [0]=> string(5) "Dummy" [1]=> string(7) "Dummy 2" [...
stackexchange/codereview
I want to run a very simple c++ code in microsoft visual c++ but I can't. In my c++ book , they told me that I can do it but it requares some steps and I don't know how to do. So , please tell me how to do it. Thanks
stackexchange/codereview
I have a mongodb collection that has documents like the ones below: [ { :event => {:type => 'comment_created'}, :item => {:id => 10}, :created_at => {:t => '11:19:03 +0100 2010', :d=> 'Fri, 19 Nov 2010'} } , { :event => {:type => 'vote_created'}, :item => {:id => 10}, :created_at => {:t => '11:19...
stackexchange/codereview
I have gotten almost a complete API to work, with creating and deleting documents and folders. But I fail at updating documents. It was very easy when using gdata, but since this code has to work on all android devices, I have to use google api java client. Here is a method where I test the updating: public void update...
stackexchange/codereview
What's the correct way to use multiple Scanner objects in my program? For example, I use the scanner to read a file, then depending on what is found in the file, I prompt for user input and use the scanner again. Here is an extraction of my code: Scanner f = new Scanner (System.in); // Get the file name String fileName...
stackexchange/codereview
Trying to get integer part of float.MaxValue but it is throwing error? long l = Convert.ToInt64(float.MaxValue); Console.WriteLine(l); Error: Arithmetic operation resulted in an overflow.
stackexchange/codereview
I'm trying to build a websocket server in Java, but I'm having difficulty... the specification of websockets say that you have to concatenate the numbers from key1 and key2 then concatenate the extra 8 bytes of data to '...form a 128 bit string whose MD5 sum is then used by the server to prove that it read the handshak...
stackexchange/codereview
I am currently trying to use Eclipse to develop some code that I've been doing in a text editor in C. I am currently under Linux, compiling it with GCC with the following arguments: gcc -o SO SO.c -lpthread -lrt I've tried adding "-lpthread -lrt" to Eclipse's "C/C++ Build"->"Discovery Options"-> "Compiler Invocation A...
stackexchange/codereview
We are in the process of scaling one of our web applications from a single server to a web farm. The application currently uses the Http runtime cache to cache the reference data for the application. The data is 'similar' to product catalog: categories (ie List) products (ie List) As the data is updated very infre...
stackexchange/codereview
I've been going back and forth with in_array and for loops, but haven't quite been able to accomplish what I've been trying to do... I have an array (named $contacts) that looks like this: Array ( [3] => 1 [5] => 1 [7] => 1 ) I'm trying to add additional key => value pairs based on results from a query:...
stackexchange/codereview
I'm trying to send email in windows server using PHP. When I use php mail function. then i get following error message. Warning: mail() [function.mail]: SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or con...
stackexchange/codereview
i want to show images from external url listed in external xml ("similar" to picasa API). from where i need to start, there is an app sample like this, do i can read is source?
stackexchange/codereview
I have excel sheet with data which I want to get Levenshtein Distance between them. I already tried to export as text, read in from script (php), run Levenshtein (calculate Levenshtein Distance), save it to excel again. But I am looking for a way to programatically calculate a Levenshtein Distance in VBA. How would I g...
stackexchange/codereview
Rails3,jQuery. What I'm trying to do: Create a new WorkoutPlan that HABTM Exercises. Then create a new Workout that belongs_to a WorkoutPlan. I want the Workout#edit page to build a form with fields_for new/edit WorkoutRoutines, one routine for each exercise in the WorkoutPlan. That last part is where I'm struggling,...
stackexchange/codereview
I was working with python-twitter and realized that twitter provides streaming api to consume tweets in realtime. I found one example that uses pyCurl here Have anyone tried or know how to use that with python-twitter library? please let me know Thank you
stackexchange/codereview
I'm using devise with rails 3 and i'm trying to create a page which can be viewed by everyone (even those not signed up) but has additional functionality for people who are registered. The problem is that when I call current_user there is no user because I haven't used the authenticate! filter on my controller, because...
stackexchange/codereview
How can I double even numbers in a list in Prolog? For example: X=[1,2,3,5,4] The result should be: X=[1,2,2,3,5,4,4] Thank you!
stackexchange/codereview
I am catching an Exception and trying to examine the getCause() of it, performing some further actions if the cause is a of type MyException, defined in another library. I am getting this Eclipse (compiler?) error when trying to check if e.getCause() instanceof MyException: Incompatible conditional operand types Throw...
stackexchange/codereview
I needed a generic function in php that will properly clean and escape any variable used in a Dynamic MySQL Statement. For example MySQL is vulnerable to random user - inserted data. Any sample code , or links are highly appreciated. Edit 1- I did follow the links posted below. I still feel a concrete example would hel...
stackexchange/codereview
I want to add new element by jquery with old element and also remove old element in place of new. For ex, <div id="a1"> </div> should be like <table border="0" cellpadding="0" cellspacing="0"> <tr> <td class="Frame_Box_top_left"></td> <td class="Frame_Box_top"></td> <td class="Frame_Box_top_...
stackexchange/codereview
I'm having trouble with the following JQuery script $('#extra_data').append('<div id="tabs-' + (tab_length + 1) + '"></div>'); $.get(url, function(data) { $('#tabs-' + (tab_length + 1)).html(data); }); My trouble is that the $.get(..) operation doesn't return any results - although when using firebug it ...
stackexchange/codereview
I have a method: - (void)setName:(ModelClass *)model { [model release]; ModelClass *tmp = [[[ModelClass alloc] initWithId:@"New"] autorelease]; model = [tmp retain]; NSLog([NSString stringWithFormat:@"Gia tri trong la %@",model.modelClassId]); } and - (void)viewDidLoad { [sup...
stackexchange/codereview
I know there's ample information about datetimes on the internet but I'm having trouble using what I've been seeing. I have a calander control hooked up to a text box. It takes it in the form 15/11/2010 (british). I use it to query datetime fields in a SQL server db in the format 15/11/2010 00:00:00. After the capture...
stackexchange/codereview
I'm trying to determine if a point is inside a polygon. the Polygon is defined by an array of Point objects. I can easily figure out if the point is inside the bounded box of the polygon, but I'm not sure how to tell if it's inside the actual polygon or not. If possible, I'd like to only use C# and WinForms. I'd rather...
stackexchange/codereview
I am facing some issues with memcached under heavy load. I am using ab to stress test my site. I use one instance of memcached to store php sessions and another one to store objects. While benchmarking the site, I often get exceptions from the site which have to do with failing get() from memcache. The key definitely e...
stackexchange/codereview
I have two users in my server: root and development. Everytime Sphinx is restarted, the ownership of searchd.production.pid always changed to root. I always use the development to do any cap, update code, etc. though. I have this in my deploy.rb: after "deploy:update_code", "sphinx:stop" after "deploy:migrate", "sphinx...
stackexchange/codereview
I have a textarea with random base64 code in it. The text inside it has a annoying thin red line underlining it in Opera. Is there a opera html attribute that can disable the spell checker on that field? spellcheck="false" seems to work in Chrome, but not in Opera
stackexchange/codereview
I'm searching a space of vectors of length 12, with entries 0, 1, 2. For example, one such vector is 001122001122. I have about a thousand good vectors, and about a thousand bad vectors. For each bad vector I need to locate the closest good vector. Distance between two vectors is just the number of coordinates whic...
stackexchange/codereview
I am using Devise :confirmable and :recoverable module to confirm a user and to let him recover his password if he forgets it. Everything is going fine, the mail gets generated and I can see it in the server log, but then I am facing errors and the mail is not delivered to the mailbox. The SMTP settings for my environm...
stackexchange/codereview
I am making use of this script to get the first item of my Twitter feed. However, it is slow (it takes 3 to 4 seconds to load page now). Why is it so slow? Here is how I use it. require_once 'rss_php.php'; //see link above $rss = new rss_php; $rss->load('http://twitter.com/statuses/user_timeline/XXXXXX.rss'); $feed ...
stackexchange/codereview
Is there any way (official according to UML 2.0) to have sequence diagrams or activity diagrams in multithreaded environment? Or UML is just "singlethreaded"?
stackexchange/codereview
I need to add a number of really complex dynamic HTML structures to my Velocity template. If I were to attempt to write these directly in the template, it would be an absolute mess. Let me explain what I'm trying to do... let's say, on my website, a user can post comments. Rather than writing all the complex dynamic HT...
stackexchange/codereview
I have a method that checks to see if a string (lets say "strparent") contains another string ("strsub") but the thing is, "strsub" does not always contain the same value as there is a digit within it that can be any whole digit. Example 1: " tab (ver 3) by " Example 2: " tab (ver 12) by " I'm not too experienced wit...
stackexchange/codereview
Hii , While I was implementing some of the programs for the class assignment, it just struck me how it would be to implement the same in a generic fashion using C. I do know that we need to make use of the void pointers and functions but i was just stuck as to how to do it. Please give me an example that is simple and ...
stackexchange/codereview
I have a table where i set one column (N) as the "is identity" so it can increment by 1 everytime i added somthing to the table. How do i re-order N when i delete a row? For example if i added 5 things to the table, N would go 1,2,3,4,5. But if i delete row 3, N will be 1,2,4,5. I want it to automatically change th...
stackexchange/codereview
I noticed that Gson converts the string "<" into an unicode escape sequence in JSON output. Can you avoid this somehow, or do characters like "<" and ">" always have to be escaped in JSON? Consider this example which prints {"s":"\u003c"}; I'd want simply {"s":"<"}. public static void main(String[] args) { Gson gs...
stackexchange/codereview
I'm trying to add a new assembly (.S) file to the Linux kernel. It may be a dumb question, but I can't seem to find how and where to add such files to the make files. I've looked at code examples of current .S files, but I can't find where they are assembled and linked to the vmlinux binary. Any hints would be apperici...
stackexchange/codereview
I am using mod_perl 2, mason, and apache 2.2 on Ubuntu 10.10 (x86) (standard packages from apt). When I send a HTTP request to my server, I get the following: $ nc localhost 80 < ~/Desktop/test.http HTTP/1.1 200 OK Date: Mon, 22 Nov 2010 00:32:02 GMT Server: Apache/2.2.16 (Ubuntu) Vary: Accept-Encoding Transfer-Encodin...
stackexchange/codereview
I have received an iPhone application developed for the company I work for by an outsourcing company. I do not have access to the source, only a compiled binary. I want to be able to sign it using our certificate, provisioning info, etc so I can submit it to the app store. How do I go about doing this? I'm aware of the...
stackexchange/codereview
How does a web browser handle the JavaScript content of a webpage? Is the JavaScript content being parsed into a DOM and then rendered? I do not need a specification, but I need to know how it is done. Please tell me the whole process of handling JavaScript content on a web page.
stackexchange/codereview
I do a lot of $this->escape() in the zend view. Is this enough to prevent XSS? There's HTMLPurifier outside the Zend Framework. I wonder how zend's $this->escape() compares to HTMLPurifier.
stackexchange/codereview
Let's say the public IP of the router is 92.1.85.179 The local IP of the computer with the server is 192.168.0.2 The router is set to forward 92.1.85.179:5678 to 192.168.0.2:5678 In the server I have: System.setProperty( "java.rmi.server.hostname" , "92.1.85.179" ); Registry registry = LocateRegistry.createRegistry( 56...
stackexchange/codereview
All my PHP pages work fine but there is one PHP page that used to work ok but now it freezes (when I go to it in the browser, it times out without a response). This is the only error that's written to logs: [Thu Nov 18 12:23:18 2010] [notice] Apache/2.2.15 (Win32) PHP/5.2.13 configured -- resuming normal operations [Th...
stackexchange/codereview
I have a few questions that are related to this same topic, so I thought it would be nice to ask them in a single thread. I have perused over some other related topic but haven't been able to find quite the answer I'm looking for. In general, most of these seem to be related to security issues. My questions are as f...
stackexchange/codereview
We have developed an Air application to deliver course material to clients. However, some clients are experiencing connectivity issues to our server, which we have managed to duplicate. Some background. The App makes jQuery $.ajax POST requests to the server to log the user in using their username and password. The ser...
stackexchange/codereview
I've created a subclass of UIScrollView to implement a one of my custom controls, at this point everything is working great. However what I'd like to be able to call a methods whenever a Touch Up Inside event is detected (just like interface builder) does anybody know how I could do this?
stackexchange/codereview
This is the "real" link: domain.com/show_shop.php?id=4 This is the rewritten: domain.com/show_shop/4 I use the later because I have this in my .htaccess: RewriteRule ^show_shop/([0-9_]+)$ show_shop.php?id=$1 [NC] But it doesn't work for some reason. Will not this rewriterule give what I want? Thanks EDIT: Re...
stackexchange/codereview
As the description states, I have a function that takes in an array and an object as arguments and assigns all of the objects fields to their respective values in the array depending on the type of the object. The objects all have different fields, but they all have a type attribute which the function uses to determin...
stackexchange/codereview
I'm trying to create function using phpmyadmin/mysql console. Without any luck. I'm getting info of syntax error. Can anybody take a look on this function? CREATE FUNCTION fnCategoryList ( @NewsID INT ) RETURNS VARCHAR(1000) AS BEGIN DECLARE @CategoryList VARCHAR(1000) SET @CategoryList = '' SELECT @Ca...
stackexchange/codereview
My Project Model looks like this: # == Schema Information # Schema version: 20101117094659 # # Table name: projects # # id :integer not null, primary key # name :string(255) # description :string(255) # designer_id :integer # client_id :integer # notified :boolean # created_at :date...
stackexchange/codereview
I would like to convert this code (using a scripting language with a Sockets extension) over to C++ using LibCurl. I have only used LibCurl once previously, so I am at a bit of a loss as to what else I am going to need. My main point of confusing is wether I should be able to just use curl_easy_setopt(curl, CURLOPT_HTT...
stackexchange/codereview
If I use aspnet_compiler to publish an ASP.NET MVC web site, does it do the same tasks that devenv would do? Or is it just pre-compiling to minimize the startup delay? I.E. my requirnment is to be able to compile and publish an ASP.NET web site. in this case, should I use devenv first to build the web site, and then u...
stackexchange/codereview
I have demonstrate the DGV as per following way. I am trying to add input of textbox into DGV as below. Unbound DGV: private void Form2_Load(object sender, EventArgs e) { DataGridViewColumn srno = new DataGridViewTextBoxColumn(); dataGridView1.Columns.Insert(0, srno); DataGridViewColumn par...
stackexchange/codereview
I was trying to define a custom CSS pseudo class in Nokogiri and ran into some issues with unexpected characters. I took the example in the Node documentation, and tried to modify it for my needs. I wanted to match a regex with the node.text value like this: node.css('script:regex("[\"\']([^/s]+)[\"\']")', Class.new { ...
stackexchange/codereview
Its not to hard to invalidate a particular template cache in django def invalidate_cache_key(fragment_name, *variables): args = md5_constructor(u':'.join([urlquote(var) for var in variables])) cache_key = 'template.cache.%s.%s' % (fragment_name, args.hexdigest()) cache.delete(cache_key) However I have a situa...
stackexchange/codereview
I'm working in a directory called testsite and I want all .php extensions to be replaced by a trailing slash. I'm halfway there, in that (for example) entering http://mydomain.com/testsite/about means that http://mydomain.com/testsite/about.php is loaded. However, I now want the URL to be displayed as ./about/ so that...
stackexchange/codereview
((IObjectWithChangeTracker)user).ChangeTracker.State seems to give me "Unchanged" every time. When I call ApplyChanges everything is picked up properly, but I would like to be able to make a determination in my business layer on whether someone has a changed a particular property, if they did I want to perform an acti...
stackexchange/codereview
I'm trying to initiate a Rails 3 console from Netbeans 6.9.1 (just upgraded) and fail with Uncaught exception: no such file to load -- script/console The debugger fails as well on a similar error (... -- script/server). The project I'm trying to run this on was previously a Rails 2.3.8 app which I upgraded, and Netbe...
stackexchange/codereview
i want to get data between xml tags? how to navigate? and get values.. im using wsdl2objc from google code:http://code.google.com/p/wsdl2objc/ output soapbody follows: read instruction here: http://code.google.com/p/wsdl2objc/wiki/UsageInstructions my header file: #import "MService.h" how to get image source and text ...
stackexchange/codereview
I have 2 question 1) can I make an animation using C# or i should use wpf ? 2)How can i insert a picture or a movie file into my database ?
stackexchange/codereview
There is a listview with several fields in delphi. A thread checks and adds items to listview. If there is the same caption, an integer will be added in the subitem of this caption. When the item count is less than 2000, the performance is OK. When checking and adding items and items count are more than about 2000, the...
stackexchange/codereview
I have 3 different SQL queries from 3 different unrelated tables (all using LIMIT and ORDER BY). I would like to merge and sort the results according to the "date" field (which appears in all of them) What is the SQL to do this?
stackexchange/codereview
There are 20 buttons in an Activity . The ids are R.id.ButtonR1C1; R.id.ButtonR1C2 .. and so on ie. Row 1, Col 1.. now earlier I had created 20 buttons. private Button b1,b2,b3...; and then b1=(Button)findViewbyId(R.id.ButtonR1C1); b2=(Button)findViewbyId(R.id.ButtonR1C2); .... and so on. Finally b1.setOnClickListe...
stackexchange/codereview
Looking for a screen cast, which will get you started with WCF 4.0
stackexchange/codereview
I'm working on a project which uses Raphael to render SVGs for Chrome, Firefox, and Safari, and VML for Internet Explorer. Since Raphael doesn't have built-in support for SVG marker elements, I decided to write a plugin for it myself. I got the SVG side working no problem, but the VML docs aren't giving me any help in ...
stackexchange/codereview
I'm wanting to write a widget displays the users' prepay balance, remaining data etc. I'm thinking of automatically calling the USSD code which returns this data (will have to have a regex for each network), at intervals (not often, to save battery). This would have to be done in the background. I have an app at the m...
stackexchange/codereview
I worked with rails around the year ago. Now I get the new version of Rails and I am a bit confused. Where is my script/server and script/generate. I finded this guide and as I see I need use 'rails' command now. Is it version 3 changes? Is there a document which describe all such changes. Is there a good book corresp...
stackexchange/codereview
I have 2 Doctrine 2 Entities: - Country (id, name) - Mapping (id, objectType, internalId, externalId) I need association between Country and Mapping using following condition: Country.id = Mapping.internalId AND Mapping.objectType = 'country' Can I implement this relation using YAML/XML mapping?
stackexchange/codereview
Thanks to this post I now know how to make a table with different row heights on iPhone. (With UITableView) How to do this on a Mac? Should I use NSTableView? How about NSCollectionView? I feel like NSTableView is too complicated - at least much more complicated than UITableView. I mean, I don't need all the headers a...
stackexchange/codereview
I was trying to achieve this query1: UPDATE temp_svn1 t set closedate=(select max(date) from temp_svn1 p where p.id=t.id Apparently MySQL does not allow such queries. So I came up with this query using inner joins but this is too slow. How can I write a better query for this? OR How can I achieve the logic of query 1? ...
stackexchange/codereview
I have this JSF page trying to load a GWT app. The page works fine on Firefox and IE but on Chrome I get the following error when I check with developer tools. Uncaught TypeError: Object # has no method 'write' I tried to change CONTENT_TYPE of the page as read in other posts but no luck. Here is the page, www.paste....
stackexchange/codereview
short story I run ./manage.py schemamigration junk_app --initial on a completely fresh django project right after freshly installing South ( http://south.aeracode.org/ ), and I get the following error: Unknown command: 'schemamigration' Type 'manage.py help' for usage. EDIT: I have version .7 (south/init.py has versio...
stackexchange/codereview
given a pointer to unsigned char value, *ptr. How to copy its whole value to new char value char buff; in a correct way (malloc etc), without looping for each character? Any way to retreive the memory amount currently allocated for the pointer value?
stackexchange/codereview
When using either NSRectFill or NSBezierPath.fillRect to draw a block over some text in an NSTextView, the text seems to go over my rectangle. I.e. there is just a sliver of the rectangle peeking out from behind the text I'm supposed to be overwriting. How can I ensure that I'm drawing the rectangle after the text is d...
stackexchange/codereview
I need an obvious example about AES decryption. i just want to know how it works in order to make my own coding of this algorithm so, I neither want code nor algorithms, i just want some explanation of how it works, I need to understand it first before i can make an implemetation fir it. Can someone give me tutorials o...
stackexchange/codereview
Hello is there a way to take the content of a php file while processing the php code in it? I need to include a code into another page but I need to print the content it in a specific position. If I use include the code will be printed before the html tag of course cause it's processed before the page, but if I use fi...
stackexchange/codereview
time1 = "2010-04-20 10:07:30" time2 = "2010-04-21 10:07:30" How to convert the above from string to time stamp? I need to subtract the above timestamps time2-time1.
stackexchange/codereview
I find myself in the situation where I need to call a PHP function stored as a string from another PHP function. <?php $phpcodestring = "<?php echo 'Hello World!' ?>"; echo $phpcodestring; ?> How can I get Hello World to render to screen with the above structure?
stackexchange/codereview
I'd like to create a form where I have checkboxes, and when clicked, they open separate textareas for the user to enter more information in. If I want to use Django's dynamically created form fields, is there a way that I can put a function call in for each checkbox.
stackexchange/codereview
How do I display an image with the following configuration in Android? Retain original aspect ratio (the image can be scaled, but not stretched) Fill the width of the parent Aligned to the bottom of the parent The following does not work: <ImageView android:layout_width="fill_parent" android:layout_height="wrap_cont...
stackexchange/codereview
I need to HTML encode chracters like my input is <test> my expected output is &lt;test&gt;. How can I do this?
stackexchange/codereview
I am trying to understand how to work with branching and merging in Team Foundation Server 2010. The strategy below is for a web development team. My idea is to have 5 folders. The Main folder, a Development folder, a QA folder, Production folder and a Hotfix folder. The Main folder will only consist of the Main Branch...
stackexchange/codereview
I've got an problem with getting information back from a memory block allocated by the called function. Specifically, there's function XGetWindowProperties in the X11 lib included with JNA. It returns the results via the last parameter - PointerByReference prop_return. I know the actual memory area contains an array of...
stackexchange/codereview
The JSON is: {"Name":"bb", "age":"10"} I searched a lot of in the Internet but most of the answers are for I know "Name" and "age" previously, so they reference like j.Name, j.age. I am just wanting to do equivalent thing as, we don't know the keys inside the object, we want to iterate over all items and print out bo...
stackexchange/codereview