Daily Archives

Articles indexed Wednesday January 12 2011

Page 7/37 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • aio_read from file error on OS X

    - by Pyetras
    The following code: #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <aio.h> #include <errno.h> int main (int argc, char const *argv[]) { char name[] = "abc"; int fdes; if ((fdes = open(name, O_RDWR | O_CREAT, 0600 )) < 0) printf("%d, create file", errno); int buffer[] = {0, 1, 2, 3, 4, 5}; if (write(fdes, &buffer, sizeof(buffer)) == 0){ printf("writerr\n"); } struct aiocb aio; int n = 2; while (n--){ aio.aio_reqprio = 0; aio.aio_fildes = fdes; aio.aio_offset = sizeof(int); aio.aio_sigevent.sigev_notify = SIGEV_NONE; int buffer2; aio.aio_buf = &buffer2; aio.aio_nbytes = sizeof(buffer2); if (aio_read(&aio) != 0){ printf("%d, readerr\n", errno); }else{ const struct aiocb *aio_l[] = {&aio}; if (aio_suspend(aio_l, 1, 0) != 0){ printf("%d, suspenderr\n", errno); }else{ printf("%d\n", *(int *)aio.aio_buf); } } } return 0; } Works fine on Linux (Ubuntu 9.10, compiled with -lrt), printing 1 1 But fails on OS X (10.6.6 and 10.6.5, I've tested it on two machines): 1 35, readerr Is this possible that this is due to some library error on OS X, or am I doing something wrong?

    Read the article

  • How to call back (like onActivityResult) after launching activity from browser by clicking url?

    - by kimilhee
    I succeded to call activity from browser link with tag like this. <a href="myapp://launch.myapp.com/activity2?var1=linkClicked">my app</a> of cource I added actvity setting in AndroidManifest.xml like this. <activity android:name=".Activity2" > <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category> <data android:host="launch.myapp.com" android:scheme="myapp" android:pathPrefix="/activity2"></data> </intent-filter> </activity> I want to call back from the activity2 with a value. Is there any way to receive some value from the activity that was launched by the browser like above? In other words I want do something like onActivityResult in the browser and get a value from the activity and set the value on the web page which has launched the activity.

    Read the article

  • Safest way to change variable names in a project

    - by kamziro
    So I've been working on a relatively large project by myself, and I've come to realise that some of the variable names earlier on were.. less than ideal. But how does one change variable names in a project easily? Is there such a tool that can go through a project directory, parse all the files, and then replace the variable names to the desired one? It has to be smart enough to understand the language I imagine. I was thinking of using regexp (sed/awk on linux?) tools to just replace the variable name, but there were many times where my particular variable is also included as a part of strings. There's also the issue about changing stuff on a c++ namespace, because there is actually two classes in my project that share the same name, but are in different namespaces. I remember visual stuio being able to do this, but what's the safest and most elegant way to do this on linux?

    Read the article

  • Activity.findViewById returning null sporadically

    - by adstro
    From the crash logs that I am getting from the Android market, I can see that some of my users are getting Force Closes caused by NullPointerExceptions when my code tries to access views that are in my application. In one example, my activity makes a call to findViewById() in onCreate() after I call setContentView(). I get an NPE when I try to access the view after the call to findViewById() (still in onCreate). What has me really scratching my head is that this does not happen all of the time (in fact most of the time the code acts as I would expect), but enough to have me concerned. I could add code to always check for null and avoid the NPE, but I would like to understand what could be causing the sporadic behavior. Does anyone know what could be causing this?

    Read the article

  • no such file to load -- rails (MissingSourceFile)... say what?!!

    - by Julian
    Hello, I'm having an obnoxious and weird problem while trying to include the ThinkingTank gem into my rails project. When I include gem 'thinkingtank' in my project's Gemfile I get the following error: ~/.rvm/gems/ree-1.8.7-2010.01/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require': no such file to load -- rails (MissingSourceFile) from ~/.rvm/gems/ree-1.8.7-2010.01/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/thinkingtank-0.0.5/lib/thinkingtank.rb:1 from ~/.rvm/gems/ree-1.8.7-2010.01/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `require' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/bundler-1.0.7/lib/bundler.rb:112:in `require' from ~/git/myproject/config/boot.rb:121:in `load_environment' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/rails-2.3.5/lib/initializer.rb:137:in `process' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/rails-2.3.5/lib/initializer.rb:113:in `send' from ~/.rvm/gems/ree-1.8.7-2010.01/gems/rails-2.3.5/lib/initializer.rb:113:in `run' from ~/git/myproject/config/environment.rb:9 from ~/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/irb/init.rb:254:in `require' from ~/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/irb/init.rb:254:in `load_modules' from ~/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/irb/init.rb:252:in `each' from ~/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/irb/init.rb:252:in `load_modules' from ~/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/irb/init.rb:21:in `setup' from ~/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/irb.rb:54:in `start' from ~/.rvm/rubies/ree-1.8.7-2010.01/bin/irb:17 The output from ruby -v is: ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-darwin10.6.0], MBARI 0x6770, Ruby Enterprise Edition 2010.01 And the output from rails -v is: Rails 2.3.5 I've followed the basic guidelines from their documentation and from similar SA questions. But none of issues have the rails gem going missing.. And yes, we are including rails in our Gemfile =) Thank you in advance.

    Read the article

  • Using control from a separate class in C#

    - by DazSlayer
    I have a program that dynamically creates controls when it starts, it works just fine when the code to do this is in the class of the actual form. I tried moving the code to a separate class and found that I could not use Controls.Add(). How can I add controls to the Form from a separate class? This is what I have so far: TextBox txtbx = new TextBox(); txtbx.Text = "asd" + x.ToString(); txtbx.Name = "txtbx" + x.ToString(); txtbx.Location = new Point(10, (20 * x)); txtbx.Height = 20; txtbx.Width = 50; Controls.Add(txtbx); Error 1 The name 'Controls' does not exist in the current context

    Read the article

  • Locking down a server for shared internet hosting.

    - by Wil
    Basically I control several servers and I only host either static websites or scripts which I have designed, so I trust them up to a point. However, I have a few customers who want to start using scripts such as Wordpress or many others - and they want full control over their account. I have started to do the basics - like on php.ini, I have locked it down and restricted commands such as proc, however, there is obviously a lot more I can do. right now, using NTFS permissions, I am trying to lock down the server by running Application Pools and individual sites in their own user, however I feel like I am hitting brick walls... (My old question on Server Fault). At the moment, the only route I can think of is either to implement an off the shelf control panel - which will be expensive and quite frankly, over the top, or look at the Microsoft guide - which is really for an entire infrastructure, not for someone who just wants to lock down a few servers. Does anyone have any guides that can put me on the correct path?

    Read the article

  • Configuring an apache virtualhost to link to another's virtualhost's subdomain

    - by Laurent Van Winckel
    I have a domain on my server (on its own virtualhost), e.g. domain.com, which has a lot of subdomains with content on it. sub1.domain.com sub2.domain.com This virtualhost looks like this: ServerAdmin [email protected] ServerName domain.com ServerAlias *.domain.com DocumentRoot /var/www/domain.com/public_html/ I want to put other domains on the server and have each of them link to a specific subdomain on domain.com. I don't want it to redirect. I want a similar behavior as the [L,PT] flags on mod rewrite. I've tried this: ServerName otherdomain.com ReWriteEngine on RewriteCond %{HTTP_HOST} ^otherdomain.com$ [NC] RewriteRule ^(.*)$ http://sub1.domain.com/$1 [PT,L] But it is giving me a 400 Bad request error. How would I configure such a virtualhost?

    Read the article

  • How to safely send newsletters on VPS (SMTP) w/ non-hosted domain as "From" email?

    - by Andy M
    Greetings, I'm trying to understand the safest way to use SMTP. I'm considering purchasing a second virtual server mainly for email sending, on which I will set up PHPlist (a free open-source mailing program), so we have the freedom to send unlimited newsletters (...well, 10,000 per day at least, which requires a VPS rather than shared hosting). Here's my current setup with a paid mass-mailing software: I have a website - let's call it MyHostedDomain.org. I send newsletters with the From / Reply To address as [email protected], which isn't being hosting by me but I have access to the email account. Can I more or less safely set this up with an SMTP server on a VPS? i.e. send messages using [email protected] as the visible address, but having it all go through my VPS SMTP? I cannot authenticate it, right? Is this too risky a practice? Is my only hope to use an address with a domain on the VPS, i.e. [email protected]? I already have a Reverse DNS record for the domain hosted on my current VPS. I also see other suggestions, like SenderID and DKIM. But with all these things combined, will this still work? I don't want to get blacklisted, but the good thing is this is a somewhat private list, and users opt-in to subscribe. So it's a self-made audience. (If it makes you feel better, this is related to a non-profit activity, not some marketing scam...it's for a good cause, I assure you!)

    Read the article

  • Fatal Execution Engine Error on the Windows2008 r2, IIS7.5

    - by user66524
    Hi Guys We are running some asp.net(3.5) applications on the Windows2008 r2, IIS7.5. Recently we got some event logs so difficult, we have not idea hope some guys can help. 1.EventID: 1334 (9-1-2011 8:41:57) Error message An error occurred during a process host idle check. Exception: System.AccessViolationException Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. StackTrace: at System.Collections.Hashtable.GetEnumerator() at System.Web.Hosting.ApplicationManager.IsIdle() at System.Web.Hosting.ProcessHost.IsIdle() 2.EventID: 1023 (9-1-2011 19:44:02) Error message .NET Runtime version 2.0.50727.4952 - Fatal Execution Engine Error (742B851A) (80131506) 3.EventID: 1000 (9-1-2011 19:44:03) Error message Faulting application name: w3wp.exe, version: 7.5.7600.16385, time stamp: 0x4a5bcd2b Faulting module name: mscorwks.dll, version: 2.0.50727.4952, time stamp: 0x4bebd49a Exception code: 0xc0000005 Fault offset: 0x0000c262 Faulting process id: 0x%9 Faulting application start time: 0x%10 Faulting application path: %11 Faulting module path: %12 Report Id: %13 4.EventID: 5011 (9-1-2011 19:44:03) Error message A process serving application pool 'AppPoolName' suffered a fatal communication error with the Windows Process Activation Service. The process id was '2552'. The data field contains the error number. 5.some info: we got the memory.hdmp(234MB) and minidump.mdmp(19.2) from control panel action center but I donot know how to use that :(

    Read the article

  • Encrypted partitions with redundancy on ubuntu server

    - by Flamewires
    Hey I have to make a file system with an encrypted partition with on ubuntu server. something like Unencrypted: / - 10 GB /home - 10GB /var - 5GB -------------- Encrypted: /opt - 50GB This I can figure out in the setup, just partition as normal, setup /tmp as a encrypted volume with dm-crypt. However im not sure how to mirror this entire drive, so that if either failed i could still boot. and how will that affect the encrypted partition. Any help would be appreciated.

    Read the article

  • SQL 2008 publisher -> SQL 2000 subscriber: Is a pull subscription possible for merge replication?

    - by Brian Dunzweiler
    I am trying to synchronize a SQL 2000 SP4 subscriber to a SQL 2008 publisher via a merge pull subscription. When the subscriber tries to run the merge agent, it fails the following error: The process could not connect to Distributor 'OH05DBS002\SAM_SSG_2008'. SQL Server does not exist or access denied. Has anyone had success with this setup? I was able to create and synchronize a push subscription so I know that communication works between the two, at least from 2008-2000. The lack of communication from 2000-2008 also affects the ability to create a linked server on the SQL 2000 subscriber. One other tidbit - I did install the SQL 2008 native client on the the 2000 box but it didn't help either. Before anyone asks, I can't upgrade the subscriber as it still needs to support replication between MS Access 2003. Yeah, I know. :) TIA, Brian

    Read the article

  • Hardware Raid Card Reviews with SSDs

    - by Nalandial
    Yes I realize there are several questions about this but none of them seem to have the answer I'm looking for. I have two SSDs and am looking to buy a purely hardware raid card for them; however, I can't seem to find any reviews that have specifically tested hardware raid cards with SSDs rather than testing the SSDs themselves. I'm looking for a review because I'm assuming that for example: 100% gain with two 7200rpm drives doesn't necessarily mean 100% gain with a pair of SSDs, since there would be higher speeds, meaning more throughput, meaning more processor/memory usage for the card. If this assumption is wrong then that's fantastic; however if it's true, I am quite sad and would really appreciate any advice or reviews you can find. Thanks in advance!

    Read the article

  • Which iPhone ad API has produced the highest revenue for you?

    - by Kyle Humfeld
    This isn't a technical question, but more of a request for advice and empirical/anecdotal data. I'm nearly done writing a free app for iPhone, and I'm at the stage where I'm going to put ads into the app. I've had mixed success in the past with iAd (their fill rates have been atrocious recently, and their payouts have cut by about 75% over the past 4 months or so), and would like to know how much ad revenue you, the community, has seen from the various ad APIs you've used for your iPhone apps. This isn't a request for opinion, i.e. which is 'better', only what kinds of numbers you're seeing. I don't need absolute figures, but 'iAd pays x% higher than AdMob, and y% lower than AdSense' would be extremely helpful to me as I make my decision as to which ad API to integrate into my App. Also, have you had any experience or success with integrating multiple ad APIs into the same app? That's something I'm considering doing in my current iAd-filled apps (particularly my iPad app, which has yet to receive a single impression after nearly 60,000 requests)... something like: 1) Request-from-iAd 2) if that fails, request-from-adSense 3) if that fails, request-from-adMob 4) if that fails, ... etc.

    Read the article

  • ban an IP temporarily after x-many incorrect password attempts

    - by sova
    My new web server got hacked (sigh). I have physical access to my machine (in the near future). It seems like the only changes was a new user account and a borked sudoers file. It seems as though the password was discovered by dictionary searching (I didn't pick it). After I fix these problems (or do a full reinstall?) I want to add a mechanism to ban an IP (for maybe 24 hours or some time limit) after getting the password wrong x number of times, but I'm not a unix sysadmin or anything, so I'm not really sure where to get started. The machine is running Lucid Lynx, from an Ubuntu minimal installation. Thanks,I appreciate your help guys. Hopefully this is the right place for this question.

    Read the article

  • How to make xinit run at boot - pre login

    - by javanix
    I'm running a stripped down (minimal install version) of Lucid. For some reason, xinit seems to be failing on boot and I'm not sure what logs I should start checking - normally I would go with the Xorg ones in /var/logs, but running xinit manually after login works just fine, and as far as I can tell the usual Xorg.#.# files aren't created. Can anyone give me any suggestions as to where to start looking?

    Read the article

  • Ray Intersecting Plane Formula in C++/DirectX

    - by user4585
    I'm developing a picking system that will use rays that intersect volumes and I'm having trouble with ray intersection versus a plane. I was able to figure out spheres fairly easily, but planes are giving me trouble. I've tried to understand various sources and get hung up on some of the variables used within their explanations. Here is a snippet of my code: bool Picking() { D3DXVECTOR3 vec; D3DXVECTOR3 vRayDir; D3DXVECTOR3 vRayOrig; D3DXVECTOR3 vROO, vROD; // vect ray obj orig, vec ray obj dir D3DXMATRIX m; D3DXMATRIX mInverse; D3DXMATRIX worldMat; // Obtain project matrix D3DXMATRIX pMatProj = CDirectXRenderer::GetInstance()->Director()->Proj(); // Obtain mouse position D3DXVECTOR3 pos = CGUIManager::GetInstance()->GUIObjectList.front().pos; // Get window width & height float w = CDirectXRenderer::GetInstance()->GetWidth(); float h = CDirectXRenderer::GetInstance()->GetHeight(); // Transform vector from screen to 3D space vec.x = (((2.0f * pos.x) / w) - 1.0f) / pMatProj._11; vec.y = -(((2.0f * pos.y) / h) - 1.0f) / pMatProj._22; vec.z = 1.0f; // Create a view inverse matrix D3DXMatrixInverse(&m, NULL, &CDirectXRenderer::GetInstance()->Director()->View()); // Determine our ray's direction vRayDir.x = vec.x * m._11 + vec.y * m._21 + vec.z * m._31; vRayDir.y = vec.x * m._12 + vec.y * m._22 + vec.z * m._32; vRayDir.z = vec.x * m._13 + vec.y * m._23 + vec.z * m._33; // Determine our ray's origin vRayOrig.x = m._41; vRayOrig.y = m._42; vRayOrig.z = m._43; D3DXMatrixIdentity(&worldMat); //worldMat = aliveActors[0]->GetTrans(); D3DXMatrixInverse(&mInverse, NULL, &worldMat); D3DXVec3TransformCoord(&vROO, &vRayOrig, &mInverse); D3DXVec3TransformNormal(&vROD, &vRayDir, &mInverse); D3DXVec3Normalize(&vROD, &vROD); When using this code I'm able to detect a ray intersection via a sphere, but I have questions when determining an intersection via a plane. First off should I be using my vRayOrig & vRayDir variables for the plane intersection tests or should I be using the new vectors that are created for use in object space? When looking at a site like this for example: http://www.tar.hu/gamealgorithms/ch22lev1sec2.html I'm curious as to what D is in the equation AX + BY + CZ + D = 0 and how does it factor in to determining a plane intersection? Any help will be appreciated, thanks.

    Read the article

  • Code Golf: Finite-state machine!

    - by Adam Matan
    Finite state machine A deterministic finite state machine is a simple computation model, widely used as an introduction to automata theory in basic CS courses. It is a simple model, equivalent to regular expression, which determines of a certain input string is Accepted or Rejected. Leaving some formalities aside, A run of a finite state machine is composed of: alphabet, a set of characters. states, usually visualized as circles. One of the states must be the start state. Some of the states might be accepting, usually visualized as double circles. transitions, usually visualized as directed arches between states, are directed links between states associated with an alphabet letter. input string, a list of alphabet characters. A run on the machine begins at the starting state. Each letter of the input string is read; If there is a transition between the current state and another state which corresponds to the letter, the current state is changed to the new state. After the last letter was read, if the current state is an accepting state, the input string is accepted. If the last state was not an accepting state, or a letter had no corresponding arch from a state during the run, the input string is rejected. Note: This short descruption is far from being a full, formal definition of a FSM; Wikipedia's fine article is a great introduction to the subject. Example For example, the following machine tells if a binary number, read from left to right, has an even number of 0s: The alphabet is the set {0,1}. The states are S1 and S2. The transitions are (S1, 0) -> S2, (S1, 1) -> S1, (S2, 0) -> S1 and (S2, 1) -> S2. The input string is any binary number, including an empty string. The rules: Implement a FSM in a language of your choice. Input The FSM should accept the following input: <States> List of state, separated by space mark. The first state in the list is the start state. Accepting states begin with a capital letter. <transitions> One or more lines. Each line is a three-tuple: origin state, letter, destination state) <input word> Zero or more characters, followed by a newline. For example, the aforementioned machine with 1001010 as an input string, would be written as: S1 s2 S1 0 s2 S1 1 S1 s2 0 S1 s2 1 s2 1001010 Output The FSM's run, written as <State> <letter> -> <state>, followed by the final state. The output for the example input would be: S1 1 -> S1 S1 0 -> s2 s2 0 -> S1 S1 1 -> S1 S1 0 -> s2 s2 1 -> s2 s2 0 -> S1 ACCEPT For the empty input '': S1 ACCEPT For 101: S1 1 -> S1 S1 0 -> s2 s2 1 -> s2 REJECT For '10X': S1 1 -> S1 S1 0 -> s2 s2 X REJECT Prize A nice bounty will be given to the most elegant and short solution. Reference implementation A reference Python implementation will be published soon.

    Read the article

  • Android :WindowManager$BadTockenException on Spinner Click

    - by Miya
    Hi, I have a spinner in my home.class. When I click on the spinner, the process is stopped showing exception that WindowManager$BadTockenException is caught. I am calling this home.class from main.class which extends ActivityGroup. If I am simply run only the home.class, the spinner is showing all items. But the problem is only with calling home.class from main.class. The following are my code. Please tell me why this is happened. main.class public class main extends ActivityGroup { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent=new Intent(this,home.class); View view=getLocalActivityManager().startActivity("1", intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView(); setContentView(view); } } home.class String[] country={"Please selects","US","INDIA","UK"}; Spinner s2 = (Spinner) findViewById(R.id.spinnerCountry); ArrayAdapter<CharSequence> adapterCountry=new ArrayAdapter(this,android.R.layout.simple_spinner_item,country); adapterCountry.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); s2.setAdapter(adapterCountry); s2.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected( AdapterView<?> parent, View view, int position, long id) { countryName=country[position]; } public void onNothingSelected(AdapterView<?> parent) { countryName=country[0]; } }); Stack Thread [<1 main] (Suspended (exception WindowManager$BadTokenException)) AlertDialog(Dialog).show() line: 245 AlertDialog$Builder.show() line: 802 Spinner.performClick() line: 260 View$PerformClick.run() line: 9080 ViewRoot(Handler).handleCallback(Message) line: 587 ViewRoot(Handler).dispatchMessage(Message) line: 92 Looper.loop() line: 123 ActivityThread.main(String[]) line: 3647 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 507 ZygoteInit$MethodAndArgsCaller.run() line: 839 ZygoteInit.main(String[]) line: 597 NativeStart.main(String[]) line: not available [native method] Thank You....

    Read the article

  • .NET unit test runner outputting FaultException.Detail

    - by Adam
    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

    Read the article

  • Sql Query to get total rows and total rows matching specific condition

    - by mrNepal
    OK, Here is what my table looks like ------------------------------------------------ id type ----------------------------------------------- 1 a 2 b 3 a 4 c 5 c 7 a 8 a ------------------------------------------------ Now, I need a query that can give me this output... ----------------------------------------------------------------- count(*) | count(type=a) | count(type=b) | count(type=c) ----------------------------------------------------------------- 8 4 1 3 ------------------------------------------------------------------ I only know to get the total set using count(*), but how to do the remaining

    Read the article

  • how to do display text message from cellphone to textbox

    - by Jiggy Degamo
    I am just making a project automated polling system using sms but i just a beginner of serial communication i have seen a code on the net so i apply it as my guide just a simple text message and display it on the textbox it connects but the provlem is its didn't display on the textbox. here is the code below please help me why it didn't display and please give me a cite that have a tutorial of serial communication using vb.net Imports System.IO.Ports Public Class Form1 Dim inputData As String = "" Private WithEvents serialPort1 As New IO.Ports.SerialPort Public Event DataReceived As IO.Ports.SerialDataReceivedEventHandler Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed ' Close the Serial Port serialPort1.Close() End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Set values for some properties serialPort1.PortName = "COM10" serialPort1.BaudRate = 2400 SerialPort1.Parity = IO.Ports.Parity.None SerialPort1.DataBits = 8 SerialPort1.StopBits = IO.Ports.StopBits.One SerialPort1.Handshake = IO.Ports.Handshake.None SerialPort1.RtsEnable = True ' Open the Serial Port SerialPort1.Open() 'Writes data to the Serial Port output buffer If SerialPort1.IsOpen = True Then SerialPort1.Write("MicroCommand") End If End Sub ' Receive data from the Serial Port 'Show received data on UI controls and do something Public Sub DoUpdate() TextBox1.Text = TextBox1.Text & inputData End Sub Private Sub serialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles serialPort1.DataReceived inputData = serialPort1.ReadExisting 'or serialPort1.ReadLine Me.Invoke(New EventHandler(AddressOf DoUpdate)) End Sub End Class

    Read the article

  • how to check some assembly is present in client and register that if not.

    - by Jimmy
    hi there, what i wana know is that how can i use assembly that is register in GAC in my C# application. Detail: What i wana achieved is that 1) Check ABC assembly that is register in my client machine or not from my windows application 2) If not then register that assemble in GAC of client from my windows application 3) And use this assembly and perform some functions Remember that that ABC assemble is my assembly having some of my function.

    Read the article

  • Wordpress include custom page

    - by Josef
    Hi, I'm sure this is a simple question. But how do I get Wordpress at startup to ignore trying to load a Page or Post and instead load my custom page? When in the Wordpress bootstrap process is it decided which php-page is going to load? I will have the following url: bt.local/wp/ads/1 And would like a php-page called ads.php to be loaded and load the ad with adid = 1. What's the best way to solve this? (there's no Post called ads and there's no Page called Ads). Thank you! KR Josef

    Read the article

  • Textarea into an array or implode?

    - by Kyle R
    Say I have a text area, user enters information exactly like styled below: Ice cream Chocolate then submits this information, I want to retrieve the information EXACTLY like so: Ice cream, Chocolate Is this the best way to do it: $arr = explode("\n", $var); $arr = implode(",", $arr); When doing it like this, it puts the information out like so: Ice cream , Chocolate Note the space after cream, will a simple trim() fix this?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >