Daily Archives

Articles indexed Wednesday April 21 2010

Page 32/126 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • renaming a setup in c#

    - by Hema Joshi
    hi , i have a setpu in c:\3c\install\builds\output\ dir having name setup. i want to rename this setup from a c# file. please tell me how to rename this . when i am tyring File.Move(c:\3c\install\builds\output\setup,c:\3c\install\builds\Renamesetup\newsetup); it is giving file not found exception. Could not find file 'c:\3c\install\builds\output\setup'. please tell me what is wrong in it . thanks

    Read the article

  • rewrite 301 replace domain name with a new domain name

    - by user172697
    Hello , guys I need some help on mod rewrite 301 , to redirect my old website address to the new address , here is my scenario ive www.domain1.com/page1/ want to be redirect to domain2.com/page1/ ive to replace all request goes to domain1 with domain2 and keep the page after .com so watever was after .com should be the same just replace domain1 with domain2 . anyone can help me with this Regards

    Read the article

  • Getting Assert to work in Visual C++ Unit Tests?

    - by garsh0p
    I'm using Visual Studio 2008's built in testing framework in my Visual C++ project. I'm adding a new Test Project, then a new Unit Test. However, I can't use any of the functions provided by Assert. Assert shows up in the Intellisense, but I can't do anything with it. I've done unit tests fine in Visual C#. Am I forgetting to do anything? EDIT: There isn't much code because everything I'm doing is auto-generated by Visual Studio 2008. Here are the steps I'm doing: File - New Project - Visual C++ - General - Empty Project Right click solution in Solution Explorer - Add - New Project... Visual C++ - Test - Test Project Open UnitTest1.cpp (auto-generated) Go to TestMethod1() From here, when I try to use the Assert class (like Assert.AreEqual), I can't do it. If I do the same in a Visual C# project, it works fine.

    Read the article

  • Beginner to RUBY - require_relative problem

    - by WANNABE
    Hi, I'm learning Ruby (using version 1.8.6) on Windows 7. When I try to run the stock_stats.rb program below, I get the following error: C:\Users\Will\Desktop\ruby>ruby stock_stats.rb stock_stats.rb:1: undefined method `require_relative' for main:Object (NoMethodE rror) I have three v.small code files: stock_stats.rb require_relative 'csv_reader' reader = CsvReader.new ARGV.each do |csv_file_name| STDERR.puts "Processing #{csv_file_name}" reader.read_in_csv_data(csv_file_name) end puts "Total value = #{reader.total_value_in_stock}" csv_reader.rb require 'csv' require_relative 'book_in_stock' class CsvReader def initialize @books_in_stock = [] end def read_in_csv_data(csv_file_name) CSV.foreach(csv_file_name, headers: true) do |row| @books_in_stock << BookInStock.new(row["ISBN"], row["Amount"]) end end # later we'll see how to use inject to sum a collection def total_value_in_stock sum = 0.0 @books_in_stock.each {|book| sum += book.price} sum end def number_of_each_isbn # ... end end book_in_stock.rb require 'csv' require_relative 'book_in_stock' class CsvReader def initialize @books_in_stock = [] end def read_in_csv_data(csv_file_name) CSV.foreach(csv_file_name, headers: true) do |row| @books_in_stock << BookInStock.new(row["ISBN"], row["Amount"]) end end # later we'll see how to use inject to sum a collection def total_value_in_stock sum = 0.0 @books_in_stock.each {|book| sum += book.price} sum end def number_of_each_isbn # ... end end Thanks in advance for any help.

    Read the article

  • How active record is automatically setting up the autoincremental value of ID?

    - by piemesons
    Here this is what we are doing:-- an_order = Order.new an_order.name = "Dave Thomas" an_order.email = "[email protected]" an_order.address = "123 Main St" an_order.pay_type = "check" an_order.save Now it will insert a new row in orders table right. I m having a ID column in that table. Now suppose after inserting this record the value of the ID corresponding to this record is 100. Now how this 100 value came to know? Does the previous value of ID ie 99 (Suppose) is stored somewhere in some variable/file in the ORM layer or before inserting this value a query was fired to know about the last inserted value or database is itself doing that or anything else???

    Read the article

  • what is the right way to exit Windoes Service OnStart if configuration is wrong and nothing to do in

    - by matti
    Is something like this ok? protected override void OnStart(string[] args) { if (SomeApp.Initialize()) { SomeApp.StartMonitorAndWork(); base.OnStart(args); } } protected override void OnStop() { SomeApp.TearDown(); base.OnStop(); } Here Initialize reads a config file and if it's wrong there's nothing to do so service should STOP! If config is ok StartMonitorAndWork starts: Timer(new TimerCallback(DoWork), null, startTime, loopTime); and DoWork polls database periodically. The question is: "Is exiting OnStart without doing nothing enough if Initialize returns false? OR should there be something like this: private void ExitService() { this.OnStop(); System.Environment.Exit(1); } protected override void OnStart(string[] args) { if (ObjectFolderApp.Initialize()) { SomeApp.StartMonitorAndWork(); base.OnStart(args); } else { ExitService(); } } Thanks & BR - Matti

    Read the article

  • Best way for launching html/jsp to communicate with GWT module

    - by h2g2java
    I asked this at the GWT forum but I'm impatient for the answer and I seem to get rather good responses here. A html or jsp file is used to launch the xxx.nocache.js, which then decides which browser "permutation" to use. <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8"> <title>xxx</title> <script type="text/javascript" language="javascript" src="xxx.nocache.js"></script> </head> In my case, I am using a jsp. When the JSP is executed, it discovers some conditions. I wish to pass these conditions as values to the GWT module being launched. The "elegant" GWT way to pass these values would be to persist them as request/memcache attributes and then have the GWT module perform RPC to retrieve those values. For example, the JSP discovers that the current user is Whoopy. Shouldn't I simply have the JSP generate javascript to store user = "Whoopy" as a top or namedframe level javascript variable and use JSNI within the module to retrieve the value for user? I have not tried it yet, but I would like to know how anyone might have done it without having to use RPC.

    Read the article

  • Is there any way to programitically change a Data/ItemTemplate in Silverlight?

    - by Kris Erickson
    So I have a Listbox, which is using an ItemTemplate to display an image. I want to be able to change the size of the displayed image in the ItemTemplate. Through databinding I can change the Width, but the only way I can see how to do this is to add a Property (Say, ImageSize) to the class I am binding to and then change every item in the colleciton to have a new ImageSize. Is there no way to access the property of an item in that Datatemplate? E.g. <navigation:Page.Resources> <DataTemplate x:Key="ListBoxItemTemplate"> <Viewbox Height="100" Width="100"> <Image Source="{Binding Image}"/> </Viewbox> </DataTemplate> </navigation:Page.Resources> <Grid> <ListBox ItemTemplate="{StaticResource ListBoxItemTemplate}" ItemSource="{Binding Collection}"/> </Grid> Is there anyway to set the Width and Height of the viewbox without binding a property to every element in the collection?

    Read the article

  • Show child and parent together using CONNECT BY Sql statement

    - by martilyo
    I have an sql statement that currently is just returning all the end parent rows for a list of child rows: SELECT DISTINCT row FROM table heirarchy WHERE parent_row = NULL CONNECT BY nocycle PRIOR parent_row = row START WITH row IN (select statement returning child rows) Is there a way to show the child and its corresponding parent together in the same result set using a modified version of my sql? Thanks.

    Read the article

  • To update or to not update?

    - by Massimo
    Since starting working where I am working now, I've been in an endless struggle with my boss and coworkers in regard to updating systems. I of course totally agree that any update (be it firmware, O.S. or application) should not be applied carelessly as soon as it comes out, but I also firmly believe that there should be at least some reason if the vendor released it; and the most common reason is usually fixing some bug... which maybe you're not experiencing now, but you could be experiencing soon if you don't keep up with . This is especially true for security fixes; as an examle, had anyone simply applied a patch that had already been available for months, the infamous SQL Slammer worm would have been harmless. I'm all for testing and evaluating updates before deployng them; but I strongly disagree with the "if it's not broken then don't touch it" approach to systems management, and it genuinely hurts me when I find production Windows 2003 SP1 or ESX 3.5 Update 2 systems, and the only answer I can get is "it's working, we don't want to break it". What do you think about this? What is your policy? And what is your company policy, if it doesn't match your own?

    Read the article

  • memcpy(), what should the value of the size parameter be?

    - by Tomas
    Hi, I want to copy an int array to another int array. They use the same define for length so they'll always be of the same length. What are the pros/cons of the following two alternatives of the size parameter to memcpy()? memcpy(dst, src, ARRAY_LENGTH*sizeof(int)); or memcpy(dst, src, sizeof(dst); Will the second option always work? Regardless of the content? One thing that favors the last one is that if the array were to change, it'll be some house-keeping to update the memcpy()'s. Thanks

    Read the article

  • Android custom categories

    - by marian
    Hello, I have a view as a main screen of the application which contains the available application's actions as icon+text pairs ( desktop like). I want to find out programatically what are the activities defined ONLY in my AndroidManifest.xml Suppose I have : < activity android:name="example.mainActivity" android:label="mainActivity" < intent-filter < action android:name="android.intent.action.MAIN" / < category android:name="android.intent.category.LAUNCHER" / < /intent-filter < /activity < activity android:name="example.activity1" android:label="Activity1" < intent-filter < action android:name="android.intent.action.VIEW" / < category android:name="example.custom.ACTIVITY" / < /intent-filter < /activity < activity android:name="example.activity2" android:label="Activity2" < intent-filter < action android:name="android.intent.action.VIEW" / < category android:name="example.custom.ACTIVITY" / < /intent-filter < /activity I want that in the mainActivity to dinamically read Activity1 and Activity2 because when i add Activity3 for example it will be automatically read. I thought that this could be done by defining a custom category, example.custom.ACTIVITY, and in the mainActivity use the packageManager.queryIntentActivities(Intent intent, int flags) but it doesn't seem to be working. I really would like to code it to dinamically discover the installed activities in my application. Do you have any ideas on how to do this? Thank you

    Read the article

  • how to disable hyperlink browsing from an Html editor ?

    - by ahmed
    Hello , how do I disable browsing to a http link from a Html editor. I have a vb.net web form with a html editor, when I add a hyperlink to the html editor, for example my application website for instance http://myapplication/myloginpage.aspx When I run and click the link I can browse my application from inside the Html Editor, which is so weird. How do I stop this from happening. This is an Intranet application. And the component for Html Editor is of TMS.

    Read the article

  • the element 'transport' cannot contain child element 'extendedProtectionPolicy' because the parent e

    - by neildeadman
    I inherited a web application that makes calls to a web service. It is being developed in VS2008 SP1 and deployed to IIS6 (2k3 Server R2). Since I upgraded to Windows 7 Enterprise RTM, the following line gets added to my Web.config: <extendedProtectionPolicy policyEnforcement="Never" /> The problem is that when I deploy this application to my web server I get the following error: The element 'transport' cannot contain child element 'extendedProtectionPolicy' because the parent element's content model is empty I can remove the line and it will work, but its a pain and I forget sometimes to remove it again (VS2008 adds seems to add it back whenever I load the solution!!). Is there anything that can be done? Here is my 'transport' section: <transport clientCredentialType="None" proxyCredentialType="None" realm=""> <extendedProtectionPolicy policyEnforcement="Never" /> </transport> Thanks Neil

    Read the article

  • Is JPA + EJB to much slow (or heavy) for over Internet transactions?

    - by Xavier Callejas
    Hi, I am developing a stand-alone java client application that connects to a Glassfish v3 application for JPA/EJB facade style transactions. In other words, my client application do not connect directly to the database to CRUD, but it transfers JPA objets using EJB stateless sessions. I have scenarios where this client application will be used in an external network connected with a VPN over Internet with a client connection of 512kbp/DSL, and a simple query takes so much time, I'm seeing the traffic graph and when I merge a entity in the client application I see megabytes of traffic (I couldn't believe how a purchase order entity could weight more than 1 mb). I have LAZY fetch in almost every many-to-many relationship, but I have a lot of many-to-one relationships between entities (but this is the great advantage of JPA!). Could I do something to accelerate the the speed of transactions between JPA/EJB server and the remote java client? Thank you in advance.

    Read the article

  • how to write or create (when no exist) a file using python and Google AppEngine

    - by zjm1126
    this is my code: f = open('text/a.log', 'wb') f.write('hahaha') f.close() and it is not create a new file when not exist how to do this , thanks updated class MyThread(threading.Thread): def run(self): f = open('a.log', 'w') f.write('hahaha') f.close() error is : Traceback (most recent call last): File "D:\Python25\lib\threading.py", line 486, in __bootstrap_inner self.run() File "D:\zjm_code\helloworld\views.py", line 15, in run f = open('a.log', 'w') File "d:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1188, in __init__ raise IOError('invalid mode: %s' % mode) IOError: invalid mode: w

    Read the article

  • PDF text search and split library

    - by Horace Ho
    I am look for a server side PDF library (or command line tool) which can: split a multi-page PDF file into individual PDF files, based on a search result of the PDF file content Examples: Search "Page ???" pattern in text and split the big PDF into 001.pdf, 002,pdf, ... ???.pdf A server program will scan the PDF, look for the search pattern, save the page(s) which match the patten, and save the file in the disk. It will be nice with integration with PHP / Ruby. Command line tool is also acceptable. It will be a server side (linux or win32) batch processing tool. GUI/login is not supported. i18n support will be nice but no required. Thanks~

    Read the article

  • C# Process <instance>.StandardOutput InvalidOperationException "Cannot mix synchronous and asynchron

    - by Rahul2047
    I tried this myProcess = new Process(); myProcess.StartInfo.CreateNoWindow = true; myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; myProcess.StartInfo.FileName = "Hello.exe"; myProcess.StartInfo.Arguments ="-say Hello"; myProcess.StartInfo.UseShellExecute = false; myProcess.OutputDataReceived += new DataReceivedEventHandler(myProcess_OutputDataReceived); myProcess.ErrorDataReceived += new DataReceivedEventHandler(myProcess_OutputDataReceived); myProcess.Exited += new EventHandler(myProcess_Exited); myProcess.EnableRaisingEvents = true; myProcess.StartInfo.RedirectStandardOutput = true; myProcess.StartInfo.RedirectStandardError = true; myProcess.StartInfo.ErrorDialog = true; myProcess.StartInfo.WorkingDirectory = "D:\\Program Files\\Hello"; myProcess.Start(); myProcess.BeginOutputReadLine(); myProcess.BeginErrorReadLine(); Then I am getting this error.. My process takes very long to complete, so I need to show progress in runtime.

    Read the article

  • Nhibernate - getting single column from other table

    - by Muhammad Akhtar
    I have following tables Employee: ID,CompanyID,Name //CompanyID is foriegn key of Company Table Company: CompanyID, Name I want to map this to the following class: public class Employee { public virtual Int ID { get; set; } public virtual Int CompanyID { get; set; } public virtual string Name { get; set; } public virtual string CompanyName { get; set; } protected Employee() { } } here is my xml class <class name="Employee" table="Employee" lazy="true"> <id name="Id" type="Int32" column="Id"> <generator class="native" /> </id> <property name="CompanyID" column="CompanyID" type="Int32" not-null="false"/> <property name="Name" column="Name" type="String" length="100" not-null="false"/> What I need to add in xml class to map CompanyName in my result? here is my code... public ArrayList getTest() { ISession session = NHibernateHelper.GetCurrentSession(); string query = "select Employee.*,(Company.Name)CompanyName from Employee inner join Employee on Employee.CompanyID = Company.CompanyID"; ArrayList document = (ArrayList)session.CreateSQLQuery(query, "Employee", typeof(Document)).List(); return document; } but in the returned result, I am getting CompanyName is null is result set and other columns are fine. Note:In DB, tables don't physical relation Please suggest my solution ------ Thanks

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >