on-internet

Excel unable to insert more than 255 chars?

I am using OLE DB driver to insert more than 255 characters into an Excel sheet, but I get the error: Exception Details: System.Data.OleDb.OleDbException: The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. Seems from this thread that it's an Excel limitation. Even the Microsoft site seems to say so here. So does this mean I can't programmatically, but I can manually? Because I can enter more than 255 characters when I manually type them in Excel. So is it a Microsoft.ACE.OLEDB.12.0(AccessDatabaseEngine.exe) driver limitation?

Join the discussion →

MaintainScrollPositionOnPostback is not working - how to debug?

I inherited some web shop project (ASP.NET 3.5, Webforms, Visual Studio 2008 PRO). On one page I have MaintainScrollPositionOnPostback set to true. When shopping cart (user control loaded in master page) is empty, then asp.net is not generating Javascript code required for scroll position. When I add some items to the cart, then everything works fine. Can you give me any advice how to find part of the code which is responsible for this issue? I don't have an access to the 3rd party profilers.

Join the discussion →

How do I add a Marker to a jQuery UI Slider?

I have a simple jQuery UI slider that has a numerical range from 25 to 35. It works fine and the default value is 28. I'm hoping to add a simple tick mark to the slider to indicate that 28 is where the default is. Is there a simple way to add an indicator? $('#cycle_length').slider({ range: "min", value: 28, min: 25, max: 35, step: 1, slide: function( event, ui ) { $( "#amount" ).val( ui.value ); } }); $( "#amount" ).val( $( "#cycle_length" ).slider( "value" ) );

Join the discussion →

Why isn't the method toLowerCase(); working in my code?

import java.util.Scanner; public class Test { public static void main(String[] args) { char[] sArray; Scanner scan = new Scanner(System.in); System.out.print("Enter a Palindrome : "); String s = scan.nextLine(); sArray = new char[s.length()]; for(int i = 0; i < s.length(); i++) { s.toLowerCase(); sArray[i] = s.charAt(i); System.out.print(sArray[i]); } } }

Join the discussion →

Thread.CurrentPrincipal in .NET console application

Here is a trivial console application that I run in a command prompt: using System; using System.Threading; namespace Test { internal class Runner { [STAThread] static void Main(string[] args) { Console.WriteLine(Thread.CurrentPrincipal.GetType().Name); Console.WriteLine(Thread.CurrentPrincipal.Identity.Name); } } } The output is 'GenericPrincipal' and an empty string as identity name. Why is there the run time constructs GenericPrincipal instead of WindowsPrincipal? How do I force it to construct WindowsPrincipal from the security token of the starting process (cmd.exe in my case)?

Join the discussion →

HQL: Is an element of one collection in another collection?

I want to check whether at least one element of a collection (u.organisations) is contained in another collection (? = excludedOrganisations): select distinct u from SystemUser u join u.userGroups g join u.organisations o where 3 in elements(g.permissions) and EACH_ELEMENT_OF(o) not in (?) How can I express the EACH_ELEMENT_OF with HQL? My last trial is: select distinct u from SystemUser u join u.userGroups g where 3 in elements(g.permissions) and not exists ( select org from Organisation org where org in elements(u.organisations) and org not in (?) ) But I get the exception: IllegalArgumentEx

Join the discussion →

Eclipse specific colour change with new Ubuntu themes

All but one colour is a problem in Eclipse with the new Ubuntu (10.10) dark themes. I want to change only this one, not the theme. This is the background/colour used by Eclipse in lists (Explorer, Open Resource) when an item is pre selected (a selected item displays ok). The current display is white on light-grey, not easily readable. Where can I change that?

Join the discussion →

ISE for cmd/batch scripts

There a Integrated Scripting Environment for Windows PowerShell scripting language, but is there an ISE for Windows batch (.bat) scripts? How do people develop .bat scripts efficiently? Do you use some kind of ISE?

Join the discussion →

Format date as day of week

