Daily Archives

Articles indexed Monday March 15 2010

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

  • What is the best method to convert to an Integer in JavaScript?

    - by Mathew Byrne
    There are several different methods for converting floating point numbers to Integers in JavaScript. My question is what method gives the best performance, is most compatible, or is considered the best practice? Here are a few methods that I know of: var a = 2.5; window.parseInt(a); // 2 Math.floor(a); // 2 a | 0; // 2 I'm sure there are others out there. Suggestions?

    Read the article

  • XamlParseException using Silverlight Toolkit control in Expression Blend

    - by Dan Auclair
    I am having a strange issue opening up my UserControl in Expression Blend when using a Silverlight Toolkit control. My UserControl uses the toolkit's ListBoxDragDropTarget as follows: <controlsToolkit:ListBoxDragDropTarget mswindows:DragDrop.AllowDrop="True" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"> <ListBox ItemsSource="{Binding MyItemControls}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <controlsToolkit:WrapPanel/> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox> </controlsToolkit:ListBoxDragDropTarget> Everything works as expected at runtime and looks fine in Visual Studio 2008. However, when I try to open my UserControl in Blend I get XamlParseException: [Line: 0 Position: 0] and I can not see anything in the design view. More specifically Blend complains: The element "ListBoxDragDropTarget" could not be displayed because of a problem with System.Windows.Controls.ListBoxDragDropTarget: TargetType mismatch. My silverlight application is referencing System.Windows.Controls.Toolkit from the Nov. 2009 toolkit release, and I've made sure to include these namespace declarations for the ListBoxDragDropTarget: xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" xmlns:mswindows="clr-namespace:Microsoft.Windows;assembly=System.Windows.Controls.Toolkit" If I comment out the ListBoxDragDropTarget control wrapper and just leave the ListBox I can see everything fine in the design view without errors. Furthermore, I realized this is happening with a variety of Silverlight Toolkit controls because if I comment out ListBoxDragDropTarget and replace it with <controlsToolkit:BusyIndicator /> the same exact error occurs in Blend. What is even weirder is that if I start a brand new silverlight application in blend I can add these toolkit elements without any kind of error, so it seems like something dumb that is happening with my project references to the toolkit assemblies. I'm pretty sure this has something to do with loading the default styles for the toolkit controls from its generic.xaml, since the error has to do with the TargetType and Blend is probably trying to load up the default styles. Has anyone encountered this issue before or have any ideas as to what may be my problem?

    Read the article

  • SEO friendly CMS with user profile functionality

    - by kjgilla
    My company has a project to create a magazine style site with user profile functionality. We need: CMS for the article publishing. SEO Friendly urls. Commenting capability for the published articles. User profile system with limited social networking functionality (friends,friend messages,blog,account tweaking/personalization, article commenting) My area of expertise is asp.net, particularly MVC. I have read similar posts on this site regarding CMS with MVC and I'm surveying the landscape (N2, Kooboo, MvcCms, etc). What I am really interested in knowing is whether there are any platforms out there (WAMP or LAMP) that provide this functionality out of the box. I may be willing to go the LAMP route if it requires little development work. If I have to crack open any code then it probably needs to be .net unless there are compelling reasons to go another route.

    Read the article

  • Qt application crashing immediately without debugging info. How do I track down the problem?

    - by jjacksonRIAB
    I run an Qt app I've built: ./App Segmentation fault I run it with strace: strace ./App execve("./App", ["./App"], [/* 27 vars */]) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 868 detached Again, no useful info. I run it with gdb: (gdb) run Starting program: /root/test/App Reading symbols from shared object read from target memory...(no debugging symbols found)...done. Loaded system supplied DSO at 0xffffe000 Program received signal SIGSEGV, Segmentation fault. 0x00000001 in ?? () Again, nothing. I run it with valgrind: ==948== Process terminating with default action of signal 11 (SIGSEGV) ==948== Bad permissions for mapped region at address 0x0 ==948== at 0x1: (within /root/test/App) Even if I put in debugging symbols, it doesn't give any more useful info. ldd shows all libraries being linked properly. Is there any other way I can find out what's wrong? I can't even do standard printf, cout, etc debugging. The executable doesn't even seem to start running at all. I rebuilt with symbols, and tried the suggestion below (gdb) break main Breakpoint 1 at 0x45470 (gdb) run Starting program: /root/test/App Breakpoint 1 at 0x80045470 Reading symbols from shared object read from target memory...done. Loaded system supplied DSO at 0xffffe000 Program received signal SIGSEGV, Segmentation fault. 0x00000001 in ?? () I checked for static initializers and I don't seem to have any. Yep, I tried printf, cout, etc. It doesn't even make it into the main routine, so I'm looking for problems with static initializers in link libraries, adding them in one-by-one. I'm not getting any stack traces either.

    Read the article

  • Changing the action of a hyperlink in a Silverlight RichTextArea

    - by Marc Schluper
    The title of this post could also have been "Move over Hyperlink, here comes Actionlink" or "Creating interactive text in Silverlight." But alas, there can be only one. Hyperlinks are very useful. However, they are also limited because their action is fixed: browse to a URL. This may have been adequate at the start of the Internet, but nowadays, in web applications, the one thing we do not want to happen is a complete change of context. In applications we typically like a hyperlink selection to initiate an action that updates a part of the screen. For instance, if my application has a map displayed with some text next to it, the map would react to a selection of a hyperlink in the text, e.g. by zooming in on a location and displaying additional locational information in a popup. In this way, the text becomes interactive text. It is quite common that one company creates and maintains websites for many client companies. To keep maintenance cost low, it is important that the content of these websites can be updated by the client companies themselves, without the need to involve a software engineer. To accommodate this scenario, we want the author of the interactive text to configure all hyperlinks (without writing any code). In a Silverlight RichTextArea, the default action of a Hyperlink is the same as a traditional hyperlink, but it can be changed: if the Command property has a value then upon a click event this command is called with the value of the CommandParameter as parameter. How can we let the author of the text specify a command for each hyperlink in the text, and how can we let an application react properly to a hyperlink selection event? We are talking about any command here. Obviously, the application would recognize only a specific set of commands, with well defined parameters, but the approach we take here is generic in the sense that it pertains to the RichTextArea and any command. So what do we require? We wish that: As a text author, I can configure the action of a hyperlink in a (rich) text without writing code; As a text author, I can persist the action of a hyperlink with the text; As a reader of persisted text, I can click a hyperlink and the configured action will happen; As an application developer, I can configure a control to use my application specific commands. In an excellent introduction to the RichTextArea, John Papa shows (among other things) how to persist a text created using this control. To meet our requirements, we can create a subclass of RichTextArea that uses John's code and allows plugging in two command specific components: one to prompt for a command definition, and one to execute the command. Since both of these plugins are application specific, our RichTextArea subclass should not assume anything about them except their interface. public interface IDefineCommand { void Prompt(string content, // the link content Action<string, object> callback); // the method called to convey the link definition } public interface IPerformCommand : ICommand {} The IDefineCommand plugin receives the content of the link (the text visible to the reader) and displays some kind of control that allows the author to define the link. When that's done, this (possibly changed) content string is conveyed back to the RichTextArea, together with an object that defines the command to execute when the link is clicked by the reader of the published text. The IPerformCommand plugin simply implements System.Windows.Input.ICommand. Let's use MEF to load the proper plugins. In the example solution there is a project that contains rudimentary implementations of these. The IDefineCommand plugin simply prompts for a command string (cf. a command line or query string), and the IPerformCommand plugin displays a MessageBox showing this command string. An actual application using this extended RichTextArea would have its own set of commands, each having their own parameters, and hence would provide more user friendly application specific plugins. Nonetheless, in any case a command can be persisted as a string and hence the two interfaces defined above suffice. For a Visual Studio 2010 solution, see my article on The Code Project.

    Read the article

  • Windows 7 Office 2007 GPO install

    - by Scott
    I have a GPO that works fine for installing Office 2007 Pro Plus on Vista and XP but when it installs Office on Windows 7 somehow the office key does not get entered via the customized msp, and needs to be entered manually. Has anyone else run into this? Any suggestions for a fix? Its defeats the purpose of remote unattended install if I then have to run around entering the stupid key. edit: I am sorry I should have specified I also have the config.xml file customized already. I have it set to display level none, completion no, suppress modal to yes accept eula to yes, the key put in and the company name and the username variable (%USERNAME%).

    Read the article

  • E-mail duplication problem

    - by Gavin Osborn
    I have taken out a hosting agreement with a well respected hosting provider for a couple of internet facing servers. We have deployed several applications to these servers which send various e-mails back to us for reporting purposes. Context: Each server runs Windows Server 2003 R2 with the IIS 6.0 SMTP service installed. Each application is configured to use the local instance of IIS to send e-mails. The external IP address of each server is mapped to a particular domain eg: server1.mydomain.com server2.mydomain.com These e-mails are sent from a company domain name and not the domain name of the hosted servers (eg: [email protected]) Symptoms: A small number (<1%) of e-mails sent from these applications appear to be duplicated. These are exact duplicate in terms of both content and message headers. The Fix: I contacted my hosting provider and they told me this was a common problem & instructed me to: Change the HELO response of your mail server service to a FQDN (server1.mydomain.com && server2.mydomain.com) Create a DNS A record that resolves the FQDN of your mail server to the primary IP address of your sending mail server. Create a PTR record that resolves your primary IP address back to your mail server's FQDN In the sending domain's (mycompanydomain.com) DNS zone file, add the appropriate SPF record for your hosted servers. eg: v=spf1 a mx include:mydomain -all The Problem Continues: I made all of the changes as prescribed above, I was a little hesitant because these steps seemed to suggest they were more for stopping your messages getting blocked than they were for stopping them from being duplicated - but I am certainly no expert in these matters. It has been 5 days since I applied this fix and the problem still persists. I am certain that these problems are not a bug in the software because they are 4 different applications installed on 2 different servers, all of whom are exhibiting this strange behaviour. This behaviour has also not been seen in our UAT environment. Were my hosts correct to suggest this fix? If not, does anyone know what could be the cause of this problem? Many Thanks

    Read the article

  • notation of Path to files/folders/drives that is shared on a network in windows?

    - by claws
    Hello, When some thing shared on network using windows network share option. Some people use path like \\something\something\something$ I'm don't know if this is correct way or not. but as far as I remember there is a dollar sign. Can any one please tell me. What is this notation? Where can I find more details about this? What is samba server/sharing? I don't understand when people use it. Is it something related to Linux? EDIT I'm a programmer. I guess this file sharing on network using windows uses client server architecture. I want to know what is this server on windows called? What protocol does it use? client is of course our windows explorer.exe? Which service in services.msc is responsible for this?

    Read the article

  • Where is the script editor in google spreadsheet?

    - by René Nyffenegger
    Hello I just stumbled upon this link and wanted to try it out. Yet, if I open a google spreadsheet, I have no scripts submenu under the tools menu. This was with firefox 3.0.15 and IE 7. Unfortunately, I didn't find anything that indicated why there wouldn't be such menus with my spreadsheets. Does someone know more about this? Thanks / Rene

    Read the article

  • Windows vista, IIS7 and error messages/pages

    - by Camila
    Hei, I have a new laptop installed with Windows Vista ultimate (Swedish version). I changed the display language to English, everything seems ok except error pages in IIS7 are still in Swedish. Is it possible to get error pages/messages in English ? How? Thanks in advance!

    Read the article

  • Constant Memory Leak in SpeechSynthesizer

    - by DudeFX
    I have developed a project which I would like to release which uses c#, WPF and the System.Speech.Synthesizer object. The issue preventing the release of this project is that whenever SpeakAsync is called it leaves a memory leak that grows to the point of eventual failure. I believe I have cleaned up properly after using this object, but cannot find a cure. I have run the program through Ants Memory Profiler and it reports that WAVEHDR and WaveHeader is growing with each call. I have created a sample project to try to pinpoint the cause, but am still at a loss. Any help would be appreciated. The project uses VS2008 and is a c# WPF project that targets .NET 3.5 and Any CPU. You need to manually add a reference to System.Speech. Here is the Code: <Window x:Class="SpeechTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <StackPanel Orientation="Vertical"> <Button Content="Start Speaking" Click="Start_Click" Margin="10" /> <Button Content="Stop Speaking" Click="Stop_Click" Margin="10" /> <Button Content="Exit" Click="Exit_Click" Margin="10"/> </StackPanel> </Grid> // Start of code behind using System; using System.Windows; using System.Speech.Synthesis; namespace SpeechTest { public partial class Window1 : Window { // speak setting private bool speakingOn = false; private int curLine = 0; private string [] speakLines = { "I am wondering", "Why whenever Speech is called", "A memory leak occurs", "If you run this long enough", "It will eventually crash", "Any help would be appreciated" }; public Window1() { InitializeComponent(); } private void Start_Click(object sender, RoutedEventArgs e) { speakingOn = true; SpeakLine(); } private void Stop_Click(object sender, RoutedEventArgs e) { speakingOn = false; } private void Exit_Click(object sender, RoutedEventArgs e) { App.Current.Shutdown(); } private void SpeakLine() { if (speakingOn) { // Create our speak object SpeechSynthesizer spk = new SpeechSynthesizer(); spk.SpeakCompleted += new EventHandler(spk_Completed); // Speak the line spk.SpeakAsync(speakLines[curLine]); } } public void spk_Completed(object sender, SpeakCompletedEventArgs e) { if (sender is SpeechSynthesizer) { // get access to our Speech object SpeechSynthesizer spk = (SpeechSynthesizer)sender; // Clean up after speaking (thinking the event handler is causing the memory leak) spk.SpeakCompleted -= new EventHandler(spk_Completed); // Dispose the speech object spk.Dispose(); // bump it curLine++; // check validity if (curLine = speakLines.Length) { // back to the beginning curLine = 0; } // Speak line SpeakLine(); } } } } I run this program on Windows 7 64 bit and it will run and eventually halt when attempting to create a new SpeechSynthesizer object. When run on Windows Vista 64 bit the memory will grow from a starting point of 34k to so far about 400k and growing. Can anyone see anything in the code that might be causing this, or is this an issue with the Speech object itself. Any help would be appreciated.

    Read the article

  • GWT: How can I use JsonpRequestBuilder to handle a Json response of a list

    - by Anthony Kong
    My backend server function returns a list of json object to the caller. I would like to use JsonRequestBuilder to interact with this backend function I defined a AsyncCallback this way class MyCallBack extends AsyncCallback<List<MyObject>> { However, JsonpRequestBuilder does not this declaration AsyncCallback because the generic type is bounded to <T extends JavaScriptObject. List<MyObject does not satisfy this requirement. Do you have any suggestion to this problem?

    Read the article

  • Efficient paging with large tables in sql 2008

    - by Kumar
    for tables with 1,000,000 rows and possibly many many more ! haven't done any benchmarking myself so wanted to get the experts opinion. Looked at some articles on row_number() but it seems to have performance implications What are the other choices/alternatives ?

    Read the article

  • How to write to Tomcat log files

    - by Ankur
    What is the easiest way to print out something in a Tomcat Log file. I was under the impression that System.out.println() would print to one of the log files. I just want to print out the value of a string, so the simplest solution would be best. If there is no simple/trivial solution I guess I will use Log4J

    Read the article

  • reinitialize jqTransform?

    - by SoulieBaby
    Hi all, I'm using jqTransform to make my forms look a bit prettier, however I'm using jquery to change the select list (depending on what's selected from another select list) and it just pulls in the regular form select list rather than the jqTransform styles.. I was wondering if there's a way of reinitializing it? I've tried adding: jQuery('#bookingForm').jqTransform({ imgPath: '/templates/home/images/jqtransform/' }); after the jquery inserts the new select box, but it doesnt seem to work.. I'm trying to do this because I couldnt figure out how to show/hide options in a select list using jquery.

    Read the article

  • mysql - How select a akin records?

    - by zeroonea
    I have a table with name varchar address varchar country varchar city varchar ..... to store address of location example: name|address|country HaLong hotel|156 blahblah street|Vietnam Hotel Ha Long|156 blah blah|Vietnam Two rows above is duplicate data. I have a form, when user submit new location. The code need to find akin records to give a message (ex: This location already in db, use it or create new?) How to make a query to get akin record like this?

    Read the article

  • C# : Direct3D in a control, AND fullscreen on a secondary monitor - what's the best way ?

    - by Led
    I'm working on a C# application that needs to use Direct3D in a control in a windows form, AND (at the same time) fullscreen on a secondary monitor. Basically, I want a Windows Forms application on one screen with a user-interface to control the graphics, and I'd like to show preview-graphics in a small control, and full-blown superduper megafancy graphics fullscreen on a secondary monitor. What's the best way to approach this? (For example, I know XNA can render in a Windows Forms control, but is it possible to then add a fullscreen window on another monitor as well?)

    Read the article

  • Recommend ONE favorite SSIS component that does SFTP/FTPS

    - by Kevin Fairchild
    Sometimes normal FTP doesn't quite cut it... When you need to do secure FTP via SSIS packages, what ONE product would you recommend? Before answering, please see if someone has already suggested the same thing and, if so, vote it up. NOTE: Ideally, it needs to handle both SSH and SSL FTP connections, but I'd consider two separate components if it makes the most sense....

    Read the article

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