The Go language creators write:
Go doesn't provide assertions. (...) Programmers use them as a crutch to
avoid thinking about proper error
handling and reporting.
What is your opinion about this?
Could you tell me what .NET framework installed by default on Windows XP system?
Because I wanted to write a C# application that does not require anything else to be installed.
If none is there any way not to force users to download .net framework (for example 3.5) but install it?
Say I'm writing a Django app, and all the templates in the app require a certain variable.
The "classic" way to deal with this, afaik, is to write a context processor and add it to TEMPLATE_CONTEXT_PROCESSORS in the settings.py.
My question is, is this the right way to do it, considering that apps are supposed to be "independent" from the actual project using them?
In other words, when deploying that app to a new project, is there any way to avoid the project having to explicitly mess around with its settings?
Does anyone know a c++ library that uses advanced encryption standard encryption that can achieve encryption and decryption (using counter mode) in just two lines of codes. No need of padding or buffering the plaintexts the library will take care of all this. I have had a look at crypto++, openssl and libtomcrypt but in these it seems I need to write codes to buffer and pad the plaintexts which I don't want. In brief, I need something along these lines:
ciphertext = encrypt(ctr_mode(),plaintext,key)
plaintext = decrypt(ctr_mode(),ciphertext,key)
Thanks!
I'm trying to write parallel tests in soapui and need to transfer properties between the test steps
I currently have 3 tests steps:
Execute legacy request
Execute new request
XML diff the two responses in a groovy script
I've found a lot of blogs about picking values out with xpaths, but nothing about passing the full response through.
My questions is how do I fill out the source and target boxes in the property transfer editor?
Hi there
I've heard many times that Linus Torvalds is a genius when it comes to writing good code. I also wish to write good code and I'd like to see how the first version of Linux was written.
Does anyone know where I can find the first version of Linux? I'm looking for the first version (not 1.0) because I think it will be smaller and easier to understand.
Many thanks.
Hi,
i have this line below in frontend/config/view.yml:
stylesheets: [main.css]
The rules of that file are applied to the templates of the modules of frontend, but no to the templates of sfDoctrineGuardPlugin.
Even if i write at the beginning of the template it doesn't work..
What should i do?
Javi
I am trying to make a macro in Outlook that will scan the To: list for a certain text string, and spit out a message if all but one (or two, etc) addresses have it. Is there a simple way to do this?
Essentially, I am trying to write something that'll avoid being able to send a restricted message to a bunch of people with the string 'xyz' in the address, if one or more do not have it. AutoComplete makes this difficult, without checking through one-by-one.
Tornadoweb and Nginx are popular web servers for the moment and many benchmarkings show that they have a better performance than Apache under certain circumstances. So my question is:
Is 'epoll' the most essential reason that make them so fast? And what can I learn from that if I want to write a good socket server?
I'm trying to write a method that uses recursion to print the string formed by "interleaving" the strings str1 and str2. In other words, it should alternate characters from the two strings: the first character from str1, followed by the first character from str2, followed by the second character from str1, followed by the second character from str2, etc.
How would I go about this? Any ideas are greatly appreciated!! Thanks
I write a sokoban solver for fun and practice, it uses a simple algorithm (something like BFS).
now i want to estimate its running time ( O and omega). but i need to know how to calculate count of paths from a vertex to another in a network. each path from a to b is a sequence of edges with no circuit.
for example this is a correct path:
http://www.imgplace.com/viewimg143/4789/501k.png
but this is not:
http://www.imgplace.com/viewimg143/6140/202.png
In this JDO, why is .class needed here?
Query averageSalaryQuery = pm.newQuery(Employee.class);
I would prefer to write this more concise syntax if possible?
Query averageSalaryQuery = pm.newQuery(Employee);
hi i have many prebuild and postbuild events in different projects.
i want to write these events in a single batch file and then call this script in the main
project please tell me this is the correct way or any other best way of handlling these events while making a setup
thanks
Can I use NSTableView like I've used ListView in Windows? By that I mean JUST adding rows to the view.
I need to display a very simple two columned table and I don't want to write all this data related crap. Can I just 'add' stuff to a table view?
If not what is the simplest way to do what I'm trying to do (preferably without data sources)?
Why is this disallowed in C#?
Actually I'd like to be able to write
alias Y<A, B> : X<A, B>, X<B, A>
The unification is actually desired here; if the A = B then just one method should be defined.
I am new to learning prolog, and I want to know, if we have some procedure like
father("Nic","Adam").
and I want to write a function that it will add new value to this
father("Nic","Adam","something"..)
how can I do this? Using list? Or what?
I am attempting to manage my projects a little better so I am looking at attempting to apply some of (eventually all) the features of scrum.
Looking at user stories specifically the high level format seems to be:
As a User I can Feature Description
or
Artifact is Doing Something
How would I write "Upgrade the Database"?
Is it simply Upgrade the Database?
I think I am being thrown off as there is no specific actor/customer and that the customer is the IT department.
Can someone please write to me source code in Java? I have a task: create a program, that contains two dimensional array (with numbers) and the programm needs to sum zeros in each column and then get out the number of column in which the zeros are least.. thanks!
How does one convert an empty string to an int using Struts2. When the application encounters this parameter with no value, like from an empty text field, it throws the following exception.
java.lang.NoSuchMethodException:
com.XXXXXXXXXXXX.setID([Ljava.lang.String;)
Where ID is an integer, and the URL is:
Something.action?ID=&other=rawr
Is there a way to do this without using an Integer (class)? Do I have to write a type converter?
I have a function in powershell 2.0 named getip which gets the IP address(es) of a remote system.
function getip {
$strComputer = "computername"
$colItems = GWMI -cl "Win32_NetworkAdapterConfiguration" -name "root\CimV2" -comp $strComputer -filter "IpEnabled = TRUE"
ForEach ($objItem in $colItems)
{Write-Host $objItem.IpAddress}
}
The problem I'm having is with getting the output of this function to a variable. The folowing doesn't work...
$ipaddress = (getip)
$ipaddress = getip
set-variable -name ipaddress -value (getip)
any help with this problem would be greatly appreciated.
Anyone know how to write an m4 macro to accepts an arbitrary list of parameters?
Here is an example for what I want to implement:
ADD_OBJECTS_TO_LAYOUT(`LAYOUT_1', (`OBJ_ID_SQUARE', `COLOR_ID_RED'))
ADD_OBJECTS_TO_LAYOUT(`LAYOUT_2', (`OBJ_ID_SQUARE', `COLOR_ID_RED'), (`OBJ_ID_CIRCLE', `COLOR_ID_GREEN'))
ADD_OBJECTS_TO_LAYOUT(`LAYOUT_3', (`OBJ_ID_CIRCLE', `COLOR_ID_GREEN'), (`OBJ_ID_CIRCLE', `COLOR_ID_BLUE'), (`OBJ_ID_TIRANGLE', `COLOR_ID_RED'))
Hello,
I am running some unit tests on a WCF service. The service is configured to include exception details in the fault response (with the following in my service configuration file).
<serviceDebug includeExceptionDetailInFaults="true" />
If a test causes an unhandled exception on the server the fault is received by the client with a fully populated server stack trace. I can see this by calling the exception's ToString() method. The problem is that this doesn't seem to be output by any of the test runners that I have tried (xUnit, Gallio, MSTest). They appear to just output the Message and the StackTrace properties of the exception.
To illustrate what I mean, the following unit test run by MSTest would output three sections:
Error Message
Error Stack Trace
Standard Console Output (contains the information I would like, e.g. "Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: ..."
try
{
service.CallMethodWhichCausesException();
}
catch (Exception ex)
{
Console.WriteLine(ex); // this outputs the information I would like
throw;
}
Having this information will make the initial phase of testing and deployment a lot less painful. I know I can just wrap each unit test in a generic exception handler and write the exception to the console and rethrow (as above) within all my unit tests but that seems
a very long-winded way of achieving this (and would look pretty awful).
Does anyone know if there's any way to get this information included for free whenever an unhandled exception occurs? Is there a setting that I am missing? Is my service configuration lacking in proper fault handling? Perhaps I could write some kind of plug-in / adapter for some unit testing framework? Perhaps theres a different unit testing framework which I should be using instead!
My actual set-up is xUnit unit tests executed via Gallio for the development environment, but I do have a separate suite of "smoke tests" written which I would like to be able to have our engineers run via the xUnit GUI test runner (or Gallio or whatever) to simplify the final deployment.
Thanks.
Adam
in mako template, i use this
${request.environ['repoze.who.identity']['user']}
and the render in controller:
render('file.html')
can i write this better without passing in parameter everytime?
Hi,
I am using C# to write/read to an Access 2007 Database. The table is
ID - AutoNumber [pkey]
Fname - Text
Lname - Text
Address - Text
The query string I Use is
"Insert into TblMain (Fname,Lname,Address) Values ('"+fname+"','"+lname+"','"+adrs+"')"
No errors are returned, the query executes but data is not added to the db.
Inserting to table using which does not have an autonumber data column works perfectly.
What am I missing?