I have a table which has amongst others a date column servdate. I use the following query to get me all jobs from within the past week ( a week starts from monday): SELECT * FROM tb1 WHERE servdate BETWEEN date('now', 'Weekday 1', '-21 days') AND date('now') I want the query to work exactly the same but instead to return the servdate fields as their corresponding day of the week. For example, "monday", instead of "2010-11-28". Is this possible?

Join the discussion →

MySQL LEFT JOIN returning no unmatched rows due to WHERE conditions on the right-hand table

I have two tables in MySQL hotel_respondents and hotel_results - they are joined by hotel_respondents.login_id = hotel_results.company I have the following data in hotel_results table: date brand code q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 q16 q17 q18 q19 q20 q21 q22 q23 q24 q25 NOV2010 XYZ 66j8ttk2 8 6 4 8 3 8 8 8 7 4 8 7 7 4 7 6 6 7 4 5 7 7 2 1 1 NOV2010 XYZ 66j8ttk2 9 9 5 5 5 5 3 3 9 9 9 5 6 8 6 8 8 5 5 5 6 6 2 1 1 NOV2010 XYZ 66j8ttk2 10 10 7 10 8 10 10 9 8 10 10 10 8 10 10 10 10 10 10 10 10 10 1 1 1 NOV2010 XYZ 66j8ttk2 8 6 4 8 3 8 8 8 7 4 8 7 7 4 7 6 6 7 4 5 7 7 2 1 1 NOV2010

Join the discussion →

MySql mysql.h file not found in VS2008 C++

I am getting this error when trying to run a simple SQL C++ program (IDE used VS 2008) fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory this is how my code looks like; #include "stdafx.h" #include <iostream> #include <windows.h> #include <mysql.h> int _tmain(int argc, _TCHAR* argv[]) { return 0; } I think that my IDE is unable to find the path of the MYSQL Installation or some thing similar. What should i do to resolve this situation. Step by step instructions appreciated.

Join the discussion →

PHP / LDAP on inexpensive hosting plan

For my login system, I would like to check a username and password against a remote LDAP server using PHP. Can anyone tell me if just checking a user against LDAP will work on an inexpensive hosting plan from a company such as GoDaddy, 1&1, or Dreamhost? Ex: $objConn = ldap_connect($strDomain); I don't want to run an LDAP server, just simply use the LDAP functions of PHP to verify an account.

Join the discussion →

Keyboard Enter key not working in MFC Dialog Box?

Keyboard Enter key not working in MFC Dialog Box ? I have one MFC Login dialog box when I enter Username and password and hit Enter key the dialog box close down while when I use mouse to click on login it login's successfully. What I need to do for making keyboard key work in MFC ?

Join the discussion →

How to reduce default C++ memory consumption?

I have a server application written in C++. After startup, it uses about 480 KB of memory on x86 Linux (Ubuntu 8.04, GCC 4.2.4). I think 480 KB is an excessive amount of memory: the server isn't even doing anything yet, no clients have been connected to the server. (See also my comment below in which I explain why I think 480 KB is a lot of memory.) The only things the server does during initialization is spawning one or two threads, setting up a few sockets, and other simple things that aren't very memory-intensive. Note that I'm talking about real memory usage, not VM size. I measured it by

Join the discussion →

How to group the arguments while using Getopt::Long?

To a Perl script that I am writing, there can be a lot (~50) of command line options provided. Most of them are optional, so a call will have only some of the options provided. I am using Getopt::Long but it does not allow me to use GetOptions more than once. As a result, I have to use all the command line options in one GetOptions call. Is there some good way to group the options while using GetOptions? $ cat test.pl use strict; use warnings; use Getopt::Long; my ($a, $b, $c, $d); GetOptions ('a=s' => \$a, 'b=s' => \$b); GetOptions ('c=s' => \$c, 'd=s' => \$d); print "a = $a\nb = $b\nc = $c\n

Join the discussion →

What is the best practice to use when using PHP and HTML?

I have been designing websites for a while now, but there is one thing that I have never been quite sure of when using PHP and HTML. Is it better to have the whole document in PHP and echo HTML like so: <?php doSomething(); echo "<div id=\"some_div\">Content</div>"; ?> Or have a HTML file like so and just add in the PHP: <html> <body> <?php doSomething(); ?> <div id="some_div">Content</div> </body> </html> It seems tidier to echo HTML, especially if lots of PHP gets used throughout the page, but doing so loses all formatting of the HTML i.e. colors in the IDE etc.

