instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have a Rails model called Person which has database table columns for first_name and last_name. I've also defined a full_name method to return the combined first_name and last_name of the instance. Is there a way to return an array, hash, or object which has first_name, last_name, as well as full_name? Here's the co...
stackexchange/codereview
I'm new to Indy and I want to build a simple proxy-server with it. This is a quite big library, and I just don't know where to start. When client connects to server, OnExucute fires up and receives client connection as parameter (AContext.Connection). I want to do following: [client connection] := AContext.Connection r...
stackexchange/codereview
I'm trying to make a document that has a very small font throughout, I tried this: \documentclass[0.5mm, a4paper]{article} \documentclass[7pt, a4paper]{article} But it doesn't seem that they allow me to go anything below 10pt. This hack make it work, but not for the section headers: \fontsize{4mm}{5mm}\selectfont Do...
stackexchange/codereview
In my project I use jCarousel (http://sorgalla.com/jcarousel/) plugin to dynamically display images and list them. I wonder is anybode expirienced memory problems with this plugin? I'm trying the following scenario: Configure jCarousel to dynamically load images periodically reset jCarousel and load new images As ...
stackexchange/codereview
I want to remove the Author and Date on posts assigned to a specific category for a site that I'm just started. I thought the following addition to my custom theme's function.PHP file would do the trick. The name of the category is "Funds" and for all other posts not assigned this category I want the Author and Date in...
stackexchange/codereview
I want to pass the teamcity username of the current logged in user to a build script called from teamcity, is there a property that has this? I didn't see one when I looked. It can't be a user specified property because I want it to be tied to their actual login so there is some sort of authentication of who they are.
stackexchange/codereview
I have a JavaScript function like this in my ASP.NET MVC 3 application. function Foo() { var url = "@Url.Action("MyAction", "MyController")"; alert(url); } I'm confused as to why the above code works. I was expecting to have to escape @Url.Action(...) inside <%= tags?
stackexchange/codereview
I have few tables that have the same structure (e.g. Queue1, Queue2, etc.). I have to keep them separate for administrative reasons. Some Queue tables may be created by the application. I am using a data context and linq and C#. Now I want to perform an operation on all the tables. I retreive my tables this way. ...
stackexchange/codereview
I am trying to help a friend to install RoR 2.3.8 We started with his laptop having Ruby 1.8.5 and installed Macports. Then updated gem framework and used Macports to install Sqlite3 and Ruby 1.8.7 Finally we are trying to do sudo gem install sqlite3-ruby and getting and error stating "sqlite3-ruby requires Ruby versi...
stackexchange/codereview
I have a project in a repository. People will soon start checking it out, working on it, then committing their changes back. But there is one file within that project (an elaborate configuration file of my own design) that everyone simply must have a copy of, but they will make changes to it that should never ever be...
stackexchange/codereview
I was able to successfully insert a new document using the following code but I was not able to get the _id of the newly inserted document. After the insert, user is null. Thank you! MongoServer server = MongoServer.Create(); MongoDatabase test = server.GetDatabase("Test"); MongoCollection<BsonDocument> users = test.G...
stackexchange/codereview
I am using the carrierwave gem (http://github.com/jnicklas/carrierwave) for ruby on rails. How do I go about creating thumbnails for video uploads? In my previous implementation with Paperclip, I was using FFMPEG. How / where should this be done in Carrierwave? There aren't too many useful resources on Google on this. ...
stackexchange/codereview
I am using a newsletter plugin - meenews to extract my posts. By default it only gets items that are Published and not the future ones. Ideally I would like to show up and coming events, not ones that have already passed. Is there a way in my functions.php for my theme that I can tell it to put all posts as published, ...
stackexchange/codereview
> center = [50, 50] > radius = 10 > db.places.find({"loc" : {"$within" : {"$center" : [center, radius]}}}) Is it 10 km, miles, feet, or meters? Lat/long?
stackexchange/codereview
Spring security provides this switch user feature which I used in previous projects. I checked the document of Seam 2.2.0.GA and found a RunAsOperation class for this purpose, but how can I implement a switch user function (something like su - <username> in linux) using Seam Security?
stackexchange/codereview
I'm trying to find a reliable solution to determine if my page was loaded in iframe on external site using javascript. If iframe src located on the same domain it's preaty easy: you can use if (window.frameElement) or if (window.location !== window.parent.location) but if iframe src is not on the same domain all modern...
stackexchange/codereview
While I'm not sure whether Stack Overflow is the best place to ask this question, its the best I could come up with see how my google skills are failing me... Even though this question isn't specific to any language I think that people here should be able to help fill me in on the concepts and theory. So, with that sai...
stackexchange/codereview
I just read this: Android: How can I stop an infinite animation applied on an ImageView?, I tried it and it works perfectly, I set the animation in the onCreate() method of my Activity using AnimationUtils.loadAnimation(AppContext, animationRes), then I start the animation using startAnimation() and stop it using clea...
stackexchange/codereview
What is the equivalent of ./configure in Windows? Sometimes I download a C/C++ library and when I use the make it, it says "use ./configure" but obviously ./configure can only be used on a Linux machine and the libraries don't usually have instructions for compiling on Windows (although they do support Windows, they do...
stackexchange/codereview
Instead of having a user enter their age (e.g. "27") inside a textbox or use a drop down list to select a number ranging for 15 to 99, is there a quicker way to get user to select their age? I came across a sample code the other day which has an up/down arrow to let the user move the number up/down to the right age. I ...
stackexchange/codereview
Ok I am pretty ashamed I am posting for help with this, but here you go. I just need to display some data in 3 evenly adjusted columns in dropdownlist. Here is the code to adjust the padding of each string based on the string with max length. Second column looks ok but the last one is off by the offset of the differen...
stackexchange/codereview
This is my first time working with interfaces and proper namespace structure. When I compile I get the error below, I have no idea what it means. Any searches I do shows up private public issues but both are public. Any ideas? Error Inconsistent accessibility: return type 'System.Collections.Generic.List' is less ac...
stackexchange/codereview
I would like to be able to store reusable html-formatted text in Sitecore and reference in codebehind for inclusion in a custom user control. What is the best practice for doing this? If a user selects option A, for example, I would reference standard text A in my control. Any examples for how to accomplish this are ap...
stackexchange/codereview
We have the JAXB/Java code below. This worked fine until we changed List<JQGridTO> rows to List<? extends JQGridTO> rows. When we made that change we get this error: Constructor threw exception; nested exception is com.sun. xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptio...
stackexchange/codereview
I encountered this in some .Net Framework code. I've never seen it before. Anyone know what it means? switch(msgFlags) { case Message.[....]: // <-- never seen this before? // do some stuff } Edit: I was stepping through some of my code, when it threw an exception. The exception broke on the lines somewhere in t...
stackexchange/codereview
I am trying to acces a specific bit and modify it. I have moved 0x01ABCDEF (hex value) into ecx and want to be able to check bit values at specific position. For example I must take byte 0 of 0x01ABCDEF (0xEF) check if bit at position 7 is 1 set the middle 4 bits to 1 and the rest to 0.
stackexchange/codereview
A number of articles reference IMvcServiceLocator for customizing service location in MVC3. I'm assuming they were using the preview, but I've just upgraded to the RC, and the type can't be found. Is this something that's changed with the RC, or am I missing a reference (I've downloaded various complete examples and th...
stackexchange/codereview
I have an urgent project in which I'm supposed to implement bignum. I only have experience working in IA-32, any basic advice would be helpful.
stackexchange/codereview
I've tried to follow all the information I could find, but I am not having any luck finding the source of my texture problems and could really use a hand. The following is piece of code in which I'm trying to draw 3 pieces of my background using glDrawTexfOES. The 3 pieces should look like green grass. public void onD...
stackexchange/codereview
A Flickr page displays the title and description of the photo. When I click on the description, it will turn it into a text-box, with a Save button. Then, I can edit what I want...and click "Save." It'll save it via AJAX. It doesn't go to a different page or anything...it just turns the current description into a wik...
stackexchange/codereview
I would like to know how to retrieve the dimensions of an image with objective-c. I have searched google and the documentation with no success, unfortunately.
stackexchange/codereview
On OSX 10.6.4 with i686-apple-darwin10-g++-4.2.1 compiling using TextMate and a Makefile which in the first place has been made für a Linux and I am trying to translate for OSX. When compiling a c++ project I get the "can't link with a main executable" error: g++ -Wall -g -I ~/svnX-Repository/axp-Projekte/xrlfupa/trun...
stackexchange/codereview
Need your help. I'm trying to create a page that has two UI states. want I want is a function that when called toggles between them? hopefully that's clear enough for some guidance. Thanks function toggleUIChange () { jquery stuff for inital state, { jquery stuff for other state} }
stackexchange/codereview
I'm going to have a file with about 5 MB size and I have 2 options: Read a plain PHP array from a file using include function. Read a serialize/json converted array from a file using file_get_contents function then decode it. Which one will be faster? I'm going to use it as cache.
stackexchange/codereview
So, I have a "Open Project" menu item, and I want to set mnemonic to it. I prefer it to be 'e' character from Project word. But when I set it with openProjectMenuItem.setMnemonic('e'); it sets 'e' character from Open word as mnemonic. Is there a way to achieve what I want?
stackexchange/codereview
I have the following columns in a table: SCORE_ID SCORE_PERSON_ID SCORE_VOTE The SCORE_PERSON_ID is a variable. I need to sum the SCORE_VOTE per SCORE_PERSON_ID. Can you suggest of a good way to do that?
stackexchange/codereview
I have tried a very simple example of PHP MySQL Ajax following the example - http://www.tutorialspoint.com/ajax/ajax_in_action.htm I created two files putting these in a same folder and uploaded it to the server.I have also checked the connection with DB from the php file. But I don't understand why the html file does ...
stackexchange/codereview
I would like to draw a standard 2D line graph with pylot, but force the axes' values to be between 0 and 600 on the x, and 10k and 20k on the y. Let me go with an example... import pylab as p p.title(save_file) p.axis([0.0,600.0,1000000.0,2000000.0]) #define keys and items elsewhere.. p.plot(keys,items) p.savefig(sa...
stackexchange/codereview
This is a repost on another issue, better isolated this time. In my environment.rb file I changed this line: config.time_zone = 'UTC' to this line: config.active_record.default_timezone = :utc Ever since, this call: Category.find(1).subcategories.map(&:id) Fails on "Stack level too deep" error after the second time ...
stackexchange/codereview
I'm tyring to build a CheckBoxList to a Silverlight control I'm building and I'm having some trouble getting it right. What I'm after, is a CheckBoxList that wraps the CheckBoxes vertically within a GridRow of * height. The problem I have is that I want to specify the height of the WrapPanel to be that of the row it is...
stackexchange/codereview
I want capture Rank from this code : $RankStr = 'var trafficstatsSnippet = "/site/trafficstats;pysa1bpbPOVl6Wm5d4Zv4nKXKdM%3D /aahoonet.com/?adult=&category=&rank=1234567";' I use this code : $NewPOS = strpos($RankStr, "rank="); $SRank = substr($RankStr, $NewPOS + 5, 10); echo $SRank; because of RANK code varia...
stackexchange/codereview
For the next few months I will be needing to use PETSc and SuperLU_DIST together. On the PETSc webpage they give a list of software to which PETSc "interfaces" one of which is SuperLU_DIST. I am not really sure what is meant by the word "interface". I mean both libraries have been written in C. So surely if I write a...
stackexchange/codereview
Right now I have two hashes. I want to assign one entire hash to an id in a second hash. However, I am having trouble assigning that hash into the other hash. Can you assign a hash into another hash by just saying: $nodes{$id}=%nodeHash; Right now this doesn't work because when I say: print Dumper(\%nodes); I get thi...
stackexchange/codereview
I'm trying to find the best way to generate the following output <name> job took 30 seconds <name> job took 1 minute and 20 seconds <name> job took 30 minutes and 1 second <name> job took 3 hours and 2 minutes I started this code def time_range_details time = (self.created_at..self.updated_at).count sync_time = ca...
stackexchange/codereview
I have an entity called Account and I have given this entity a class name of Account instead of the default NSManagedObject. I want to be able to specify objects within my main code to be instances of the class type Account. For example, I want to be able to declare a method such as -(BOOL)loginTo:(Account *)account. ...
stackexchange/codereview
The command line tool ec2-run-instances takes a -f parameter to pass a file to the instance at run time. Are there any Python APIs for EC2 that do the equivalent? I'm looking to customize a Wowza Media Server, which requires passing in a file when booting up a new image.
stackexchange/codereview
I was wondering if I can store a data object in a certain tag associated with a tableViewCell, for ease of access to the data associated logically to that cell. So is there a property to store the data object in? for a TableViewCell? Thanks
stackexchange/codereview
I'm currently working on some straight up assembly code on Ubunutu. I was wondering what my options are as far as debuggers go for just assembly code. Somethings with a GUI would be preferable.
stackexchange/codereview
I have a database table that has Id, Group, Items as columns. How do i code the xaml template with binding so that the list appears as Group 1 item 1 item 2 Group 2 item 3
stackexchange/codereview
This Regex Pattern: \bgoogle\b Test case: http://www.google.com/ It matches. Why?
stackexchange/codereview
I am still new to Facebook Graph API, and trying to start using facebook places search. (search places by location) https://graph.facebook.com/search?type=place&center=37.76,122.427&distance=1000 One thing i have noticed is user have to login to their Facebook account to do the search, otherwise the search will be re...
stackexchange/codereview
Rails provides a great feature that is model callback. These callbacks matches steps of an Active record object life cycle : after_save, before_validation, etc... Therefore I'm wondering if we could has specific callbacks. For instance, :after_login, :before_login, :after_logout, ... for an user model would be great. H...
stackexchange/codereview
In SQL Server 2008, let's say I have an index (LastName, FirstName) on the table Employees. The index is sorted ASC on both columns. Is there any point to the ORDER BY in the following query? SELECT LastName, FirstName FROM Employees ORDER BY LastName, FirstName Is the query analyzer smart enough to omit the ORD...
stackexchange/codereview
In our application, we store the most number of users online. We do this by tracking what page each user is on currently and upon login, delete users who have been inactive for X minutes and then take a count of the users online, overwriting the most number online if this is higher. How can we change this to track the ...
stackexchange/codereview
I'm looking for a function that maps a multi-set of integers to an integer, hopefully with some kind of guarantee like pairwise independence. Ideally, memory usage would be constant, and the hash value could be updated in O(1) time after an insert/delete. (This forbids doing something like sorting the integers and usin...
stackexchange/codereview
How do I generate a list of <p>'s from an array with HTML and using JavaScript?
stackexchange/codereview
I'm having some CSS trouble when trying to get IE's display the same as Firefox's display. Particularly, I'm trying to vertically center text within a box while still having full height: Shown here: http://img9.imageshack.us/img9/4045/goddammitv.png Is there anyway which I can get the height of the link to be the same ...
stackexchange/codereview
I have a question about creating custom views. I wanted to implement an interface where I want to have different objects configured in one place, each of them with it's own controls. Kind of like in automator, on the right side view where the workflow is shown with different actions. Are those NSView or NSCell subclass...
stackexchange/codereview
I'm trying to get a simple pass through geometry shader to work under Mac OS X 10.6. The code compiles and links without problem, but for some reason no geometry is being drawn to the screen. Here's my shader code: #version 120 #extension GL_EXT_geometry_shader4: enable void main() { gl_Position = gl_PositionIn[...
stackexchange/codereview
I have stumbled upon a person changing mv command to -mv within a makefile target. What is the difference? %/install-stamp: dh_testdir ...
stackexchange/codereview
I have a panel in my application, and the user can change its width. My problem is when the title is very long. I would like to crop the title by changing the width. I have tried changind the width of the titleTextField by: this.titleTextField.width = ...; But it does not work. Can any body help me?
stackexchange/codereview
I have a problem with my visual studio - 08 build. some of the static objects are not getting instantiated. its wierd, i have a couple of files which create similar static objects. some are created some are not. when i tried to break point in the file for uncreated objects, my breakpoint is disabled. how do i make sure...
stackexchange/codereview
I am wondering what would be the best way to use NHibernate.Spatial with SQLite for testing purposes? Mostly, I will need to be able to run NHibernate queries (HQL and others) against in-memory SQLite where Spatial is used. This leads me to a couple of options: Create a fake dialect for SQLite where it would always re...
stackexchange/codereview
I have a function that is supposed to take a string, append things to it where necessary, and return the result. My natural inclination is to just return the result, which involved string concatenation, and if it failed, let the exception float up to the caller. However, this function has a default value, which I just...
stackexchange/codereview
Hey folks, I'm migrating a website over a to new CMS with a different URL structure, I'd like to have users redirect if a specific part of the link is missing. So if the user goes to www.domain.com/articles/name_of_article it'll take them to the old site, however if they go to www.domain.com/ it'll forward them to the ...
stackexchange/codereview
I deleted the contents of the development.log file on my server because it was getting big. Then after it was empty, I noticed that it stopped logging entirely. So I deleted the file completely and it still continued not to log. Then I remade the file manually and still no luck. Any idea what's going on?
stackexchange/codereview
Not being experienced in multi-threaded programming or technologies, I would like to ask this question as a way to focus a design to accomplish the following requirements for relatively long running jobs (between 4 and 10 seconds) that are launched in real time by some user action: After the job is initiated and until...
stackexchange/codereview
If you go to http://wonderwall.msn.com/, you'll notice that the wall is scrollable...and it's an awesome grid layout. Is there a library that can do this? Preferably in JQuery
stackexchange/codereview
I am wanting to setup RabbitMQ as a two (or more) node cluster with HA. Use case: a client producer app (C#.NET) knows that the cluster has two nodes and publishes to the cluster. Various consumer apps (also C#.NET) connect to the cluster and get all messages generated by the producer. So long as at least one node is...
stackexchange/codereview
I am writing now writing some evented code (In python using gevent) and I use the nginx as a web server and I feel both are great. I was told that there is a trade off with events but was unable to see it. Can someone please shed some light? James
stackexchange/codereview
Can someone please explain the memory layout of the data stored in a vector<bool>? like what layout does the memory have from address &myVec[0] upwards? Does it depend on endianness? Is the memory continguous for all stored values? (i'm aware that vector<bool> doesn't actually store booleans). can I dump the content of...
stackexchange/codereview
I'm working on developing a javascript framework and I don't want anyone to be able to link to the "nightly build" .js file directly on the server. Based on my research from google, here's what I have in my htaccess: <FilesMatch /development/flanvas/flanvas.js> ForceType applicaton/octet-stream </FilesMatch> And I've...
stackexchange/codereview
I'm new in this xml world therefore I have this xml file: <?xml version="1.0"?> <Graphics xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Graphics> <PropertiesGraphicsEllipse> <Left>56</Left> <Top>43.709333795560333</Top> <Right>225</Right> ...
stackexchange/codereview
I have created an standalone application in which i want that when the user clicks on the run button then the terminal should open and a particular command should be executed on the terminal. I am able to open the terminal successfully using the following code... Process process = null; try { process = new Proc...
stackexchange/codereview
I got a quite unusual question today from a client. They provide a mission-critical service where it's important that people are notified when a certain event happens. Currently they have an API that simply writes out TRUE or FALSE, when accessed by a web browser, depending on the state of their alert. They want to tak...
stackexchange/codereview
I am occasionally on an expensive Internet connection and I would like to know (at least approximately) how much data will be pushed to the remote in a git push.
stackexchange/codereview
I am using FacebookSDK (ASP.Net MVC Facebook Canvas Application) and I am just trying to output the video id from two videos I have uploaded to Facebook. Using the SDK I have successfully retrieved the videos and it says it has the two videos however I am not sure how to write the code to grab and output the video ids...
stackexchange/codereview
I am trying to save my whole viewmodel into the IsolatedStorage Settings. It is quite large as it contains many other VMs. When I try and read the value it throws a "Operation not permitted on IsolatedStorageFileStream" error. This seems like a red-herring as I am not using files, I am using the IsolatedStorageSetting...
stackexchange/codereview
Very briefly: I'm having an issue with ensuring that VB DLLs honour the timeouts set in IIS and ASP. A site I work on uses a number of home-rolled DLLs and their methods could, potentially, run for longer than a web user is willing to wait. If the visitor presses Escape or closes their browser then the process natural...
stackexchange/codereview
I tried to send an email vie PHP but got nothing. I don't see what I am doing wrong. // Send an email. $subject = 'Welcome to mypage'; $message = 'your registration went fine.'; echo $email; $a=mail($email, $subject, $message ); echo 'Mail sent, a='.$a; I checked that $email contains my email address and $a = 1 af...
stackexchange/codereview
I've got a partial control with Ajax.BeginForm containing simple form with one textbox and validation message. Model is using data annotations to set this field to required. When above partial control gets loaded in the view directly using Html.RenderPartial then client side validation works fine. When above partial co...
stackexchange/codereview
Consider a linked list whose nodes are chars, so the list represents a string. How do you write a recursive routine to check whether the string is a palindrome such that the the said function starts unwinding the stack when it processes the character(s) at the middle of the string? For example, suppose that my string i...
stackexchange/codereview
Here is an example of what I am trying to do. XML: <TEST> <NODE> <A id="ELEMENT_1"/> <A id="ELEMENT_2"/> <A id="ELEMENT_3"/> </NODE> <SOME_OTHER_NODE> <B nodeId="ELEMENT_1" invalid="1"/> </SOME_OTHER_NODE> </TEST> XSL: <xsl:apply-templates select="A[?? only select the A's where there is no B w...
stackexchange/codereview
I'm trying to create a toggle effect using + and - boxes for showing and hiding divs. And example http://theodin.co.uk/tools/tutorials/jqueryTutorial/index.html This is the script I'm using $(function(){ $('.block').hide(); $('#show').toggle(function(){ $('.block').show(); ...
stackexchange/codereview
This is occurring during the end of the analysis when the DTA tries to drop the indexes it created. Unfortunately, with the database in use, this is causing terrible blocking issues. Is there a way to prevent this? Using SQL Server 2008
stackexchange/codereview
I have the Xaml code that show everything correctly but I want to make it so the first column's content is bold: <c:TreeView Name="JobList" SelectedItemChanged="JobList_SelectedItemChanged"> <c:TreeView.Columns> <GridViewColumn Header="Jobs" Width="350" DisplayMemberBinding="{Binding Name}"/> <GridV...
stackexchange/codereview
I'm writing an iPad application and I need a bar to span the entire bottom of the screen, in front of both the root controller's view and the detail controller's view. The bar is a sub-view of the detail controller's view, and I have "clip sub-views" turned off so that it extends outwards to the left of the detail cont...
stackexchange/codereview
In a nutshell we're unable to get reasonable scrolling performance from any kind of WPF grid/items control when loaded with heavy amounts of pure data. We've created a static independent prototype using the DevExpress WPF grid and uploaded it here: http://jump.fm/QOTDL We've also tried with the Infragistics and Xceed g...
stackexchange/codereview
I'm getting this compiler error when calling vector's size(). Why? #include <vector> #include <iostream> #include <fstream> #include <sstream> #include <string> #include <cassert> using namespace std; class Vertex { float firstValue; float secondValue; float thirdValue; Vertex (float first, float ...
stackexchange/codereview
Im building a simple form where im trying to pass values from check boxes... <div class="checkboxclass"> <input name="form[paperdesign][]" value="150" id="paperdesign0" type="checkbox"> <label for="paperdesign0">text 1</label> <input name="form[paperdesign][]" value="100" id="paperdesign1" type="checkbox"> <label for="...
stackexchange/codereview
I need to exactly set the height of a parent ul element dependent on the included li's. But as soon as I have a line-height CSS property with fractional digits the whole calculation isn't correct anmyore. Sometimes the calculated height is sometimes too large and sometimes too small (e.g. jsfiddle link 1px in Firefox)....
stackexchange/codereview
I have certain text added to all my files. I want to delete that from my files. The text is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> </head> <body>...
stackexchange/codereview
For example, I want to locate all ports used between 1 - 1024 without manually crawling through a 780 packet trace.
stackexchange/codereview
I have this equation: R= 2*(-I dot N)*N + I Can I simply type (-I) or something similar, or do I have to multiply I by -1?
stackexchange/codereview
I am porting a Java middleware client to objC. The java client uses the java stream.write and stream.flush at the end of the send. For the java client to send to the Echo server I need to add the stream.writeBytes("\r\n"); followed by stream.flush for the server to bounce the message back. I am using the asyncsocket ...
stackexchange/codereview
I know that global variables are bad. But if I am using node's module "util" in 40 files in my framework, isn't it better to just declare it as a global variable like: util = require('util'); in the index.js file instead of writing that line in 40 files? Cause I often use the same 5-10 modules in each file, that would...
stackexchange/codereview
I've written the following Extension Method <Extension()> Public Function ToUtcIso8601(ByVal dt As Date) As String Return String.Format("{0:s}Z", dt) End Function But I also need a Nullable version of the same method... how exactly do I do this? This is what I was thinking, but I'm not sure if this...
stackexchange/codereview
Where can I find some simple sample code for public key encryption and decryption on Mac OS X? I'm frustrated that Apple's "Certificate, Key, and Trust Services Programming Guide" shows how to do this stuff on iOS, but the needed APIs (SecKeyEncrypt, SecKeyDecrypt) are apparently not available on Mac OS X. There's pr...
stackexchange/codereview
i'm trying to automate a file download with Windows Script Host (JScript). i see ADODB.Stream has an Open method whose documentation makes it seem like it should be possible to open a HTTP URL and stream the response body: var url = 'http://example.com/example.tar.gz'; var path = 'example.tar.gz'; var input = WScript...
stackexchange/codereview
I'm quite confused by this one. I've build a "read more" button using mostly CSS (following this tutorial). Everything is working well, but the text is showing as white in Firefox but light blue in webkit (safari, chrome). Here's the CSS: .showcase-readmore { float:right; color:#ffffff; font:2em Futura, ‘Century Gothic...
stackexchange/codereview