instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I didn't find any example how to solve my problem, so I want to ask you for help. I can't simply send POST request using RestTemplate object in JSON Every time I get: org.springframework.web.client.HttpClientErrorException: 415 Unsupported Media Type I use RestTemplate in this way: ... restTemplate = new RestTemplate...
stackexchange/codereview
I am developing ASP.NET 2.0 application using SQL Express 2005. I have attached my database with the application. The Connection string: <add name="WCMIRConnectionString" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=&quot;\App_Data\WCMIR.mdf&quot;;Integrated Secur...
stackexchange/codereview
I have a Rails 3 project that does file upload/download, with access rights (User has many Files, and can only read/write his own files). If I store my files on classic filesystem, I can check the access to the file in my rails app and then use X-Sendfile header to redirect to the file, if user has access. In this wa...
stackexchange/codereview
Run time error on main method in MovieList.java. I'm not sure my program design is fundamentally very good, but I'd like to know why it crashes. Thanks in advance. package javaPractical.week3; import javax.swing.*; public class Movie { //private attributes private String title; private String movieURL; ...
stackexchange/codereview
Possible Duplicate: Can you write object oriented code in C? Hi! Just for the fun of it, I've been experimenting these last two days with creating a very simple, very straightforward object environment in pure C. I've been toying around with macros, dynamic linking, type-description structures and the like, and I've...
stackexchange/codereview
So, I just wanted to understand why this was happening in my WPF app as it seems to be adding a "space" or faint line without me wanting it... I have the following XAML <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="WpfApplicatio...
stackexchange/codereview
I have a small menu that looks like this: Item1 | Item2 | Item3 The menu sits inside a div and floats to the right in the div. When I hover "Item1" I would like a "sub menu" to slide out to the left of the "Item1" item. Item 1.1 : Item 1.2 - Item...
stackexchange/codereview
How do I properly displays the "time" datatype of MS SQL to ASP.NET MVC page? When I get the column to my class (the property in my class in of type DateTime), I call the "ToShorTimeString()" method but then that would displays something like this: "1/1/0001 12:00:00 AM" I need it to be able to display as, i.e. "11:00 ...
stackexchange/codereview
I'm using acts_as_versioned for images. Though it's possible in my app to update just the title, which shouldn't be a version as version are for image replacements. Problem is, if you update just the title, acts_as_versioned creates a new version which breaks everything. So when calling the model def update_title for p...
stackexchange/codereview
This happens only sometimes, but makes my files unreadable. The problem is that the DataContractSerializer adds a couple of >>> at the end of the XML files when serializing. Making them useless when trying to deserialize. Has anyone had this problem? Example: <SomeObject xmlns="someNamespace"> </SomeObject>>> Thanks. ...
stackexchange/codereview
i'm using this query $numposts = get_option('posts_per_page'); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('cat=5&showposts='.$numposts.'&paged=' . $paged); how to order the posts by custom field?
stackexchange/codereview
I've created a feature with a custom feature receiver for a site in sharepoint, using forms based authentication. However, whenever I try and activate the feature (even though the forms based account has top privileges) I get a 403 - "Requires you to be logged in". I can activate and deactivate other features just fine...
stackexchange/codereview
Given this code: private ObjectQuery<E> GetEntity() { // Pluralization concern. Table and Type need to be consistently named. // TODO: Don't get cute with database table names. XXX and XXXs for pluralization return _dc.CreateQuery<E>("[" + typeof(E).Name + "s]"); } Is there any way to determine an Entity t...
stackexchange/codereview
How can I center a UIMapView around an array of MKAnnotation?
stackexchange/codereview
I have searched long and hard for module that would show Customer Savings(in $$). There are two ways I wish to possibly implement this. Method One: Customer enters a "base" $$ amount, start date, and an incrementing value per time period Ex: Base=$1,000,000; Start:1/1/2010; Increment=$100; Time Period=Minute This woul...
stackexchange/codereview
Recently I have been writing a program in C++ that pings three different websites and then depending on pass or fail it will wait 5 minutes or 30 seconds before it tries again. Currently I have been using the ctime library and the following function to process my waiting. However, according to my CPU meter this is an u...
stackexchange/codereview
It is an application that has been built using seam 2.2 and it is running perfectly under Jboss 4.1.2. Because of support from my ISP I will have to upgrade JBoss to version 5.1 . I did try to run same app under JBoss 5 and everything looked fine but one single thing failed. It is a piece of code that generates some JS...
stackexchange/codereview
I need to write a SQL query that pulls from a table that stores records for each time one of our salespeople speaks to a client. The relevant columns are: (1) the salesperson's employee ID, (2) the client's account number, and (2) the date of the conversation. It's often the case that salespeople have spoken to clients...
stackexchange/codereview
There has to be a built in way of doing this, right? class Object def send_chain(arr) o=self arr.each{|a| o=o.send(a) } return o end end
stackexchange/codereview
I'm currently experiencing a problem while trying to set up a project to deploy to an internal nexus repository. Since I'm rather new to Maven in general, I expect that there is just something that I'm not really comprehending in how to set up distribution management. The basic issue is that when I execute "mvn deploy...
stackexchange/codereview
I'm using Grails 1.3.4, which uses Hibernate, going against an Oracle 11g database. My application fails on startup, with the following error: 2010-11-04 09:45:34,671 INFO [grails.spring.BeanBuilder] [RuntimeConfiguration] Configuring data source for environment: TEST 2010-11-04 09:45:36,812 ERROR [org.hibernate.util...
stackexchange/codereview
I'm posting data from a Flex app to a php script. GET works fine but POST doesn't seem to transmit anything. as3httpclintlib is the library I'm working with, however, I kind of doubt that is the problem, because replicating the request in php gives me the same result. I've looked around and while there seem to be multi...
stackexchange/codereview
I'm looking for a datatype in SQL Server that stores data as hexadecimal rather than int, but can't find anything similar. Surely there is a hexadecimal datatype?
stackexchange/codereview
I want to allow A-Z, a-z, and Japanese kanji, hiragana, and katakana and nothing else. So far I've come up with this: $pattern = '/[^\w\x{3041}-\x{3094}\x{30A1}-\x{30fA}\x{30fC}\x{4E00}-\x{9FFF}_\-]+/u'; preg_replace($pattern, '', $string); I'm not sure if this form of regex is PHP specific. I'm accepting a string in ...
stackexchange/codereview
I use the .Net Mutex class to lock parts of my app across threads. I'm having some deadlock issues, and it would be very helpful if I could find out the name of the thread that currently has the lock. Is there an easy way to do that?
stackexchange/codereview
I am looking to load test a consumer website. I have tried using JMeter. However, in that case, all the requests originate from one machine. What I really want is to simulate real users across the country some on low speed dialup connections and others on highspeed. What are the best practices to follow in such a scen...
stackexchange/codereview
i have an ip-to-country lookup table. this table is updated max once a month while read to very frequently. i currently have it as innodb. is this the best table type for a table that is pretty much only read from ? thanks in advance.
stackexchange/codereview
I am trying to make a textual game in python. All goes well however, I would like to make a function that will allow me to print something to the terminal, but in a fashion hat looks like typing. Currently I have: def print_slow(str): for letter in str: print letter, time.sleep(.1) print_slow("junk...
stackexchange/codereview
I have a Listview and i want to bind it to a list declared on the same class(codebehind) public ObservableCollection<Slot> ListViewList { get; set; } <ListView x:Name="ListViewSlots" Margin="0,230,0,0" ItemsPanel="{DynamicResource ItemsPanelTemplate1}" ItemsSource="{Binding Path=UserControl.ListViewList}" > But is no...
stackexchange/codereview
I have read two excel sheets in two temp tables, #temp and #temp1 Replacing the tables in IN Clause returns different resutls. I was expecting the same. Can anyone explain? select * from #temp where name in (select comp_name from #temp1) Returns 473 records. select * from #temp1 where comp_name in (select name from #t...
stackexchange/codereview
function get_radio_value() { for (var i=0; i < document.fm1.gp1.length; i++) { if (document.fm1.gp1[i].checked) { var rad_val = document.fm1.gp1[i].value; if(rad_val == "Last Name"){ get_radio_value.url = "rpc.php"; } } } } then outside the scope y...
stackexchange/codereview
I want to convert a date string to a date object in jQuery, and the code below works fine for Chrome and Firefox, but not in Internet Explorer: <script type="text/javascript" charset="utf-8"> //Validate if the followup date is now or passed: jQuery.noConflict(); var now = new Date(); jQuery(".FollowUpDate")...
stackexchange/codereview
I want to track tweet button clicks via Google Analytics, but tweet button is an iframe with content from another domain. Is there some tricks to add callbacks for tweet button click?
stackexchange/codereview
I have a system which uses mod_rewrite, making these URLs /index.php?page=login into /login/. When I post the classic way action="/login/" and I'm done without any problems(the GET parameter tells index.php to let the login module to process the POST data). However when I use jQuery's post function $.post("/login/",......
stackexchange/codereview
I'm wondering if a new object is creating here: String obj; if(obj == "") { } and here: if(obj.equals("")){} I mean is the object like new String("") instantiating for those both cases?
stackexchange/codereview
I have such code in my app: var t = new Thread(new ThreadStart(new Action(SomeClass.SomeMethod))); t.Start(); ... t.Join(); but as I understand, compiler does some optimization and run SomeMethod in the same thread as main code. I check this by setting different Names of the thread in t and Thread.CurrentThread. How ...
stackexchange/codereview
I have a variable being passed to my JSP view from a spring controller that maps to an enum. It is being printed out at 'ENUM_VALUE', not very user friendly. What is the best way to convert this to a more readable form like 'Enum value'. I'd rather a pure EL solution so as to avoid writting more code in the controller ...
stackexchange/codereview
Facebook has a super cool service called "inventory estimator" that estimates the reach for an advertisement based on different filters (http://www.facebook.com/ads/create). Does some one know which technologies involved in this service ? Any details about the implementation would be great. Haggai
stackexchange/codereview
I do not manage to compile my project Windows phone 7 with a video of 80 Mb. When I start the build, a OutOfMermoryException is generated … Xap packaging failed. Exception of type 'System.OutOfMemoryException' was thrown. What is that somebody has already had this problem? I thought that the limit of size for the XAP w...
stackexchange/codereview
I have the following code: var paramTemp = ret.split('^'); $.each(paramTemp, function(key, elem) { var splitTemp = elem.split('*'); params = { splitTemp[0]: splitTemp[1] }; }); I get complaints when I try to set the key to splitTemp[0]. How do I set a key to a variables value? Thanks.
stackexchange/codereview
I'm working my way through the O'Reilly jQuery Cookbook. On p.65 there is an example that looks wrong to me, but I'm new to jQuery (less than a week) so I figure it is very likely that I am the one who is confused. The code intends to get the first three items from an ordered list & do something with them; for simplici...
stackexchange/codereview
I want' to parse dates in this format, but ignore parts of the string. 'Wed, 27 Oct 1770 22:17:00 GMT' From what I have gathered, datetime does not support time zones very well. Which is fine, I really just want to ignore the timezone part of the string, without having to do string manipulation on it. Is there somethin...
stackexchange/codereview
I use vim (primary so that I can work on plain ssh terminal - still uncomfortable with Emacs non-gui version) but most of my colleagues in the organization use emacs. So using CVS, we face indentation inconsistency issues (tabs becoming spaces, number of tabs/spaces, code layout etc). Is there a way I can make VIM inde...
stackexchange/codereview
Possible Duplicate: Why use getters and setters? Which method is better practice? $user = new User(); $user->username = "bob"; $user->password = "password"; $user->age = 42; echo $user->username; vs. $user = new User(); $user->setUsername("bob")->setPassword("password")->setAge(42); echo $user->getUsername(); Is...
stackexchange/codereview
This might seem a simple question, but I don't really get the idea of when should I use alloc, retain or copy.
stackexchange/codereview
In python I need a stack, and I'm using a list for it. In the documenation it says that you can use append() and pop() for stack operations but what about accessing the top of the stack without removing it? How to do that in the most readable way? Because all I came up with is stack[-1:][0] which looks a bit ugly for ...
stackexchange/codereview
I have the following log file: START:SOME_STRING BL:2 LK:3 LH:5 end START:SOME_STRING BL:5 LK:6 LH:6 end Which has multiple START: -> end structures inside. Is there a better 'non-sloppy' way of parsing this file rather than reading line by line and using SPLIT?
stackexchange/codereview
Our team is having a heated debate as to whether we allow failing unit tests to be checked-in to source control. On one side the argument is that yes you can as long as it is temporary - to be resolved within the current sprint. Some say even that in the case of bugs that may not be corrected within the current spri...
stackexchange/codereview
Possible Duplicate: How can I move a URL via 301 redirect and retain the page's Facebook likes and Open Graph information? For example suppose I had 1000 Likes on this URL: example.com/coolpage.php But I wanted to rename the URL to: example.com/domscoolpage.php Can I transfer the Likes from the 1st to the 2nd in the...
stackexchange/codereview
I have GridView on my asp.net page, one column in that grid is ImageButton (TemplateField with ID="imbReserve"). On click on that button I want to show PopUp, but when I put TargetControlId="imbReserve" I get error message " A control with ID 'imbReserve' could not be found". How to achieve this, on click on button ins...
stackexchange/codereview
My application using tapestry 4.1.6 jar files deploys correctly in weblogic 10.3.3.0. But at runtime, I am getting NoSuchMethodException from tapestry files.Same application works fine in weblogic 9. Any ideas? Error Log java.lang.NoSuchMethodError: org.apache.commons.pool.impl.TapestryKeyedObjectPool.assertOpen()V ...
stackexchange/codereview
How can i check/evaluate the exact type of T without an object for T. I know my question maybe confusing but consider this... public abstract class Business { public abstract string GetBusinessName(); } public class Casino : Business { public override string GetBusinessName() ...
stackexchange/codereview
I'm currently developing a web site using asp.net mvc 2 in c#. I have never used the caching feature in MVC and would like to apply it to the user profile page. The content on this page rarely changes and the only part that needs to be in realtime is the list of recent posts by the user. (I use linq-to-sql to load data...
stackexchange/codereview
I'm trying to install matplotlib for graphing applications in Python on Mac OS X. When I run "python setup.py install", it gives me this load of errors: http://pastebin.com/u7fL37ic. A quick snippet: src/ft2font.cpp:2170: error: ‘FT_LOAD_TARGET_MONO’ was not declared in this scope src/ft2font.cpp:2171: error: ‘FT_LOAD...
stackexchange/codereview
On Windows 7 I tried to register a new DataSnap server using tregsrvr (using run as administrator), which runs and confirms that the registration succeeded. However I can not find the server in DCOMCNFG to check its settings. There are quite many DCOM entries, which have a GUID as their ID. I know one of them should be...
stackexchange/codereview
I am experimenting with WPF and I came across a problem I can't seem to figure out although I have done some work with Silverlight previously and used DataContexts, Data Bindings and INPC successfully. This time I am stuck... I am using this code to create an instance of the application's main window: protected overrid...
stackexchange/codereview
I'm getting different errors each time I compile my C project. There are 3 sets of them that randomly appear during the building process, and all of them are syntax error before 'foo' or syntax error before 'foo' token. They happen in different files and there are no obvious syntax errors there. I'm using Windows 7,...
stackexchange/codereview
I have several numbers in an array var numArr = [1, 3, 5, 9]; I want to cycle through that array and multiply every unique 3 number combination as follows: 1 * 3 * 5 = 1 * 3 * 9 = 1 * 5 * 9 = 3 * 5 * 9 = Then return an array of all the calculations var ansArr = [15,27,45,135]; Anyone have an elegant solution? Tha...
stackexchange/codereview
Say I had the following strings: Dublin, Ireland. DublinIreland Ireland, Dublin What regular Expression could I use to find the word Dublin in the above strings, but, it cannot count DublinIreland. As in, DublinIreland doesn't say Dublin, it is a whole word that says DublinIreland.
stackexchange/codereview
I've a problem with this function. This function reallocs the size of the array 'music' when its needed. But a execution error occurred when i try call this function many times in a loop. its probably a memory allocation problem, but i cant figure this out. void adicionar( Musica** music , int* cont){//adiciona uma mú...
stackexchange/codereview
H! I have source in C, which is use the connect(peer->fd, (struct sockaddr *)dst->sockaddr, sizeof(struct sockaddr_in)); C method. I use the NDK and make the jni. My application is a msrp modul, which contain a server and a client. This method is part of the client. The source fragment: /* We're going to be the client...
stackexchange/codereview
I am about to build a web application and I want to allow other developers extend it with their own applications. Should I do this with iFrames like Facebook? Is this a good practice? Are there other alternatives that let other developers extend my application (that is for the user it looks like it's from my applicatio...
stackexchange/codereview
I have not been able to debug or step through unit test. Here is my sample test code... using System; using System.Text; using System.Collections.Generic; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using DomainModel.Entities; using DomainModel.Abstract; using WebUI.Controllers; namespace Te...
stackexchange/codereview
Here is a list of security issues that my authentication system has to address (I know there are already plugins for this, I want to create my own -- I'm just like that! ((especially since I want to learn how to do it)). using rails form forgery protection storing a guid as the auth_token in the cookie, not the user i...
stackexchange/codereview
How can I extract the decimal part of a string that has an equals sign as the delimiter? Example: 2 = No 10 = (6 - 8 hrs/day, Good & Restful) 1 = low in fat 1 = low in sugar 1 = high in fiber Someone please help. Thanks.
stackexchange/codereview
Possible Duplicate: SQL CASE statement Hi Frdz, i have created a stored proc and i put three queries in stored proc with inputvariable @EtlLoadId = 0 and i get three different windows for each query under result tab. is there any chance i can get results from the stored proc (results of three queries) as only one w...
stackexchange/codereview
Is it possible using VBA to close all open files in a given directory, with out knowing filename/extension etc... EDIT ..... I have directories linked to records, for example the record for Joe Bloggs has a directory created related to the name eg Bloggs, Joe If the user changes the records names, the folder name there...
stackexchange/codereview
I have a simple windows form app that I need to get the file path for. I am placing a config file in the same directory and I need to be able to get the path to that file. I have used Application.CommonAppDataPath but that returns the path with 1.0.0.0 at the end. and Applicaiton.StartupPath but that returns the path...
stackexchange/codereview
I have a comprehensive web application with the use of lots of nested tables. This app works fine for desktop version / view. I am in the process of getting it setup for mobile view. Which is nearly done, BUT: I am using JSP and java to, for example, retrieve search results. All of these are displayed in one row at a t...
stackexchange/codereview
is there something wrong with this syntax? SELECT * FROM tblcustomer WHERE uName LIKE '%%' AND tMonth = '3' ORDER BY uName ASC i got this error.. Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given.. EDIT include 'settings.php'; $con = connectDB(); $mo = array('Jan','Feb','Mar','Apr','May'...
stackexchange/codereview
Yesterday I ran into an ambiguity issue in SQL for the first time. I got used to SQL errors in case of table ambiguity and yesterday did not even try to think about the problem in that way. Here is a simplified query: SELECT val1, ( SELECT SUM(val2) as val2_sum FROM ( SELECT 1 as id, 10 as val2 ...
stackexchange/codereview
Is there a way to tell OpenGL not to write the depth of wholly transparent fragments into the depth buffer? Just be be sure, the texture I want to render is never semi-transparent; its alpha values are only ever 1.0 or 0.0, and I use the GL_NEAREST filter, so it never interpolates into any value in between. I would thi...
stackexchange/codereview
If someone has the answer could you help me, please? I have 2 images - background similar to arc and arrow. And i need to move arrow image over background image like this is a clock ticker arrow. So i need : Rotate arrow to make it parallel to current tick on the arc Move arrow to the next point For this i need to us...
stackexchange/codereview
tl;dr: It seems like params[:commit] does not contain the actual relevant information to create a new Commit, instead, it only contains the value of the submit button for the form whose name is also "commit". Any ideas as to why this is happening? I did not change anything. I am running rails 3 with the webrick server ...
stackexchange/codereview
in mat lab if i read a data set into a new structure with an x and y value and now from that list i need to choose two radom points from that data list of data there are like 400 points and i just need to choose two points so i can draw a line between the two points trying to do a least means of squares problem pleas...
stackexchange/codereview
Hi I am currently writing an application that allows users to upload images, which are stored on the filesystem with a reference in the database. However I have multiple application servers which these files need to be replicated to. What are common methods for doing something like this? Are there any particularly goo...
stackexchange/codereview
I'm fixing a customer site designed in ASP.NET, using Master pages. I need to put a jQuery adgallery inserted in a Content page which is linked to the master page. <asp:Content ContentPlaceHolderID="cphHeader" runat="server"> <div class="ad-gallery"> </div> </asp:Content> Since that Content renders in server-si...
stackexchange/codereview
I'm building a tab activity and but I don't want the tab text to appear below the icon. Is there any XML property to define this behavior? On the other hand, how can I place tabs in the bottom of the screen instead of the top?
stackexchange/codereview
In response to some asynchronous event on the server, I want to update the class of an HTML node in order to reflect its updated status. I know the id of the node, and the class I want to change it to. What JsCmd do I need to use to update the class? In general, where can I find a good reference on the JsCmd's and w...
stackexchange/codereview
i want to join two tables to get the Doctors name instead of the ID SELECT Doctors.doct_name, Shifts.shift_date, Shifts.shift_day, Shifts.shift_start, Shifts.shift_end FROM SHIFTS JOIN Doctors ON Doctors.doct_id = Shifts.doct_id the Column are shown but without any Results ,, no data ...
stackexchange/codereview
I need to connect my MySQL database from within Java program, for that I have to use JDBC. I need to supply it with the necessary connection parameters. And I have to store these parameters in a separate configuration file to be passed as an argument to your Java program during execution. A sample db.properties file ha...
stackexchange/codereview
My database stores three types of user: Agent, Programmer and Employee. All three types of user will have an address, a telephone number, a fax number, etc..., so to minimize table count, I want to create a table tbContactDetails, and use this to store the contacts details of these 3 types of user. My tbContactDetails...
stackexchange/codereview
I'm creating multiple fullcalendar's on a single page and i would like to write a single event render callback such that it can read the options from the fullcalendar instance that it is called from/in, things like minTime and maxTime, not sure how to do this.
stackexchange/codereview
In the following working example the list's selected index is supposed to reset to 0 whenever the text box changes. However, for some odd reason every other keystroke the selected item disappears and then reappears at the subsequent keystroke. <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.a...
stackexchange/codereview
Does JSON, JQuery & ASP.NET 2.0 webforms go together or is it only preferred in MVC with ASP.NET 3.5 & 4.0? While using JSON, would gridviews and repeaters controls be of any use (binding with JSON data) or do I format the results in custom tables myself ? Would my business object classes still be of any use while usi...
stackexchange/codereview
I'm working on an email validation program for my cmpsci class and am having trouble with this one part. What I'm doing is reading a list of valid top level domains from a text file into a vector class I wrote myself (I have to use a custom vector class unfortunately). The problem is that the program reads in and adds ...
stackexchange/codereview
Is it possible to add a block of css that I only want to be displayed in Safari and no other browsers?
stackexchange/codereview
here is my code snippet: @Stateless public class mySLSB { @PersistenceContext(unitName = "db") private EntityManager myEntityManager; public void crud(MyEntity myEntity) throws MyException { myEntityManager.merge(myEntity); } } However this merge can cause a ConstraintViolationException, which does not throw MyE...
stackexchange/codereview
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER Procedure [dbo].[spGetQualityReport] ( @providerKey INT ) AS -- declare @providerKey INT -- set @providerKey = 1; --Get Database providerId first DECLARE @realProvId INT; SET @realProvId = (SELECT TOP(1) providerId from providerKeyTran...
stackexchange/codereview
I'm trying to send a binary file to a server over HTTP. The beginning of the file contains headers already I'm trying to send a file using command line version of curl for windows like so: C:>curl -H "Content-Type:application/octet-stream" --data-binary @asdf.file http://server:1234/url Curl is adding headers which c...
stackexchange/codereview
I want to know how long a program running, so I tried "/usr/bin/time ./program > /dev/null". But soon I found it displays program's output to stderr. I tried "/usr/bin/time ./program > /dev/null 2>&1" then, but /usr/bin/time's output not appear. So my question is, how to ignore program's output, and keep time's output....
stackexchange/codereview
I have a class which inherits from two different interfaces. Both interfaces declare a method with the same name. How can I provide a different implementation for each interface ? In C#, the answer is there, but it does not work in java: Inheritance from multiple interfaces with the same method name I thought about pro...
stackexchange/codereview
In this question (link) it was said that the line below (in each unit) would remove as much RTTI as possible: {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])} The posting didn't mention what Delphi version it works with, but I assume D2010. However, when I include the line above, I get this error: DCC ...
stackexchange/codereview
Let arr be an array of dimension 16 x 20 Here is the valgrind output for the code snippet mentioned. The output is from cachegrind. for (i = 0; i < 20; i++) arr[0][i] = 0; Ir I1mr I2mr Dr D1mr D2mr Dw D1mw D2mw 64 0 0 41 0 0 1 0 0 60 0 ...
stackexchange/codereview
When I try to create a new OpportunityLineItemSchedule I'm running into following error.. Error code: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY Error message: insufficient access rights on cross-reference id Attached is the code snippet. Any help will be extremely useful. SObject[] rs = new SObject[1]; MessageEleme...
stackexchange/codereview
Is it possible to have a controller action do both the GET and POST? i.e. the GET shows a form, and the POST takes the forms values and saves to the db.
stackexchange/codereview
Looking for a starting point on importing and displaying a 3DXML model on the iPad. Pretty sure that OpenGL is the way to go, but not seeing any ports that are able to read 3DXML models. Does anyone have a starting point on this? (Have been looking at GLC_lib, but not seeing an objective C port) Thanks in advance!
stackexchange/codereview
So I am trying to write a script to download a picture file with python and I found this def using google but every picture I get it to download comes out "corrupt". Any ideas... def download(url): """Copy the contents of a file from a given URL to a local file. """ import urllib webFile = urllib.urlopen(url) loc...
stackexchange/codereview
First off, I came to Java as a website programmer. In JavaScript, all you have to do to add a mousemove, mouseover, or click event is call an addEventListener function. From my limited experience with Java, you can't just implement the MouseListener interface from any object. Basically, what I have so far is a JPanel, ...
stackexchange/codereview
I need to prevent tree node anchor from navigating current page, but the anchors have to keep showing its link (no hash). I tried to put return false when it sets up the listener: ... listeners : { click : function (node) { /* some processes */ return false; } } ... Seems it is useless, the an...
stackexchange/codereview