Daily Archives

Articles indexed Tuesday May 25 2010

Page 11/118 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How to combine array list string in java ?

    - by tiendv
    I have some arraylist string with keyword inside like that ! A windows is arraylist string with keyword is bold Struct of window : 9 words before + keyword + 9 words after You can see some window overlaping How to i combine that arraylist to receive like that : Thanks

    Read the article

  • Problem with stackless python, cannot write to a dict

    - by ANON
    I have simple map-reduce type algorithm, which I want to implement in python and make use of multiple cores. I read somewhere that threads using native thread module in 2.6 dont make use of multiple cores. is that true? I even implemented it using stackless python however i am getting into weird errors [Update: a quick search showed that the stack less does not allows multiple cores So are their any other alternatives?] def Propagate(start,end): print "running Thread with range: ",start,end def maxVote(nLabels): count = {} maxList = [] maxCount = 0 for nLabel in nLabels: if nLabel in count: count[nLabel] += 1 else: count[nLabel] = 1 #Check if the count is max if count[nLabel] > maxCount: maxCount = count[nLabel]; maxList = [nLabel,] elif count[nLabel]==maxCount: maxList.append(nLabel) return random.choice(maxList) for num in range(start,end): node=MapList[num] nLabels = [Label[k] for k in Adj[node]] if (nLabels!=[]): Label[node] = maxVote(nLabels) else: Label[node]=node However in above code the values assigned to Label, that is the change in dictionary are lost. Above propagate function is used as callable for MicroThreads (i.e. TaskLets)

    Read the article

  • DirectShow: Video-Preview and Image (with working code)

    - by xsl
    Questions / Issues If someone can recommend me a good free hosting site I can provide the whole project file. As mentioned in the text below the TakePicture() method is not working properly on the HTC HD 2 device. It would be nice if someone could look at the code below and tell me if it is right or wrong what I'm doing. Introduction I recently asked a question about displaying a video preview, taking camera image and rotating a video stream with DirectShow. The tricky thing about the topic is, that it's very hard to find good examples and the documentation and the framework itself is very hard to understand for someone who is new to windows programming and C++ in general. Nevertheless I managed to create a class that implements most of this features and probably works with most mobile devices. Probably because the DirectShow implementation depends a lot on the device itself. I could only test it with the HTC HD and HTC HD2, which are known as quite incompatible. HTC HD Working: Video preview, writing photo to file Not working: Set video resolution (CRASH), set photo resolution (LOW quality) HTC HD 2 Working: Set video resolution, set photo resolution Problematic: Video Preview rotated Not working: Writing photo to file To make it easier for others by providing a working example, I decided to share everything I have got so far below. I removed all of the error handling for the sake of simplicity. As far as documentation goes, I can recommend you to read the MSDN documentation, after that the code below is pretty straight forward. void Camera::Init() { CreateComObjects(); _captureGraphBuilder->SetFiltergraph(_filterGraph); InitializeVideoFilter(); InitializeStillImageFilter(); } Dipslay a video preview (working with any tested handheld): void Camera::DisplayVideoPreview(HWND windowHandle) { IVideoWindow *_vidWin; _filterGraph->QueryInterface(IID_IMediaControl,(void **) &_mediaControl); _filterGraph->QueryInterface(IID_IVideoWindow, (void **) &_vidWin); _videoCaptureFilter->QueryInterface(IID_IAMVideoControl, (void**) &_videoControl); _captureGraphBuilder->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, _videoCaptureFilter, NULL, NULL); CRect rect; long width, height; GetClientRect(windowHandle, &rect); _vidWin->put_Owner((OAHWND)windowHandle); _vidWin->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS); _vidWin->get_Width(&width); _vidWin->get_Height(&height); height = rect.Height(); _vidWin->put_Height(height); _vidWin->put_Width(rect.Width()); _vidWin->SetWindowPosition(0,0, rect.Width(), height); _mediaControl->Run(); } HTC HD2: If set SetPhotoResolution() is called FindPin will return E_FAIL. If not, it will create a file full of null bytes. HTC HD: Works void Camera::TakePicture(WCHAR *fileName) { CComPtr<IFileSinkFilter> fileSink; CComPtr<IPin> stillPin; CComPtr<IUnknown> unknownCaptureFilter; CComPtr<IAMVideoControl> videoControl; _imageSinkFilter.QueryInterface(&fileSink); fileSink->SetFileName(fileName, NULL); _videoCaptureFilter.QueryInterface(&unknownCaptureFilter); _captureGraphBuilder->FindPin(unknownCaptureFilter, PINDIR_OUTPUT, &PIN_CATEGORY_STILL, &MEDIATYPE_Video, FALSE, 0, &stillPin); _videoCaptureFilter.QueryInterface(&videoControl); videoControl->SetMode(stillPin, VideoControlFlag_Trigger); } Set resolution: Works great on HTC HD2. HTC HD won't allow SetVideoResolution() and only offers one low resolution photo resolution: void Camera::SetVideoResolution(int width, int height) { SetResolution(true, width, height); } void Camera::SetPhotoResolution(int width, int height) { SetResolution(false, width, height); } void Camera::SetResolution(bool video, int width, int height) { IAMStreamConfig *config; config = NULL; if (video) { _captureGraphBuilder->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, _videoCaptureFilter, IID_IAMStreamConfig, (void**) &config); } else { _captureGraphBuilder->FindInterface(&PIN_CATEGORY_STILL, &MEDIATYPE_Video, _videoCaptureFilter, IID_IAMStreamConfig, (void**) &config); } int resolutions, size; VIDEO_STREAM_CONFIG_CAPS caps; config->GetNumberOfCapabilities(&resolutions, &size); for (int i = 0; i < resolutions; i++) { AM_MEDIA_TYPE *mediaType; if (config->GetStreamCaps(i, &mediaType, reinterpret_cast<BYTE*>(&caps)) == S_OK ) { int maxWidth = caps.MaxOutputSize.cx; int maxHeigth = caps.MaxOutputSize.cy; if(maxWidth == width && maxHeigth == height) { VIDEOINFOHEADER *info = reinterpret_cast<VIDEOINFOHEADER*>(mediaType->pbFormat); info->bmiHeader.biWidth = maxWidth; info->bmiHeader.biHeight = maxHeigth; info->bmiHeader.biSizeImage = DIBSIZE(info->bmiHeader); config->SetFormat(mediaType); DeleteMediaType(mediaType); break; } DeleteMediaType(mediaType); } } } Other methods used to build the filter graph and create the COM objects: void Camera::CreateComObjects() { CoInitialize(NULL); CoCreateInstance(CLSID_CaptureGraphBuilder, NULL, CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2, (void **) &_captureGraphBuilder); CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **) &_filterGraph); CoCreateInstance(CLSID_VideoCapture, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void**) &_videoCaptureFilter); CoCreateInstance(CLSID_IMGSinkFilter, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void**) &_imageSinkFilter); } void Camera::InitializeVideoFilter() { _videoCaptureFilter->QueryInterface(&_propertyBag); wchar_t deviceName[MAX_PATH] = L"\0"; GetDeviceName(deviceName); CComVariant comName = deviceName; CPropertyBag propertyBag; propertyBag.Write(L"VCapName", &comName); _propertyBag->Load(&propertyBag, NULL); _filterGraph->AddFilter(_videoCaptureFilter, L"Video Capture Filter Source"); } void Camera::InitializeStillImageFilter() { _filterGraph->AddFilter(_imageSinkFilter, L"Still image filter"); _captureGraphBuilder->RenderStream(&PIN_CATEGORY_STILL, &MEDIATYPE_Video, _videoCaptureFilter, NULL, _imageSinkFilter); } void Camera::GetDeviceName(WCHAR *deviceName) { HRESULT hr = S_OK; HANDLE handle = NULL; DEVMGR_DEVICE_INFORMATION di; GUID guidCamera = { 0xCB998A05, 0x122C, 0x4166, 0x84, 0x6A, 0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86 }; di.dwSize = sizeof(di); handle = FindFirstDevice(DeviceSearchByGuid, &guidCamera, &di); StringCchCopy(deviceName, MAX_PATH, di.szLegacyName); } Full header file: #ifndef __CAMERA_H__ #define __CAMERA_H__ class Camera { public: void Init(); void DisplayVideoPreview(HWND windowHandle); void TakePicture(WCHAR *fileName); void SetVideoResolution(int width, int height); void SetPhotoResolution(int width, int height); private: CComPtr<ICaptureGraphBuilder2> _captureGraphBuilder; CComPtr<IGraphBuilder> _filterGraph; CComPtr<IBaseFilter> _videoCaptureFilter; CComPtr<IPersistPropertyBag> _propertyBag; CComPtr<IMediaControl> _mediaControl; CComPtr<IAMVideoControl> _videoControl; CComPtr<IBaseFilter> _imageSinkFilter; void GetDeviceName(WCHAR *deviceName); void InitializeVideoFilter(); void InitializeStillImageFilter(); void CreateComObjects(); void SetResolution(bool video, int width, int height); }; #endif

    Read the article

  • Internal Server Error with mod_wgsi [django] on windows xp

    - by sacabuche
    when i run development server it works very well, even an empty project runing in mod_wsgi i have no problem but when i want to put my own project i get an Internal Server Error (500) in my apache conf i put WSGIScriptAlias /codevents C:/django/apache/CODEvents.wsgi <Directory "C:/django/apache"> Order allow,deny Allow from all </Directory> Alias /codevents/media C:/django/projects/CODEvents/html <Directory "C:/django/projects/CODEvents/html"> Order allow,deny Allow from all </Directory> in CODEvents.wsgi import os, sys sys.path.append('C:\\Python26\\Lib\\site-packages\\django') sys.path.append('C:\\django\\projects') sys.path.append('C:\\django\\apps') sys.path.append('C:\\django\\projects\\CODEvents') os.environ['DJANGO_SETTINGS_MODULE'] = 'CODEvents.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() and in my error_log it said: [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] mod_wsgi (pid=1848): Exception occurred processing WSGI script 'C:/django/apache/CODEvents.wsgi'. [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] Traceback (most recent call last): [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 241, in __call__ [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] response = self.get_response(request) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\core\\handlers\\base.py", line 142, in get_response [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self.handle_uncaught_exception(request, resolver, exc_info) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\core\\handlers\\base.py", line 166, in handle_uncaught_exception [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return debug.technical_500_response(request, *exc_info) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\views\\debug.py", line 58, in technical_500_response [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] html = reporter.get_traceback_html() [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\views\\debug.py", line 137, in get_traceback_html [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return t.render(c) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\__init__.py", line 173, in render [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self._render(context) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\__init__.py", line 167, in _render [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self.nodelist.render(context) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\__init__.py", line 796, in render [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] bits.append(self.render_node(node, context)) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\debug.py", line 72, in render_node [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] result = node.render(context) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\debug.py", line 89, in render [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] output = self.filter_expression.resolve(context) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\__init__.py", line 579, in resolve [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] new_obj = func(obj, *arg_vals) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\defaultfilters.py", line 693, in date [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return format(value, arg) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\dateformat.py", line 281, in format [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return df.format(format_string) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\dateformat.py", line 30, in format [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] pieces.append(force_unicode(getattr(self, piece)())) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\dateformat.py", line 187, in r [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self.format('D, j M Y H:i:s O') [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\dateformat.py", line 30, in format [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] pieces.append(force_unicode(getattr(self, piece)())) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\encoding.py", line 66, in force_unicode [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] s = unicode(s) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\functional.py", line 206, in __unicode_cast [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self.__func(*self.__args, **self.__kw) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\__init__.py", line 55, in ugettext [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return real_ugettext(message) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\functional.py", line 55, in _curried [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\__init__.py", line 36, in delayed_loader [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return getattr(trans, real_name)(*args, **kwargs) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", line 276, in ugettext [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return do_translate(message, 'ugettext') [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", line 266, in do_translate [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] _default = translation(settings.LANGUAGE_CODE) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", line 176, in translation [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] default_translation = _fetch(settings.LANGUAGE_CODE) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", line 159, in _fetch [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] app = import_module(appname) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\importlib.py", line 35, in import_module [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] __import__(name) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\contrib\\admin\\__init__.py", line 1, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\contrib\\admin\\helpers.py", line 1, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] from django import forms [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\forms\\__init__.py", line 17, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] from models import * [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\forms\\models.py", line 6, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] from django.db import connections [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\db\\__init__.py", line 75, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] connection = connections[DEFAULT_DB_ALIAS] [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\db\\utils.py", line 91, in __getitem__ [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] backend = load_backend(db['ENGINE']) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\db\\utils.py", line 49, in load_backend [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] raise ImproperlyConfigured(error_msg) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] TemplateSyntaxError: Caught ImproperlyConfigured while rendering: 'django.db.backends.postgresql_psycopg2' isn't an available database backend. [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] Try using django.db.backends.XXX, where XXX is one of: [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] 'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3' [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] Error was: cannot import name utils please help me!!

    Read the article

  • Basic SQL Select in Postgresql fails

    - by Rhubarb
    I am doing a select * on a postgresql table, and everything looks good. But if I do: SELECT Name from People It says: ERROR: column People.Name does not exist SQL state: 42703 Character: 8 But the name column shows up during select *. I've tried: SELECT People.Name from People as well, with the same result. Am I missing something? It should be pretty easy to do this in any other database.

    Read the article

  • Built in method to encode ampersands in urls returned from Url.Action?

    - by Blegger
    I am using Url.Action to generate a URL with two query parameters on a site that has a doctype of XHTML strict. Url.Action("ActionName", "ControllerName", new { paramA="1" paramB="2" }) generates: /ControllerName/ActionName/?paramA=1&paramB=2 but I need it to generate the url with the ampersand escaped: /ControllerName/ActionName/?paramA=1&amp;paramB=2 The fact that Url.Action is returning the URL with the ampersand not escaped breaks my HTML validation. My current solution is to just manually replace ampersand in the URL returned from Url.Action with an escaped ampersand. Is there a built in or better solution to this problem?

    Read the article

  • CAML query with nonexistent field

    - by Jason Hocker
    We need to have a web service that queries a sharepoint list using CAML, but we do not know what version of the list that we are using. Version introduced a new field we want to use in the query if it is present, but just ignore that otherwise. If I put it in the query on the old version, we get no results. How should I check if the field exists before setting up the query?

    Read the article

  • Match d-M-Y with javascript regex how?

    - by bakerjr
    Hi, my date formatting in PHP is d-M-Y and I'm trying to match the dates with a javascript regex: s.match(new RegExp(/^(\d{1,2})(\-)(\w{3})(\-)(\d{4})$/)) To be used with the jQuery plugin, tablesorter. The problem is it's not working and I'm wondering why not. I tried removing the dashes in my date() formatting (d M Y) and tried the ff and it worked: s.match(new RegExp(/^\d{1,2}[ ]\w{3}[ ]\d{4}$/)); My question is what is the correct regex if I'm using dashes on PHP's date() i.e. d-M-Y? Thanks!

    Read the article

  • Help needed in pivoting(SQL SERVER 2005)

    - by Newbie
    I have a table like ID Grps Vals --- ---- ----- 1 1 1 1 1 3 1 1 45 1 2 23 1 2 34 1 2 66 1 3 10 1 3 17 1 3 77 2 1 144 2 1 344 2 1 555 2 2 11 2 2 22 2 2 33 2 3 55 2 3 67 2 3 77 The desired output being ID Record1 Record2 Record3 --- ------- ------- ------- 1 1 23 10 1 3 34 17 1 45 66 77 2 144 11 55 2 344 22 67 2 555 33 77 I have tried(using while loop) but the program is running slow. I have been asked to do so by using SET based approach Can any one please help to solve this.(SQL SERVER 2005)

    Read the article

  • How to get SQL Profiler to monitor trigger execution

    - by firedfly
    I have a trace setup for SQL Server Profiler to monitor SQL that is executed on a database. I recently discovered that trigger execution is not included in the trace. After looking through available events for a trace, I do not see any that look like they would include trigger execution. Does anyone know how to setup a trace to monitor the execution of triggers?

    Read the article

  • Exception of Binding form data to object

    - by Captain Kidd
    I'm practising Spring MVC.But fail to populate command object in Controller when I use spring standard tag. For example: "form:input path="password"" But I perfectly do this with HTML standard tag. Like: "input type="text" name="password"" I wonder the way how to use Spring tag binding data. In addition, I think configuration and coding is right in my sample. protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { UserFormBean b = (UserFormBean)command; System.out.println("s"); return super.onSubmit(request, response, command, errors); } <form:form commandName="command" action="/SpringFrame/register.html"> <form:input path="password"/> <!-- <input type="text" name="password"/> --> <input type="submit"/> </form:form>

    Read the article

  • GNU Smalltalk text interface hard to use

    - by None
    I built GNU Smalltalk from source on my Mac because I couldn't get it working using fink and I found VMs like Squeak hard to understand. When I run the gst command it works fine, but unlike command line interfaces such the Python and Lua ones, it is hard to use because when I use the left or right arrow keys, I want the cursor to move left or right, but instead it inserts text like "^[[D". I understand why it does this but is there any way to fix it so it is more usable?

    Read the article

  • How to adjust video recording brightness?

    - by Paul
    When I record videos in low-light conditions on my Motorola Droid results are poor... very dark images. On my old phone, an LG Dare, recording in low light works better thanks to a brightness adjustment in the video recorder which can be set manually... Android does not have a similar brightness adjustment when recording video. Does anyone have suggestions for how to adjust the brightness using Android's APIs? I have searched the official APIs, but I cannot find a way to control brightness.

    Read the article

  • How do I alter the default style of a button without WPF reverting from Aero to Classic?

    - by DanM
    I've added PresentationFramework.Aero to my App.xaml merged dictionaries, as in... <Application x:Class="TestApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml" /> <ResourceDictionary Source="pack://application:,,,/WPFToolkit;component/Themes/Aero.NormalColor.xaml" /> <ResourceDictionary Source="ButtonResourceDictionary.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> I'm trying to modify the default look of buttons just slightly. I put this style in my ButtonResourceDictionary: <Style TargetType="Button"> <Setter Property="Padding" Value="3" /> <Setter Property="FontWeight" Value="Bold" /> </Style> All buttons now have the correct padding and bold text, but they look "Classic", not "Aero". How do I fix this style so my buttons all look Aero but also have these minor changes? I would prefer not to have to set the Style property for every button.

    Read the article

  • Where does User.Identity data come from?

    - by niaher
    For example: if I am retrieving User.Identity.Name, does it come from .ASPXAUTH cookie or is retrieved from the database using my membership provider? Are any database requests made when I access User.Identity? Thanks. EDIT: Right now I am pretty sure it comes from an authentication ticket cookie, but can't find any official documentation to confirm this. Anyone?

    Read the article

  • Looking for a generic handler/service for mongodb and asp.net / c#

    - by JohnAgan
    I am new to MongoDB and have a perfect place in mind to use it. However, it's only worth it if I can make the queries from JavaScript and return JSON. I read another post on here of someone asking a similar question, but not specific to C#. What's the easiest way I can implement a generic service/handler in asp.net/c# that would allow me to interact with mongodb via JavaScript? I understand JavaScript can't call mongodb directly, so the next best thing is what I'm looking for.

    Read the article

  • Internal Server Error with mod_wsgi [django] on windows xp

    - by sacabuche
    when i run development server it works very well, even an empty project runing in mod_wsgi i have no problem but when i want to put my own project i get an Internal Server Error (500) in my apache conf i put WSGIScriptAlias /codevents C:/django/apache/CODEvents.wsgi <Directory "C:/django/apache"> Order allow,deny Allow from all </Directory> Alias /codevents/media C:/django/projects/CODEvents/html <Directory "C:/django/projects/CODEvents/html"> Order allow,deny Allow from all </Directory> in CODEvents.wsgi import os, sys sys.path.append('C:\\Python26\\Lib\\site-packages\\django') sys.path.append('C:\\django\\projects') sys.path.append('C:\\django\\apps') sys.path.append('C:\\django\\projects\\CODEvents') os.environ['DJANGO_SETTINGS_MODULE'] = 'CODEvents.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() and in my error_log it said: [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] mod_wsgi (pid=1848): Exception occurred processing WSGI script 'C:/django/apache/CODEvents.wsgi'. [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] Traceback (most recent call last): [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 241, in __call__ [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] response = self.get_response(request) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\core\\handlers\\base.py", line 142, in get_response [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self.handle_uncaught_exception(request, resolver, exc_info) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\core\\handlers\\base.py", line 166, in handle_uncaught_exception [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return debug.technical_500_response(request, *exc_info) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\views\\debug.py", line 58, in technical_500_response [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] html = reporter.get_traceback_html() [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\views\\debug.py", line 137, in get_traceback_html [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return t.render(c) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\__init__.py", line 173, in render [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self._render(context) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\__init__.py", line 167, in _render [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self.nodelist.render(context) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\__init__.py", line 796, in render [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] bits.append(self.render_node(node, context)) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\debug.py", line 72, in render_node [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] result = node.render(context) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\debug.py", line 89, in render [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] output = self.filter_expression.resolve(context) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\__init__.py", line 579, in resolve [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] new_obj = func(obj, *arg_vals) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\template\\defaultfilters.py", line 693, in date [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return format(value, arg) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\dateformat.py", line 281, in format [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return df.format(format_string) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\dateformat.py", line 30, in format [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] pieces.append(force_unicode(getattr(self, piece)())) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\dateformat.py", line 187, in r [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self.format('D, j M Y H:i:s O') [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\dateformat.py", line 30, in format [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] pieces.append(force_unicode(getattr(self, piece)())) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\encoding.py", line 66, in force_unicode [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] s = unicode(s) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\functional.py", line 206, in __unicode_cast [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return self.__func(*self.__args, **self.__kw) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\__init__.py", line 55, in ugettext [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return real_ugettext(message) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\functional.py", line 55, in _curried [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\__init__.py", line 36, in delayed_loader [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return getattr(trans, real_name)(*args, **kwargs) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", line 276, in ugettext [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] return do_translate(message, 'ugettext') [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", line 266, in do_translate [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] _default = translation(settings.LANGUAGE_CODE) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", line 176, in translation [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] default_translation = _fetch(settings.LANGUAGE_CODE) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", line 159, in _fetch [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] app = import_module(appname) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\utils\\importlib.py", line 35, in import_module [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] __import__(name) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\contrib\\admin\\__init__.py", line 1, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\contrib\\admin\\helpers.py", line 1, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] from django import forms [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\forms\\__init__.py", line 17, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] from models import * [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\forms\\models.py", line 6, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] from django.db import connections [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\db\\__init__.py", line 75, in <module> [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] connection = connections[DEFAULT_DB_ALIAS] [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\db\\utils.py", line 91, in __getitem__ [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] backend = load_backend(db['ENGINE']) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] File "C:\\Python26\\lib\\site-packages\\django\\db\\utils.py", line 49, in load_backend [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] raise ImproperlyConfigured(error_msg) [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] TemplateSyntaxError: Caught ImproperlyConfigured while rendering: 'django.db.backends.postgresql_psycopg2' isn't an available database backend. [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] Try using django.db.backends.XXX, where XXX is one of: [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] 'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3' [Mon May 24 23:31:39 2010] [error] [client 127.0.0.1] Error was: cannot import name utils please help me!!

    Read the article

  • Designing Web Service Using Ruby on Rails - Mapping ActiveRecord Models

    - by michaeldelorenzo
    I've put together a RoR application and would now like to publish a RESTful web service for interacting with my application. I'm not sure where to go exactly, I don't want to simply expose my ActiveRecord models since there is some data on each model that isn't needed or shouldn't be exposed via an API like this. I also don't want to create a SOAP solution. My application is built using Rails 2.3.5 and I hope to move to Rails 3.0 soon after its released. I'm basically looking for a way to map my ActiveRecord models to "models" that would be exposed via the web service. Is ActiveResource the correct thing to use? What about ActionWebService?

    Read the article

  • How to make Spring accept fluent (non-void) setters?

    - by Chris
    Hi, I have an API which I am turning into an internal DSL. As such, most methods in my PoJos return a reference to this so that I can chain methods together declaratively as such (syntactic sugar). myComponent .setID("MyId") .setProperty("One") .setProperty2("Two") .setAssociation(anotherComponent) .execute(); My API does not depend on Spring but I wish to make it 'Spring-Friendly' by being PoJo friendly with zero argument constructors, getters and setters. The problem is that Spring seems to not detect my setter methods when I have a non-void return type. The return type of this is very convenient when chaining together my commands so I don't want to destroy my programmatic API just be to compatible with Spring injection. Is there a setting in Spring to allow me to use non-void setters? Chris

    Read the article

  • application monitoring tools

    - by Shachar
    we're an ISV about to deploy our SaaS application over the internet to our end users, and are currently looking for an application monitoring solution. In addition to monitoring the usual OS-level suspects (I/O, disk space, logs, CPU, RAM, swapping, etc.), we're also looking to monitor, alert and report on internal application events, conditions, and counters (think queue size for internal service, or latency of a service we're getting from a third party via custom APIs). We're started looking at Nagios, Zenoss, etc., but found out those do only low-level stuff, and are currently looking at MOM and ManageEngine. Still, they are far from being an custom app monitoring tool. So - do you have anything to suggest?

    Read the article

  • Steve Jobs animera la keynote d'ouverture de la WWDC 2010, l'iPhone 4G y sera-t-il dévoilé ?

    Steve Jobs animera la keynote d'ouverture de la WWDC 2010, l'iPhone 4G y sera-t-il dévoilé ? Le lundi 7 juin s'ouvrira la WWDC, la Worldwide Developers Conference d'Apple. Cette édition 2010 débutera à 10 heures (heure locale, soit 19 heures à Paris) et sera lancée par une keynote d'ouverture, qui sera présenté par Steve Jobs en personne. L'information a été officiellement confirmée par Apple, qui indique également que plus de 5000 développeurs assisteront à l'évènement qui a affiché complet 8 jours seulement après la mise en vente des billets. L'un des sujets principaux qui y sera abordé sera l'iPhone 4. Plus de détails devraient être divulgués sur l'appareils, sans oublier qu'Apple pourrait aussi y faire des anno...

    Read the article

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