Daily Archives

Articles indexed Tuesday March 9 2010

Page 2/49 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • What is the best way to generate a sitemap?

    - by Zakaria
    Hi everybody, I need to build a sitemap for my website. The url will be "www.example.com/mysitemap.html". I know that there are some tools that generate automatically an XML file that contains the reachable URLs and also improve the SEO. So my questions are: How can I build this HTML page going from the generated XML? Or am I wrong and this kind of HTML page is built manually? If not, how do we integrate the XML and convert it to the website? Thank you very much. Regards.

    Read the article

  • Run Sinatra via a Rake Task to Generate Static Files?

    - by viatropos
    I'm not sure I can put this correctly but I'll give it a shot. I want to use Sinatra to generate static html files once I am ready to deploy an application, so the resulting final website would be pure static HTML. During development, however, I want everything to be dynamic so I can use Haml and straight Ruby code to make things fast/dry/clear. I don't want to use Jekyll or some of the other static site generators out there because they don't have as much power as Sinatra. So all I basically need to be able to do is run a rake task such as: rake sinatra:generate_static_files. That would run the render commands for Haml and everything else, and the result would be written to files. My question is, how do I do that with Sinatra in a Rake task? Can I do it in a Rake task? The problem is, I don't know how to include the Sinatra::Application in the rake task... The only other way I could think of doing it is using net/http to access a URL that does all of that, but that seems like overkill. Any ideas how on to solve this?

    Read the article

  • Resources for JVM Tuning

    - by portoalet
    Anybody knows a good book or two (or resources) for JVM Tuning? I am struggling to find any. I stumbled upon Apress Java EE 5 Performance Management and Optimization, but there was not much in there.

    Read the article

  • Reading Excel files from C#

    - by dbkk
    Is there a free or open source library to read Excel files (.xls) directly from a C# program? It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting (tab-delimited) file, but I'd like to eliminate the manual step.

    Read the article

  • DotNetZip extract file issue

    - by Kumar
    Trying to extract files to a given folder ignoring the path in the zipfile but there doesn't seem to be a way. This seems a fairly basic requirement given all the other good stuff implemented in there. What am i missing ? code is - using (Ionic.Zip.ZipFile zf = Ionic.Zip.ZipFile.Read(zipPath)) { zf.ExtractAll(appPath); }

    Read the article

  • Best way to duplicate databases nightly?

    - by Margaret
    Hey all We just got two new servers, that are running Windows Server 2008. The intent is to make the machines pretty much identical, copying the content of the master to the slave on a nightly basis, so that if anything fails, the second copy can stand in immediately. It doesn't need to be up-to-the-minute mirroring, though I suppose that wouldn't hurt if performance is not affected. The two machines will, amongst other things, each be running an instance of SQL Server 2008. The aim is to duplicate the databases on the master down to the slave on a nightly basis. Unless I'm misunderstanding, the slave databases in mirrored databases require the primary to be present to work correctly; I'm hoping for some solution where we have a second machine that can be up and running with minimal downtime if the first one falls over. Am I misunderstanding mirroring? Is that the best way to do things, or should I use some other mechanism? If so, what?

    Read the article

  • linux kernel option to set sata disk to udma/133 1.5gbps

    - by John Doe
    hi, i try to speed up boot time of my linux server box which uses removable HDD rack's the current boot time is around 2 min's but if i connect the hdd's directly to the mainboard its about 2 sec's the problem is that ahci's kernel implementation causes a timeout of around 30 seconds for each disk during boot which originates from the hdd-rack after the timeout the kernel prints that the disk is limited with speed to 1.5gbps and udma/133 is used so the question i have is: how can i set this in grub as a boot option so the kernel doesnt have to wait for a timeout and just hardcoded limits the speed of the disks? i read about a few options like pci=nomsi or such, which dont work thats why im asking for limiting precisely the disks during boot thx

    Read the article

  • Django .htaccess

    - by Jon
    I have a site that is only partially Django driven. I want the Django portion to be anything under http:www.mydomain.com/register. Anything not in this directory should get served by apache as usual. I also must use fastcgi on my server. How would I set my .htaccess and urls to get this to work?

    Read the article

  • Converting .wav (CCITT A-Law format) to .mp3 using LAME

    - by iar
    I would like to convert wav files to mp3 using the lame encoder (lame.exe). The wav files are recorded along the following specifications: Bit Rate: 64kbps Audio sample size: 8 bit Channels: 1 (mono) Audio sample rate: 8 kHz Audio format: CCITT A-Law If I try to convert such a wav file using lame, I get the following error message: Unsupported data format: 0x0006 Could anyone provide me with a command line string using lame.exe that will enable me to convert these kind of wav files?

    Read the article

  • what does "execute" permission do?

    - by terrani
    Hi, I am shocked that I still don't understand "Execute" permission in linux. There are three permission - read, write, and execute. I understand that read and write literally, but what does execute do exactly? Let's say I have example.php with execute permission. What can I do with example.php???

    Read the article

  • Instantiating a list of parameterized types, making beter use of Generics and Linq

    - by DanO
    I'm hashing a file with one or more hash algorithms. When I tried to parametrize which hash types I want, it got a lot messier than I was hoping. I think I'm missing a chance to make better use of generics or LINQ. I also don't like that I have to use a Type[] as the parameter instead of limiting it to a more specific set of type (HashAlgorithm descendants), I'd like to specify types as the parameter and let this method do the constructing, but maybe this would look better if I had the caller new-up instances of HashAlgorithm to pass in? public List<string> ComputeMultipleHashesOnFile(string filename, Type[] hashClassTypes) { var hashClassInstances = new List<HashAlgorithm>(); var cryptoStreams = new List<CryptoStream>(); FileStream fs = File.OpenRead(filename); Stream cryptoStream = fs; foreach (var hashClassType in hashClassTypes) { object obj = Activator.CreateInstance(hashClassType); var cs = new CryptoStream(cryptoStream, (HashAlgorithm)obj, CryptoStreamMode.Read); hashClassInstances.Add((HashAlgorithm)obj); cryptoStreams.Add(cs); cryptoStream = cs; } CryptoStream cs1 = cryptoStreams.Last(); byte[] scratch = new byte[1 << 16]; int bytesRead; do { bytesRead = cs1.Read(scratch, 0, scratch.Length); } while (bytesRead > 0); foreach (var stream in cryptoStreams) { stream.Close(); } foreach (var hashClassInstance in hashClassInstances) { Console.WriteLine("{0} hash = {1}", hashClassInstance.ToString(), HexStr(hashClassInstance.Hash).ToLower()); } }

    Read the article

  • Learning Linux screencasts

    - by Dmitriy Nagirnyak
    Hi, I am trying to get started with Linux. There are number of books (many of which are just man pages), some of them provide good overview so I can dig deeper online then. What I would like is to find number of screencasts that would cover basics of Linux commands, server administration, commonly performed tasks etc (no GUI, only terminal). I want to watch the screencasts to "get it quicker" and then use a book or online resources to "dig it deeper". Any recommendations? Thanks, Dmitriy.

    Read the article

  • Voice Recognition Connection problem

    - by user244190
    I,m trying to work through and test a Voice Recognition example based on the VoiceRecognition.java example at http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html but when click on the button to create the activity, I get a dialog that says Connection problem. My Manifest file is using the Internet Permission, and I understand it passes the to the Google Servers. Do I need to do anything else to use this. Code below UPDATE 2: Thanks to Steve, I have been able to install the USB Driver and debug the app directly on my Droid. Here is the LogCat output from clicking on my mic button: 03-08 18:36:45.686: INFO/ActivityManager(1017): Starting activity: Intent { act=android.speech.action.RECOGNIZE_SPEECH cmp=com.google.android.voicesearch/.IntentApiActivity (has extras) } 03-08 18:36:45.686: WARN/ActivityManager(1017): Activity is launching as a new task, so cancelling activity result. 03-08 18:36:45.787: DEBUG/NetworkLocationProvider(1017): setMinTime: 120000 03-08 18:36:45.889: INFO/ActivityManager(1017): Displayed activity com.google.android.voicesearch/.IntentApiActivity: 135 ms (total 135 ms) 03-08 18:36:45.905: DEBUG/NetworkLocationProvider(1017): onCellLocationChanged [802,0,0,4192,3] 03-08 18:36:45.951: INFO/MicrophoneInputStream(1429): Starting voice recognition with audio source VOICE_RECOGNITION 03-08 18:36:45.998: DEBUG/AudioHardwareMot(990): Codec sampling rate already 16000 03-08 18:36:46.092: INFO/RecognitionService(1429): ssfe url=http://www.google.com/m/voice-search 03-08 18:36:46.092: WARN/RecognitionService(1429): required parameter 'calling_package' is missing in IntentAPI request 03-08 18:36:46.115: DEBUG/AudioHardwareMot(990): Codec sampling rate already 16000 03-08 18:36:46.131: WARN/InputManagerService(1017): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@4487d240 (uid=10090 pid=3132) 03-08 18:36:46.131: WARN/IInputConnectionWrapper(3132): showStatusIcon on inactive InputConnection 03-08 18:36:46.248: WARN/MediaPlayer(1429): info/warning (1, 44) 03-08 18:36:46.334: DEBUG/dalvikvm(3206): GC freed 3682 objects / 369416 bytes in 293ms 03-08 18:36:46.358: WARN/MediaPlayer(1429): info/warning (1, 44) 03-08 18:36:46.412: WARN/MediaPlayer(1429): info/warning (1, 44) 03-08 18:36:46.444: WARN/MediaPlayer(1429): info/warning (1, 44) 03-08 18:36:46.475: WARN/MediaPlayer(1429): info/warning (1, 44) 03-08 18:36:46.506: WARN/MediaPlayer(1429): info/warning (1, 44) 03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44) 03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44) 03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44) 03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44) 03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44) 03-08 18:36:46.514: INFO/MediaPlayer(1429): Info (1,44) The line that concerns me is the warning of the missing parameter calling-package. UPDATE: Ok, I was able to replace my emulator image with one from HTC that appears to come with Google Voice Search, however now when I run from the emulator, i'm getting an Audio Problem message with Speak Again or Cancel buttons. It appears to make it back to the onActivityResult(), but the resultCode is 0. Here is the LogCat output: 03-07 20:21:25.396: INFO/ActivityManager(578): Starting activity: Intent { action=android.speech.action.RECOGNIZE_SPEECH comp={com.google.android.voicesearch/com.google.android.voicesearch.RecognitionActivity} (has extras) } 03-07 20:21:25.406: WARN/ActivityManager(578): Activity is launching as a new task, so cancelling activity result. 03-07 20:21:25.968: WARN/ActivityManager(578): Activity pause timeout for HistoryRecord{434f7850 {com.ikonicsoft.mileagegenie/com.ikonicsoft.mileagegenie.MileageGenie}} 03-07 20:21:26.206: WARN/AudioHardwareInterface(554): getInputBufferSize bad sampling rate: 16000 03-07 20:21:26.256: ERROR/AudioRecord(819): Recording parameters are not supported: sampleRate 16000, channelCount 1, format 1 03-07 20:21:26.696: INFO/ActivityManager(578): Displayed activity com.google.android.voicesearch/.RecognitionActivity: 1295 ms 03-07 20:21:29.890: DEBUG/dalvikvm(806): threadid=3: still suspended after undo (s=1 d=1) 03-07 20:21:29.896: INFO/dalvikvm(806): Uncaught exception thrown by finalizer (will be discarded): 03-07 20:21:29.896: INFO/dalvikvm(806): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@435d3c50 on ml_trackdata that has not been deactivated or closed 03-07 20:21:29.896: INFO/dalvikvm(806): at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596) 03-07 20:21:29.896: INFO/dalvikvm(806): at dalvik.system.NativeStart.run(Native Method) 03-07 20:21:31.468: DEBUG/dalvikvm(806): threadid=5: still suspended after undo (s=1 d=1) 03-07 20:21:32.436: WARN/IInputConnectionWrapper(806): showStatusIcon on inactive InputConnection I,m still not sure why I,m getting the Connect problem on the Droid. I can use Voice Search ok. I also tried clearing the cache, and data as described in some posts, butstill not working?? /** * Fire an intent to start the speech recognition activity. */ private void startVoiceRecognitionActivity() { Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo"); startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE); } /** * Handle the results from the recognition activity. */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) { // Fill the list view with the strings the recognizer thought it could have heard ArrayList<String> matches = data.getStringArrayListExtra( RecognizerIntent.EXTRA_RESULTS); mList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, matches)); } super.onActivityResult(requestCode, resultCode, data); }

    Read the article

  • WPF ComboBox SelectedValue not updating from binding source.

    - by vg1890
    Here's my binding source object: Public Class MyListObject Private _mylist As New ObservableCollection(Of String) Private _selectedName As String Public Sub New(ByVal nameList As List(Of String), ByVal defaultName As String) For Each name In nameList _mylist.Add(name) Next _selectedName = defaultName End Sub Public ReadOnly Property MyList() As ObservableCollection(Of String) Get Return _mylist End Get End Property Public ReadOnly Property SelectedName() As String Get Return _selectedName End Get End Property End Class Here is my XAML: <Window x:Class="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" xmlns:local="clr-namespace:WpfApplication1" > <Window.Resources> <ObjectDataProvider x:Key="MyListObject" ObjectInstance="" /> </Window.Resources> <Grid> <ComboBox Height="23" Margin="24,91,53,0" Name="ComboBox1" VerticalAlignment="Top" SelectedValue="{Binding Path=SelectedName, Source={StaticResource MyListObject}, Mode=OneWay}" ItemsSource="{Binding Path=MyList, Source={StaticResource MyListObject}, Mode=OneWay}" /> <Button Height="23" HorizontalAlignment="Left" Margin="47,0,0,87" Name="btn_List1" VerticalAlignment="Bottom" Width="75">List 1</Button> <Button Height="23" Margin="0,0,75,87" Name="btn_List2" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="75">List 2</Button> </Grid> </Window> Here's the code-behind: Class Window1 Private obj1 As MyListObject Private obj2 As MyListObject Private odp As ObjectDataProvider Public Sub New() InitializeComponent() Dim namelist1 As New List(Of String) namelist1.Add("Joe") namelist1.Add("Steve") obj1 = New MyListObject(namelist1, "Steve") . Dim namelist2 As New List(Of String) namelist2.Add("Bob") namelist2.Add("Tim") obj2 = New MyListObject(namelist2, "Tim") odp = DirectCast(Me.FindResource("MyListObject"), ObjectDataProvider) odp.ObjectInstance = obj1 End Sub Private Sub btn_List1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btn_List1.Click odp.ObjectInstance = obj1 End Sub Private Sub btn_List2_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btn_List2.Click odp.ObjectInstance = obj2 End Sub End Class When the Window first loads, the bindings hook up fine. The ComboBox contains the names "Joe" and "Steve" and "Steve" is selected by default. However, when I click a button to switch the ObjectInstance to obj2, the ComboBox ItemsSource gets populated correctly in the dropdown, but the SelectedValue is set to Nothing instead of being equal to obj2.SelectedName. Thanks in advance!

    Read the article

  • Calling a method with an arg of Class<T> where T is a parameterized type

    - by Brian Ferris
    I'm attempting to call a constructor method that looks like: public static SomeWrapper<T> method(Class<T> arg); When T is an unparameterized type like String or Integer, calling is straightforward: SomeWrapper<String> wrapper = method(String.class); Things get tricky when T is a parameterized type like List<String>. The following is not valid: SomeWrapper<List<String>> wrapper = method(List<String>.class); About the only thing I could come up with is: List<String> o = new ArrayList<String>(); Class<List<String>> c = (Class<List<String>>) o.getClass(); SomeWrapper<List<String>> wrapper = method(c); Surely there is an easier way that doesn't require the construction of an additional object?

    Read the article

  • jQuery UI Question. How to pass parameters to a function.

    - by jiji40
    I am pretty new to jQuery. How do I pass parameters to a function? I found some jQueryUI demos and I got it working except "view" link. I have a problem with passing parameters to and show them in modal popup windows. I have "Create New User" button and "View" link on the page. Clicking "Create New User" does pass the parameters and show them on modal popup window. ('12345' in User ID textbox, 'John Starks' in User Name textbox) $(function() { ... //Create New User button $('#create-user') .button() .click( function() { $('#dialog-form').dialog('open'); userId.val('12345'); userName.val('John Starks'); } ); }); But, "View" link doesn't work... Clicking "View" link does pop up modal window with no value in the textbox(User ID and User Name) function doView( idP, nameP ) { $('#dialog-form2').dialog('open'); userId.val(idP); userName.val(nameP); } <a href="#" OnClick="doView('001','John Doe');" >view</a> ... How to pass the parameters to modal window? Thanks in advance.

    Read the article

  • Ruby on Rails testing: How can I test or at the very least see a form_for's error_messages_for?

    - by williamjones
    I'm working on creating a tests, and I can't figure out why the creation of a model from a form_for is failing in the test but works in real browsers. Is there a straightforward way for me to see what the problems are in the model creation? Even better would be, is there a straightforward way for me to test the error outputs that I access via error_messages_for? In that case, I'd like to also add in tests that make sure that malformed forms are outputting the correct errors.

    Read the article

  • How to make the process quicker?

    - by dewacorp.alliances
    We build a system that handling the billing analyse and what it does it just have a raw bill from vendor and process to "common" table and this is using SQL Server 2005 Integration Services. At the moment, the batch has 300,000 rows and it took about 6 minutes to process. Now, the current spec are: 2 CPUs Intel Xeon E5345 @ 2.33 GHz RAM 4GB Is there anyway I can speed up this process?

    Read the article

  • Specifying Cell Format in CSV File

    - by Someone
    I am generating a csv file from a PHP array. It opens just fine in Excel and OpenOffice Calc, however the data in one of the column are zip codes. Excel makes the cell formats of the column number general by default. This results in the leading 0 getting dropped in zip codes. Is there any way I can specify the cell formats within the CSV file?

    Read the article

  • Variable inside of the markup for an asp:HyperLink NavigationUrl property?

    - by RichAmberale
    Hi, I'm new to ASP.NET and can't figure out how to accomplish this... My code (that needs fixing): <asp:HyperLink runat="server" NavigateUrl="~/EditReport.aspx?featureId=<%= featureId %>" ImageUrl="~/new.gif" /> featureId gets defined as an integer in the backing code. I want href's like... /EditReport.aspx?featureId=2224 ...but instead I am getting... /EditReport.aspx?featureId=<%= featureId %>

    Read the article

  • Track http domain referer

    - by tony noriega
    Can i track the http referer with javascript, and append a variable to the URL string to store into a dbase? or could i track a cookie that the user gets? (very layman's terms here, sorry) if http referrer is domain.com add to url '&referer=google' which should stay with them during their session. OR when a user clicks my Google adwords ad. they get a cookie with a referring domain in it. try to read that cookie, and append the same variable. any thoughts?

    Read the article

  • How does one modify the thread scheduling behavior when using Threading Building Blocks (TBB)?

    - by J Teller
    Does anyone know how to modify the thread scheduling (specifically affinity) when using TBB? Doing a high level analysis on a simple parallel-for application, it seems like TBB is specifying the underlying threads' affinity in a way that reduces performance. Specifically, the cores I'm running on have hyper-threading enabled, and it looks like TBB is affinitizing threads to the same core even if there is a different core left completely unloaded. FWIW, I realize it's likely that TBB is doing the "right thing" and that changing the threads' affinity will only reduce performance. I'd just like to experiment with it to see if that's really the case.

    Read the article

  • How to structure controller to sort multiple criteria asp.net mvc

    - by Solomon
    Hi, What's the best way to set up a controller to sort by many (possibly null) criteria? Say for example, I was building a site that sold cars. My CarController has a function Index() which returns an IList of cars to the view, and details on each car are rendered with a partial view. What's the best way to structure this? Especially if there are a lot of criteria: Car Type (aka SUV), Car Brand, Car Model, Car Year, Car Price, Car Color, bool IsNew, or if I want to sort by closest to me etc... I'm using NHibernate as my ORM. Should I have just a ton of possible NHibernate queries and figure out which one to choose based on if/then's in the controller? Or is there a simpler way. Thanks so much for the help.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >