instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm trying to use a custom profile in ASP.NET using VB.NET according to this post: How to assign Profile values? I created my profile class under the folder /class/Usuario.vb using the Locus namespace. The class inherits ProfileBase as specified in the post above. The problem is that when I try to make a reference to t...
stackexchange/codereview
Possible Duplicate: How do I find gems that depend on a given gem? I want to find out which gems depend on e.g. one of my gems, so i can see if i would break anything, is this supported/possible ?
stackexchange/codereview
Is it possible to get the MAC from an another PC in the same Network via IPv6 (without WMI)? With IPv4 it is easy (ARP). IPv6 uses the "Neighbor Discovery Protocol" (NDP) to get the MAC address. Are there any methods in .Net for this?
stackexchange/codereview
I have a drop down list with multiple radio button values to choose from. If you don' t choose a option the value will be saved in the database as null. But if you choose an option, you can't uncheck it. So I need a "not stated" option in the dropdown list instead, which would save the value as null in the database. ...
stackexchange/codereview
Is there any way in jQuery to get the current cursor-position in an text input without doing ugly browser specific code? Like in: <input id="myTextInput" type="text" value="some text" > the cursor being after the "x" of "some text", I can get "8"?
stackexchange/codereview
I am a Delphi programmer and have written, over the years, hundreds of classes and routines which I can use in every Delphi program I write. This library is called dlib and can be used in every Delphi program by putting this folder in my library path and using one of the units in the uses section of a Delphi unit. Bein...
stackexchange/codereview
Am unable to connect to mysql database on ec2 from my current server .. using telnet i tried to check if the port is open .. but i get the following error .. "telnet: Unable to connect to remote host: Connection refused" .. i checked the security group as well .. and it has MySQLL (port 3306) added .. The root device f...
stackexchange/codereview
I'd like to be able to set a condition from which to decide whether certain tests run in NUNIT. For example if a global variable x = 1 then only run the tests from a certain class/assembly or only run the first test. Is anything like this possible? How would one go about doing this? Thanks!!
stackexchange/codereview
A lot of time can pass between the moment a stack trace is generated and the moment the stack trace is thoroughly investigated. During that time, a lot can happen to the file in question, sometimes obscuring the original error. The error might have been fixed in the meantime (overlapping bugs). Is it possible to get St...
stackexchange/codereview
If the table is: Month 1 2 3 4 5 6 7 I need help how to convert it into Month January Februari May etc... The data needed to be converted as a expressen code in the reporting designer interface.
stackexchange/codereview
I have two fields, one is just the number of the other one, e.g. Field 1 = "12AB" and Field 2 is "12". I'm trying to make Field 2 auto-update but I'm not sure how. I'm trying to get: ClassName ClassYear 12AB 12 13BU 13 15BE 15 But instead the whole fields update to the number in the last one: ClassName...
stackexchange/codereview
I am on a linux server connecting to a webservice via PHP/Soap. The problem is that a method is zipping the response via SharpZipLib. So all I get in return is a garbled string. Does anyone know of a way to unzip this with PHP or JS? Thanks! Update: This is the compressed test data that gets returned: UEsDBC0AAAAIAI...
stackexchange/codereview
Does the Common Service Locator, used for "providing an abstraction over IoC containers and service locators", support Mono .NET?
stackexchange/codereview
I am using Weld, Jboss' implementation of CDI. JPA/Hibernate for persistence. For something different I am giving it a crack on Glassfish 3 which I have not used before. I am using Maven for dependency management. As CDI doesn't have transaction management included out of the box, I decided to use the Seam 3 Persist...
stackexchange/codereview
I have the following bash script: tail -F -n0 /private/var/log/system.log | while read line do if [ ! `echo $line | grep -c 'launchd'` -eq 0 ]; then echo 'launchd message' exit 0 fi done For some reason, it is echoing launchd message, waiting for a full 5 seconds, and then exiting. Why is this...
stackexchange/codereview
I'm building a cool app that needs to check the number of "tweets", "shares" and "diggs" each URL in a feed has an then arrange them according to the number of "tweets" etc... Any ideas on how this can be done? It shouldn't be that hard, but I cant figure it out =) Checkout www.babblr.me , they have a similar solution....
stackexchange/codereview
im trying to convert this code to c# for ( int k=0; k < 3; k++ ) if ( anim.jointInfo[j].flags & (1 << k) ) { //.... } flags: int jointInfo: List<>
stackexchange/codereview
If I do this- alert(anchor); I get this- "[object HTMLLIElement]" ... ok, yep, it is the element I want. So I want to get that elements ID. So I test it like this: alert(anchor.attr("id")); ... but I don't get any alert, nothing. I must not be selecting an element. What am I doing wrong, what don't I understand?
stackexchange/codereview
This is a question on edit form UI for a WP7 app: I currently have my edit form fields set to 2-way binding which means that as the user changes them they save on edit and update the UI in the ViewModel (Method 1). So I don't need a Save button and there is no Cancel button (unless you code in logic to store the origi...
stackexchange/codereview
I'm playing around with a simple web app locally, and can't quite figure out why it is not caching correctly on the iPhone. I am serving a .manifest file with the correct MIME-type, and the site works perfectly fine with my local server turned on or off on desktop Safari, Chrome and Firefox. It is only mobile Safari ...
stackexchange/codereview
I need a clever regex to match ... in these: <img src="..." <img src='...' <img src=... I want to match the inner content of src, but only if it is surrounded by ", ' or none. This means that <img src=..." or <img src='... must not be accepted. Any ideas how to match these 3 cases with one regex. So far I use somethin...
stackexchange/codereview
I am attempting to use preceding-sibling to select unique elements from a group. Using the folliwng xml as an example.. <items> <item> <options> <option> <option-data> <data-ab>TEST1</date-qualifier> <date>20101026</date> </option-data> <option-data> <data-ab>TEST2</date-qualifier> ...
stackexchange/codereview
Say i have a string as follows ' *my test string 1 111:222:444: &EVERYTHING INSIDE THIS REGARLESS OF CHAR OR INT£ This is a test string (123456789)' I want to return every thing inside & and the £ sign or match it. Any body could help me with the regex expression for this.
stackexchange/codereview
Although not really a programming question I believe many developers would have come across this and therefore give the best answer. Currently I am developing an App for iPhone for the organisation I work for. Its close to release and there is heaps of interest when I present it but the occasional question comes up am ...
stackexchange/codereview
I'm having difficulties to understand exactly WHEN autorelease pools are created and released in AppKit apps. For example, if I have an ApplicationController class that overrides init, is there an autorelease pool that gets created before it starts and gets drained after it ends?
stackexchange/codereview
Is there a way to change a border color of some common controls in Windows Forms (TextBox, ComboBox, MaskedTextBox, ...) when they are in focus? I would like to achieve that in my dialog, so when control is in focus it's border becomes blue?
stackexchange/codereview
when my app is exited i see the following in the debugger console. The thread '_threadstartex' (0xd48) has exited with code 0 (0x0). The thread '_threadstartex' (0xf80) has exited with code 0 (0x0). The thread '_threadstartex' (0x190) has exited with code 0 (0x0). The thread '_threadstartex' (0xaa0) has exited with co...
stackexchange/codereview
I want to accept to accept the html input from user and post it on my site also want to make sure that it don't create problem with my site template due to dirty html code. I was using html purifier in the past but Html purifier is not working on one of my server. So I am searching for best alternative. Which is purel...
stackexchange/codereview
I have a script, client.py, that reads command line args straight as a script (not wrapped in a function like main()), like so: opts, args = getopt.getopt(sys.argv[1:], "l:r:a:j:b:f:n:u:") and prints a bunch of stuff. I need to call this script from my code (on Google App Engine, if that matters). It seems that callin...
stackexchange/codereview
I have encountered what I expect is a common issue in web development. I have an ASP.NET MVC 2.0 ecommerce site. I pass the cost of an item to the product page view via a viewmodel - this cost may vary based on user type, user history, quantity purchased, etc. I want to guarantee that when the user submits the form to...
stackexchange/codereview
Yes, I know async and friends does a lot behind the scenes, but how about "clean up" items (WPF support?) from the various wish lists? Or are there other C# 5.0 features that will be coming?
stackexchange/codereview
Ok I have an Image that I'm trying to read. Problem is that the Image.read(file) returns NULL. File file = new File("C:\\images\\image1.jpg"); if(file.exists()){ System.out.println("Image file exists."); BufferedImage originalImage = ImageIO.read(file); } So image exists but ImageIO.read(file) returns NULL. ...
stackexchange/codereview
Is there a better way to do this? I feel like I am doing something wrong by being too repetitive. O = viz.pick(1, viz.WORLD) BackSetts = ["set_b1b", "set_b2a", "set_b1a", "set_b2b"] LeftSetts = ["set_l1a", "set_l1b", "set_l2a", "set_l1b"] NormSetts = ["set_nr_a", "set_nr_b"] Maps = ["MapA","MapB"] if O.name in BackS...
stackexchange/codereview
I have a pretty basic X11 app that I run on Linux that I'm trying to get compiled under OSX 10.5.8. I have X11 and the X11 SDK installed, and modified the makefile as follows: CFLAGS = -L/usr/X11/lib -I/usr/X11/include Everything compiles fine, but the linker can't find the X11 lib. ld: library not found for -lX11 I've...
stackexchange/codereview
I am trying to program my notification to RESUME my app, instead of simply starting a new instance of my app... I am basically looking for it to do the same thing as when the Home button is long-pressed and the app is resumed from there. Here is what I am currently doing: void notifyme(String string){ String ns = ...
stackexchange/codereview
I'm trying to compile an open source project I downloaded which was apparently written in VC++ 7.1. After a lot of trouble, being a novice at C++, I managed to download and fix includes for STLPort that the project uses. However, I get something like 15,000 errors complaining that certain types are not defined. A few o...
stackexchange/codereview
One of the libraries in my audio project continually outputs a byte[] array stream of PCM audio (along with a length and offset integer). I'm learning to use the Tritonus implementation of the Java Sound API to encode this PCM stream into mp3. The Java Sound API provides an converted/encoded byte[] array via an AudioI...
stackexchange/codereview
Looking for a way to get a list of telephone area codes for a given latitude and longitude (and if necessary a given intl. code.) Note, I'm not talking about international dialing prefixes but the area codes within them. For example, Denver Colorado is covered by the area codes 303 and 720. It's at 39.739 -104.985 and ...
stackexchange/codereview
How to I respond to a user pressing a UISegment? Is there a delegate, or must I programmatically (or Interface Builder), attach the selectors?
stackexchange/codereview
The app responds to a custom URL, and correctly launches when in a suspended state. The question is, can I disable showing the Default.png when launched this way? A use case for clarity: app is started normally a home button press puts app in standby a url of the scheme the app recognizes is tapped in mobile safari us...
stackexchange/codereview
Anybody have trouble with an MPMoviePlayerViewController giving a white screen when it is presented? - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { MPMoviePlayerViewController* mpViewController = [[MPMoviePlayerViewController alloc] init]; [[mpViewController moviePl...
stackexchange/codereview
I was just having a nap and then that crazy idea came into my head. Here it is. We have 2 different photos with face in each. How can we detect if there is the same person on that two photos? Is it possible to do that? If yes, can I do it with Java or PHP? What the way to do it? Any ideas? Maybe each face has a "algori...
stackexchange/codereview
Here's what I need to do: I will have a toolbar with multiple objects on it (for this we'll call them A,B,C,D) and I want to be able to have the user click and drag them around and be able to snap them to a grid and connect to each other. Sounds easy, right? Well here's my problem: some objects are different sizes, so...
stackexchange/codereview
I'm looking for interesting algorithms for image magnification that can be implemented on a gpu for real-time scaling of video. Linear and bicubic interpolations algorithms are not good enough. Suggestions? Here are some papers I've found, unsure about their suitability for gpu implementation. Adaptive Interpolation Le...
stackexchange/codereview
is there functionality in java to open the containing folder of a file across any platform. I can accomplish this in windows by running Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("explorer /select,c:\\sampleFile.txt"); You can open a file (if the Desktop api is supported) on any platform with java....
stackexchange/codereview
It keeps giving me an error in "Void type not allowed here." public class BugTester { public static void main(String[] args) { Bug bugsy = new Bug(10); bugsy.move(); //now the position is 11 bugsy.turn(); bugsy.move(); //now the position is 10 bugsy.move(); ...
stackexchange/codereview
So I've written a roulette selection function for my genetic algorithm which follows: public String tournament(float fitness, Chromosome pop[], int selection) { // roulette if (selection == 1) { Random random = new Random(); float slice = random.nextFloat() * fitness; float curFitne...
stackexchange/codereview
I have a situation where using VBScript I need to check for the presence of multiple spaces. I want to check for the presence of 2 or more consecutive spaces, so \s+ doesnt work for my needs. Does anyone know how I can accomplish this using VBScript regular expressions.
stackexchange/codereview
Variants of this question have been asked many times, but none of the answers clarified what I am interested in: I would like (obviously... :) to synchronize my local working copy with two repositories on two different servers. If I use svn switch with the --relocate option, is it possible (and reasonably safe) to kee...
stackexchange/codereview
I got a basic map running using google maps v3 Next features that I would like to add include: draw line as road directions instead of direct point to point polyline draw a circle 75 km circle around from a specific point highlight the postal code of a specific point. I Would appreciate people's thoughts on these top...
stackexchange/codereview
Im tossing up at the moment whether or not to start developing for iPhone or Android. The main thing drawing me towards Android at the moment is that apps are developed using Java, which I like, as opposed to Objective-C, which I hate. Really though, the next thing on my list is to consider the costs. Apple requires y...
stackexchange/codereview
I have an image sitting on my SDcard (of type jpg) and I am trying to send the image via HttpPost to my servlet running on Apache Tomcat 7.0 So far I have google-ing the way to do this but I can't seem to find the perfect way. Do any of you might have some suggestion or solution to this problem? Thank you in advance, S...
stackexchange/codereview
How do I change the toolbar's background?
stackexchange/codereview
I am running Pylons using SQLAlchemy to connect to MySQL, so when I want to use a database connection in a controller, I can do this: from myapp.model.meta import Session class SomeController(BaseController): def index(self): conn = Session.connection() rows = conn.execute('SELECT whatever') ... S...
stackexchange/codereview
Basically I have following models in CakePHP: User(id, username) Photo(id, user_id, path) I have set up following relation: User hasMany Photo. On one screen, I would like to list users, and show random photo next to each user. I tried setting up following relation: User hasOne SamplePhoto (where SamplePhoto is just P...
stackexchange/codereview
I am trying to figure out if there is anything that you can do in c++ that you absolutely cannot do in c#? I know that there are platforms that are targeted to native libraries, but I want to know if the lowest level c# can compare with the lowest level c++.
stackexchange/codereview
Can you recommend any tools? Should we build our own? Should we create the sitemap manually?
stackexchange/codereview
This is a follow up to an older question. Given a ISBN number, e.g. 3-528-03851-5 which exception type should I raise if the passed in string doesn't match the format X-XXX-XXXXX-X?
stackexchange/codereview
I'm using this code but I can't figure out how to get the email from the user. I know you must get special permission from the user but I don't know how. I can get the public data from the user but that's not what I even need. The only thing I need is the email. I guess it's something with this line: $me = $facebook->a...
stackexchange/codereview
Possible Duplicate: How can I simulate an anchor click via jquery? For some reason I thought this would be really easy. Here's my code: $('#someDamnedDiv').live('click', function () { $('a', this).trigger('click'); }); What the Sam Hill is wrong with my function?
stackexchange/codereview
I have the following jQuery code that detects if a user has clicked a search button but not typed anything in the text box, if so then they are focused on the textbox and the box turns red. What I want to do is when the user unfocuses (blur) from the textbox regardless of whether they have entered text or not then the ...
stackexchange/codereview
I am using SonyEricsson X10i phone. I have developend an application that just shows the current location of a user. Now the problem is When i turn on my application it just keep searching. It is not showing anything. Even if i try to use built in navigation system it does not work. I have turned on GPS receiver. My fi...
stackexchange/codereview
I have a PDF that I want to append some text to. the addFooter() that is available in CF9 would work perfectly, but I only have access to CF8. Any one have workarounds for this feature in 8? Thanks
stackexchange/codereview
I have a User model with an 'email' field. In my view, I have rendered the label for this field as 'Email address' as follows: <%= form_for(:user) do |f| %> <%= f.label :email, 'Email address' %><br / <%= f.text_field :email %> <% end %> However, when validation errors are generated, 'Email' is used instead: Emai...
stackexchange/codereview
I need to write a code that will copy one set of form values into another. And normally it is done by something like this: <script type="text/javascript"> function copyGroup() { if(document.formName.copy[0].checked){ document.formName.a1.value = document.formName.b1.value; document.formName.a2.value...
stackexchange/codereview
I wonder if it is possible to select item that belongs to one group, without selecting whole group. What I trying to make is a group of items, that can be moved (all items are moved together) but none of them can't be moved individually. But I want also to be able to select items inside this group and then do something...
stackexchange/codereview
I have a really simple external css stylesheet that has the following : div.hideBox { display:none; } So when the html page loads, the div with that class attribute 'hideBox' will not show on the page, which is what I want. But I the box to show/appear when a user clicks on a button on that same page. I tried to u...
stackexchange/codereview
I'm trying to convert some mysql tables from latin1 to utf8. I'm using the following command, which seems to mostly work. ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; However, on one table I get an error about a duplicate key entry. This is caused by a unique index on a "name" field. It...
stackexchange/codereview
Get ready for some strangeness. The following works fine in Firefox: Redirecting to this URL: http://localhost/webs/van/front-end/slr/edit_rule.php?rule_name=test&rule_type=alloc_ext&copy=1 However, it does not work in IE8 since it converts the above to this, note the copyright symbol in the address at the end: http:/...
stackexchange/codereview
I create a very simple activity where I create and set the view in java code instead of xml. The width I pass to the outer LinearLayout though has no effect at all (200). The view is displayed on the entire width of the screen, no matter what value I pass here. (Note that this is just sample code; I know that in a real...
stackexchange/codereview
I want to implement TCP protocol using Java. I've read Sun documentation and examples but all of them simply open a socket, client waits for server to accept the connection and then sends data. I wonder how I can implement the three way handshake and data validation using Java? How do server and client exchange sequen...
stackexchange/codereview
Every week I produce a word document with some copy, tables and charts from various sources on our network. It can take a bit of time and sometimes I make mistakes or forget stuff that should go in. I want to automate this process as much as possible. So basically I want to make a Word Template or Console App that when...
stackexchange/codereview
I'm new to Android programming. I have a program that looks like this: Here is the main java block: public class MyAndroid extends Activity { private EditText input1; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(sav...
stackexchange/codereview
This may be a bit silly question, but I just started doing pretty things in jQuery and I suddenly wondered how to solve a problem that I never even bothered looking into without the help of frameworks. Suppose we have two div elements: <body> <div id="lorem1" style="display:block; height:400px;"> Lorem ipsu...
stackexchange/codereview
I want to show a "Confirm Close" window when closing the main app window, but without making it disappear. Right now I am using a windowsListener, and more specifially the windowsClosing event, but when using this event the main window is closed and I want to keep it opened. Here is the code I am using: To register the...
stackexchange/codereview
I asked a related but very general question earlier (see especially this response). This question is very specific. This is all the code I care about: result = {} for line in open('input.txt'): key, value = parse(line) result[key] = value The function parse is completely self-contained (i.e., doesn't use any shar...
stackexchange/codereview
I have the following factories: Factory.define :email do |email| email.email {"infomcburney.cowan.com"} end Factory.define :lead do |lead| lead.emails {|emails| [emails.association(:email)]} end Which are modeling the following classes class Lead < ActiveRecord::Base has_many :emails end class Email < ActiveR...
stackexchange/codereview
I have this following directory structure: auth controllers daos etc.. I have this DAO working: class TeamsDao extends Zend_Db_Table_Abstract { protected $_name = 'teams'; etc... I want to add a new DAO and my question is: After adding the file and a new class representing a new dao, do I need to tell zend that I...
stackexchange/codereview
I apologize because I am quite certain this is a basic question. All I want to do is create a very simple choropleth map in R using the maps package. This is my first attempt at mapping any data in R. My geography is the lower 48 states including DC. Here are the first few rows of the dataset I want to plot. > head(...
stackexchange/codereview
I have problem with width of ImageButtons, it isn't the same size. I have experimented with all attributes for two hours and nothing. I create buttons at runtime and put inside row (also created at runtime). Does anybody know any solution for this ? public static TableRow[] Create(List<Apartment> list){ TableR...
stackexchange/codereview
Earlier I managed to port some C++ CryptoPP Rijndael_128 CBC code to MCrypt PHP, but now I'm having problems with CFB mode. The C++ and PHP results do not match (well the first byte matches but this could be coincidence, everything else doesn't). With some diagnostics, it looks like PHP's mcrypt is not setting the key ...
stackexchange/codereview
I am looking to draw a music staff on a .NET (C#) form. I am using Microsoft Visual C# 2010 Express. I was wondering if anyone knew of existing code or existing free .NET libraries that can help with that. I am looking at drawing both the treble and bass clef staff and adding one quarter note to some where in the st...
stackexchange/codereview
I am using XSLT to transform a XML file in to a HTML file. I would like to insert a plain text file in to the HTML as part of the transform. Is this possible?
stackexchange/codereview
Two of my modules are conflicting and it's causing a serious issue, I'm not all that familiar with back-end programming so I've come here hoping someone can help me out. P.S. I did try to solve this on my own for at least an hour or two, learned quite a bit but not anything that was straight forward enough to solve thi...
stackexchange/codereview
I know that with Vista you can generate a dump file by goigg to task manager->processes-> right clicking on the process. Is this option available in other versions of windows meaning Windows 7, Windows 2003, Windows 2008 etc?
stackexchange/codereview
We use a teamcity server to do CI for some things, we have started with some sharepoint web part development (again) and would like to integrate this into our CI system Using WSPBuilder on the desktop works really well but I am not sure how to fire off the tasks on the CI server. Has anyone done this? Are there MSbuild...
stackexchange/codereview
REDIT: Was trying to avoid just placing the entire block of code on the forum and saying fix it for me, but here it is, to simply the process of determining the error: #! /usr/bin/python2.6 import threading import Queue import sys import urllib import urllib2 from urlparse import urlparse from lxml.html import parse, t...
stackexchange/codereview
What i'm trying to do is display a drop down with all field names from mysql database, once the user picks one and submits the form i want to display a second dropdown filled with all the rows from the submitted field name, this is my code so far: $result = mysql_query("select * from `parts`") or die(mysql_error()); e...
stackexchange/codereview
Do not answer to set to YES the property of the MFMailComposeViewController, and then simply write the html link through Link It simply does NOT work. Try it. Thank you. Luca
stackexchange/codereview
I have a Javascript function that is associated with an onChange event. I understand that some browsers support onPaste at either the document or an element level. Is there a way to determine if the onChange event was caused by a "paste" - I tried adding a global var that gets set when onPaste is fired, and then reset ...
stackexchange/codereview
Here is the code: class LongOp { //The delegate Action longOpDelegate = LongOp.DoLongOp; //The result string longOpResult = null; //The Main Method public string CallLongOp() { //Call the asynchronous operation IAsyncResult result = longOpDelegate.BeginInvoke(Callback, null)...
stackexchange/codereview
I'm trying to send some data to my controller with the Js helper like so: view: <?php $this->Js->get('#FieldId')->event( //fieldId is a selectbox 'change', $js->request( array( 'controller'=>'users', 'action'=>'check' ), array( 'update'=>'#result', ...
stackexchange/codereview
Is there way to pass the thread "index" of a PLINQ query into one of it's operators, like a Select? The background is that I have a PLINQ Query that does some deserialization, the deserialization method uses a structure (problably an array) to pass data to another method: ParallelEnumerable.Range(0, nrObjects)...
stackexchange/codereview
I am trying to create authorization action filter the will fire on each request to check if the user is allow to do some stuff. So, i created the following classes/interfaces: public interface IGlobalAuthorizationFilter : IGlobalFilter, IAuthorizationFilter { } public interface IGlobalFilter { bool ShouldBeInvoke...
stackexchange/codereview
When I run code analysis on the following chunk of code I get this message: Object 'stream' can be disposed more than once in method 'upload.Page_Load(object, EventArgs)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object. using(var stream = File.Open(newFi...
stackexchange/codereview
Given an object like this: { name: "joe" } I want to get the value "name". I know I can use the for construct to iterate over the properties in an object, but the objects I'll be dealing with will always have a single key:value pair, and I won't know the name of the property. To further illustrate: var a = { age: 24 }...
stackexchange/codereview
I want to read a sound file from application bundle, copy it, play with its maximum volume level(Gain value or peak power, I'm not sure about the technical name of it), and then write it as another file to the bundle again. I did the copying and writing part. Resulting file is identical to input file. I use AudioFileRe...
stackexchange/codereview
I am trying I have a simple one-to-many association. I am trying to update photos that belong to an album through a nested form: The edit form for the photo album: <%= semantic_form_for(@album, :url => user_album_path(@user, @album), :html => {:method => :put} ) do |f| %> <%= f.inputs do %> <%= f.input :title %> <...
stackexchange/codereview
I have a web service which exposes functionality to create, edit, delete user settings. Right now I have a UserSetting entity which is instantiated on each call to the web service. This entity has methods Create, Edit and Delete and other required properties. The intentions are to serialise this class as an XML file an...
stackexchange/codereview
I am having an upload image system. You upload a image, then you crop it and press save. If you cancel this procedure at after you uploaded the image, the image will remain on the server. So therefore i tried my idea of making a column in db called "failImage", so when you upload the image, it stores the filename e.g 1...
stackexchange/codereview