Daily Archives

Articles indexed Wednesday March 31 2010

Page 33/124 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Zend Dd Rowset getting parent row

    - by simple
    I am wondering about using the abstraction in Zend Db RowSet instead of joins, is it possible for instance I am able to get some info from parent table as in here /** * Get default photo info (path , description) */ public function getDefaultPhotoInfo($userdId){ $select = $this->select($this) ->where('id=?', $userdId); $rowset = $this->fetchAll($select); $current = $rowset->current(); $res = $current->findParentRow('UserPhotos', 'Avatar'); if(isset($res)){ return $res->toArray(); } } How can I use Rowset abstraction to get this logic working table( id, pic_path,) table_translation(id, table_id, lang_id, pic_title); the above is representation of two tables , the idea is to get the info from both table specifying the lang_id , it is easy with joins but can I do it with the abstraction of Db Rowset ?

    Read the article

  • SimpleDateFormat give inconsistent results

    - by Julien Gagnet
    I am trying to parse a date and I am getting different results when I run the code locally/BST compare to a server in Paris/CEST. I've reproduced the issue in a the following sample. This is trying to parse the start date for the Australian Grand Prix. TimeZone tz = TimeZone.getTimeZone("AET"); DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH mm"); dateFormat.setTimeZone(tz); long time = dateFormat.parse("28/03/2010 17 00").getTime(); System.out.println("Time "+time); It seems like I am setting the timezone correctly on the date format and the current timezone shouldn't be affecting the code. But locally it prints 1269756000000 and in Paris 1269759600000. Any idea?

    Read the article

  • Ellipsis notation in C#?

    - by Joshua
    Where can I get info about implementing my own methods that have the ellipsis notation, e.g. static void my_printf(char* format, ...) { } Also is that called ellipsis notation or is there a fancier name?

    Read the article

  • How to call parent window function in chrome browser?

    - by Pier Luigi
    HI, I've surprisingly found problems, in Chrome browser, in calling window parent javascript functions. If I have a window with a javascript function defined in it <script type="text/javascript"> function dolink() { . . . } </script> and I have an iframe inside that window that makes this call using jquery <script type="text/javascript"> $(function() { $('a.arglink').click(function() { window.parent.dolink($(this).attr('href')); return false; }); }); </script> the call to dolink function doesn't work. Stepping with chrome javascript debugger, it appears that window.parent.dolink is undefined. It's by design or a mistake that I made? In Firefox and IE it works fine.

    Read the article

  • Pass an Event as parameter

    - by dkson
    I have a class which bundles events and registers controls to easily register/unregister them, it's basically used this way: Private Sub MyFocusHandler(ByVal sender As Object, ...) ... End Sub ... Dim b1 = new MyTextBox() Dim b2 = new MyTextBox() .... 'Lot of Controls' Dim cr = new ControlRegistration() cr.RegisterControl(b1) cr.RegisterControl(b2) .... 'Register a lot of controls' cr.RegisterEvent("Focus",New EventHandler(AddressOf MyFocusHandler)) cr.RegisterEvent("Validate",New EventHandler(AddressOf MyValidateHandler)) So I don't have to add the handlers manually for each control. The ControlRegistration-Class will cycle through the list of registered controls and check if a control has a registered event and then attach the eventhandler, something like: ... For Each control in contols Dim ev_info As Reflection.EventInfo = _ control.GetType().GetEvent(.GetType().GetEvent(event_name)) If Not (ev_info Is Nothing) Then ev_info.AddEventHandler ... ... My problem is that i am identifying the event by a string Public Sub RegisterEvent(ByVal eventName As String, ByVal handler As [Delegate]) ... ... cr.RegisterEvent("Focus",New EventHandler(AddressOf MyFocusHandler)) I don't want to depend on the name of the event, since it is possibly that the name changes, and then things will break up. Is there a way I can do this like: Public Sub RegisterEvent(ByVal theEvent As ???, ByVal handler As [Delegate]) ... ... cr.RegisterEvent(IMyControl.MyEvent,New EventHandler(AddressOf MyEventHandler)) I hope it is clear what I want to archive. Anybody any ideas? Thanks

    Read the article

  • Trouble compiling libpng (& zlib) using RVCT 4.0's armcc compiler

    - by Arjun
    Hi, I'm trying to compile libpng & zlib using the RVCT 4.0 armcc compiler. However armcc cannot find 'fcntl.h', which I assume is a standard C library. Cygwin has fcntl.h (and the associated files types.h and _types.h), but when I use those, I get various compilation errors. Should I be using Cygwin's version of standard C libraries, or RVCT's? If the latter is correct, where do I get RVCT's versions of fcntl.h, types.h and _types.h? Thanks! Arjun

    Read the article

  • Tortoise SVN diff two trees

    - by Midhat
    Hi Consider the following situation Code was added to the trunk at revision x A branch was created The modifications of rev x were removed from trunk in rev x+10 trunk and branch goes their own ways till rev x+100 Now we need to update the branch with changes form the trunk The problem with a simple "merge a range of revisions" is that due to step 3, the initial branch modifications are being removed. Is there any way to work around this without resorting to manual merge. Version Info: TortoiseSVN 1.6.7, Build 18415 - 32 Bit , 2010/01/22 17:55:06 Subversion 1.6.9,

    Read the article

  • regex php: find everything in div

    - by Fifth-Edition
    I'm trying to find eveything inside a div using regexp. I'm aware that there probably is a smarter way to do this - but I've chosen regexp. so currently my regexp pattern looks like this: $gallery_pattern = '/([\s\S]*)<\/div/'; And it does the trick - somewhat. the problem is if i have two divs after each other - like this. <div class="gallery">text to extract here</div> <div class="gallery">text to extract from here as well</div> I want to extract the information from both divs, but my problem, when testing, is that im not getting the text in between as a result but instead: "text to extract here text to extract from here as well" So . to sum up. It skips the first end of the div. and continues on to the next. The text inside the div can contain "<", "/" and linebreaks. just so you know! Does anyone have a simple solution to this problem? Im still a regexp novice.

    Read the article

  • How can I transfer an NHibernate PersistentGenericSet over WCF

    - by Ian Oakes
    I'm trying to send objects retrieved by NHibernate over WCF, but whenever a have a property of ICollection I get an exception. When NHibernate gets the data from the database this property is intitialized with an instance of PersistentGenericSet. Is there a way I can send a PersistentGenericSet over WCF? -or- Is there some way making NHibernate initialize these properties with another type?

    Read the article

  • Can't view other computers on Network

    - by Darkart
    Systems: My Machine: Windows 7 Ultimate connected through ethernet into router Her Machine--Other Machine: Windows 7 Ultimate connected through wireless Router:F5D8236-4 N Wireless Router Version 1 Firmware: 2.01.03 (Apr 28 2009) ISP: Comcast Problem: I can not view the "Other Machine" on the network at all. I opened command prompt and ran net view and saw the pc name. I tried pinging the pc and it times out. Went inside the router and tried viewing the computer on the DHCP list and it can not be seen. I restored the router back to default settings and firmware and completely reset the modem and router, and created home group. I went to the other machine to configure home group settings and made sure that both PC's had identical settings. She was able to see my machine but I could not see hers. I restarted both machines and now we cant see each other at all. Also her PC ("Other Machine") had exclamation mark in the wireless icon but was connected just fine. There is no firewalls on currently or anti-virus enabled, and still can not see each other. Right now I am checking for updated drivers for the wireless card, but my question is could it be the router or something hardware related? I have went through all the settings in the Home group and visited most FAQ's and still no luck. Also as it stands I can not view her machine inside the router DHCP Client List :(

    Read the article

  • i have a win32 windows application and want to capture full screen and remove the border of window d

    - by moon
    win32 windows application and want to capture full screen and remove the border of window displayed any one tell me how can i do so if this window capture the mouse keyboard controls then it will be ideal? // MonitorScreen.cpp : Defines the entry point for the application. // include "stdafx.h" include "MonitorScreen.h" define MAX_LOADSTRING 100 // Global Variables: HINSTANCE hInst; // current instance TCHAR szTitle[MAX_LOADSTRING]; // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name // Forward declarations of functions included in this code module: ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); // TODO: Place code here. MSG msg; HACCEL hAccelTable; // Initialize global strings LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_MONITORSCREEN, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance); // Perform application initialization: if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MONITORSCREEN)); // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int) msg.wParam; } // // FUNCTION: MyRegisterClass() // // PURPOSE: Registers the window class. // // COMMENTS: // // This function and its usage are only necessary if you want this code // to be compatible with Win32 systems prior to the 'RegisterClassEx' // function that was added to Windows 95. It is important to call this function // so that the application will get 'well formed' small icons associated // with it. // ATOM MyRegisterClass(HINSTANCE hInstance) { WNDCLASSEX wcex; int s =sizeof(WNDCLASSEX); wcex.cbSize =sizeof(WNDCLASSEX); wcex.style = DESKTOP_HOOKCONTROL ;//CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = NULL;//hInstance; wcex.hIcon = NULL;//LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MONITORSCREEN)); wcex.hCursor = NULL;//LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(9); wcex.lpszMenuName = NULL;//MAKEINTRESOURCE(IDC_MONITORSCREEN); wcex.lpszClassName = szWindowClass; wcex.hIconSm = NULL;//LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); return RegisterClassEx(&wcex); } // // FUNCTION: InitInstance(HINSTANCE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; hInst = hInstance; // Store instance handle in our global variable hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); return TRUE; } // // FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) // // PURPOSE: Processes messages for the main window. // // WM_COMMAND - process the application menu // WM_PAINT - Paint the main window // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; switch (message) { case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } // Message handler for about box. INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (message) { case WM_INITDIALOG: return (INT_PTR)TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; } break; } return (INT_PTR)FALSE; }

    Read the article

  • Purpose of singletons in programming

    - by thecoshman
    This is admittedly a rather loose question. My current understanding of singletons is that they are a class that you set up in such a way that only one instance is ever created. This sounds a lot like a static class to me. The main differnce being that with a static class you don't / can't instance it, you just use it such as Math.pi(). With a singletong class, you would still need to do something like singleton mySingleton = new singleton(); mysingleton.set_name("foo"); singleton otherSingleton = new singleton(); // correct me if i am wrong, but mysingleton == othersingleton right now, yes? // this the following should happen? otherSingleston.set_name("bar"); mysingleton.report_name(); // will output "bar" won't it? Please note, I am asking this language independently, more about the concept. So I am not so worried about actually how to coed such a class, but more why you would wan't to and what thing you would need to consider.

    Read the article

  • Why Basic HTML gets loaded

    - by Priyanka
    Hello... When I browse internet,basic HTML gets loaded on my computer. For eg.- for orkut or facebook login,only the text box appears,and when inputs are provided,and redirection is done,it says "error on page". Even on google search,basic HTML gets loaded on my computer.. I tried installing new Internet version i.e., IE8,but the same problem. Kildly provide a good solution to this problem.

    Read the article

  • MySQl - update field by counting data in other table

    - by Qiao
    There are two tables. One is users info "users", one is comments info "comments". I need to create new field "comments" in users table, that contains number of comments of that user. Table "comments" has "user" field with user's id of that comment. What is optimal way to count number of comments by every user? With php you should write script that selects every user and than count number of his comments and then update "comments" field. It is not hard for me, but boring. Is it possible to do it without php, only in MySQL?

    Read the article

  • C#: Streaming an Audio file from a Server to a Client

    - by Andreas Grech
    I am currently writing an application that will allow a user to install some form of an application (maybe a Windows Service) that will open a port on it's PC and given a particular destination on the hard disk, will then be able to stream mp3 files. I will then have another application that will connect to the server (being the user's pc) and be able to browse the hosted data by connecting to that PC (remotely ofcourse) given the port, and stream mp3 files from the server to the application I have found some tutorials online but most of them are about File Servers in C# and they download allow you to download a whole file. What I want is to stream an mp3 file so that it starts playing when a certain number of bytes are download (ie, whilst it is being buffered) How do I go about in accomplishing such a task? What I need to know specifically is how to write this application (that I will turn into a Windows Service later on) that will listen on a specified port a stream files, so that I can then access the files by something of the sort: http://<serverip>:65000/acdc/wholelottarosie.mp3 and hopefully be able to stream that file in a WPF MediaPlayer. [Update] I was following this tutorial about building a file server and sending the file from the server to the client. Is what I have to do something of the sort? [Update] Currently reading this post: Play Audio from a Stream using C# and I think it looks very promising as to how I can play streamed files; but I still don't know how I can actually stream the files from the server.

    Read the article

  • CKEditor adds unwanted newline to '<p>'

    - by dove
    If I load up a set of paragraphs then the editor replaces my <p> with <p>&#x9; It means <p>paragraph 1</p> <p>paragraph 2</p> <p>paragraph 3</p> ends up like <p> paragraph 1</p> <p> paragraph 2</p> <p> paragraph 3</p> Has anyone come across this and know how to fix? It seems to be an issue but no response on their forum My humble guess from looking at their source is that this was introduced to remove a different bug. I've looked at the obvious configuration settings and the like.

    Read the article

  • How to list directory hierarchy in PyGTK treeview widget?

    - by lyrae
    I am trying to generate a hierarchical directory listing in pyGTK. Currently, I have this following directory tree: /root folderA - subdirA - subA.py - a.py folderB - b.py I have written a function that -almost- seem to work: def go(root, piter = None): for filename in os.listdir(root): isdir = os.path.isdir(os.path.join(root, filename)) piter = self.treestore.append(piter, [filename]) if isdir == True: go(os.path.join(root, filename), piter) This is what i get when i run the app: I also think my function is inefficient and that i should be using os.walk(), since it already exists for such purpose. How can I, and what is the proper/most efficient way of generating a directory tree with pyGTK?

    Read the article

  • "a.parentNode is undefined" error in this jquery function...

    - by Pandiya Chendur
    I use the following jquery pagination plugin and i got the error a.parentNode is undefined when i executed it... <script type="text/javascript"> $(document).ready(function() { getRecordspage(1, 5); $(".pager").pagination(17, { callback: pagechange, current_page: '0', items_per_page: '5', num_display_entries : '5', next_text: 'Next', prev_text: 'Prev', num_edge_entries: '1' }); }); function pagechange() { $(this).addClass('current').siblings().removeClass('current'); $("#ResultsDiv").empty(); $("#ResultsDiv").css('display', 'none'); getRecordspage($(this).text(), 5); } </script> and in my page, <div id="ResultsDiv" style="display:none;"> </div> <div id="pager" class="pager"> </div> Any suggestion....

    Read the article

  • GSM Modem Wavecom 900

    - by Sopolin
    Dear All, I have one GSM Modem Series 900. I want to test it for sending and receiving message to mobile. I can connect with this modem, but when I put my SIM Card and I type AT command like here: AT: Status "OK" AT+CPIN?: Status "+CPIN: PH-NET PIN" AT+CPIN="xxxx": Status "Error" I don't know why it can't connect with the SIM Card. So do you any solution to help me on this problem? Thanks, Sopolin

    Read the article

  • Get all model details in zend.

    - by Prasanth P
    Hi, I have one doubt in zend framework. I need all model details from project which i have done in zend framework. Is there any possibility to get all model details in zend framework. Please help me.. Thanks and regards, Prasanth P

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >