Search Results

Search found 2978 results on 120 pages for 'ex parrot'.

Page 16/120 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • How to use ULS in SharePoint 2010 for Custom Code Exception Logging?

    - by venkatx5
    What is ULS in SharePoint 2010? ULS stands for Unified Logging Service which captures and writes Exceptions/Logs in Log File(A Plain Text File with .log extension). SharePoint logs Each and every exceptions with ULS. SharePoint Administrators should know ULS and it's very useful when anything goes wrong. but when you ask any SharePoint 2007 Administrator to check log file then most of them will Kill you. Because read and understand the log file is not so easy. Imagine open a plain text file of 20 MB in NotePad and go thru line by line. Now Microsoft developed a tool "ULS Viewer" to view those Log files in easily readable format. This tools also helps to filter events based on exception priority. You can read on this blog to know in details about ULS Viewer . Where to get ULS Viewer? ULS Viewer is developed by Microsoft and available to download for free. URL : http://code.msdn.microsoft.com/ULSViewer/Release/ProjectReleases.aspx?ReleaseId=3308 Note: Eventhought this tool developed by Microsoft, it's not supported by Microsoft. Means you can't support for this tool from Microsoft and use it on your own Risk. By the way what's the risk in viewing Log Files?! How to use ULS in SharePoint 2010 Custom Code? ULS can be extended to use in user solutions to log exceptions. In Detail, Developer can use ULS to log his own application errors and exceptions on SharePoint Log files. So now all in Single Place (That's why it's called "Unified Logging"). Well in this article I am going to use Waldek's Code (Reference Link). However the article is core and am writing container for that (Basically how to implement the code in Detail). Let's see the steps. Open Visual Studio 2010 -> File -> New Project -> Visual C# -> Windows -> Class Library -> Name : ULSLogger (Make sure you've selected .net Framework 3.5)   In Solution Explorer Panel, Rename the Class1.cs to LoggingService.cs   Right Click on References -> Add Reference -> Under .Net tab select "Microsoft.SharePoint"   Right Click on the Project -> Properties. Select "Signing" Tab -> Check "Sign the Assembly".   In the below drop down select <New> and enter "ULSLogger", uncheck the "Protect my key with a Password" option.   Now copy the below code and paste. (Or Just refer.. :-) ) using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; using System.Runtime.InteropServices; namespace ULSLogger { public class LoggingService : SPDiagnosticsServiceBase { public static string vsDiagnosticAreaName = "Venkats SharePoint Logging Service"; public static string CategoryName = "vsProject"; public static uint uintEventID = 700; // Event ID private static LoggingService _Current; public static LoggingService Current {  get   {    if (_Current == null)     {       _Current = new LoggingService();     }    return _Current;   } }private LoggingService() : base("Venkats SharePoint Logging Service", SPFarm.Local) {}protected override IEnumerable<SPDiagnosticsArea> ProvideAreas() { List<SPDiagnosticsArea> areas = new List<SPDiagnosticsArea>  {   new SPDiagnosticsArea(vsDiagnosticAreaName, new List<SPDiagnosticsCategory>    {     new SPDiagnosticsCategory(CategoryName, TraceSeverity.Medium, EventSeverity.Error)    })   }; return areas; }public static string LogErrorInULS(string errorMessage) { string strExecutionResult = "Message Not Logged in ULS. "; try  {   SPDiagnosticsCategory category = LoggingService.Current.Areas[vsDiagnosticAreaName].Categories[CategoryName];   LoggingService.Current.WriteTrace(uintEventID, category, TraceSeverity.Unexpected, errorMessage);   strExecutionResult = "Message Logged"; } catch (Exception ex) {  strExecutionResult += ex.Message; } return strExecutionResult; }public static string LogErrorInULS(string errorMessage, TraceSeverity tsSeverity) { string strExecutionResult = "Message Not Logged in ULS. "; try  {  SPDiagnosticsCategory category = LoggingService.Current.Areas[vsDiagnosticAreaName].Categories[CategoryName];  LoggingService.Current.WriteTrace(uintEventID, category, tsSeverity, errorMessage);  strExecutionResult = "Message Logged";  } catch (Exception ex)  {   strExecutionResult += ex.Message;   } return strExecutionResult;  } } }   Just build the solution and it's ready to use now. This ULS solution can be used in SharePoint Webparts or Console Application. Lets see how to use it in a Console Application. SharePoint Server 2010 must be installed in the same Server or the application must be hosted in SharPoint Server 2010 environment. The console application must be set to "x64" Platform target.   Create a New Console Application. (Visual Studio -> File -> New Project -> C# -> Windows -> Console Application) Right Click on References -> Add Reference -> Under .Net tab select "Microsoft.SharePoint" Open Program.cs add "using Microsoft.SharePoint.Administration;" Right Click on References -> Add Reference -> Under "Browse" tab select the "ULSLogger.dll" which we created first. (Path : ULSLogger\ULSLogger\bin\Debug\) Right Click on Project -> Properties -> Select "Build" Tab -> Under "Platform Target" option select "x64". Open the Program.cs and paste the below code. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint.Administration; using ULSLogger; namespace ULSLoggerClient {  class Program   {   static void Main(string[] args)     {     Console.WriteLine("ULS Logging Started.");     string strResult = LoggingService.LogErrorInULS("My Application is Working Fine.");      Console.WriteLine("ULS Logging Info. Result : " + strResult);     string strResult = LoggingService.LogErrorInULS("My Application got an Exception.", TraceSeverity.High);     Console.WriteLine("ULS Logging Waring Result : " + strResult);      Console.WriteLine("ULS Logging Completed.");      Console.ReadLine();     }   } } Just build the solution and execute. It'll log the message on the log file. Make sure you are using Farm Administrator User ID. You can play with Message and TraceSeverity as required. Now Open ULS Viewer -> File -> Open From -> ULS -> Select First Option to open the default ULS Log. It's Uls RealTime and will show all log entries in readable table format. Right Click on a row and select "Filter By This Item". Select "Event ID" and enter value "700" that we used in the application. Click Ok and now you'll see the Exceptions/Logs which logged by our application.   If you want to see High Priority Messages only then Click Icons except Red Cross Icon on the Toolbar. The tooltip will tell what's the icons used for.

    Read the article

  • Finding the groups of a user in WLS with OPSS

    - by user12587121
    How to find the group memberships for a user from a web application running in Weblogic server ?  This is useful for building up the profile of the user for security purposes for example. WLS as a container offers an identity store service which applications can access to query and manage identities known to the container.  This article for example shows how to recover the groups of the current user, but how can we find the same information for an arbitrary user ? It is the Oracle Platform for Securtiy Services (OPSS) that looks after the identity store in WLS and so it is in the OPSS APIs that we can find the way to recover this information. This is explained in the following documents.  Starting from the FMW 11.1.1.5 book list, with the Security Overview document we can see how WLS uses OPSS: Proceeding to the more detailed Application Security document, we find this list of useful references for security in FMW. We can follow on into the User/Role API javadoc. The Application Security document explains how to ensure that the identity store is configured appropriately to allow the OPSS APIs to work.  We must verify that the jps-config.xml file where the application  is deployed has it's identity store configured--look for the following elements in that file: <serviceProvider type="IDENTITY_STORE" name="idstore.ldap.provider" class="oracle.security.jps.internal.idstore.ldap.LdapIdentityStoreProvider">             <description>LDAP-based IdentityStore Provider</description>  </serviceProvider> <serviceInstance name="idstore.ldap" provider="idstore.ldap.provider">             <property name="idstore.config.provider" value="oracle.security.jps.wls.internal.idstore.WlsLdapIdStoreConfigProvider"/>             <property name="CONNECTION_POOL_CLASS" value="oracle.security.idm.providers.stdldap.JNDIPool"/></serviceInstance> <serviceInstanceRef ref="idstore.ldap"/> The document contains a code sample for using the identity store here. Once we have the identity store reference we can recover the user's group memberships using the RoleManager interface:             RoleManager roleManager = idStore.getRoleManager();            SearchResponse grantedRoles = null;            try{                System.out.println("Retrieving granted WLS roles for user " + userPrincipal.getName());                grantedRoles = roleManager.getGrantedRoles(userPrincipal, false);                while( grantedRoles.hasNext()){                      Identity id = grantedRoles.next();                      System.out.println("  disp name=" + id.getDisplayName() +                                  " Name=" + id.getName() +                                  " Principal=" + id.getPrincipal() +                                  "Unique Name=" + id.getUniqueName());                     // Here, we must use WLSGroupImpl() to build the Principal otherwise                     // OES does not recognize it.                      retSubject.getPrincipals().add(new WLSGroupImpl(id.getPrincipal().getName()));                 }            }catch(Exception ex) {                System.out.println("Error getting roles for user " + ex.getMessage());                ex.printStackTrace();            }        }catch(Exception ex) {            System.out.println("OESGateway: Got exception instantiating idstore reference");        } This small JDeveloper project has a simple servlet that executes a request for the user weblogic's roles on executing a get on the default URL.  The full code to recover a user's goups is in the getSubjectWithRoles() method in the project.

    Read the article

  • Salon LesJeudis.com Paris : plus de 2.000 postes IT à pourvoir ce jeudi 27 septembre, Rennes et Lyon suivront

    Salon LesJeudis.com Paris : plus de 2.000 postes IT à pourvoir cette semaine Le jeudi 27 septembre, Rennes et Lyon suivront LesJeudis.com organise un nouveau salon de recrutement ce jeudi 27 septembre au CNIT de la Défense de 11h à 21h. Pour les développeurs qui recherchent un emploi ou un nouveau poste, plus de 2.000 postes seront à pourvoir. Parmi les nombreuses entreprises qui seront à la recherche de candidats, citons les habituels Sogeti, ou Steria mais aussi dans un éventail assez large des entreprises comme Parrot, Michelin, OVH ou le PMU. Chaque candidat aura également la possibilité de soumettre son profil à un consultant en ressources humain...

    Read the article

  • Salon LesJeudis.com : plus de 1.500 postes IT à pourvoir le jeudi 12 avril à Paris, les codes QR remplacent les CV

    Salon LesJeudis.com : plus de 1.500 postes IT à pourvoir Le jeudi 12 avril à Paris, les codes QR remplacent les CV LesJeudis.com organise un nouveau salon de recrutement ce jeudi 12 avril au CNIT de la Défense de 11h à 21h. Une initiative bienvenue pour tous les développeurs qui recherchent un emploi ou un nouveau poste. Plus de 1.500 postes seront à pourvoir. Parmi les nombreuses entreprises qui seront à la recherche de candidats citons les habituels Sogeti, Accenture ou Steria mais aussi des entreprises comme Parrot, la RATP, Ericsson, GDF-Suez ou AXA. Chaque candidat aura la possibilité de soumettre son profil à un consultant en ressources humaine...

    Read the article

  • Sharing ideas without risk of leaking

    - by eversor
    As freelancers, we meet somewhere and chat about a new idea for a project, brainstorm etc. Up to this point, we have taken notes of the ideas, but we would like to be able to share more efficiently the ideas with each other. However, I fear that if I use some online product (such as Google Docs) these ideas could be seen by people outside the team (employees of the company of the online product, other users...). I am not sure if I am being a little Paranoid parrot... One solution that we have considered is to install a Subversion with just one ideas.txt. But that would require a server in one of our houses, which is a little unconfortable. So how do you share your ideas for a new project with your team without risking the ideas to be stolen?

    Read the article

  • My book is released – Async in C# 5

    - by Alex Davies
    I’m pleased to announce that my book “Async in C# 5″ has been published by O’Reilly! http://oreil.ly/QQBjO3 If you want to know about how to use async, and whether it’s important for your code, I thoroughly recommend reading it. It’s the best book about the subject I’ve ever written. In fact it’s probably the best book I’ve written full stop. I may have only written one book. It also has a very fetching parrot on the cover, which would make a very good addition to your bookshelf.

    Read the article

  • JDK7?????

    - by Todd Bao
    ??JSR 334,JDK 7?????????????,???:1. switch????String????:    public static void switchString(String s){        switch (s){        case "db": ...        case "wls": ...        case "idm": ...        case "soa": ...        case "fa": ...        default: ...        }    }2. ?????????? - "0b"???"_"???,?????????? a. ???????????, 0b: ????????????:        byte b1 = 0b00100001;     // New        byte b2 = 0x21;        // Old        byte b3 = 33;        // Old b. ??????????????,?????,????????????:    long phone_nbr = 021_1111_2222;3. ???????????? - "?? new",????????:        ArrayList<String> al1 = new ArrayList<String>();    // Old        ArrayList<String> al2 = new ArrayList<>();        // New4. ????reflect?????????? - ReflectOperationException,????:    ClassNotFoundException,     IllegalAccessException,     InstantiationException,     InvocationTargetException,     NoSuchFieldException,     NoSuchMethodException5. catch????????,?????????,????????:    try{        // code    }    catch (SQLException | IOException ex) {        // ...    }6. ?????? - ??????????,??????????style:    public void test() throws NoSuchMethodException, NoSuchFieldException{    // ??        try{            // code        }        catch (RelectiveOperationException ex){    // ??            throws ex;        }    }7. ???try()?? - Try with Resources,?????????????(???????????java.lang.AutoCloseable??),???????try?????"("??"{":    try(BufferedReader br = new BufferedReader(new FileReader("/home/oracle/temp.txt"))){        ... br.readLine() ...    }try-with-resources?????catch,??????????catch???????Todd

    Read the article

  • Exception converting Office files to PDF using ABCpdf.NET onWindows Server 2008

    - by drivendevelopment
    Has anyone delt with this exception from ABCpdf? We're running on Server 2008 and only have issues converting Office files (Word and Excel). This all worked well on Server 2003. Because we're only having issues with Office files I wonder if it's related to the XPS support on Server 2008? The code that calls into this function is running as a Windows Service. Private Overloads Function ConvertMicrosoftOfficeDocToPdf(ByVal inputFile As Byte(), ByVal fileExt As String) As Byte() Dim abcDoc As WebSupergoo.ABCpdf7.Doc = Nothing Try abcDoc = New WebSupergoo.ABCpdf7.Doc() Dim xro As New WebSupergoo.ABCpdf7.XReadOptions() xro.FileExtension = fileExt Try abcDoc.Read(inputFile, xro) Catch ex As Exception System.Diagnostics.Trace.Write(ex.ToString()) Throw ex End Try Dim fileBytes As Byte() = abcDoc.GetData() Return fileBytes Finally If Not abcDoc Is Nothing Then abcDoc.Clear() abcDoc.Dispose() End If End Try End Function WebSupergoo.ABCpdf7.Internal.PDFException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. --- System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at WebSupergoo.ABCpdf7.Internal.NDoc._InvokeMethod(IntPtr inDoc, Int32 inMethod, Int32 inIndex, Int32 inFlags, String inParams, String& outErr) at WebSupergoo.ABCpdf7.Internal.NDoc.InvokeMethod(IntPtr inDoc, Int32 inMethod, Int32 inIndex, Int32 inFlags, String inParams, String& outErr) at WebSupergoo.ABCpdf7.Doc.PrintToXps(String inputFile, String outputFile, Int32 timeout, String printerName) at WebSupergoo.ABCpdf7.Operations.XpsImportOperation.ImportAny(Doc doc, String path, Int32 timeout) at WebSupergoo.ABCpdf7.XReadOptions.ImportXpsAny(Doc doc, String path, Boolean clear) at WebSupergoo.ABCpdf7.XReadOptions.Read(Doc doc, Byte[] data, ReadModuleType module) at WebSupergoo.ABCpdf7.XReadOptions.Read(Doc doc, Byte[] data)

    Read the article

  • OutofMemoryError: bitmap size exceeds VM budget (Android)

    - by Chrispix
    Getting an Exception in the BitmapFactory. Not sure what is the issue. (Well I can guess the issue, but not sure why its happening) ERROR/AndroidRuntime(7906): java.lang.OutOfMemoryError: bitmap size exceeds VM budget ERROR/AndroidRuntime(7906): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:295) My code is pretty straight forward. I defined an XML layout w/ a default image. I try to load a bm on the SDCard (if present - it is). If not it shows the default image. Anyway.. Here is code : public class showpicture extends Activity { public void onCreate(Bundle savedInstanceState) { /** Remove menu/status bar **/ requestWindowFeature(Window.FEATURE_NO_TITLE); final Window win = getWindow(); win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); Bitmap bm; super.onCreate(savedInstanceState); setContentView(R.layout.showpicture); try { ImageView mImageButton = (ImageView)findViewById(R.id.displayPicture); bm = Bitmap.createScaledBitmap(BitmapFactory.decodeFile("/sdcard/dcim/Camera/20091018203339743.jpg"),100, 100, true); parkImageButton.setImageBitmap(bm); } catch (IllegalArgumentException ex) { Log.d("MYAPP",ex.getMessage()); } catch (IllegalStateException ex) { It fails on the bm=Bitmap.createScaledBitmap any thoughts? I did some research on the forums, and it pointed to this post I just don't know why it is not working. Any help would be great! Thanks, Chris.

    Read the article

  • Web Service Exception Handling

    - by SchlaWiener
    I have a Winforms app that consumes a C# Webservice. If the WebService throws an Exception my Client app always get's a SoapException instead of the "real" Exception. Here's a demo: [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { throw new IndexOutOfRangeException("just a demo exception"); } } Now, on the client side, I want to be able to handle different exceptions in a different way. try { ServiceReference1.Service1SoapClient client = new ServiceReference1.Service1SoapClient(); Button1.Text = client.HelloWorld(); } catch (IndexOutOfRangeException ex) { // I know how to handle IndexOutOfRangeException // but this block is never reached } catch (MyOwnException ex) { // I know how to handle MyOwnException // but this block is never reached } catch (System.ServiceModel.FaultException ex) { // I always end in this block } But that does not work because I always get a "System.ServiceModel.FaultException" and I can only figure out the "real" exception by parsing the Exception's message property: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IndexOutOfRangeException: just a demo\n at SoapExceptionTest.Service1.Service1.HelloWorld() in ... --- End of inner exception stack trace --- Is there a way to make this work somehow?

    Read the article

  • C# Sockets Buffer Overflow No Error

    - by Michael Covelli
    I have one thread that is receiving data over a socket like this: while (sock.Connected) { // Receive Data (Block if no data) recvn = sock.Receive(recvb, 0, rlen, SocketFlags.None, out serr); if (recvn <= 0 || sock == null || !sock.Connected) { OnError("Error In Receive, recvn <= 0 || sock == null || !sock.Connected"); return; } else if (serr != SocketError.Success) { OnError("Error In Receive, serr = " + serr); return; } // Copy Data Into Tokenizer tknz.Read(recvb, recvn); // Parse Data while (tknz.MoveToNext()) { try { ParseMessageAndRaiseEvents(tknz.Buffer(), tknz.Length); } catch (System.Exception ex) { string BadMessage = ByteArrayToStringClean(tknz.Buffer(), tknz.Length); string msg = string.Format("Exception in MDWrapper Parsing Message, Ex = {0}, Msg = {1}", ex.Message, BadMessage); OnError(msg); } } } And I kept seeing occasional errors in my parsing function indicating that the message wasn't valid. At first, I thought that my tokenizer class was broken. But after logging all the incoming bytes to the tokenizer, it turns out that the raw bytes in recvb weren't a valid message. I didn't think that corrupted data like this was possible with a tcp data stream. I figured it had to be some type of buffer overflow so I set sock.ReceiveBufferSize = 1024 * 1024 * 8; and the parsing error never, ever occurs in testing (it happens often enough to replicate if I don't change the ReceiveBufferSize). But my question is: why wasn't I seeing an exception or an error state or something if the socket's internal buffer was overflowing before I changed this buffer size?

    Read the article

  • How to use Guice in Swing application

    - by Gerco Dries
    I have a Swing application that I would like to convert from spaghetti to using dependency injection with Guice. Using Guice to provide services like configuration and task queues is going great but I'm now starting on the GUI of the app and am unsure of how to proceed. The application is basically a JFrame with a bunch of tabs in a JTabbedPane. Each of the tabs is a separate JPanel subclass that lays out the various components and needs services to perform actions when certain buttons are pressed. In the current application, this looks somewhat like this: @Inject public MainFrame(SomeService service, Executor ex, Configuration config) { tabsPane = new JTabbedPane(); // Create the panels for each tab and add them to the tabbedpane somePanel = new SomeTabPanel(service, ex, config); tabsPane.addTab("Panel 1", somePanel); someOtherPanel = new SomeOtherTabPanel(service, ex, config); tabsPane.addTab("Panel 2", someOtherPanel); ... do more stuff } Obviously, this doesn't exactly follow DI best practices. I don't want to have to @Inject the tabs because that would get me a constructor with dozens of parameters. I do want to use Guice to inject the required dependencies into whatever tab objects I need without me having to pass all of those dependencies to the tab constructors. All of the dependencies for the tab objects are services that my Module knows about, so basically all I think I want to do is to ask Guice for the required objects and have them constructed for me.

    Read the article

  • Japanese text garbled while passing to a http restlet service

    - by satish-gunuputi
    Hi , I have a perl client which is calling a http restlet service (put method). Some of the parameters in this call contain japanese text. when I printed the contents of these request parameters in the restlet service I found these chars garbled ! This is my PERL client code: my %request_headers = ( 'DocumentName' => $document_name, --> This name is a JAPANESE String 'DocumentDescription' => 'Test Japanese Chars', 'content-length' => 200, 'Content-Type' => 'application/octet-stream; charset=utf-8', 'User-Agent' => "JPCharTester", ); $s-write_request('PUT', '/test-document/TEST/TEST_DOCUMENT' , %request_headers, $content); in this call both the values of $context and $document_name are JAPANESE Strings. But ONLY the document_name is received as garbled in my backend service. Here goes the Service code: String URL_ENCODING = "UTF-8"; String documentName = requestHeaders.getFirstValue("DocumentName"); System.out.println("Encoded Document Name : "+documentName+" <<<"); --> documentName is garbled here try { documentName = URLDecoder.decode(documentName, URL_ENCODING); System.out.println(>>> Decoded Document Name : "+documentName+" <<<"); --> documentName is garbled here } catch (java.io.UnsupportedEncodingException ex) { throwException(ex.getMessage(), Status.SERVER_ERROR_INTERNAL, ex); } both the above log statements printed GARBLED TEXT !! Can someone tell me what is the mistake I am doing and how to fix this ? Thanks in advance for your help. Regards, Satish.

    Read the article

  • UniqueConstraint in EmbeddedConfiguration

    - by LantisGaius
    I just started using db4o on C#, and I'm having trouble setting the UniqueConstraint on the DB.. here's the db4o configuration static IObjectContainer db = Db4oEmbedded.OpenFile(dbase.Configuration(), "data.db4o"); static IEmbeddedConfiguration Configuration() { IEmbeddedConfiguration dbConfig = Db4oEmbedded.NewConfiguration(); // Initialize Replication dbConfig.File.GenerateUUIDs = ConfigScope.Globally; dbConfig.File.GenerateVersionNumbers = ConfigScope.Globally; // Initialize Indexes dbConfig.Common.ObjectClass(typeof(DAObs.Environment)).ObjectField("Key").Indexed(true); dbConfig.Common.Add(new Db4objects.Db4o.Constraints.UniqueFieldValueConstraint(typeof(DAObs.Environment), "Key")); return dbConfig; } and the object to serialize: class Environment { public string Key { get; set; } public string Value { get; set; } } everytime I get to commiting some values, an "Object reference not set to an instance of an object." Exception pops up, with a stack trace pointing to the UniqueFieldValueConstraint. Also, when I comment out the two lines after the "Initialize Indexes" comment, everything runs fine (Except you can save non-unique keys, which is a problem)~ Commit code (In case I'm doing something wrong in this part too:) public static void Create(string key, string value) { try { db.Store(new DAObs.Environment() { Key = key, Value = value }); db.Commit(); } catch (Db4objects.Db4o.Events.EventException ex) { System.Console.WriteLine (DateTime.Now + " :: Environment.Create\n" + ex.InnerException.Message +"\n" + ex.InnerException.StackTrace); db.Rollback(); } } Help please? Thanks in advance~

    Read the article

  • asp.net Dynamic Data Site with own MetaData

    - by loviji
    Hello, I'm searching info about configuring own MetaData in asp.NET Dynamic Site. For example. I have a table in MS Sql Server with structure shown below: CREATE TABLE [dbo].[someTable]( [id] [int] NOT NULL, [pname] [nvarchar](20) NULL, [FullName] [nvarchar](50) NULL, [age] [int] NULL) and I there are 2 Ms Sql tables (I've created), sysTables and sysColumns. sysTables: ID sysTableName TableName TableDescription 1 | someTable |Persons |All Data about Persons in system sysColumns: ID TableName sysColumnName ColumnName ColumnDesc ColumnType MUnit 1 |someTable | sometable_pname| Name | Persona Name(ex. John)| nvarchar(20) | null 2 |someTable | sometable_Fullname| Full Name | Persona Name(ex. John Black)| nvarchar(50) | null 3 |someTable | sometable_age| age | Person age| int | null I want that, in Details/Edit/Insert/List/ListDetails pages use as MetaData sysColumns and sysTableData. Because, for ex. in DetailsPage fullName, it is not beatiful as Full Name . someIdea, is it possible? thanks Updated:: In List Page to display data from sysTables (metaData table) I've modified <h2 class="DDSubHeader"><%= tableName%></h2>. public string tableName; protected void Page_Init(object sender, EventArgs e) { table = DynamicDataRouteHandler.GetRequestMetaTable(Context); //added by me uqsikDataContext sd=new uqsikDataContext(); tableName = sd.sysTables.Where(n => n.sysTableName == table.DisplayName).FirstOrDefault().TableName; //end GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context)); GridDataSource.EntityTypeName = table.EntityType.AssemblyQualifiedName; if (table.EntityType != table.RootEntityType) { GridQueryExtender.Expressions.Add(new OfTypeExpression(table.EntityType)); } } so, what about sysColums? How can I get Data from my sysColumns table?

    Read the article

  • StackOverFlowException - but oviously NO recursion/endless loop

    - by user567706
    Hi there, I'm now blocked by this problem the entire day, read thousands of google results, but nothing seems to reflect my problem or even come near to it... i hope any of you has a push into the right direction for me. I wrote a client-server-application (so more like 2 applications) - the client collects data about his system, as well as a screenshot, serializes all this into a XML stream (the picture as a byte[]-array]) and sends this to the server in regular intervals. The server receives the stream (via tcp), deserializes the xml to an information-object and shows the information on a windows form. This process is running stable for about 20-25 minutes at a submission interval of 3 seconds. When observing the memory usage there's nothing significant to see, also kinda stable. But after these 20-25 mins the server throws a StackOverflowException at the point where it deserializes the tcp-stream, especially when setting the Image property from the byte[]-array. I thoroughly searched for recursive or endless loops, and regarding the fact that it occurs after thousands of sucessfull intervals, i could hardly imagine that. public byte[] ImageBase { get { MemoryStream ms = new MemoryStream(); _screen.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); return ms.GetBuffer(); } set { if (_screen != null) _screen.Dispose(); //preventing well-known image memory leak MemoryStream ms = new MemoryStream(value); try { _screen = Image.FromStream(ms); //<< EXCEPTION THROWING HERE } catch (StackOverflowException ex) //thx to new CLR management this wont work anymore -.- { Console.WriteLine(ex.Message + Environment.NewLine + ex.StackTrace); } ms.Dispose(); ms = null; } } I hope that more code would be unnecessary, or it could get very complex... Please help, i have no clue at all anymore thx Chris

    Read the article

  • SqlDataAdaptor why get a different query

    - by Murat
    Hi All, I have a database reader class. But i want to use this class, sometimes SqlDataAdaptor.Fill() method get another query to Datatable. I look at Query in SqlCommand Instance and my query is correct but returning values from different table? What is the problem? This My Code public static DataTable GetLatestRecords(string TableName, string FilterFieldName, int RecordCount, params DBFieldAndValue[] FilterFields) { DataTable DT = new DataTable(); Type ClassType = typeof(T); string SelectString = string.Format("SELECT TOP ({0}) * FROM {1}", RecordCount, TableName); if (FilterFields.Length > 0) { SelectString += " WHERE 1 = 1 "; for (int index = 0; index < FilterFields.Length; index++) SelectString += FilterFields[index].ToString(index); } SelectString += string.Format(" ORDER BY {0} DESC", FilterFieldName); try { SqlConnection Connection = GetConnection<T>(); SqlCommand Command = new SqlCommand(SelectString, Connection); for (int index = 0; index < FilterFields.Length; index++) Command.Parameters.AddWithValue("@" + FilterFields[index].Field + "_" + index, FilterFields[index].Value); if (Connection.State == ConnectionState.Closed) Connection.Open(); Command.CommandText = SelectString; SqlDataAdapter DA = new SqlDataAdapter(Command); DT.Dispose(); DT = new DataTable(); DA.Fill(DT); if (Connection.State == ConnectionState.Open) Connection.Close(); } catch (Exception ex) { WriteLogStatic(ex.Message); throw new Exception(@"Veritabani islemleri sirasinda hata olustu!\nAyrintilar 'C:\Temp' dizini altindadir.\n" + ex.Message); } return DT; }

    Read the article

  • Wrong Ruby Float and BigDecimal subtraction result

    - by SamChandra
    I am running: [~/ruby/rails/sas]$ ruby --version ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0] on Mac Snow Leopard 10.6.3 Can anyone help to explain why the Float and BigDecimal subtraction can be this wrong. [~/ruby/rails/sas]$ console Loading development environment (Rails 2.1.1) >> num = 30.0 => 30.0 >> num.class => Float >> ex = 28.04.to_d => #<BigDecimal:105367e40,'0.284E2',8(8)> >> ex.class => BigDecimal >> num - ex => 1.6 >> _.class => Float >> I was hoping that the result should be 1.96, I know that perhaps doing an arithmetic operation using 2 different data types are not recommended, but this behavior is so strange. It seems to be wise that from now on, I have to check the variables data type before doing any arithmetic operation. Hopefully somebody can give me an insight on what was happening.

    Read the article

  • object reference not set to an instance of object exception coming at runtime.

    - by amby
    Hi, I am getting this error at runtime: object reference not set to an instance of object my question is that am i using stringbuilder array correctly here. Because I am new in C#. and i think its the problem with my stringbuilder array. Below is the code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Text; using System.Web.Script.Serialization; using System.Web.Script.Services; using System.Collections; public partial class Testing : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [WebMethod] public static string SendMessage() { try { al2c00.ldap ws = new al2c00.ldap(); Hashtable htPeople = new Hashtable(); //DataTable dt = ws.GetEmployeeDetailsBy_NTID("650FA25C-9561-430B-B757-835D043EA5E5", "john"); StringBuilder[] empDetails = new StringBuilder[100]; string num = "ambreen"; empDetails[0].Append("amby"); num = empDetails[0].ToString(); htPeople.Add("bellempposreport", num); JavaScriptSerializer jss = new JavaScriptSerializer(); string output = jss.Serialize(htPeople); return output; } catch(Exception ex) { return ex.Message + "-" + ex.StackTrace; } } } please reply me what i am doing wrong here.

    Read the article

  • Ldap query returns null result when deployed.

    - by Trey Carroll
    I'm using a very simple Ldap query in my asp.net mvc 2.0 site: String ldapPath = ConfigReader.LdapPath; String emailAddress = null; try { DirectorySearcher search = new DirectorySearcher(ConfigReader.LdapPath); search.Filter = String.Format("(&(objectClass=user)(objectCategory=person)(objectSid={0})) ", securityIdentifierValue); // add the mail property to the list of props to retrieve search.PropertiesToLoad.Add("mail"); var result = search.FindOne(); if (result == null) { throw new Exception("Ldap Query with filter:" + search.Filter.ToString() + " returned a null value (no match found)"); } else { emailAddress = result.Properties["mail"][0].ToString(); } } catch (ArgumentOutOfRangeException aoorEx) { throw new Exception( "The query could not find an email for this user."); } catch (Exception ex) { //_log.Error(string.Format("======!!!!!! ERROR ERROR ERROR !!!!! in LdapLookupUtil.cs getEmailFromLdap Exception: {0}", ex)); throw ex; } return emailAddress; It works fine on my localhost machine. It works fine when I run it in VS2010 on the server. It always returns a null result when deployed. Here is my web.config: Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config -- section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. -- <!-- -- section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. -- I'm running it under the default app pool. Does anybody see the problem? This is driving me crazy!

    Read the article

  • .NET Sockets Buffer Overflow No Error

    - by Michael Covelli
    I have one thread that is receiving data over a socket like this: while (sock.Connected) { // Receive Data (Block if no data) recvn = sock.Receive(recvb, 0, rlen, SocketFlags.None, out serr); if (recvn <= 0 || sock == null || !sock.Connected) { OnError("Error In Receive, recvn <= 0 || sock == null || !sock.Connected"); return; } else if (serr != SocketError.Success) { OnError("Error In Receive, serr = " + serr); return; } // Copy Data Into Tokenizer tknz.Read(recvb, recvn); // Parse Data while (tknz.MoveToNext()) { try { ParseMessageAndRaiseEvents(tknz.Buffer(), tknz.Length); } catch (System.Exception ex) { string BadMessage = ByteArrayToStringClean(tknz.Buffer(), tknz.Length); string msg = string.Format("Exception in MDWrapper Parsing Message, Ex = {0}, Msg = {1}", ex.Message, BadMessage); OnError(msg); } } } And I kept seeing occasional errors in my parsing function indicating that the message wasn't valid. At first, I thought that my tokenizer class was broken. But after logging all the incoming bytes to the tokenizer, it turns out that the raw bytes in recvb weren't a valid message. I didn't think that corrupted data like this was possible with a tcp data stream. I figured it had to be some type of buffer overflow so I set sock.ReceiveBufferSize = 1024 * 1024 * 8; and the parsing error never, ever occurs in testing (it happens often enough to replicate if I don't change the ReceiveBufferSize). But my question is: why wasn't I seeing an exception or an error state or something if the socket's internal buffer was overflowing before I changed this buffer size?

    Read the article

  • Not indent the first paragraph of a LaTeX document

    - by Andrew
    In the standard LaTeX article class (and probably others as well), paragraph indentation follows standard American publishing norms of not indenting the first paragraph after a section{} or subsection{}. I've redefined \maketitle in a LaTeX document and put the actual title left-aligned as the last line, fairly close to the actual text (kind of like this) Author Date Title Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Section title Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Since the title is left-aligned and so close to the text, I'd like the first paragraph of the document to not be indented, just like with the headings ... Title Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor... ... I've attempted to use @afterindentfalse, which is what the section commands use, inside my renewed commands, but it doesn't work. \makeatletter \def\noindentation{\let\@afterindentfalse} \newcommand{\mytitle}[1]{% \vskip 2em {\bf\sffamily\LARGE #1} \noindentation} \renewcommand{\@maketitle}{ \begin{flushleft}{ % Author \@author \par % Date \@date \par % Title \mytitle{\@title} } \end{flushleft} } \makeatother By default the first paragraph in the article class is indented, so this question is applicable whether or not I renew \maketitle. So, what's the best way to automatically not indent the first paragraph of the document? Thanks!

    Read the article

  • algorithm || method to write prog

    - by fatai
    I am one of the computer science student. My wonder is everyone solve problem with different or same method, but actually I dont know whether they use method or I dont know whether there are such common method to approach problem. All teacher give us problem which in simple form sometimes, but they dont introduce any approach or method(s) so that we can first choose method then apply that one to problem , afterward find solution then write code. I have found one method when I failed the course, More accurately, When I counter problem in language , I will get more paper and then ; first, input/ output step ; my prog will take this / these there argument(s) and return namely X , ex : in c, input length is not known and at same type , so I must use pointer desired output is in form of package , so use structure second, execution part ; in that step , I am writing all step which are goes to final output ex : in python ; 1.) [ + , [- , 4 , [ * , 1 , 2 ]], 5] 2.) [ + , [- , 4 , 2 ],5 ] 3.) [ + , 2 , 5] 4.) 7 ==> return 7 third, I will write test code ex : in c++ input : append 3 4 5 6 vector_x remove 0 1 desired output vector_x holds : 5 6 But now, I wonder other method ; used to construct class :::: for c++ , python, java used to communicate classes / computers used for solving embedded system problem ::::: for c Why I wonder , because I learn if you dont costruct algorithm on paper, you may achieve your goal. Like no money no lunch , I can say no algorithm no prog therefore , feel free when you write your own method , a way which is introduced by someone else but you are using and you find it is so efficient

    Read the article

  • How to build Android for Samsung Galaxy Note

    - by Tr?n Ð?i
    I'd like to modify and build my own Android for my Samsung Galaxy Note I've downloaded Android 4.1.2 from http://source.android.com and Samsung open source for my Samsung Galaxy Note. After extract Samsung open source, I get 2 folders: Kernel and Platform, and 2 README text file README_Kernel.txt 1. How to Build - get Toolchain From android git server , codesourcery and etc .. - arm-eabi-4.6 - edit build_kernel.sh edit "CROSS_COMPILE" to right toolchain path(You downloaded). EX) CROSS_COMPILE= $(android platform directory you download)/android/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- Ex) CROSS_COMPILE=/usr/local/toolchain/arm-eabi-4.6/bin/arm-eabi- // check the location of toolchain - execute Kernel script $ ./build_kernel.sh 2. Output files - Kernel : arch/arm/boot/zImage - module : drivers/*/*.ko 3. How to Clean $ make clean README_Platform.txt [Step to build] 1. Get android open source. : version info - Android 4.1 ( Download site : http://source.android.com ) 2. Copy module that you want to build - to original android open source If same module exist in android open source, you should replace it. (no overwrite) # It is possible to build all modules at once. 3. You should add module name to 'PRODUCT_PACKAGES' in 'build\target\product\core.mk' as following case. case 1) bluetooth : should add 'audio.a2dp.default' to PRODUCT_PACKAGES case 2) e2fsprog : should add 'e2fsck' to PRODUCT_PACKAGES case 3) libexifa : should add 'libexifa' to PRODUCT_PACKAGES case 4) libjpega : should add 'libjpega' to PRODUCT_PACKAGES case 5) KeyUtils : should add 'libkeyutils' to PRODUCT_PACKAGES case 6) bluetoothtest\bcm_dut : should add 'bcm_dut' to PRODUCT_PACKAGES ex.) [build\target\product\core.mk] - add all module name for case 1 ~ 6 at once PRODUCT_PACKAGES += \ e2fsck \ libexifa \ libjpega \ libkeyutils \ bcm_dut \ audio.a2dp.default 4. In case of 'bluetooth', you should add following text in 'build\target\board\generic\BoardConfig.mk' BOARD_HAVE_BLUETOOTH := true BOARD_HAVE_BLUETOOTH_BCM := true 5. excute build command ./build.sh user What I need to do after followed 2 above files

    Read the article

  • Help with error creating SharePoint list (probably due to privilege issues)

    - by Swami
    I'm getting an error when trying to activate a webpart. It activates fine in one setup , but fails in a different one. Administrator in both. Seems like it fails because it's not able to create the list. The error is: Message: Value cannot be null. Stack Trace: at Microsoft.Sharepoint.SPRoleAssignment..ctor at ClientRequestHandler.CreateList(... private static void CreateLists() { try { SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = SPContext.Current.Site) { using (SPWeb web = site.RootWeb) { string listName = LIST_NAME; bool listExist = ContainList(web, listName); if (!listExist) { AddFieldDelegate _delegate = new AddFieldDelegate(AddAttachmentFields); SPList list = CreateList(web, listName, _delegate); RegisterList(web, list, KEY); } } } }); } catch (Exception ex) { throw new Exception(String.Format("Message: {0} Stack Trace: {1}", ex.Message, ex.StackTrace.ToString())); } } private static SPList CreateList(SPWeb web, string listName, AddFieldDelegate _delegate) { web.AllowUnsafeUpdates = true; SPListTemplateType genericList = new SPListTemplateType(); genericList = SPListTemplateType.GenericList; Guid listGuid = web.Lists.Add(listName, "List", genericList); SPList list = web.Lists[listGuid]; list.Hidden = true; SPView view = _delegate(list); view.Update(); //Remove permissions from the list list.BreakRoleInheritance(false); //Make site owners the list administrators SPPrincipal principal = web.AssociatedOwnerGroup as SPPrincipal; SPRoleAssignment assignment = new SPRoleAssignment(principal); assignment.RoleDefinitionBindings.Add(web.RoleDefinitions.GetByType(SPRoleType.Administrator)); list.RoleAssignments.Add(assignment); //update list changes list.Update(); return list; }

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >