In Rails, is there a way to display different error messages on a production rails server (a nice graphic) vs a development server (detailed error information, stack trace, etc.)?
Hi, I'm learning simulink and I want to use the rician channle block from the communications blockset. I'm told I need to change the format format. Would anyone have some sample code where they used the rician channels in simulink to model a bit error rate process?
I am new to programming and only know html,css,PHP and would like to start learning another new language. I am focused on web development and would just like to get your opinion on ASP.net and python.
Which language would serve me best in making sites as to general programming? ASP.NET or django python?
I know Python is "easy to learn" and similar to PHP, but ASP.net is also a good language.
Hello,
I'd like to brush my brain to avoid confusions. In few words, what can be said about Mocking process in TDD
What's the GREAT idea behind MOCKING?
Mocking frameworks are meant to be used only to avoid accessing DB during tests or they can be used for something else?
For new comers (like me), are all the frameworks equal or I need to choose one for this or that reason?
Thanks for helping
I am new to C# world. I am attempting to calculate time taken by a algorithum for the purpose of comparison. Following code measures the elapsed time from when a subroutine is called until the subroutine returns to the main program.This example is taken from "Data structures through C#" by Michael McMillan.
After running this program the output is Time=0, which is incorrect. The program appears to be logically correct. Can anybody help me. Following is the code
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
namespace Chap1
{
class Program
{
static void Main(string[] args)
{
int num1 = 100;
int num2 = 200;
Console.WriteLine("num1: " + num1);
Console.WriteLine("num2: " + num2);
Swap<int>(ref num1, ref num2);
Console.WriteLine("num1: " + num1);
Console.WriteLine("num2: " + num2);
string str1 = "Sam";
string str2 = "Tom";
Console.WriteLine("String 1: " + str1);
Console.WriteLine("String 2: " + str2);
Swap<string>(ref str1, ref str2);
Console.WriteLine("String 1: " + str1);
Console.WriteLine("String 2: " + str2);
Console.ReadKey();
}
static void Swap<T>(ref T val1, ref T val2)
{
T temp;
temp = val1;
val1 = val2;
val2 = temp;
}
}
class Timing
{
TimeSpan StartTiming;
TimeSpan duration;
public Timing()
{
StartTiming = new TimeSpan(0);
duration = new TimeSpan(0);
}
public TimeSpan startTime()
{
GC.Collect();
GC.WaitForPendingFinalizers();
StartTiming = Process.GetCurrentProcess().Threads[0].UserProcessorTime;
return StartTiming;
}
public void stopTime()
{
duration = Process.GetCurrentProcess().Threads[0].UserProcessorTime.Subtract(StartTiming);
}
public TimeSpan result()
{
return duration;
}
}
}
Hi all,
I'd like to do some development of smart phone apps and my native programming language is java.
The first application I'd like to write will need to be able to (attempt to) connect to a network (LAN or WiFi) automatically in the background (on a schedule).
would an android phone be the best path or are there competitive purer java options?
Can anyone explain how to start with iPhone and iPad development?
Dont you have to pay? or is it just pay when you release?
I dont see where to get the iPad SDK or anything.
I already have XCode 3.2.1 on Snow Leopard.
Hello everyone,
I have got a new Mac book (MacBook Pro), and I am previously using Windows. I use this MacBook for personal (e.g. instant messaging, document, browsing the web) and development (writing C++ and Java code) purpose. Any recommended discussion group or forums (or I can directly ask here in StackOverflow)? I am a newbie.
thanks in advance,
George
I've noticed that the Rails log correctly displays the time taken to execute an action in the logs, and that the View: part of that is also rendered correctly. However, the DB: value is always zero:
Aug 11 13:00:22 [2326] INFO: Completed in 2072ms (View: 94, DB: 0) | 200 OK
In fact, all my DB timings are being logged as zero. I'm logging at DEBUG level, in development mode, running Rails 2.3.2.
Apologies in advance if the answer is blatantly obvious.
I've had a bunch of EAGAIN's from trying to fork() or spawning threads, which lead me to believe that I'm leaking resources somewhere.
Is it possible, in POSIX, to get the following from inside the process itself:
number of active pthreads
number of active child processes
number of active pipes
number of active sockets (or maybe this and pipes would be counted as file descriptors?)
Or do these have to be counted manually? There's already counters for them, but I think one of them are leaking.
I am looking for resources to develop HTML5 apps for iphone primarily. Are their frameworks and tools that I can use to get started? I am looking for:
Javascript frameworks that help with UI layout
Touch based controls for phones
Articles on iphone development, best practices, etc.
I searched stackoverflow and was not able to come up with a good list of resources. I am looking for examples like these http://jqtouch.com/
Hi ALl
Is there a way to find out which process is causing a particular event to occur?
In the inotify-tool version 3.13, in struct_kernel , pid,uid and gid are used but it is not handled in the source code.
Is there any latest patch available for the same.
Please let me know.
Hello,
I've lost my Reporting Services project file for Business Intelligence Development Studio. How can I open the existing reports in a new project? Can I "open" the whole project like in SSAS? I want to get the datasets and data sources into the project again as well.
Hi,
I am working on Enterprise Search and we are using Fast ESP and for now i have 4 projects but i have no information about stages and python. But i realize that i have learn custom stage development. Because we have a lot of difficulties about document processing. I want to know how can i develop custom stage and especially i wanna know about how i can find Attributefilter stage source code. I am waiting your answers
Can anyone share his experience on workflow for R peject development under ESS? I tried several times to learn emacs but I have not get it yet. I can understand ESS as an editor, but is there a project view in ESS? what's the efficient ways to set up/view R project directory, coding, and testing? Thanks for any advices.
Hi,
Are there any limitations based on Windows Server 2008 R2 versions for Windows Process Activation Service? (i.e. some features of WAS are unavailable, limitations on number of worker processes, etc.)
Thanks a lot!
I am working remotely on a Windows Server via Remote Desktop Connection and some process has hung the server. I looked up how to bring up the Task Manager remote (equivalent of locally doing CTRL+ALT+DEL) and I found CTRL+ALT+END and it doesn't seem to work.
I tried logging off and logging back on and the system is still up (tried earlier seeing the properties of My Comptuer, FYI).
Does anyone know how I can escape this 'hindrance' and star fresh?!?
How to get process Commandline Parameters at Windows 2000 using C#?
I'm use WMI query :select ExecutablePath,CommandLine from Win32_Process where Name='test'
but windows 2000 throw this exception:
system.management.managementexception : invalid query.
so I do not know how to do it work in windows 2000,please help me,
Thank you!
Hi I am using the Development Provisioning Assistant
At Step 3: Verify your private and public keys in Keychain Access, I have the "iPhone Developer: XXXXXXX" certificate in the Keychains-login, but I can't find any keys. If I click Category-Keys I see nothing.
What should I do to make it has the private key and public key there?
I'd like to load some test data into my development db but not put it into my production db.
In django you can create database-specific fixtures using this mechanism: http://docs.djangoproject.com/en/dev/ref/django-admin/#database-specific-fixtures
It is possible to do something similar with django-nonrel?
Im using Rails, Passenger (both are 3.0.5) and Nginx on my production server. As I heard, Rails should show public/404.html or public/500.html instead of development errors like ActiveRecord::RecordNotFound or Unknown action but that doesn't happen. I've tried to delete config.ru file and set rack_env or rails_env in nginx.conf but nothing helped.
Here is my nginx.conf:
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /home/makk/.rvm/gems/ruby-1.9.2-p0/gems/passenger-3.0.5;
passenger_ruby /home/makk/.rvm/bin/passenger_ruby;
#passenger_ruby /home/makk/.rvm/wrappers/ruby-1.9.2-p0/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root /home/makk/projects/1server/deploy/current/public;
index index.html index.htm;
passenger_enabled on;
rack_env production;
recursive_error_pages on;
if (-f /home/makk/projects/1server/maintenance.html) {
return 503;
}
error_page 404 /404.html;
error_page 500 502 504 /500.html;
error_page 503 @503;
}
location @503 {
error_page 405 = /maintenance.html;
# Serve static assets if found.
if (-f $request_filename) {
break;
}
rewrite ^(.*)$ /maintenance.html break;
}
location ~ ^(\/phpmyadmin\/)(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(\/phpmyadmin\/)(.*)$;
fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin/$fastcgi_path_info;
include fastcgi_params;
}
}
}
It seems that this question duplicates this one but there are no working suggestions.
UPD: I have both development and production apps on same PC. In production Rails ignores config.consider_all_requests_local = false (in /config/environments/production.rb) due to local_request? method. So one of possible solutions is listed below (taken from here):
# config/initializers/local_request_override.rb
module CustomRescue
def local_request?
return false if Rails.env.production? || Rails.env.staging?
super
end
end
ActionController::Base.class_eval do
include CustomRescue
end
Or for Rails 3:
class ActionDispatch::Request
def local?
false
end
end
Sometime back I used a windows tool to see what a process is doing. This tool allowed me to inspect functions exported from DLL. It also allowed me to change the values passed to a function on the fly.
I cannot recollect the name(not sure if that was free or commercial one). Could any one point to me solution that can do this?
(Tools like ProcessExplorer, ProcessMonitor helps a bit.. this was better)
Cheers,
Jayan
When dealing with websites with large amount of javascript, i see that these are still usually served to the client as one large javascript file.
In the development phase, are the javascript files usually split up (say there are 300 lines of js) to make things abit more manageable, and then merged when the website is 'put live'? Or do the developers just put up with working in one long large file?
How can you programmatically measure per-process (or better, per-thread) CPU usage under windows 95, windows 98 and windows ME?
If it requires the DDK, where can you obtain that?
Please note the Win9x requirement. It's easy on NT.
EDIT: I tried installing the Win95/98 version of WMI, but Win32_Process.KernelModeTime and Win32_Process.UserModeTime return Null (as do most Win32_Process properties under win9x).
Wordpress theme not displaying when activated on production server, but will display on development environment. I can view the theme in preview mode, but not when it's activated. Any idea on where to start would be great.