Daily Archives

Articles indexed Friday December 24 2010

Page 13/25 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Accessing MS Access database from C#

    - by Abilash
    I want to use MS Access as database for my C# windows form application.I have used OleDb driver for connecting MS Access. I am able to select the records from the MS Access using OleDbConnection and ExecuteReader.But I am un able to insert,update and delete records. My code is as follows: OleDbConnection con=new OleDbConnection(strCon); try { con.Open(); OleDbCommand com = new OleDbCommand("INSERT INTO DPMaster(DPID,DPName,ClientID,ClientName) VALUES('53','we','41','aw')", con); int a=com.ExecuteNonQuery(); //OleDbCommand com = new OleDbCommand("SELECT * FROM DPMaster", con); //OleDbDataReader dr = com.ExecuteReader(); //while (dr.Read()) //{ // MessageBox.Show(dr[2].ToString()); //} MessageBox.Show(a.ToString()); } catch { MessageBox.Show("cannot"); } If I execute the commented block the application works.But the insert block doesnt works.Why I am unable to insert/update/delete the records into database? My Connection String is as follows: string strCon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=xyz.mdb;Persist Security Info=True";

    Read the article

  • Separate one-off code paths

    - by DeadMG
    I'm implementing an application with different code paths that shall be chosen once at startup and then fixed forevermore for that execution- for example, choosing D3D11 or D3D9 rendering path. Obviously I don't want to duplicate all my other code. Is run-time inheritance (no virtual inheritance) a fair solution? I don't want to waste a bunch of performance making virtual lookups when the type was fixed long ago. Not just that, but it makes me nervous that the functions can't be inlined and whether or not it affects RVO and NRVO and such. Am I just being over-concerned about this?

    Read the article

  • nunit-console can not loacte fixture

    - by tguclu
    Hi I have 2.5.8 and VS2010 I want to run tests against a dll and if I type >nunit-console a.dll I also have these suites namespace LicMgmtLib.Tests { /// <summary> /// Contains the complete suite for LicMgmtLibTest project /// </summary> public class AllTests { [Suite] public static IEnumerable Suite { get { List<Type> suite = new List<Type>(); foreach (Type testCase in UnitTests.Suite) { suite.Add(testCase); } return suite; } } } } and namespace LicMgmtLib.Tests { /// <summary> /// Contains the unit test cases for LicMgmtLibTest project /// </summary> public class UnitTests { [Suite] public static IEnumerable Suite { get { List<Type> suite = new List<Type>(); suite.Add(typeof(LicenceManagerTests)); suite.Add(typeof(CertManagerTests)); return suite; } } } } If I would like to run tests using Suites I type nunit-console a.dll /fixture=AllTests.Suite but it fails with the message >Unable to locate fixture AllTests.Suite If you wonder why I use Suites ,I don't know. We are using MSBuild in our project and this is a requirement of MSBuild I guess. Any help appreciated Regards

    Read the article

  • Pythagoras triangle

    - by Gogolo
    I would like to ask you about this programing part, is it everything ok? the task was: Write the pseudocode or flow diagram and code for the theorem of Pythagoras - for right-angle triangle with three ribs (a, b, and c) of type integer int KendiA = 0; int KendiB = 0; int H = 0; string Trekendeshi = null; int gjetja = 0; for (KendiA = 1; KendiA <= 15; KendiA++) { for (KendiB = 1; KendiB <= 15; KendiB++) { for (H = 1; H <= 30; H++) { if ((Math.Pow(KendiA, 2) + Math.Pow(KendiB, 2) == Math.Pow(H, 2))) { gjetja = gjetja + 1; Trekendeshi = gjetja + "\t" + KendiA + "\t" + KendiB + "\t" + H; Console.WriteLine(Trekendeshi); } } } }

    Read the article

  • BUG - ProteaAudio with Lua does not work

    - by Stackfan
    Any idea why i cant use or cant build in Lua the ProTeaAudio ? 1) Exist [root@example ~]# yum install lua-devel Loaded plugins: presto, refresh-packagekit Setting up Install Process Package lua-devel-5.1.4-4.fc12.i686 already installed and latest version Nothing to do 2) get failed to build the RtAudio [sun@example proteaAudio_src_090204]$ make g++ -O2 -Wall -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__ -Irtaudio -Irtaudio/include -I../lua/src -I../archive/baseCode/include -c rtaudio/RtAudio.cpp -o rtaudio/RtAudio.o rtaudio/RtAudio.cpp:365: error: no ‘unsigned int RtApi::getStreamSampleRate()’ member function declared in class ‘RtApi’ rtaudio/RtAudio.cpp: In member function ‘virtual bool RtApiAlsa::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, RtAudioFormat, unsigned int*, RtAudio::StreamOptions*)’: rtaudio/RtAudio.cpp:5835: error: ‘RTAUDIO_SCHEDULE_REALTIME’ was not declared in this scope rtaudio/RtAudio.cpp:5837: error: ‘struct RtAudio::StreamOptions’ has no member named ‘priority’ make: *** [rtaudio/RtAudio.o] Error 1 [sun@example proteaAudio_src_090204]$ Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > require("proAudioRt"); stdin:1: module 'proAudioRt' not found: no field package.preload['proAudioRt'] no file './proAudioRt.lua' no file '/usr/share/lua/5.1/proAudioRt.lua' no file '/usr/share/lua/5.1/proAudioRt/init.lua' no file '/usr/lib/lua/5.1/proAudioRt.lua' no file '/usr/lib/lua/5.1/proAudioRt/init.lua' no file './proAudioRt.so' no file '/usr/lib/lua/5.1/proAudioRt.so' no file '/usr/lib/lua/5.1/loadall.so' stack traceback: [C]: in function 'require' stdin:1: in main chunk [C]: ?

    Read the article

  • JS/PHP: Who is responsible for generating the content?

    - by Extrakun
    Here's a situation which I have encountered, creating a form on the client side and using PHP to process. Here are some considerations The PHP script generates the form and send to the client side. This is because of internationalization issues The client side uses JavaScript to submit form; the ID of the form is hard-coded inside the JavaScript as it is generated by PHP. This means everytime the PHP code is updated, the JS must change. The question here is, who should be dependent on who? Should the JS generate the form instead, so that the PHP script has to know the names of the form elements? OR should it be the other way round?

    Read the article

  • Strange problem with Google App Engine Java Mail

    - by Velu
    Hi, I'm using the MailService feature of Google App Engine in my application. It works fine in one application without any issues. But the same code doesn't work in another app. I'm not able to figure it out. Please help. Following is the piece of code that I use to send mail. public static void sendHTMLEmail(String from, String fromName, String to, String toName, String subject, String body) { _logger.info("entering ..."); Properties props = new Properties(); Session session = Session.getDefaultInstance(props, null); _logger.info("got mail session ..."); String htmlBody = body; try { Message msg = new MimeMessage(session); _logger.info("created mimemessage ..."); msg.setFrom(new InternetAddress(from, fromName)); _logger.info("from is set ..."); msg.addRecipient(Message.RecipientType.TO, new InternetAddress( to, toName)); _logger.info("recipient is set ..."); msg.setSubject(subject); _logger.info("subject is set ..."); Multipart mp = new MimeMultipart(); MimeBodyPart htmlPart = new MimeBodyPart(); htmlPart.setContent(htmlBody, "text/html"); mp.addBodyPart(htmlPart); _logger.info("body part added ..."); msg.setContent(mp); _logger.info("content is set ..."); Transport.send(msg); _logger.info("email sent successfully."); } catch (AddressException e) { e.printStackTrace(); } catch (MessagingException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); System.err.println(e.getMessage()); } } When I look at the log (on the server admin console), it prints the statement "content is set ..." and after that there is nothing in the log. The mail is not sent. At times I get the following error after the above statement is printed (and the mail is not sent). com.google.appengine.repackaged.com.google.common.base.internal.Finalizer getInheritableThreadLocalsField: Couldn't access Thread.inheritableThreadLocals. Reference finalizer threads will inherit thread local values. But the mail quota usage keeps increasing. Remember, this works fine in one application, but not in other. I'm using the same set of email addresses in both the apps (for from and to). I'm really stuck with this. Appreciate any help. Thank you. Velu

    Read the article

  • Custom Glassfish Security Realm does not work (unable to find LoginModule)

    - by ifischer
    I'm trying to get a Custom Security Realm in Glassfish working (i tried 3.0.1 final and 3.1 B33). I read nearly all tutorials about this, but it doesn not work on my System. I'm getting the error Login failed: javax.security.auth.login.LoginException: unable to find LoginModule class: de.company.security.utility.CustomLoginModule when trying to login. Here is what i did: I created a little Maven project, which contains the needed Realm class, CustomRealm, and the corresponding LoginModule, CustomLoginModule. My pom.xml: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany</groupId> <artifactId>CustomJDBCRealm</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>Custom JDBCRealm</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>org.glassfish.security</groupId> <artifactId>security</artifactId> <version>3.1-b33</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> <optimise>true</optimise> <debug>true</debug> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build> </project> My Custom Realm class: package de.company.security.utility; import com.sun.appserv.security.AppservRealm; import com.sun.enterprise.security.auth.realm.BadRealmException; import com.sun.enterprise.security.auth.realm.InvalidOperationException; import com.sun.enterprise.security.auth.realm.NoSuchRealmException; import com.sun.enterprise.security.auth.realm.NoSuchUserException; import java.util.Enumeration; import java.util.Properties; import java.util.Vector; /** * * @author ifischer */ public class CustomRealm extends AppservRealm { Vector<String> groups = new Vector<String>(); private String jaasCtxName; private String startWith; @Override public void init(Properties properties) throws BadRealmException, NoSuchRealmException { jaasCtxName = properties.getProperty("jaas-context", "customRealm"); startWith = properties.getProperty("startWith", "z"); groups.add("dummy"); } @Override public String getAuthType() { return "Custom Realm"; } public String[] authenticate(String username, char[] password) { // if (isValidLogin(username, password)) return (String[]) groups.toArray(); } @Override public Enumeration getGroupNames(String username) throws InvalidOperationException, NoSuchUserException { return groups.elements(); } @Override public String getJAASContext() { return jaasCtxName; } public String getStartWith() { return startWith; } } My LoginModule class: /* * Copyright (c) 2010 ProfitBricks GmbH. All Rights Reserved. */ package de.company.security.utility; import com.sun.appserv.security.AppservPasswordLoginModule; import com.sun.enterprise.security.auth.login.common.LoginException; import java.util.Set; import org.glassfish.security.common.PrincipalImpl; /** * * @author ifischer */ public class CustomLoginModule extends AppservPasswordLoginModule { @Override protected void authenticateUser() throws LoginException { _logger.info("CustomRealm : authenticateUser for " + _username); final CustomRealm realm = (CustomRealm)_currentRealm; if ( (_username == null) || (_username.length() == 0) || !_username.startsWith(realm.getStartWith())) throw new LoginException("Invalid credentials"); String[] grpList = realm.authenticate(_username, getPasswordChar()); if (grpList == null) { throw new LoginException("User not in groups"); } _logger.info("CustomRealm : authenticateUser for " + _username); Set principals = _subject.getPrincipals(); principals.add(new PrincipalImpl(_username)); this.commitUserAuthentication(grpList); } } I compiled this Maven project and copyied the resulting JAR-file to the Glassfish/lib directory. Then i added the Security Realm "customRealm" to my Glassfish with asadmin: asadmin create-auth-realm --classname de.company.security.utility.CustomRealm --property jaas-context=customRealm:startWith=a customRealm I even referenced the LoginModule class for the JAAS context of my Custom Realm, therefore i inserted this into the login.conf of my domain: customRealm { de.company.security.utility.CustomLoginModule required; }; Although this LoginModule SHOULD BE on the Glassfish classpath, as it's classfiled is packaged in the JAR that i put into the Glassfish/lib-dir, it cannot be found when i try to login. For login, i build a really simple JSF-project, which calls the HttpServletRequest-login-method of Servlet 3.0. When trying to login i'm getting the following Exception: 2010-12-24T14:41:31.613+0100|WARNING|glassfish3.0.1| javax.enterprise.system.container.web.com.sun.web.security|_ThreadID=25; _ThreadName=Thread-1;|Web login failed: Login failed: javax.security.auth.login.LoginException: unable to find LoginModule class: de.company.security.utility.CustomLoginModule Anybody got an idea what i can do that Glassfish loads the LoginModule-class?

    Read the article

  • How does the increment operator (++) work on DateTime in C#

    - by sohtimsso1970
    What happens if you use the increment operator (++) on a DateTime type in C#? For instance, if I did this: DateTime blah = new DateTime(2010, 12, 24); blah++; What does blah become? Does that increment by a tick or a day? Or is that even legal? I don't have a dev environment around, and won't for a few days, or I would just try it and find out. I was too curious to wait so I figured I'd ask the community.

    Read the article

  • Unit testing a method with many possible outcomes

    - by Cthulhu
    I've built a simple~ish method that constructs an URL out of approximately 5 parts: base address, port, path, 'action', and a set of parameters. Out of these, only the address part is mandatory, the other parts are all optional. A valid URL has to come out of the method for each permutation of input parameters, such as: address address port address port path address path address action address path action address port action address port path action address action params address path action params address port action params address port path action params andsoforth. The basic approach for this is to write one unit test for each of these possible outcomes, each unit test passing the address and any of the optional parameters to the method, and testing the outcome against the expected output. However, I wonder, is there a Better (tm) way to handle a case like this? Are there any (good) unit test patterns for this? (rant) I only now realize that I've learned to write unit tests a few years ago, but never really (feel like) I've advanced in the area, and that every unit test is a repeat of building parameters, expected outcome, filling mock objects, calling a method and testing the outcome against the expected outcome. I'm pretty sure this is the way to go in unit testing, but it gets kinda tedious, yanno. Advice on that matter is always welcome. (/rant) (note) christmas weekend approaching, probably won't reply to suggestions until next week. (/note)

    Read the article

  • Application logic for invoicing and subscriptions?

    - by Industrial
    Hi everyone, We're just in the planning stage of a web app that offers subscriptions to our customers. The subscription periods varies and can be prolonged indefinitely by our customers, but are always at least one month (30 days). When a customer signs up, the customer information (billing address, phone number and so on) are stored in a customers table and a subscription is created in the subscriptions table: id | start_date | end_date | customer_id -------------------------------------------------------- 1 | 2010-12-31 | 2011-01-31 | 1 Every month we'll loop through the subscriptions table (cronjob preferably) and create invoices for the past subscription period, which are housed in their own table - invoices. Depending on the customer, invoices are manually printed out and sent by mail, or just emailed to the customer. Due to the nature of our customers and the product, we need to offer a variety of different payment alternatives including wire transfer and card payments, hence some invoices may need to be manually handled and registered as paid by our staff. The 15th every month, the invoices table are looped through and if no payment has been marked for the actual invoice, the according subscription will be removed. If there's a payment registered, the end_date in the subscriptions table is incremented by another 30 days (or what now our period our customer has chosen). Are we looking at headaches by incrementing dates forwards and backwards to handle non-paying customers and extending subscriptions? Would it be a better idea to add new subscriptions as customers extends their subscription?

    Read the article

  • ASP.NET - Update Dataset directly to DB

    - by karthik
    Hi, Description: I wanted to update dataset to database in Asp.NET. Instead of retrieving the entire table, I am retrieving only one record using the following statement :- select * from Products where ProductID=3 Now I wanted to update dataset directly in to DB by using following statements (DAP 4.1) db.UpdateDataSet(ds, ds.Tables[0].TableName, null, cmdupdate, null, UpdateBehavior.Standard); Questions Can I Retrieve only one row from DB while a lot of other records are there and update back using Adapter update? ( In other words, I am not selecting all records from table) I am using Data Application Block 4.1? It will work there right? If anyone can give example for update will be great ( with Procedures). Thanks Ka

    Read the article

  • online payment process in radio button

    - by keils
    hi guys im developing in my own website.every thing works fine.i want to know if i clicks the any one of the radio button that value change correspondingly.can any one please post some code i tried this below code. my website is http:spsmobile.co.uk just check the link in this page u just go to phone unlock and click make payment you will see the radio button named pay delivery methods thanks in adv var total = parseInt($("div.total-text").text().substring(1), 10); $("input[name='rmr']").bind('change', function () { var amount = 0; switch (this.value) { case "1": amount = 3; break; case "2": amount = 5.5; break; case "4": amount = 10; break; } $("div.total-text").text("£" + (total + amount)); }); }); $(document).ready(function () { $('#primary').bind('change', function () { $.ajax({ type: "POST", url: "include/unlock_function.php", data: $(this).is(':checked'), success: function (theresponse) {} } } }; } }:

    Read the article

  • Error: 'Sys' is undefined

    - by thegunner
    Hi, When I moved my website over to another server I've noticed now that ajax doesn't appear to be working. When I remote desktop to the server and go to the url on the server i.e. http://myserver/mywebsite ... everything works ok. When I open up the website in visual studio on the server it works as no problem as well. It's only when I connect remotely that the 'javascript' error occurs. To my web.config I've added: <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </httpModules> I've tried <compilation debug="false"/> and tried emptying web history and still no luck. Any ideas?

    Read the article

  • ApnsPHP in server mode (ApnsPHP_Push_Server)

    - by Kukosk
    Hi, Im using ApnsPHP for push notifications on my server, but it's a little bit slow when you have to send a lot of notifications, so i decided to Run it in the server mode. I just want it to run in cron every 1 hour, check if there are some notifications to be sent, and if yes, run it in 5 processes to be faster. I'm sending updates to my users once a day depending on the timezone they set. So i have to run it every hour, and send messages to timezones that actually have 12:00 PM. Is there any way to do this? I know there is a demonstration but i just have no clue about how to do it. A simple sample will really help. Thank you millions!!

    Read the article

  • write cache and write sequence order

    - by excanoe
    ok, here i have some weird question: let say we have some binary file (.log), and sequence of write operations, for example log1, log2, log3 and each has some block size n (raw data). question: can I be sure that log1,log2 and log3 sequences can be written in the correct order in ONE file, even if i have few cache levels (disk hardware and os level)? update very interested in what will be with records order (not with records) if we have software or hardware failure (reboot or another reason). update there can be some percent of write failures, but main question is: will write order stay correct?

    Read the article

  • InstallExecuteSequence cache interferes with custom action operation

    - by Dima G
    I need to upgrade a product that could be installed in per-user context to a new version that is always in per-machine context. The requirements are: Whether the old version was installed in a Per-User (no matter who) or Per-Machine context should be completely seamless to an administrator user that performs the upgrade. The MSI upgrade should succeed without the need to know the password of the user that originally installed the previous version of the product in a Per-User context. The installation should be performed from a single .msi file (no setup.exe is allowed). The installation should be able to run in a silent (non-UI) mode. No reboots are allowed during installation. My strategy is to find in the beginning of the installation whether the product is already installed in per-user context, and if so, to transform the registry keys manually to Per-Machine context (I checked: no additional changes such as file system changes etc. are needed except this transform). I figured out how to move all appropriate keys in the registry from the user settings to the machine settings (pre-loaded appropriate user hive in case it didn't appear in HKEY_USERS) and created custom action that does it - and it does work when I run it as a stand-alone executable before running the MSI. The problem, however, is that when Windows Installer runs InstallExecuteSequence it first creates a 'cached product context' for all products. So when my custom action runs in the course of InstallExecuteSequence, this cache has already been created. Thus FindRelatedProducts action that determines if older product with same upgrade code exists looks on that cache and ignores the changes that my custom action applied. If before running the MSI the previous product was in per-user context, FindRelatedProducts will look at the cache and not apply the upgrade and remove the previous version, because the new product is in per-machine context, even though the previous product version is already configured to per-machine context in the registry by that time by my custom action. What can be done to solve this problem without violating the requirements stated above?

    Read the article

  • SharePoint 2010 and Windows Server Backup

    - by Enrique Lima
    A couple of months ago, a friend found a bit of information on TechNet that has proven to be quite useful. See, I am of the opinion SharePoint allows for smaller deployments to be made, and with that said, I am talking about SharePoint Foundation 2010 being used for the most part. But truly the point here is not to discuss whether or not a deployment of SharePoint Foundation 2010 or SharePoint Server 2010 is right or not.  The fact is they do take place and happen.  And information will reside there. Now, the point of this post is to raise awareness on options available for companies that have implemented it and maybe are a bit “iffy” on how to protect the information being placed in libraries and lists.  In many cases I have found SharePoint comes first and business continuity becomes an afterthought.  The documentation piece from TechNet states: “You can register SharePoint Server 2010 with Windows Server Backup by using the stsadm.exe -o -registerwsswriter operation to configure the Volume Shadow Copy Service (VSS) writer for SharePoint Server. Windows Server Backup then includes SharePoint Server 2010 in server-wide backups. When you restore from a Windows Server backup, you can select Microsoft SharePoint Foundation (no matter which version of SharePoint 2010 Products is installed), and all components reported by the VSS writer forSharePoint Server 2010 on that server at the time of the backup will be restored. Windows Server Backup is recommended only for use with for single-server deployments.” Even in the event of single-server deployments you will have options to safeguard your data. The process will require that after you have executed the stsadm command above, you will then use Windows Server Backup to do a Full Server Backup.  Then when the restore operation is needed you will be able to select specifically the section that has the SharePoint technologies backup. The restore process: Hope you find this to be a helpful post.  I have found this to be specially handy in SharePoint deployments that are part of a Team Foundation Server deployment and that are isolated from any other SharePoint farm and such.   Credits:  Sean McDonough for passing along the information available on TechNet.

    Read the article

  • Get user profile size in vbscript

    - by Cameron
    Hello, I am trying to get the size of a user's local profile using VBScript. I know the directory of the profile (typically "C:\Users\blah"). The following code does not work for most profiles (Permission Denied error 800A0046): Dim folder Dim fso Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set folder = fso.GetFolder("C:\Users\blah") MsgBox folder.Size ' Error occurs here Is there another way to do this? UPDATE: I did some deeper digging and it turns out that the Permission Denied error occurs if permission is denied to some subfolders or files of the directory whose size I wish to get. In the case of user profiles, there's always a few system files that even the Administrator group does not have permission to access. To get around this, I wrote a function that tries to get the folder size the normal way (above), then, if the error occurs, it recurses into the subdirectories of the folder, ignoring folder sizes that are permission denied (but not the rest of the folders). Dim fso Set fso = WScript.CreateObject("Scripting.FileSystemObject") Function getFolderSize(folderName) On Error Resume Next Dim folder Dim subfolder Dim size Dim hasSubfolders size = 0 hasSubfolders = False Set folder = fso.GetFolder(folderName) ' Try the non-recursive way first (potentially faster?) Err.Clear size = folder.Size If Err.Number <> 0 then ' Did not work; do recursive way: For Each subfolder in folder.SubFolders size = size + getFolderSize(subfolder.Path) hasSubfolders = True Next If not hasSubfolders then size = folder.Size End If End If getFolderSize = size Set folder = Nothing ' Just in case End Function

    Read the article

  • Migrating a running production server to Xen, unmodified as a second HDD?

    - by DaveCol
    I have a production server which I am looking to virtualize via XEN. For this purpose I have purchased a new Sata HDD, in which I have promptly installed CentOS 5.5 x64 with XEN server installed. Now I have two HDD: /dev/sda1 running as host with Xen Server Installed; and /dev/sda2 which is the HDD where the original server has installed. Is it posible to use /dev/sda2 to work as GuestOS in a xen server? Would I have to modify its kernel? Thank you for any input

    Read the article

  • please demystify the 10Gb ethernet interfaces, cables

    - by maruti
    this really is a Dell question but tempted to ask the experts @ serverfault. choosen a Dell powerconnect 8024 10GbE switch. per the spec sheet this has 10GbaseT ports. "24x 10GBASE-T (10Gb/1Gb/100Mb) with 4x Combo Ports of SFP+ (10Gb/1Gb) or 10GBASE-T" the HBA on my storage server has 10G CX4 copper ports Dell does not sell any cables and this adds to my confusion. from the picture Dell 8024 seems to have RJ-45 type ports on the front panel? my question: is it a RJ-45 + CX4 cable or CX4 + CX4 cable?

    Read the article

  • Any hardware/software routers that support Full Cone NAT?

    - by Ian Boyd
    i'm trying to get Teredo to function on my machine. Most routers, it seems, refuse to forward packets from any host other than the one i specifically connected to first. Teredo requires full Cone NAT in order to function. Does any router, hardware or software, allow full cone NAT? Is this an oversight by the designers of Teredo that nobody, in practice, can use it? i've tried m0n0wall pfsense D-Link Linksys SMC

    Read the article

  • User and Key Press Issues with Putty

    - by DizzyDoo
    Ubuntu Server newbie here, got some annoying issues with remote accessing my box with Putty. When I create a user and then login as that user, the terminal always starts with just '#' and not 'user@hostname:~#' which isn't useful where I want to see where I've changed directory too, like I can normally. Also, when logged in as a user, I can't press the cursor keys to move the caret (blinking thing) around, or press up to see previously executed commands. Instead it gives me this representation of the button pressed: ^[[D ^[[A ^[[B ^[[C. Pressing Delete, too, gives me ^[[3~. This is all strange to me, because when logged in as root, it all works fine. I'm hoping this is just something I've accidentally changed in Putty, or added the user wrongly, or perhaps just got caps lock on. Thanks.

    Read the article

  • Fixing a typo in machine name

    - by justSteve
    When i installed windows i had a typo in the machine name that i corrected from the system's 'Computer Name/Domain Changes' - the workstation is a member of a workgroup not a domain. From everything i can see the renamed machine name is correct. Shift gears.... I'm importing SQL logins from my remote server to this, my development workstation and have used the script presented here - a script that generates a CREATE statement for each login found. While I was preparing to run this script's output (from the remote box) i needed to change the domain name from the remote to my local's name - so i ran the same script locally (in order to see what SQL things my domain name is. SQL has the original machine name - the one with the typo. However, the scripts are tossing errors if i try to create logins with that identifier. CREATE LOGIN [Setve\Admin] FROM WINDOWS WITH DEFAULT_DATABASE = [master] But works correctly if i use the updated machine name: CREATE LOGIN [Steve\Admin] FROM WINDOWS WITH DEFAULT_DATABASE = [master] So the problem is: do i have a problem i need to solve? Somewhere, deep in the guts of SQL Server, it has record of a Domain name that does not exist. Should i find and fix that discrepancy? thx

    Read the article

  • Will not POST with a USB mouse or keyboard plugged in

    - by Thomas O
    I have an Abit KN9 motherboard, and a USB keyboard and mouse. The computer will not POST with the keyboard or mouse plugged in, but they can be used (and they are fully functional) if you plug them in later, after POST. On the POST side of things, it hangs when it shows the installed processor, and goes no further - pressing DEL to go to setup will not work. I've tried disabling legacy USB support as recommended, but can't find the option anywhere in the BIOS.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >