Search Results

Search found 1898 results on 76 pages for 'dd dent'.

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

  • Problem with running a script at startup as root?

    - by Usman Ajmal
    Hi The main question: Is there a way I can run 'completely' one of my script when ubuntu's desktop appears no matter if root , administrator, desktop user or an unprivileged user logged in? What does the script do? The script mounts a partition, looks for a file in that partition and finally on the basis of that file a decision of copying a partition to another partition is made. That copying is done via dd if=/dev/sda2 of=/dev/sda5 When does the script run finely? Script runs smoothly when I run it from the terminal by sudo ./my_copying_script This command asks me for the password of currently logged in user. I enter the password and the script starts working. When does the script NOT run finely? I want to run the script at startup. I set it a startup program by using the Startup Applications utility of Ubuntu. Script ran at startup but exited at the dd command returing following error: dd: opening '/dev/sda2': Permission denied On edk's suggestion I set the owner of my_copying_script as root and set the SUID. Now the permissions of my_copying_script are (-rwsr-sr-x). edk's point of view was that once I set the suid, the startup program will run with the permissions of its owner. I did that but the same /dev/sda2 permission denied error came up. I then prefixed the dd with sudo as mentioned below sudo dd if=/dev/sda2 of=/dev/sda5 but this returned following error: sudo: no tty present and no askpass program specified In other words the mounting failed. If I run the script using sudo ./myProgram i don't face this problem and the drive gets mounted successfully.

    Read the article

  • Rescue system running TFS that BSODs, into vmware esxi

    - by 3molo
    Hi, After moving to new facilities, one of our old Dell servers running Windows Server 2003 R2 on PowerEdge 2650 HW BSODs with 0x8e. The server runs Team Foundation Server, so we have a few guys dependent on it. No one here knows TFS, so we have no idea how difficult it would be to setup from scratch. We have the MSSQL database(s) backed up, recent and fresh copy. Tried removing/refitting memory modules, but with no success. The system boots into safe mode but hangs occasionally. I booted a linux livecd and did a dd of both c: and d:, so I have all the data in compressed images on a vmware machine. For the guest, I created a 38G (actually it became 40GB) partition to act as C:, and booted a live cd. I then uncompressed the compressed disk image of c: and dd'd it to the new c: using 'gunzip -dc c.img.gz | dd of=/dev/sda1 bs=1M'. The operation ran for about 1000 seconds, and completed successfully. I assumed it would at least try to boot windows (but most likely BSOD due to not having correct drivers), but the Vmware ESXi guest does not seem to recognize it as a bootable disk. We don't have the vmware enterprise license, so the vmware converter cold cloning is not an option. Did I do something wrong in my dd's etc with the ISOs, or why would it not (try to) boot? Am I wasting my time? What other approach is there? Will continue to try to remove services and drivers to make the physical machine at least work reasonably well in safe mode. What do you suggest? 1. Continue to get the dd'd images to the virtual disk and get it to boot. 2. Install a new windows server, get team foundation server and restore from backup. 3. Focus on the old problematic hardware Any help appreciated

    Read the article

  • Encrypting a non-linux partition with LUKS.

    - by linuxn00b
    I have a non-Linux partition I want to encrypt with LUKS. The goal is to be able to store it by itself on a device without Linux and access it from the device when needed with an Ubuntu Live CD. I know LUKS can't encrypt partitions in place, so I created another, unformatted partition of the EXACT same size (using GParted's "Round to MiB" option) and ran this command: sudo cryptsetup luksFormat /dev/xxx Where xxx is the partition's device name. Then I typed in my new passphrase and confirmed it. Oddly, the command exited immediately after, so I guess it doesn't encrypt the entire partition right away? Anyway, then I ran this command: sudo cryptsetup luksOpen /dev/xxx xxx Then I tried copying the contents of the existing partition (call it yyy) to the encrypted one like this: sudo dd if=/dev/yyy of=/dev/mapper/xxx bs=1MB and it ran for a while, but exited with this: dd: writing `/dev/mapper/xxx': No space left on device just before writing the last MB. I take this to mean the contents of yyy was truncated when it was copied to xxx, because I have dd'd it before, and whenever I have dd'd to a partition of the exact same size, I never get that error. (and fdisk reports they are the same size in blocks). After a little Googling I discovered all luksFormat'ted partitions have a custom header followed by the encrypted contents. So it appears I need to create a partition exactly the size of the old one + however many bytes a LUKS header is. What size should the destination partition be, no. 1, and no. 2, am I even on the right track here? UPDATE I found this in the LUKS FAQ: I think this is overly complicated. Is there an alternative? Yes, you can use plain dm-crypt. It does not allow multiple passphrases, but on the plus side, it has zero on disk description and if you overwrite some part of a plain dm-crypt partition, exactly the overwritten parts are lost (rounded up to sector borders). So perhaps I shouldn't be using LUKS at all?

    Read the article

  • Performance Overhead of Encrypted /home

    - by SabreWolfy
    I have a netbook with Windows on the second partition and Xubuntu (/ and /home) on the third partition. I selected to encrypt my home folder during installation. The performance of the netbook is adequate for the small machine that it is, but I'm looking to improve performance. I could not find much information about the overhead (CPU or drive) associated with home partition encryption. I ran the following, writing to my home partition as well as the the mounted Windows partition: dd if=/dev/zero of=~/dummy bs=512 count=10240 dd if=/dev/zero of=/media/Windows/dummy bs=512 count=10240 The first returned 2.4MB/s and the second returned 2.5MB/s. Can I therefore deduce that there is very little overhead to home folder encryption? I'm not sure if the different filesystems will make any difference (/ and /home are ext3). Update 1 I don't know why I didn't use /tmp instead of the mounted Windows folder. Only /home is encrypted, so /tmp is unencrypted ext3. The results of the dd as above are astounding: ~: 2.4 MB/s /tmp: 42.6 MB/s Comments please? The reason I am asking this is that disk access on the netbook is noticeably slow. Update 2 I timed each of the dd operations with time: ~: real 0m2.217s user 0m0.028s sys 0m2.176s /tmp: real 0m0.152s user 0m0.012s sys 0m0.136s See also: discussion on UbuntuForums.org and bug report Edit: Output of mount: /dev/sda3 on / type ext3 (rw,noatime,errors=remount-ro,user_xattr,commit=600) proc on /proc type proc (rw,noexec,nosuid,nodev) none on /sys type sysfs (rw,noexec,nosuid,nodev) fusectl on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) none on /dev type devtmpfs (rw,mode=0755) none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) none on /dev/shm type tmpfs (rw,nosuid,nodev) none on /var/run type tmpfs (rw,nosuid,mode=0755) none on /var/lock type tmpfs (rw,noexec,nosuid,nodev) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) gvfs-fuse-daemon on /home/USER/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=USER) `

    Read the article

  • Logic that can traverse all possible layouts, but not checking every combination of identical pieces?

    - by George Bailey
    Suppose we have a grid of arbitrary size, which is filled by blocks of various widths and heights. There are many 2x2 blocks (meaning they take a total of 4 cells in the grid) and many 3x3 blocks, as well as some 5x4, 4x5, 2x3, etc. I was hoping I could set up a program that would look at all possible layouts, and rank them, and find the best one. Simply it would look at all possible positions of these blocks, and see what setup is the best rank. (the rank based on how many of these can be connected by a roadway system of 1x1 road blocks, and how many squares can be left empty after this is done. - wanting to fit the most blocks as possible with the least roads.) My question, is how should I traverse all the possibilities? I could take all the blocks and try them one at a time, but since all 2x2 blocks are equal, and there are a couple dozen of them, there is no point in trying every combination there, as in the following AA BBB AA BBB CCBBB CCEEE DD EEE DD EEE is exactly the same as CC EEE CC EEE AAEEE AABBB DD BBB DD BBB You notice that there are 2 3x3 blocks and 3 2x2 blocks in my two examples. Based on the model I have now, the computer would try both of these combinations, as well as many others. The problem is that it is going to try every single possible variation of my couple dozen 2x2 blocks. And that is sorely inefficient. Is there a reasonable way to take out this duplicated work, somehow getting the computer program to treat all 2x2 blocks as equal/identical, instead of one requiring rearranging/swapping of these identical blocks? Can this be done?

    Read the article

  • Setting date from selectInputDate to object

    - by DD
    I have a date controller which does various things. Once a calendar date is set, I want to pass the value from the date controller to another bean. The problem I have is that the setPropertyActionListener gets called before the user clicks on a date. Is there a way to get the date from the selectInputDate after selection and pass to a bean? This is what I tried: <ice:selectInputDate popupDateFormat="dd-MMM-yyyy" renderAsPopup="true" value="#{dateRangeDateContoller.end}" > <f:setPropertyActionListener target="#{searchParameters.endDate}" value="#{dateRangeDateContoller.end}" /> </ice:selectInputDate>

    Read the article

  • Java simple data format british time

    - by DD
    Hi, I am using simple date format to allow users to specify which time zone they are sending data in: DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,z"); This works fine: e.g. df.parse("2009-05-16 11:07:41,GMT"); However, if someone is always sending time in London time (i.e. taking into account daylight savings), what would be the approriate time zone String to add? e.g. this doesnt work: df.parse("2009-05-16 11:07:41,Europe/London"); Thanks.

    Read the article

  • wakeonlan from remote host

    - by takeshin
    I have setup wake on lan service on my server. Everything works fine on local area network: root@server$: poweroff user@local$ wakeonlan AA:BB:CC:DD:EE:FF and the server wakes up. AA:BB:CC:DD:EE:FF is a MAC address of my server, which has IP 192.168.1.2 and hostname: example.com. It is connected to the router, which has IP 192.168.1.1 (public: xxx.xxx.xxx.xxx) When the server is up, I can ping: ping example.com or login via ssh: ssh [email protected] So far, so good. Now I'm able to wake the server up from local area, but how to wake the server from the remote location? I tried: user@local$ wakeonlan -i xxx.xxx.xxx.xxx AA:BB:CC:DD:EE:FF, but it does not work (nothing happens;). Do I have to configure my router somehow to forward magic packets? How?

    Read the article

  • Blend "Window is not supported in a WPF Project"

    - by Andy Dent
    I am having a frustrating time with Blend reporting "Window is not supported in a Windows Presentation Foundation (WPF) project." due to unbuildable configurations but can't quite work out how to mangle my way out of it. I've worked out it is probably due to my trying to have a single solution with x86 and x64 configurations. There is no way to tell Blend 2 which is the active Solution Configuration and active Solution Platform. I think it's a bit of a weakness in the configuration system, or maybe the way I've set things up, but I have Debug64 and Debug solution configurations one of each is used with the platform x86 and x64. I also think it's a simple sorting problem - x64 comes before x86 and Debug comes before Debug64 so Blend ends up with an unbuildable config of Debug with x64. When I choose the combination of Debug and x64 in VS, its XAML editor can't load either. The solution is a moderately complex one - there's a pure Win32 DLL, C++/CLI Model project and two other WPF assemblies used by the main WPF project. UPDATE I have ripped all the x64 config out of my solution and rebuilt everything with no effect. I then uninstalled Blend 2 and installed Blend 3 - it doesn't like things either. The Visual Studio XAML editor is still very happy as is the program building and running. (echoes of strangled scream of frustration from oz)

    Read the article

  • Is NUnit broken with Windows7 for C++/CLI?

    - by Andy Dent
    NUnit is failing in C++/CLI with a System.IO.FileNotFoundException. I have tried my own freshly-created project, the C++/CLI sample included with NUnit and the one from CodeProject How to use NUnit to test native C++ code using Visual Studio 2008sp1 with NUnit 2.5.5 as well as 2.4.8. I installed 2.4.8 just on C:\ in case there was something weird about paths with spaces such as Program Files (x86). I have no problems with a C# sample using NUnit. in NUnit GUI, all of these C++/CLI projects encounter the same problem, on attempting to open the projects. I'd really like to use NUnit but for now have had to go back to standard Microsoft tests System.IO.FileNotFoundException... Server stack trace: at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path) at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites) at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites) at NUnit.Core.TestSuiteBuilder.BuildSingleAssembly(TestPackage package) at NUnit.Core.TestSuiteBuilder.Build(TestPackage package) at NUnit.Core.SimpleTestRunner.Load(TestPackage package) at NUnit.Core.ProxyTestRunner.Load(TestPackage package) at NUnit.Core.ProxyTestRunner.Load(TestPackage package) at NUnit.Core.RemoteTestRunner.Load(TestPackage package) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at NUnit.Core.TestRunner.Load(TestPackage package) at NUnit.Util.TestDomain.Load(TestPackage package) at NUnit.Util.TestLoader.LoadTest(String testName)

    Read the article

  • Zend Date -- day difference

    - by Nisanth
    Hi All, I have the below line of codes $day1 = new Zend_Date('2010-03-01', 'YYYY-mm-dd'); $day2 = new Zend_Date('2010-03-05', 'YYYY-mm-dd'); $dateDiff = $day2->getDate()->get(Zend_Date::TIMESTAMP) - $day1->getDate()->get(Zend_Date::TIMESTAMP); $days = floor((($dateDiff / 60) / 60) / 24); return $days; this will return 4 But if gave $day1 = new Zend_Date('2010-02-28', 'YYYY-mm-dd'); $day2 = new Zend_Date('2010-03-01', 'YYYY-mm-dd'); $dateDiff = $day2->getDate()->get(Zend_Date::TIMESTAMP) - $day1->getDate()->get(Zend_Date::TIMESTAMP); $days = floor((($dateDiff / 60) / 60) / 24); return $days; it will return -27 .. how will i get right answer

    Read the article

  • DBD::Oracle and utf8

    - by golemwashere
    Hello, I have some troubles inserting an UTF8 string into an oracle 10 database on Solaris, using the latest DBD::Oracle on perl v5.8.4. This are my DB settings > --------SELECT * from NLS_DATABASE_PARAMETERS------------------------------- > NLS_NCHAR_CHARACTERSET AL16UTF16 > NLS_LANGUAGE AMERICAN > NLS_TERRITORY AMERICA NLS_CURRENCY $ > NLS_ISO_CURRENCY AMERICA > NLS_NUMERIC_CHARACTERS ., > NLS_CHARACTERSET UTF8 > NLS_CALENDAR GREGORIAN > NLS_DATE_FORMAT DD-MON-RR > NLS_DATE_LANGUAGE AMERICAN > NLS_SORT BINARY > NLS_TIME_FORMAT HH.MI.SSXFF AM > NLS_TIMESTAMP_FORMAT DD-MON-RR > HH.MI.SSXFF AM > NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR > NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR > HH.MI.SSXFF AM TZR NLS_DUAL_CURRENCY $ > NLS_COMP BINARY > NLS_LENGTH_SEMANTICS CHAR > NLS_NCHAR_CONV_EXCP FALSE > NLS_RDBMS_VERSION 10.2.0.4.0 > -------------------------------------------------------------------------- This are my perl $dbh-ora_nls_parameters() $VAR1 = { 'NLS_LANGUAGE' => 'AMERICAN', 'NLS_TIME_TZ_FORMAT' => 'HH.MI.SSXFF AM TZR', 'NLS_SORT' => 'BINARY', 'NLS_NUMERIC_CHARACTERS' => '.,', 'NLS_TIME_FORMAT' => 'HH.MI.SSXFF AM', 'NLS_ISO_CURRENCY' => 'AMERICA', 'NLS_COMP' => 'BINARY', 'NLS_CALENDAR' => 'GREGORIAN', 'NLS_DATE_FORMAT' => 'DD-MON-RR', 'NLS_DATE_LANGUAGE' => 'AMERICAN', 'NLS_TIMESTAMP_FORMAT' => 'DD-MON-RR HH.MI.SSXFF AM', 'NLS_TERRITORY' => 'AMERICA', 'NLS_LENGTH_SEMANTICS' => 'CHAR', 'NLS_NCHAR_CHARACTERSET' => 'AL16UTF16', 'NLS_DUAL_CURRENCY' => '$', 'NLS_TIMESTAMP_TZ_FORMAT' => 'DD-MON-RR HH.MI.SSXFF AM TZR', 'NLS_NCHAR_CONV_EXCP' => 'FALSE', 'NLS_CHARACTERSET' => 'UTF8', 'NLS_CURRENCY' => '$' }; In my script I have: use utf-8; $ENV{NLS_LANG}='AMERICAN_AMERICA.UTF8'; .. $sth->bind_param(5, $myclobfield, {ora_type => ORA_CLOB, ora_csform => SQLCS_NCHAR}); .. The string prints out 1 on print Encode::is_utf8($myclobfield); But characters like òàè are not correctly inserted into the DB. (I tested with a utf8 compliant client that can correctly insert and read them) Can anyone suggest the best way to do it? Thanks

    Read the article

  • SSRS - Oracle DB, Passing Date parameter

    - by davidl98
    Using SSRS with an Oracle Database. I need to prompt the user when running the report to enter a date for report. What is the best way to add in the parameter in my SSRS Report. Having problem finding the right date format. under the "Report Parameter" menu, I have setup the Report Parameters using the DateTime Datatype. Keep getting this error "ORA-01843: Not a Valid Month" Thank you for your help. Select a.OPR_Name, a.OPR, a.Trans_Desc, a.Trans_Start_Date, Cast(a.S_Date as date) as S_Date, Sum(a.Duration) as T From ( Select US_F.OPR_Name, ITH_F.OPR, ITH_F.ITH_RID, ITH_F.TRANSACT, Transact.DESC_1 as Trans_Desc, To_CHAR(ITH_F.Start_Time,'DD-Mon-YY') as Trans_Start_Date, To_CHAR(ITH_F.Start_Time,'MM/DD/YYYY') as S_Date, Substr(To_CHAR(ITH_F.Start_Time,'HH24:MI'),1,6) as Start_Time, To_CHAR(ITH_F.End_Time,'DD-Mon-YY') as Trans_End_Date, Substr(To_CHAR(ITH_F.End_Time,'HH24:MI'),1,6) as End_Time, Cast(Case When To_CHAR(ITH_F.Start_Time,'DD-Mon-YY') = To_CHAR(ITH_F.End_Time,'DD-Mon-YY') Then (((To_CHAR(ITH_F.End_Time,'SSSSS') - To_CHAR(ITH_F.Start_Time,'SSSSS')) / 60))/60 Else ((86399 - (To_CHAR(ITH_F.Start_Time,'SSSSS')) + To_CHAR(ITH_F.End_Time,'SSSSS'))/60)/60 End as Decimal(3,1)) as Duration from Elite_76_W1.ITH_F Left Join Elite_76_W1.Transact on Transact.Transact = ITH_F.Transact Left Join Elite_76_W1.US_F on US_F.OPR = ITH_F.OPR Where ITH_F.TRANSACT not in ('ASN','QC','LGOT') ) a Where a.S_Date = @Event_Date Having Sum(a.Duration) < 0 Group By a.OPR_Name, a.OPR, a.Trans_Desc, a.Trans_Start_Date, a.S_Date Order by a.OPR_Name

    Read the article

  • Yii: Saving date and time in DB

    - by FaisalKhan
    I am having trouble saving the date in DB through Model. In my controller, if I dump the date in log that I receive from $_POST , I get the date in this format "10/Nov/2012 07:30". If I use: $AccountAppointment->start_date=Yii::app()->dateFormatter->format($_POST['AccountAppointment']['start_date'], 'dd/M/yyyy HH:mm'); I get the error: Invalid datetime format: 1292 Incorrect datetime value: '10/NoGMT+5/2012 07:30' for column 'start_date' Changing the format in dateFormatter to 'dd/M/yyyy HH:mm' or 'dd/MM/yyyy HH:mm' or 'dd/MMM/yyyy HH:mm' throws the same error. Db is MySQL 5.0, Yii version 1.1.12. Any help would be greatly appreciated, I am almost stuck....thanks....

    Read the article

  • XHTML validating block level element as a link

    - by Matty F
    I need a way to make an entire DL element clickable with only one anchor tag, that validates as XHTML. As in: <a> <dl> <dt>Data term</dt> <dd>Data definition</dd> </dl> </a> This currently doesn't validate as XHTML as the anchor tag cannot contain the DL. The only way I can get it to validate is if I make two anchor tags and place them inside DT and DD. As in: <dl> <dt><a>Data term</a></dt> <dd><a>Data definition</a></dt> </dl> I'm trying to avoid this, as it would result in two href attributes requiring maintenance, introducing the possibility they could become out of sync. Suggestions?

    Read the article

  • CSS selector for the last occurrence of a class on a page

    - by snaken
    Is there a CSS selector for the last occurrence of a class on a page? Say i have this HTML <dd> <span> <a class="required" id="forename">foo</a> </span> </dd> <dd> <span> <a class="required" id="surname">bar</a> </span> </dd> Is there a CSS selector that would return the a tag with the ID of surname. Something like .required:last maybe? Will be using Prototype if that matters?

    Read the article

  • Allow selection of readonly files from SaveFileDialog?

    - by Andy Dent
    I'm using Microsoft.Win32.SaveFileDialog in an app where all files are saved as readonly but the user needs to be able to choose existing files. The existing files being replaced are renamed eg: blah.png becomes blah.png-0.bak, blah.png-1.bak and so on. Thus, the language for the OverwritePrompt is inappropriate - we are not allowing them to overwrite files - so I'm setting dlog.OverwritePrompt = false; The initial filenames for the dialog are generated based on document values so for them, it's easy - we rename the candidate file in advance and if the user cancels or chooses a different name, rename it back again. When I delivered the feature, testers swiftly complained because they wanted to repeatedly save files with names different from the agreed workflow (those goofy, playful guys!). I can't figure out a way to do this with the standard dialogs, in a way that will run safely on both XP (for now) and Windows 7. I was hoping to hook into the FileOK event but that is called after I get a warning dialog: |-----------------------------------------| | blah.png | | This file is set to read-only. | | Try again with a different file name. | |-----------------------------------------|

    Read the article

  • how to convert datetime to string in linqtosql?

    - by kwon
    I am using linqtosql and inside of linq query, I tried to convert datetime type column to string like 'dd-MM-yy'. However, I got error as following : NotSupportedException: Method 'System.String ToString(System.String)' has no supported translation to SQL. following is my linq query : from ffv in Flo_flowsheet_values where ffv.Flowsheet_key == 2489 && ffv.Variable_key == 70010558 && ffv.Status == 'A' && ffv.Column_time >= DateTime.ParseExact("2010-06-13 00:00", "yyyy-MM-dd HH:mm", null) && ffv.Column_time <= DateTime.ParseExact("2010-06-13 22:59", "yyyy-MM-dd HH:mm", null) select new { ColumnTime = ffv.Column_time ,ColumnTimeForXCategory = ffv.Column_time.Value.ToString("dd-MM-yy") ***====> this statement invoke error*** ,BTValue = Convert.ToDouble( ffv.Value) } what is problem? Thanks in advance

    Read the article

  • XmlDataProvider and XPath bindings don't allow default namespace of XML data?

    - by Andy Dent
    I am struggling to work out how to use default namespaces with XmlDataProvider and XPath bindings. There's an ugly answer using local-name <Binding XPath="*[local-name()='Name']" /> but that is not acceptable to the client who wants this XAML to be highly maintainable. The fallback is to force them to use non-default namespaces in the report XML but that is an undesirable solution. The XML report file looks like the following. It will only work if I remove xmlns="http://www.acme.com/xml/schemas/report so there is no default namespace. <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type='text/xsl' href='PreviewReportImages.xsl'?> <Report xsl:schemaLocation="http://www.acme.com/xml/schemas/report BlahReport.xsd" xmlns:xsl="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.acme.com/xml/schemas/report"> <Service>Muncher</Service> <Analysis> <Date>27 Apr 2010</Date> <Time>0:09</Time> <Authoriser>Service Centre Manager</Authoriser> Which I am presenting in a window with XAML: <Window x:Class="AcmeTest.ReportPreview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="ReportPreview" Height="300" Width="300" > <Window.Resources> <XmlDataProvider x:Key="Data"/> </Window.Resources> <StackPanel Orientation="Vertical" DataContext="{Binding Source={StaticResource Data}, XPath=Report}"> <TextBlock Text="{Binding XPath=Service}"/> </StackPanel> </Window> with code-behind used to load an XmlDocument into the XmlDataProvider (seems the only way to have loading from a file or object varying at runtime). public partial class ReportPreview : Window { private void InitXmlProvider(XmlDocument doc) { XmlDataProvider xd = (XmlDataProvider)Resources["Data"]; xd.Document = doc; } public ReportPreview(XmlDocument doc) { InitializeComponent(); InitXmlProvider(doc); } public ReportPreview(String reportPath) { InitializeComponent(); var doc = new XmlDocument(); doc.Load(reportPath); InitXmlProvider(doc); } }

    Read the article

  • how to incorporate a function within a function

    - by bklynM
    I updated my code with string dates created with new Date and added back in the if statement. This isn't disabling the string or range though. I've added the datepicker code too. function unavailableDays(date) { function createDateRange(first, last) { var dates = []; for(var j = first; j < last; j.setDate(j.getDate() + 7)) { dates.push(new Date(j.getTime())); } var alwaysDisabled = [new Date("1963-3-10T00:00:00"), new Date("1963-3-17T00:00:00"), new Date("1963-3-24T00:00:00"), new Date("1963-3-31T00:00:00"), new Date("1965-9-18T00:00:00")]; return dates.concat(alwaysDisabled); } var disabledDays = createDateRange(new Date("1978-8-10T00:00:00"), new Date("1978-11-5T00:00:00")); var yy = date.getFullYear(), mm = date.getMonth(), dd = date.getDate(); for (i = 0; i < disabledDays.length; i++) { if($.inArray(yy + '-' + (mm+1) + '-' + dd,disabledDays) != -1 || new Date() < date) { return [false]; } } return [true]; } $(document).ready(function (){ $('.selector').datepicker({ inline: true, dateFormat: 'yy-mm-dd', constrainInput: true, changeYear: true, changeMonth: true, minDate: new Date(1940, 1-1, 1), maxDate: new Date(2011, 10-1, 24), beforeShowDay: unavailableDays, onSelect: function(dateText, inst) { $("#img").attr("src", "http://www.example.com" + dateText + ".jpg"); var chosenDates = $.datepicker.parseDate('yy-mm-dd', dateText); var backToString = $.datepicker.formatDate('MM dd' + ',' + ' yy', chosenDates); $('.info').html('You are viewing:' + '<br />' + backToString).addClass('background'); } }); });

    Read the article

  • Ruby on Rails: jQuery datepicker - dates between validation

    - by Jazz
    I have an app that allows a user to create new projects, and the search for them later. One of the options they have when creating a project is giving them start and end dates. At the moment all the code works properly for creating and searching on the dates, but I am now wanting to restrict what dates the user can enter. I am needing for an error to flag up when the user tries to enter an end date that is before the start date. It's really more for when the user is creating the project. Here is my code so far = Application.js //= require jquery //= require jquery_ujs //= require jquery-ui //= require jquery.ui.all //= require_tree . $(function() { $("#project_start_date").datepicker({dateFormat: 'dd-mm-yy'}); }); $(function() { $("#project_end_date").datepicker({dateFormat: 'dd-mm-yy'}); }); jQuery(function(){ jQuery('#start_date_A').datepicker({dateFormat: "dd-mm-yy"}); }); jQuery(function(){ jQuery('#start_date_B').datepicker({dateFormat: "dd-mm-yy"}); }); New View: <div class="start_date" STYLE="text-align: left;"> <b>Start Date:</b> <%= f.text_field :start_date, :class => 'datepicker', :style => 'width: 80px;' %> </div> <div class="end_date" STYLE="text-align: left;"> <b>End Date:</b> <%= f.text_field :end_date, :class => 'datepicker', :style => 'width: 80px;' %> </div> Search View: Start dates between <%= text_field_tag :start_date_A, params[:start_date_A], :style => 'width: 80px;' %> - <%= text_field_tag :start_date_B, params[:start_date_B], :style => 'width: 80px;' %></br> I tried following examples online to get this to work by doing this in the application.js file: $(function() { $("#project_start_date,#project_end_date").datepicker({dateFormat: 'dd-mm-yy'}); }); jQuery(function(){ jQuery('#start_date_A,#start_date_B').datepicker({dateFormat: "dd-mm-yy"}); }); But then the script doesn't run. I am new to rails and javascript so any help at all is appreciated. Thanks in advance. UPDATE: Don't know why my question has been voted to be closed. It's quite simple: I need an error to flag up when the user tries to enter an end date that is before the start date. How can I do that??

    Read the article

  • how to add special class for labels and errors on zend form elements?

    - by user1400
    hello how we could add a special class for labels and errors for a zend-form-element for example html output code before add classes <dt id="username-label"><label for="username" class="required">user name:</label></dt> <dd id="username-element"> <input type="text" name="username" id="username" value="" class="input" /> <ul class="errors"><li>Value is required and can't be empty</li></ul></dd> and code after we add classes <dt id="username-label"><label for="username" **class="req-username"**>user name:</label></dt> <dd id="username-element"> <input type="text" name="username" id="username" value="" class="input" /> <ul **class="err-username"**><li>Value is required and can't be empty</li></ul></dd> thanks

    Read the article

  • Packing differently sized chunks of data into multiple bins

    - by knizz
    EDIT: It seems like this problem is called "Cutting stock problem" I need an algorithm that gives me the (space-)optimal arrangement of chunks in bins. One way would be put the bigger chunks in first. But see how that algorithm fails in this example: Chunks Bins ----------------------------- AAA BBB CC DD ( ) ( ) Algorithm Result ----------------------------- biggest first (AAABBB ) (CC ) optimal (AAACCDD) (BBB) "Biggest first" can't fit in DD. Maybe it helps to build a table like this: Size 1: --- Size 2: CC, DD Size 3: AAA, BBB Size 4: CCDD Size 5: AAACC, AAADD, BBBCC, BBBDD Size 6: AAABBB Size 7: AAACCDD, BBBCCDD Size 8: AAABBBCC, AAABBBDD Size 10: AAABBBCCDD

    Read the article

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