Daily Archives

Articles indexed Thursday April 22 2010

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

  • How to programmatically detect Cipher type and Encryption level from a wireless network device from

    - by amexn
    Now my team working in a network project using windows application c#. I didn't know how to programmatically detect Cipher type and Encryption level from a wireless network device from windows 2003 server. After searching i got WMI (Windows Management Instrumentation) for solving the problem.+ Please suggest example/reference for finding Cipher type and Encryption level from a wireless network device from windows 2003 server

    Read the article

  • How to use XmlPeek task?

    - by Nam Gi VU
    I've read in the MSDN MSBuild Task Reference about XmlPeek task at http://msdn.microsoft.com/en-us/library/ff598684(v=VS.100).aspx but I cannot use it in my MSBuild script. If you have used this before, please show me how!

    Read the article

  • Swap function for a char*

    - by Martin
    I have the simple function below which swap two characters of an array of characters (s). However, I am getting a "Unhandled exception at 0x01151cd7 in Bla.exe: 0xC0000005: Access violation writing location 0x011557a4." error. The two indexes (left and right) are within the limit of the array. What am I doing wrong? void swap(char* s, int left, int right) { char tmp = s[left]; s[left] = s[right]; s[right] = tmp; } swap("ABC", 0, 1); I am using VS2010 with unmanaged C/C++. Thanks!

    Read the article

  • Count number of queries executed by NHibernate in a unit test

    - by Bittercoder
    In some unit/integration tests of the code we wish to check that correct usage of the second level cache is being employed by our code. Based on the code presented by Ayende here: http://ayende.com/Blog/archive/2006/09/07/MeasuringNHibernatesQueriesPerPage.aspx I wrote a simple class for doing just that: public class QueryCounter : IDisposable { CountToContextItemsAppender _appender; public int QueryCount { get { return _appender.Count; } } public void Dispose() { var logger = (Logger) LogManager.GetLogger("NHibernate.SQL").Logger; logger.RemoveAppender(_appender); } public static QueryCounter Start() { var logger = (Logger) LogManager.GetLogger("NHibernate.SQL").Logger; lock (logger) { foreach (IAppender existingAppender in logger.Appenders) { if (existingAppender is CountToContextItemsAppender) { var countAppender = (CountToContextItemsAppender) existingAppender; countAppender.Reset(); return new QueryCounter {_appender = (CountToContextItemsAppender) existingAppender}; } } var newAppender = new CountToContextItemsAppender(); logger.AddAppender(newAppender); logger.Level = Level.Debug; logger.Additivity = false; return new QueryCounter {_appender = newAppender}; } } public class CountToContextItemsAppender : IAppender { int _count; public int Count { get { return _count; } } public void Close() { } public void DoAppend(LoggingEvent loggingEvent) { if (string.Empty.Equals(loggingEvent.MessageObject)) return; _count++; } public string Name { get; set; } public void Reset() { _count = 0; } } } With intended usage: using (var counter = QueryCounter.Start()) { // ... do something Assert.Equal(1, counter.QueryCount); // check the query count matches our expectations } But it always returns 0 for Query count. No sql statements are being logged. However if I make use of Nhibernate Profiler and invoke this in my test case: NHibernateProfiler.Intialize() Where NHProf uses a similar approach to capture logging output from NHibernate for analysis via log4net etc. then my QueryCounter starts working. It looks like I'm missing something in my code to get log4net configured correctly for logging nhibernate sql ... does anyone have any pointers on what else I need to do to get sql logging output from Nhibernate?

    Read the article

  • How to identify Draft from Inbox and Sent mails In ALL MAIl mailbox

    - by Subbi
    Hello, I am working on a mail client Application for downloading gmail emails, which uses IMAP C-client library. I want to download emails from "ALLMAIL" mailbox folder. as you know ALLMAIL folder consists of Inbox,Sent Mail and Draft Mails. Here my requirement is to distinguish Draft from Inbox and Sent mails. Usually if we download envelop of emails, that should give email's Draft info. But Gmail is failing to set this draft info. So can you please suggest how to identify draft? Thanks In advance Subbi

    Read the article

  • RAID 1 not performing as expected

    - by Faken
    I recently bought a new 320Gb hard drive for my computer to set up RAID 1 on it for some added security. Installation went as smooth as could possibly be (plug in power, plug in data cable, start up computer, Intel software recognized new drive, right click create RAID 1, done!). However, for some inexplicable reason, I seem to have strange test results when using BENCH32. On my old configuration, a single 7200 rpm drive, I achieved about 60 MB/s write and 70 MB/s read. With a new RAID 1 configuration, I would expect the write to be slightly diminished but read to be significantly improved (though not exactly double speed). However, with the new configuration, I am getting 90 MB/s write and only about 80 MB/s read. I should NOT be getting improved write performance, especially NOT better than read! What's going on? My system setup is: q6600 2.4ghz CPU 4Gb DDR2 667mhz RAM on board Intel ICH9R "RAID chip" 2x Seagate 7200 RPM 320GB drives in RAID 1 Widows 7 home premium 64-bit

    Read the article

  • User input... How to check for ENTER key

    - by user69514
    I have a section of code where the user enters input from the keyboard. I want to do something when ENTER is pressed. I am checking for '\n' but it's not working. How do you check if the user pressed the ENTER key? if( shuffle == false ){ int i=0; string line; while( i<20){ cout << "Playing: "; songs[i]->printSong(); cout << "Press ENTER to stop or play next song: "; getline(cin, line); if( line.compare("\n") == 0 ){ i++; } } }

    Read the article

  • Are AJAX sites crawlable by search engines?

    - by frankadelic
    I had always assumed that AJAX-driven content was invisible to search engines. (i.e. content inserted into the DOM via XMLHTTPRequest) For example, in this site, the main content is loaded via AJAX request by the browser: http://www.trustedsource.org/query/terra.cl ...if you view this page with Javascript disabled, the main content area is blank. However, Google cache shows the full content after the AJAX load: http://74.125.155.132/search?q=cache:JqcT6EVDHBoJ:www.trustedsource.org/query/terra.cl+http://www.trustedsource.org/query/terra.cl&cd=1&hl=en&ct=clnk&gl=us So, apparently search engines do index content loaded by AJAX. Questions: Is this a new feature in search engines? Most postings on the web indicate that you have to publish duplicate static HTML content for search engines to find them. Are there any tricks to get an AJAX-driven content to be crawled by search engines (besides creating duplicate static HTML content). Will the AJAX-driven content be indexed if it is loaded from a separate subdomain? How about a separate domain?

    Read the article

  • Please help. Creating threads and wait till finsh

    - by Raj Aththanayake
    Hi I have two method calls that I want to call using two threads. Then I want them to wait till method executions get completed before continuing. My sample solution is something like below. public static void Main() { Console.WriteLine("Main thread starting."); String[] strThreads = new String[] { "one", "two" }; String ctemp = string.Empty; foreach (String c in strThreads) { ctemp = c; Thread thread = new Thread(delegate() { MethodCall(ctemp); }); thread.Start(); thread.Join(); } Console.WriteLine("Main thread ending."); Console.Read(); } public static void MethodCalls(string number) { Console.WriteLine("Method call " + number); } Is this will do the job? Or is there another better way to do the same thing?

    Read the article

  • "select * into table" Will it work for inserting data into existing table

    - by Shantanu Gupta
    I am trying to insert data from one of my existing table into another existing table. Is it possible to insert data into any existing table using select * into query. I think it can be done using union but in that case i need to record all data of my existing table into temporary table, then drop that table and finally than apply union to insert all records into same table eg. select * into #tblExisting from tblExisting drop table tblExisting select * into tblExisting from #tblExisting union tblActualData Here tblExisting is the table where I actually want to store all data tblActualData is the table from where data is to be appended to tblExisting. Is it right method. Do we have some other alternative ?

    Read the article

  • How to create reactive tasks for programming competitions?

    - by directx
    A reactive task is sometimes seen in the IOI programming competition. Unlike batch tasks, reactive solutions take input from another program as well as outputting it. The program typically 'query' the judge program a certain number of times, then output a final answer. An example The client program accepts lines one by one, and simply echoes it back. When it encountered a line with "done", it exists immediately. The client program in Java looks like this: import java.util.*; class Main{ public static void main (String[] args){ Scanner in = new Scanner(System.in); String s; while (!(s=in.nextLine()).equals("done")) System.out.println(s); } } The judge program gives the input and processes output from the client program. In this example, it feeds it a predefined input and checks if the client program has echoed it back correctly. A session might go like this: Judge Client ------------------ Hello Hello World World done I'm having trouble writing the judge program and having it judge the client program. I'd appreciate if someone could write a judge program for my example.

    Read the article

  • Response.TransmitFile and delete it after transmission

    - by Radhi
    Hi, i have to implement GEDCOM export in my site. my .net code created one file at server when export to gedcom clicked. then i need to download it to client from server as well as user should be asked to where to save that file means savedialog is required. after its downloaded. i want to delete that file from server. i got one code to transmit file from server to client Response.ContentType = "text/xml"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + FileName); Response.TransmitFile(Server.MapPath("~/" + FileName)); Response.End(); from this LINK but i am not able to delete the file after this code as Response.End ends response so whtever code written after that line is not execute. if i do code to delete file before Response.End(); then file does not transmitted and got error. so, please can anybody provide me any solution for this. -Thanks in advance

    Read the article

  • Tool to profile php code

    - by Michael
    Looking for some [freeware/opensource] tool in order to make it easy to profile a big php project on win32 platform. Need to find out which part of code is most time consuming. It's hard to manually put timing function for each function, loop...

    Read the article

  • STI and accepts_nested_attributes_for in rails

    - by ryanshackintosh
    I have models as follows: class Entity < ActiveRecord::Base has_many :addresses accepts_nested_attributes_for :addresses, :reject_if => lambda { |a| a[:label].blank?} , :allow_destroy => true end class Client < Entity before_save :set_type private def set_type self.type = "Client" end end class Address < ActiveRecord::Base belongs_to :entity end I have recently implemented accepts_nested_attributes_for on the /clients/new form, as follows: <% form_for(@client, :html => {:class => 'form'}) do |f| -%> <%= f.label :name %> <%= f.text_field :name -%> <%= f.label :phone %> <%= f.text_field :phone %> <% f.fields_for :addresses do |a| %> <%= a.label :street %> <%= a.text_field :street%> <%= a.label :city %> <%= a.text_field :city %> <% end %> <% end %> And my controller as follows: class ClientsController < ApplicationController before_filter :load_client , :except => [:index, :new, :create, :render_clients] def new @client = Client.new @client.addresses.build end def create @client = Client.new(params[:client]) if @client.save flash[:notice] = 'Client has been successfully added' redirect_to @client else render :action => 'new' end end The issue is that when the record is saved it gives an error stating: "Entity can't be blank" I assume it is something to do with the fact that a 'Client' and not an 'Entity' is being added. Can anyone point me in the right direction?

    Read the article

  • WPF Application Hang

    - by Karim
    Hi, I'm using Windows 7 Professional (x64) and having installed .NET 4.0 RTM on my machine. Since 2 days I'm noticing that every WPF application that I'm trying to run hangs and becomes non responsive (a not responding text is appended to it's title bar) and it's painted white. There is no info regarding any exception, no error message. Nothing. Even the Event Log shows that there was "application hang" event (code 1002) and nothing more. This problem is for everything that is written in WPF, even for products like NHibernate Profiler and other stuff that I was using on a regular basis without any issues. Tried to reinstall .NET 4.0 and nothing changed. Any ideas why this might be happening?

    Read the article

  • How do I do a has_many through association on a has_many through association in rails?

    - by Angela
    Warning: I may have the wrong 'problem statement' but here it goes: A Campaign has many Contacts. A Campaign has many Emails. Therefore, a Contact has many Emails through a Campaign. And an Email can have many Contacts through a Campaign. Each Contact-Email pair has its own unique Status (status1, status2, etc). Each Status (for a Contact-Email pair) will have its own User. I do not know how to model Status, or User. Currently the immediate challenge is Status. (see diagram below)

    Read the article

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