Join the discussion →

The process could not execute 'sp_replcmds' on

I am having a lot of trouble setting up transactional replication on my test server. I am running SQL Server 2008 SP2. I am able to create a transactional publication. The snapshot agent works fine and subscribing to the publication works fine as well. The problem that I get is that the log reader agent fails with the error: The process could not execute 'sp_replcmds' on [ServerName] The snapshot and log reader agents are run under a windows account with administrator privileges on the domain and sysadmin privileges on the sql server. I have also tried running the agents under the SQL agent pr

Join the discussion →

Value of type 'T' cannot be converted to

This is likely a a novice question, but google surprisingly did not provide an answer. I have this rather artificial method T HowToCast<T>(T t) { if (typeof(T) == typeof(string)) { T newT1 = "some text"; T newT2 = (string)t; } return t; } Coming from a C++ background I have expected this to work. However, it fails to compile with "Cannot implicitly convert type 'T' to string" and "Cannot convert type 'T' to string" for both of the above assignments. I am either doing something conceptually wrong or just have the wrong syntax. Please help me sort this one out. Thank you!

Join the discussion →

How reduce background noise while recording in iphone?

I am planning to compare two audio files. i have recorded two voices and compared them using cross correlation. since the presence on background noise while recording the resulting correlation value is always near 0.5.If i give any recorded waves from internet , i am able to get the correct value. So how can i reduce the background noise while recording.Please guide me .Thanks. Is there any possibility to reduce noise from the recorded .wav file?

Join the discussion →

Detect duplicated/similar text among large datasets?

I have a large database with thousands records. Every time a user post his information I need to know if there is already the same/similar record. Are there any algorithms or open source implementations to solve this problem? We're using Chinese, and what 'similar' means is the records have most identical content, might be 80%-100% are the same. Each record will not be too big, about 2k-6k bytes

Join the discussion →

What second language to use besides Scala for LowLevel? [closed]

I am absolutely happy with Scala and just love it :) But sometimes I really want to go a bit more "low level", without a JVM and using "cool" CPU-Features like SSE etc. So what would be a good second language besides Scala? It should be: Compiled to machine code Easy usage of C-libraries Possible to program very close to the hardware Possible to program in a very highlevel-way when I want to So basically I want a Scala where I can just throw in inline assembler when I want to :) I assume, that such a language does not exist, but maybe there are some that come close. So what would be a good cho

Join the discussion →

How to know if there is a git rebase in progress?

When I start a git rebase -i, I can issue commands like git rebase --continue, or git rebase --abort. Those commands only work if a rebase is in progress. How can I know if there is a rebase in progress? (I would greatly appreciate some details on how rebase works internally; what does git do to a repo that gives it the "rebase in progress" status,?)

Join the discussion →

Semantic structure in HTML - Subtitles (Pre-HTML5)

I'm new to HTML and want to make semantically correct HTML, however I'm finding it hard to work with what seems to be only headings, lists and paragraphs. Particularly, I can't find a place that makes sense for subtitles. I'm writing a blog site so lets use that as an example: A BLOG TITLE the best blog in the world post_title1 post_title2 post_title3 Semantically 'A BLOG TITLE' is h1. It makes sense to me that the post_titleX are h2, but it doesn't feel right for the subtitle - 'the best blog in the world' to be classed at the same level as them.

Join the discussion →

Raise warning in Python without interrupting program

I am trying to raise a Warning in Python without making the program crash / stop / interrupt. I use the following simple function to check if the user passed a non-zero number to it. If so, the program should warn them, but continue as per normal. It should work like the code below, but should use class Warning(), Error() or Exception() instead of printing the warning out manually. def is_zero(i): if i != 0: print "OK" else: print "WARNING: the input is 0!" return i If I use the code below and pass 0 to the function, the program crashes and the value is never returned. Instead, I want the prog

Join the discussion →
Older stories