Search Results

Search found 1486 results on 60 pages for 'unsigned'.

Page 9/60 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • C program runs in Cygwin but not Linux (Malloc)

    - by Shawn
    I have a heap allocation error that I cant spot in my code that is picked up on vanguard/gdb on Linux but runs perfectly on a Windows cygwin environment. I understand that Linux could be tighter with its heap allocation than Windows but I would really like to have a response that discovers the issue/possible fix. I'm also aware that I shouldn't typecast malloc in C but it's a force of habit and doesn't change my problem from happening. My program actually compiles without error on both Linux & Windows but when I run it in Linux I get a scary looking result: malloc.c:3074: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)-bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) = (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)-size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed. Aborted Attached snippet from my code that is being pointed to as the error for review: /* Main */ int main(int argc, char * argv[]) { FILE *pFile; unsigned char *buffer; long int lSize; pFile = fopen ( argv[1] , "r" ); if (pFile==NULL) {fputs ("File error on arg[1]",stderr); return 1;} fseek (pFile , 0 , SEEK_END); lSize = ftell (pFile); rewind (pFile); buffer = (char*) malloc(sizeof(char) * lSize+1); if (buffer == NULL) {fputs ("Memory error",stderr); return 2;} bitpair * ppairs = (bitpair *) malloc(sizeof(bitpair) * (lSize+1)); //line 51 below calcpair(ppairs, (lSize+1)); /* irrelevant stuff */ fclose(pFile); free(buffer); free(ppairs); } typedef struct { long unsigned int a; //not actual variable names... Yes I need them to be long unsigned long unsigned int b; long unsigned int c; long unsigned int d; long unsigned int e; } bitpair; void calcpair(bitpair * ppairs, long int bits); void calcPairs(bitpair * ppairs, long int bits) { long int i, top, bot, var_1, var_2; int count = 0; for(i = 0; i < cs; i++) { top = 0; ppairs[top].e = 1; do { bot = count; count++; } while(ppairs[bot].e != 0); ppairs[bot].e = 1; var_1 = bot; var_2 = top; calcpair * bp = &ppairs[var_2]; bp->a = var_2; bp->b = var_1; bp->c = i; bp = &ppairs[var_1]; bp->a = var_2; bp->b = var_1; bp->c = i; } return; } gdb reports: free(): invalid pointer: 0x0000000000603290 * valgrind reports the following message 5 times before exiting due to "VALGRIND INTERNAL ERROR" signal 11 (SIGSEGV): Invalid read of size 8 ==2727== at 0x401043: calcPairs (in /home/user/Documents/5-3/ubuntu test/main) ==2727== by 0x400C9A: main (main.c:51) ==2727== Address 0x5a607a0 is not stack'd, malloc'd or (recently) free'd

    Read the article

  • MySQL stuck on "using filesort" when doing an "order by"

    - by noko
    I can't seem to get my query to stop using filesort. This is my query: SELECT s.`pilot`, p.`name`, s.`sector`, s.`hull` FROM `pilots` p LEFT JOIN `ships` s ON ( (s.`game` = p.`game`) AND (s.`pilot` = p.`id`) ) WHERE p.`game` = 1 AND p.`id` <> 2 AND s.`sector` = 43 AND s.`hull` > 0 ORDER BY p.`last_move` DESC Table structures: CREATE TABLE IF NOT EXISTS `pilots` ( `id` mediumint(5) unsigned NOT NULL AUTO_INCREMENT, `game` tinyint(3) unsigned NOT NULL DEFAULT '0', `last_move` int(10) NOT NULL DEFAULT '0', UNIQUE KEY `id` (`id`), KEY `last_move` (`last_move`), KEY `game_id_lastmove` (`game`,`id`,`last_move`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; CREATE TABLE IF NOT EXISTS `ships` ( `id` mediumint(5) unsigned NOT NULL AUTO_INCREMENT, `game` tinyint(3) unsigned NOT NULL DEFAULT '0', `pilot` mediumint(5) unsigned NOT NULL DEFAULT '0', `sector` smallint(5) unsigned NOT NULL DEFAULT '0', `hull` smallint(4) unsigned NOT NULL DEFAULT '50', UNIQUE KEY `id` (`id`), KEY `game` (`game`), KEY `pilot` (`pilot`), KEY `sector` (`sector`), KEY `hull` (`hull`), KEY `game_2` (`game`,`pilot`,`sector`,`hull`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; The explain: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE p ref id,game_id_lastmove game_id_lastmove 1 const 7 Using where; Using filesort 1 SIMPLE s ref game,pilot,sector... game_2 6 const,fightclub_alpha.p.id,const 1 Using where; Using index edit: I cut some of the unnecessary pieces out of my queries/table structure. Anybody have any ideas?

    Read the article

  • Two n x m relationships with the same table in mysql

    - by Christian
    I want to create a database in which there's an n x m relationship between the table drug and the table article and an n x m relationship between the table target and the table article. I get the error: Cannot delete or update a parent row: a foreign key constraint fails What do I have to change in my code? DROP TABLE IF EXISTS `textmine`.`article`; CREATE TABLE `textmine`.`article` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Pubmed ID', `abstract` blob NOT NULL, `authors` blob NOT NULL, `journal` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `textmine`.`drugs`; CREATE TABLE `textmine`.`drugs` ( `id` int(10) unsigned NOT NULL COMMENT 'This ID is taken from the biosemantics dictionary', `primaryName` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `textmine`.`targets`; CREATE TABLE `textmine`.`targets` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `primaryName` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `textmine`.`containstarget`; CREATE TABLE `textmine`.`containstarget` ( `targetid` int(10) unsigned NOT NULL, `articleid` int(10) unsigned NOT NULL, KEY `target` (`targetid`), KEY `article` (`articleid`), CONSTRAINT `article` FOREIGN KEY (`articleid`) REFERENCES `article` (`id`), CONSTRAINT `target` FOREIGN KEY (`targetid`) REFERENCES `targets` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `textmine`.`contiansdrug`; CREATE TABLE `textmine`.`contiansdrug` ( `drugid` int(10) unsigned NOT NULL, `articleid` int(10) unsigned NOT NULL, KEY `drug` (`drugid`), KEY `article` (`articleid`), CONSTRAINT `article` FOREIGN KEY (`articleid`) REFERENCES `article` (`id`), CONSTRAINT `drug` FOREIGN KEY (`drugid`) REFERENCES `drugs` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    Read the article

  • SD card initialization using SPI interface

    - by Tobias
    I get invalid response Codes from my SD Card(CMD8, CMD55, CMD41) Init routine: SDCS = 1; // MMC deaktiviert SPI1CON1bits.SMP = 0; SPI1CON1bits.CKE = 1; SPI1CON1bits.MSTEN = 1; SPI1CON1bits.CKP = 0; SPI1STATbits.SPIEN = 1; for(i=0;i<10;i++) SPI(0xFF); // RESET unsigned char rr=Command(CMD0,0); SDCS=1; // MMC deactivated /*OK response == 1*/ r=Command(CMD8,0); // check voltage SDCS=1; /* response == 0xC1 ?!? */ r = Command(CMD58,0); // READ_OCR unsigned char ocr1 = SPI(0xFF); unsigned char ocr2 = SPI(0xFF); unsigned char ocr3 = SPI(0xFF); unsigned char ocr4 = SPI(0xFF); unsigned char ocr5 = SPI(0xFF); /* r = 0xF8; ?!? ocr1 = 0x0F; ocr2 = 0xFF; ocr3 = 0xFF; ocr4 = 0xFF; ocr5 = 0xFF; */ SDCS=1; // INIT unsigned char rrr = 0; i=10000; do { rrr=Command(55,0); // Next is APP CMD SDCS=1; if(r) break; }while(--i>0); /* OK response == 1 */ // APP CMD 41 with OCR = 0x0F?? You can read the response codes in the comments. Is it possible the response code to CMD8 is 0xC1? Bit 7 should be 0, right? Is it a hardware error?

    Read the article

  • Compile time float packing/punning

    - by detly
    I'm writing C for the PIC32MX, compiled with Microchip's PIC32 C compiler (based on GCC 3.4). My problem is this: I have some reprogrammable numeric data that is stored either on EEPROM or in the program flash of the chip. This means that when I want to store a float, I have to do some type punning: typedef union { int intval; float floatval; } IntFloat; unsigned int float_as_int(float fval) { IntFloat intf; intf.floatval = fval; return intf.intval; } // Stores an int of data in whatever storage we're using void StoreInt(unsigned int data, unsigned int address); void StoreFPVal(float data, unsigned int address) { StoreInt(float_as_int(data), address); } I also include default values as an array of compile time constants. For (unsigned) integer values this is trivial, I just use the integer literal. For floats, though, I have to use this Python snippet to convert them to their word representation to include them in the array: import struct hex(struct.unpack("I", struct.pack("f", float_value))[0]) ...and so my array of defaults has these indecipherable values like: const unsigned int DEFAULTS[] = { 0x00000001, // Some default integer value, 1 0x3C83126F, // Some default float value, 0.005 } (These actually take the form of X macro constructs, but that doesn't make a difference here.) Commenting is nice, but is there a better way? It's be great to be able to do something like: const unsigned int DEFAULTS[] = { 0x00000001, // Some default integer value, 1 COMPILE_TIME_CONVERT(0.005), // Some default float value, 0.005 } ...but I'm completely at a loss, and I don't even know if such a thing is possible. Notes Obviously "no, it isn't possible" is an acceptable answer if true. I'm not overly concerned about portability, so implementation defined behaviour is fine, undefined behaviour is not (I have the IDB appendix sitting in front of me). As fas as I'm aware, this needs to be a compile time conversion, since DEFAULTS is in the global scope. Please correct me if I'm wrong about this.

    Read the article

  • From where starts the process' memory space and where does it end?

    - by nhaa123
    Hi, I'm trying to dump memory from my application where the variables lye. Here's the function: void MyDump(const void *m, unsigned int n) { const unsigned char *p = reinterpret_cast<const unsigned char *(m); char buffer[16]; unsigned int mod = 0; for (unsigned int i = 0; i < n; ++i, ++mod) { if (mod % 16 == 0) { mod = 0; std::cout << " | "; for (unsigned short j = 0; j < 16; ++j) { switch (buffer[j]) { case 0xa: case 0xb: case 0xd: case 0xe: case 0xf: std::cout << " "; break; default: std::cout << buffer[j]; } } std::cout << "\n0x" << std::setfill('0') << std::setw(8) << std::hex << (long)i << " | "; } buffer[i % 16] = p[i]; std::cout << std::setw(2) << std::hex << static_cast<unsigned int(p[i]) << " "; if (i % 4 == 0 && i != 1) std::cout << " "; } } Now, how can I know from which address starts my process memory space, where all the variables are stored? And how do I now, how long the area is? For instance: MyDump(0x0000 /* <-- Starts from here? */, 0x1000 /* <-- This much? */); Best regards, nhaa123

    Read the article

  • Using OpenGL vertex buffers in C++.

    - by Ren
    I've loaded a Wavefront .obj file and drawn it in immediate mode, and it works fine. I'm now trying to draw the same model with a vertex buffer, but I have a question. My model data is organized in the following structures: struct Vert { double x; double y; double z; }; struct Norm { double x; double y; double z; }; struct Texcoord { double u; double v; double w; }; struct Face { unsigned int v[3]; unsigned int n[3]; unsigned int t[3]; }; struct Model { unsigned int vertNumber; unsigned int normNumber; unsigned int texcoordNumber; unsigned int faceNumber; Vert * vertArray; Norm * normArray; Texcoord * texcoordArray; Face * faceArray; }; As it is now, I don't think there is any redundant data, since multiple face structures can point to the same vertex, normal, or texture coordinate. When I make vbo's for the vertex positions, normals, and texture coordinates, and assign data to them with glBufferData, do I have to have make arrays with redundant data so that they will all have the same number of elements in the same order? I'd like to know if there is a simpler way to fill the buffers with the way I already have the model's data organized.

    Read the article

  • Error compiling / linking e text editor on Linux

    - by jckdnk111
    The code compiles without too much complaint, but the last step fails with the error below. There is some discussion about it on the e forum, but still no answer. [LD] e ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x0): multiple definition of `_pcre_OP_lengths' .objs.release/cx_pcre_tables.o:(.rodata+0x0): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x70): multiple definition of `_pcre_utf8_table1' .objs.release/cx_pcre_tables.o:(.rodata+0x70): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x88): multiple definition of `_pcre_utf8_table1_size' .objs.release/cx_pcre_tables.o:(.rodata+0x88): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x8c): multiple definition of `_pcre_utf8_table2' .objs.release/cx_pcre_tables.o:(.rodata+0x8c): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0xa4): multiple definition of `_pcre_utf8_table3' .objs.release/cx_pcre_tables.o:(.rodata+0xa4): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0xc0): multiple definition of `_pcre_utf8_table4' .objs.release/cx_pcre_tables.o:(.rodata+0xc0): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x180): multiple definition of `_pcre_utt_names' .objs.release/cx_pcre_tables.o:(.rodata+0x100): first defined here /usr/bin/ld: Warning: size of symbol `_pcre_utt_names' changed from 657 in .objs.release/cx_pcre_tables.o to 740 in ../external/out.release/lib/libpcre.a(pcre_tables.o) ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x480): multiple definition of `_pcre_utt' .objs.release/cx_pcre_tables.o:(.rodata+0x3a0): first defined here /usr/bin/ld: Warning: size of symbol `_pcre_utt' changed from 630 in .objs.release/cx_pcre_tables.o to 696 in ../external/out.release/lib/libpcre.a(pcre_tables.o) ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x738): multiple definition of `_pcre_utt_size' .objs.release/cx_pcre_tables.o:(.rodata+0x618): first defined here .objs.release/cx_pcre_exec.o: In function `match(doc_byte_iter, unsigned char const*, doc_byte_iter, int, match_data*, unsigned long, eptrblock*, int, unsigned int)': cx_pcre_exec.cpp:(.text+0x1c2a): undefined reference to `_pcre_ord2utf8(int, unsigned char*)' .objs.release/eauibook.o: In function `eAuiNotebook::LoadPerspective(wxString const&)': eauibook.cpp:(.text+0x9ad): undefined reference to `wxTabFrame::SetTabCtrlHeight(int)' .objs.release/PreviewDlg.o: In function `global constructors keyed to _ZN10PreviewDlg13sm_eventTableE': PreviewDlg.cpp:(.text+0x11b2): undefined reference to `wxEVT_WEB_TITLECHANGE' PreviewDlg.cpp:(.text+0x11ee): undefined reference to `wxEVT_WEB_DOMCONTENTLOADED' .objs.release/PreviewDlg.o: In function `PreviewDlg::RefreshBrowser(PreviewDlg::cxUpdateMode)': PreviewDlg.cpp:(.text+0x2a47): undefined reference to `wxWebControl::OpenURI(wxString const&, unsigned int, wxWebPostData*, bool)' .objs.release/PreviewDlg.o: In function `PreviewDlg::OnWebDocumentComplete(wxWebEvent&)': PreviewDlg.cpp:(.text+0x3259): undefined reference to `wxWebControl::GetCurrentURI() const' .objs.release/PreviewDlg.o: In function `PreviewDlg::PreviewDlg(EditorFrame&)': PreviewDlg.cpp:(.text+0x4984): undefined reference to `wxWebControl::IsInitialized()' PreviewDlg.cpp:(.text+0x49c5): undefined reference to `wxWebControl::wxWebControl(wxWindow*, int, wxPoint const&, wxSize const&)' PreviewDlg.cpp:(.text+0x562f): undefined reference to `wxWebControl::InitEngine(wxString const&)' .objs.release/PreviewDlg.o: In function `PreviewDlg::PreviewDlg(EditorFrame&)': PreviewDlg.cpp:(.text+0x68e4): undefined reference to `wxWebControl::IsInitialized()' PreviewDlg.cpp:(.text+0x6925): undefined reference to `wxWebControl::wxWebControl(wxWindow*, int, wxPoint const&, wxSize const&)' PreviewDlg.cpp:(.text+0x758f): undefined reference to `wxWebControl::InitEngine(wxString const&)' .objs.release/PreviewDlg.o: In function `PreviewDlg::OnButtonForward(wxCommandEvent&)': PreviewDlg.cpp:(.text+0x132): undefined reference to `wxWebControl::GoForward()' .objs.release/PreviewDlg.o: In function `PreviewDlg::OnButtonBack(wxCommandEvent&)': PreviewDlg.cpp:(.text+0x182): undefined reference to `wxWebControl::GoBack()' ../ecore/libecore.so(cxInternal.o): In function `cxInternal::MoveOldSettings(eSettings&)': cxInternal.cpp:(.text+0x4d29): undefined reference to `eSettings::SetPageSettings(unsigned int, wxString const&, doc_id, int, int, wxString const&, std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<cxBookmark, std::allocator<cxBookmark> > const&, eSettings::SubPage)' collect2: ld returned 1 exit status make: *** [e] Error 1 EDIT: Forgot the link http://github.com/etexteditor/e

    Read the article

  • How to start new browser window in cpecified location whith cpecified size

    - by Pritorian
    Hi all! I create a new instance and trying to resize new instance of browser like this: [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern bool GetWindowInfo(IntPtr hwnd, ref tagWINDOWINFO pwi); [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct tagRECT { /// LONG->int public int left; /// LONG->int public int top; /// LONG->int public int right; /// LONG->int public int bottom; } [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct tagWINDOWINFO { /// DWORD->unsigned int public uint cbSize; /// RECT->tagRECT public tagRECT rcWindow; /// RECT->tagRECT public tagRECT rcClient; /// DWORD->unsigned int public uint dwStyle; /// DWORD->unsigned int public uint dwExStyle; /// DWORD->unsigned int public uint dwWindowStatus; /// UINT->unsigned int public uint cxWindowBorders; /// UINT->unsigned int public uint cyWindowBorders; /// ATOM->WORD->unsigned short public ushort atomWindowType; /// WORD->unsigned short public ushort wCreatorVersion; } [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern bool UpdateWindow(IntPtr hWnd); private void button2_Click(object sender, EventArgs e) { using (System.Diagnostics.Process browserProc = new System.Diagnostics.Process()) { browserProc.StartInfo.FileName = webBrowser1.Url.ToString(); browserProc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized; int i= browserProc.Id; tagWINDOWINFO info = new tagWINDOWINFO(); info.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(info); browserProc.Start(); GetWindowInfo(browserProc.MainWindowHandle, ref info); browserProc.WaitForInputIdle(); string str = browserProc.MainWindowTitle; MoveWindow(browserProc.MainWindowHandle, 100, 100, 100, 100, true); UpdateWindow(browserProc.MainWindowHandle); } } But I get an "No process is associated with this object". Could anyone help? Or mb other ideas how to run new browser window whith specified size and location?

    Read the article

  • Call/Ret in x86 assembly embedded in C++

    - by SP658
    This is probably trivial, but for some reason I can't it to work. Its supposed to be a simple function that changes the last byte of a dword to 'AA' (10101010), but nothing happens when I call the function. It just returns my original dword __declspec(naked) long function(unsigned long inputDWord, unsigned long *outputDWord) { _asm{ mov ebx, dword ptr[esp+4] push ebx call SET_AA pop ebx mov eax, dword ptr[esp+8] mov dword ptr[eax], ebx } } __declspec(naked) unsigned long SET_AA( unsigned long inputDWord ) { __asm{ mov eax, [esp+4] mov al, 0xAA ret } }

    Read the article

  • How to manually (bitwise) perform (float)x? (homework)

    - by Silver
    Now, here is the function header of the function I'm supposed to implement: /* * float_from_int - Return bit-level equivalent of expression (float) x * Result is returned as unsigned int, but * it is to be interpreted as the bit-level representation of a * single-precision floating point values. * Legal ops: Any integer/unsigned operations incl. ||, &&. also if, while * Max ops: 30 * Rating: 4 */ unsigned float_from_int(int x) { ... } We aren't allowed to do float operations, or any kind of casting. Now I tried to implement the first algorithm given at this site: http://locklessinc.com/articles/i2f/ Here's my code: unsigned float_from_int(int x) { // grab sign bit int xIsNegative = 0; int absValOfX = x; if(x < 0){ xIsNegative = 1; absValOfX = -x; } // zero case if(x == 0){ return 0; } //int shiftsNeeded = 0; /*while(){ shiftsNeeded++; }*/ unsigned I2F_MAX_BITS = 15; unsigned I2F_MAX_INPUT = ((1 << I2F_MAX_BITS) - 1); unsigned I2F_SHIFT = (24 - I2F_MAX_BITS); unsigned result, i, exponent, fraction; if ((absValOfX & I2F_MAX_INPUT) == 0) result = 0; else { exponent = 126 + I2F_MAX_BITS; fraction = (absValOfX & I2F_MAX_INPUT) << I2F_SHIFT; i = 0; while(i < I2F_MAX_BITS) { if (fraction & 0x800000) break; else { fraction = fraction << 1; exponent = exponent - 1; } i++; } result = (xIsNegative << 31) | exponent << 23 | (fraction & 0x7fffff); } return result; } But it didn't work (see test error below): Test float_from_int(-2147483648[0x80000000]) failed... ...Gives 0[0x0]. Should be -822083584[0xcf000000] 4 4 0 float_times_four I don't know where to go from here. How should I go about parsing the float from this int?

    Read the article

  • Login loop in Snow Leopard

    - by hgpc
    I can't get out of a login loop of a particular admin user. After entering the password the login screen is shown again after about a minute. Other users work fine. It started happening after a simple reboot. Can you please help me? Thank you! Tried to no avail: Change the password Remove the password Repair disk (no errors) Boot in safe mode Reinstall Snow Leopard and updating to 10.6.6 Remove content of ~/Library/Caches Removed content of ~/Library/Preferences Replaced /etc/authorization with Install DVD copy The system.log mentions a crash report. I'm including both below. system.log Jan 8 02:43:30 loginwindow218: Login Window - Returned from Security Agent Jan 8 02:43:30 loginwindow218: USER_PROCESS: 218 console Jan 8 02:44:42 kernel[0]: Jan 8 02:44:43: --- last message repeated 1 time --- Jan 8 02:44:43 com.apple.launchd[1] (com.apple.loginwindow218): Job appears to have crashed: Bus error Jan 8 02:44:43 com.apple.UserEventAgent-LoginWindow223: ALF error: cannot find useragent 1102 Jan 8 02:44:43 com.apple.UserEventAgent-LoginWindow223: plugin.UserEventAgentFactory: called with typeID=FC86416D-6164-2070-726F-70735C216EC0 Jan 8 02:44:43 /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow233: Login Window Application Started Jan 8 02:44:43 SecurityAgent228: CGSShutdownServerConnections: Detaching application from window server Jan 8 02:44:43 com.apple.ReportCrash.Root232: 2011-01-08 02:44:43.936 ReportCrash232:2903 Saved crash report for loginwindow218 version ??? (???) to /Library/Logs/DiagnosticReports/loginwindow_2011-01-08-024443_localhost.crash Jan 8 02:44:44 SecurityAgent228: MIG: server died: CGSReleaseShmem : Cannot release shared memory Jan 8 02:44:44 SecurityAgent228: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. Jan 8 02:44:44 SecurityAgent228: CGSDisplayServerShutdown: Detaching display subsystem from window server Jan 8 02:44:44 SecurityAgent228: HIToolbox: received notification of WindowServer event port death. Jan 8 02:44:44 SecurityAgent228: port matched the WindowServer port created in BindCGSToRunLoop Jan 8 02:44:44 loginwindow233: Login Window Started Security Agent Jan 8 02:44:44 WindowServer234: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. Jan 8 02:44:44 com.apple.WindowServer234: Sat Jan 8 02:44:44 .local WindowServer234 <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. Jan 8 02:44:54 SecurityAgent243: NSSecureTextFieldCell detected a field editor ((null)) that is not a NSTextView subclass designed to work with the cell. Ignoring... Crash report Process: loginwindow 218 Path: /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow Identifier: loginwindow Version: ??? (???) Code Type: X86-64 (Native) Parent Process: launchd [1] Date/Time: 2011-01-08 02:44:42.748 +0100 OS Version: Mac OS X 10.6.6 (10J567) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: 0x000000000000000a, 0x000000010075b000 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 com.apple.security 0x00007fff801c6e8b Security::ReadSection::at(unsigned int) const + 25 1 com.apple.security 0x00007fff801c632f Security::DbVersion::open() + 123 2 com.apple.security 0x00007fff801c5e41 Security::DbVersion::DbVersion(Security::AppleDatabase const&, Security::RefPointer<Security::AtomicBufferedFile> const&) + 179 3 com.apple.security 0x00007fff801c594e Security::DbModifier::getDbVersion(bool) + 330 4 com.apple.security 0x00007fff801c57f5 Security::DbModifier::openDatabase() + 33 5 com.apple.security 0x00007fff801c5439 Security::Database::_dbOpen(Security::DatabaseSession&, unsigned int, Security::AccessCredentials const*, void const*) + 221 6 com.apple.security 0x00007fff801c4841 Security::DatabaseManager::dbOpen(Security::DatabaseSession&, Security::DbName const&, unsigned int, Security::AccessCredentials const*, void const*) + 77 7 com.apple.security 0x00007fff801c4723 Security::DatabaseSession::DbOpen(char const*, cssm_net_address const*, unsigned int, Security::AccessCredentials const*, void const*, long&) + 285 8 com.apple.security 0x00007fff801d8414 cssm_DbOpen(long, char const*, cssm_net_address const*, unsigned int, cssm_access_credentials const*, void const*, long*) + 108 9 com.apple.security 0x00007fff801d7fba CSSM_DL_DbOpen + 106 10 com.apple.security 0x00007fff801d62f6 Security::CssmClient::DbImpl::open() + 162 11 com.apple.security 0x00007fff801d8977 SSDatabaseImpl::open(Security::DLDbIdentifier const&) + 53 12 com.apple.security 0x00007fff801d8715 SSDLSession::DbOpen(char const*, cssm_net_address const*, unsigned int, Security::AccessCredentials const*, void const*, long&) + 263 13 com.apple.security 0x00007fff801d8414 cssm_DbOpen(long, char const*, cssm_net_address const*, unsigned int, cssm_access_credentials const*, void const*, long*) + 108 14 com.apple.security 0x00007fff801d7fba CSSM_DL_DbOpen + 106 15 com.apple.security 0x00007fff801d62f6 Security::CssmClient::DbImpl::open() + 162 16 com.apple.security 0x00007fff802fa786 Security::CssmClient::DbImpl::unlock(cssm_data const&) + 28 17 com.apple.security 0x00007fff80275b5d Security::KeychainCore::KeychainImpl::unlock(Security::CssmData const&) + 89 18 com.apple.security 0x00007fff80291a06 Security::KeychainCore::StorageManager::login(unsigned int, void const*, unsigned int, void const*) + 3336 19 com.apple.security 0x00007fff802854d3 SecKeychainLogin + 91 20 com.apple.loginwindow 0x000000010000dfc5 0x100000000 + 57285 21 com.apple.loginwindow 0x000000010000cfb4 0x100000000 + 53172 22 com.apple.Foundation 0x00007fff8721e44f __NSThreadPerformPerform + 219 23 com.apple.CoreFoundation 0x00007fff82627401 __CFRunLoopDoSources0 + 1361 24 com.apple.CoreFoundation 0x00007fff826255f9 __CFRunLoopRun + 873 25 com.apple.CoreFoundation 0x00007fff82624dbf CFRunLoopRunSpecific + 575 26 com.apple.HIToolbox 0x00007fff8444493a RunCurrentEventLoopInMode + 333 27 com.apple.HIToolbox 0x00007fff8444473f ReceiveNextEventCommon + 310 28 com.apple.HIToolbox 0x00007fff844445f8 BlockUntilNextEventMatchingListInMode + 59 29 com.apple.AppKit 0x00007fff80b01e64 _DPSNextEvent + 718 30 com.apple.AppKit 0x00007fff80b017a9 -NSApplication nextEventMatchingMask:untilDate:inMode:dequeue: + 155 31 com.apple.AppKit 0x00007fff80ac748b -NSApplication run + 395 32 com.apple.loginwindow 0x0000000100004b16 0x100000000 + 19222 33 com.apple.loginwindow 0x0000000100004580 0x100000000 + 17792 Thread 1: Dispatch queue: com.apple.libdispatch-manager 0 libSystem.B.dylib 0x00007fff8755216a kevent + 10 1 libSystem.B.dylib 0x00007fff8755403d _dispatch_mgr_invoke + 154 2 libSystem.B.dylib 0x00007fff87553d14 _dispatch_queue_invoke + 185 3 libSystem.B.dylib 0x00007fff8755383e _dispatch_worker_thread2 + 252 4 libSystem.B.dylib 0x00007fff87553168 _pthread_wqthread + 353 5 libSystem.B.dylib 0x00007fff87553005 start_wqthread + 13 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x000000010075b000 rbx: 0x00007fff5fbfd990 rcx: 0x00007fff875439da rdx: 0x0000000000000000 rdi: 0x00007fff5fbfd990 rsi: 0x0000000000000000 rbp: 0x00007fff5fbfd5d0 rsp: 0x00007fff5fbfd5d0 r8: 0x0000000000000007 r9: 0x0000000000000000 r10: 0x00007fff8753beda r11: 0x0000000000000202 r12: 0x0000000100133e78 r13: 0x00007fff5fbfda50 r14: 0x00007fff5fbfda50 r15: 0x00007fff5fbfdaa0 rip: 0x00007fff801c6e8b rfl: 0x0000000000010287 cr2: 0x000000010075b000

    Read the article

  • How to get an X11 Window from a Process ID ?

    - by Adam Pierce
    Under Linux, my C++ application is using fork() and execv() to launch multiple instances of OpenOffice so as to view some powerpoint slide shows. This part works. Next I want to be able to move the OpenOffice windows to specific locations on the display. I can do that with the XMoveResizeWindow() function but I need to find the Window for each instance. I have the process ID of each instance, how can I find the X11 Window from that ? UPDATE - Thanks to Andy's suggestion, I have pulled this off. I'm posting the code here to share it with the Stack Overflow community. Unfortunately Open Office does not seem to set the _NET_WM_PID property so this doesn't ultimately solve my problem but it does answer the question. // Attempt to identify a window by name or attribute. // by Adam Pierce <[email protected]> #include <X11/Xlib.h> #include <X11/Xatom.h> #include <iostream> #include <list> using namespace std; class WindowsMatchingPid { public: WindowsMatchingPid(Display *display, Window wRoot, unsigned long pid) : _display(display) , _pid(pid) { // Get the PID property atom. _atomPID = XInternAtom(display, "_NET_WM_PID", True); if(_atomPID == None) { cout << "No such atom" << endl; return; } search(wRoot); } const list<Window> &result() const { return _result; } private: unsigned long _pid; Atom _atomPID; Display *_display; list<Window> _result; void search(Window w) { // Get the PID for the current Window. Atom type; int format; unsigned long nItems; unsigned long bytesAfter; unsigned char *propPID = 0; if(Success == XGetWindowProperty(_display, w, _atomPID, 0, 1, False, XA_CARDINAL, &type, &format, &nItems, &bytesAfter, &propPID)) { if(propPID != 0) { // If the PID matches, add this window to the result set. if(_pid == *((unsigned long *)propPID)) _result.push_back(w); XFree(propPID); } } // Recurse into child windows. Window wRoot; Window wParent; Window *wChild; unsigned nChildren; if(0 != XQueryTree(_display, w, &wRoot, &wParent, &wChild, &nChildren)) { for(unsigned i = 0; i < nChildren; i++) search(wChild[i]); } } }; int main(int argc, char **argv) { if(argc < 2) return 1; int pid = atoi(argv[1]); cout << "Searching for windows associated with PID " << pid << endl; // Start with the root window. Display *display = XOpenDisplay(0); WindowsMatchingPid match(display, XDefaultRootWindow(display), pid); // Print the result. const list<Window> &result = match.result(); for(list<Window>::const_iterator it = result.begin(); it != result.end(); it++) cout << "Window #" << (unsigned long)(*it) << endl; return 0; }

    Read the article

  • opengl 3d texture issue

    - by user1478217
    Hi i'm trying to use a 3d texture in opengl to implement volume rendering. Each voxel has an rgba colour value and is currently rendered as a screen facing quad.(for testing purposes). I just can't seem to get the sampler to give me a colour value in the shader. The quads always end up black. When I change the shader to generate a colour (based on xyz coords) then it works fine. I'm loading the texture with the following code: glGenTextures(1, &tex3D); glBindTexture(GL_TEXTURE_3D, tex3D); unsigned int colours[8]; colours[0] = Colour::AsBytes<unsigned int>(Colour::Blue); colours[1] = Colour::AsBytes<unsigned int>(Colour::Red); colours[2] = Colour::AsBytes<unsigned int>(Colour::Green); colours[3] = Colour::AsBytes<unsigned int>(Colour::Magenta); colours[4] = Colour::AsBytes<unsigned int>(Colour::Cyan); colours[5] = Colour::AsBytes<unsigned int>(Colour::Yellow); colours[6] = Colour::AsBytes<unsigned int>(Colour::White); colours[7] = Colour::AsBytes<unsigned int>(Colour::Black); glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, 2, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, colours); The colours array contains the correct data, i.e. the first four bytes have values 0, 0, 255, 255 for blue. Before rendering I bind the texture to the 2nd texture unit like so: glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_3D, tex3D); And render with the following code: shaders["DVR"]->Use(); shaders["DVR"]->Uniforms["volTex"].SetValue(1); shaders["DVR"]->Uniforms["World"].SetValue(Mat4(vl_one)); shaders["DVR"]->Uniforms["viewProj"].SetValue(cam->GetViewTransform() * cam->GetProjectionMatrix()); QuadDrawer::DrawQuads(8); I have used these classes for setting shader params before and they work fine. The quaddrawer draws eight instanced quads. The vertex shader code looks like this: #version 330 layout(location = 0) in vec2 position; layout(location = 1) in vec2 texCoord; uniform sampler3D volTex; ivec3 size = ivec3(2, 2, 2); uniform mat4 World; uniform mat4 viewProj; smooth out vec4 colour; void main() { vec3 texCoord3D; int num = gl_InstanceID; texCoord3D.x = num % size.x; texCoord3D.y = (num / size.x) % size.y; texCoord3D.z = (num / (size.x * size.y)); texCoord3D /= size; texCoord3D *= 2.0; texCoord3D -= 1.0; colour = texture(volTex, texCoord3D); //colour = vec4(texCoord3D, 1.0); gl_Position = viewProj * World * vec4(texCoord3D, 1.0) + (vec4(position.x, position.y, 0.0, 0.0) * 0.05); } uncommenting the line where I set the colour value equal to the texcoord works fine, and makes the quads coloured. The fragment shader is simply: #version 330 smooth in vec4 colour; out vec4 outColour; void main() { outColour = colour; } So my question is, what am I doing wrong, why is the sampler not getting any colour values from the 3d texture? [EDIT] Figured it out but can't self answer (new user): As soon as I posted this I figured it out, I'll put the answer up to help anyone else (it's not specifically a 3d texture issue, and i've also fallen afoul of it before, D'oh!). I didn't generate mipmaps for the texture, and the default magnification/minification filters weren't set to either GL_LINEAR, or GL_NEAREST. Boom! no textures. Same thing happens with 2d textures.

    Read the article

  • Question about unions and heap allocated memory

    - by Dennis Miller
    I was trying to use a union to so I could update the fields in one thread and then read allfields in another thread. In the actual system, I have mutexes to make sure everything is safe. The problem is with fieldB, before I had to change it fieldB was declared like field A and C. However, due to a third party driver, fieldB must be alligned with page boundary. When I changed field B to be allocated with valloc, I run into problems. Questions: 1) Is there a way to statically declare fieldB alligned on page boundary. Basically do the same thing as valloc, but on the stack? 2) Is it possible to do a union when field B, or any field is being allocated on the heap?. Not sure if that is even legal. Here's a simple Test program I was experimenting with. This doesn't work unless you declare fieldB like field A and C, and make the obvious changes in the public methods. #include <iostream> #include <stdlib.h> #include <string.h> #include <stdio.h> class Test { public: Test(void) { // field B must be alligned to page boundary // Is there a way to do this on the stack??? this->field.fieldB = (unsigned char*) valloc(10); }; //I know this is bad, this class is being treated like //a global structure. Its self contained in another class. unsigned char* PointerToFieldA(void) { return &this->field.fieldA[0]; } unsigned char* PointerToFieldB(void) { return this->field.fieldB; } unsigned char* PointerToFieldC(void) { return &this->field.fieldC[0]; } unsigned char* PointerToAllFields(void) { return &this->allFields[0]; } private: // Is this union possible with field B being // allocated on the heap? union { struct { unsigned char fieldA[10]; //This field has to be alligned to page boundary //Is there way to be declared on the stack unsigned char* fieldB; unsigned char fieldC[10]; } field; unsigned char allFields[30]; }; }; int main() { Test test; strncpy((char*) test.PointerToFieldA(), "0123456789", 10); strncpy((char*) test.PointerToFieldB(), "1234567890", 10); strncpy((char*) test.PointerToFieldC(), "2345678901", 10); char dummy[11]; dummy[10] = '\0'; strncpy(dummy, (char*) test.PointerToFieldA(), 10); printf("%s\n", dummy); strncpy(dummy, (char*) test.PointerToFieldB(), 10); printf("%s\n", dummy); strncpy(dummy, (char*) test.PointerToFieldC(), 10); printf("%s\n", dummy); char allFields[31]; allFields[30] = '\0'; strncpy(allFields, (char*) test.PointerToAllFields(), 30); printf("%s\n", allFields); return 0; }

    Read the article

  • Doctrine Fatal Error - Unknown relation alias

    - by Sadiqur Rahman
    I am getting following error message: Doctrine_Table_Exception: Unknown relation alias shoesTable in /home/public_html/projects/giftshoes/system/database/doctrine/Doctrine/Relation/Parser.php on line 237 I am using doctrine 1.2.2 with Codeigniter My Code is below: (BaseShoes.php and Shoes.php is auto generated) ------------BaseShoes------------ <?php // Connection Component Binding Doctrine_Manager::getInstance()->bindComponent('Shoes', 'sadiqsof_giftshoes'); /** * BaseShoes * * This class has been auto-generated by the Doctrine ORM Framework * * @property integer $sku * @property string $name * @property string $keywords * @property string $description * @property string $manufacturer * @property float $sale_price * @property float $price * @property string $url * @property string $image * @property string $category * @property Doctrine_Collection $Viewes * * @package ##PACKAGE## * @subpackage ##SUBPACKAGE## * @author ##NAME## <##EMAIL##> * @version SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $ */ abstract class BaseShoes extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('shoes'); $this->hasColumn('sku', 'integer', 4, array( 'type' => 'integer', 'fixed' => 0, 'unsigned' => false, 'primary' => true, 'autoincrement' => false, 'length' => '4', )); $this->hasColumn('name', 'string', 255, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '255', )); $this->hasColumn('keywords', 'string', 255, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '255', )); $this->hasColumn('description', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('manufacturer', 'string', 20, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '20', )); $this->hasColumn('sale_price', 'float', null, array( 'type' => 'float', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('price', 'float', null, array( 'type' => 'float', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('url', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('image', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('category', 'string', 50, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '50', )); } public function setUp() { parent::setUp(); $this->hasMany('Viewes', array( 'local' => 'sku', 'foreign' => 'sku')); } } --------------ShoesTable-------- <?php class ShoesTable extends Doctrine_Table { function getAllShoes($from = 0, $total = 15) { $q = Doctrine_Query::create() ->from('Shoes') ->limit($total) ->offset($from); return $q->execute(array(), Doctrine::HYDRATE_ARRAY); } } ---------------Shoes Model----------------- <?php /** * Shoes * * This class has been auto-generated by the Doctrine ORM Framework * * @package ##PACKAGE## * @subpackage ##SUBPACKAGE## * @author ##NAME## <##EMAIL##> * @version SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $ */ class Shoes extends BaseShoes { function __construct() { parent::__construct(); $this->shoesTable = Doctrine::getTable('Shoes'); } function getAllShoes() { return $this->shoesTable->getAllShoes(); } }

    Read the article

  • MinGW Doesn't Generate an Object File When Compiling

    - by Nathan Campos
    I've just bought a new laptop for me on the travel, then on my free time, I've started to test MinGW on it by trying to compile my own OS that is written in C++, then I've created all the files needed and the kernel.cpp: extern "C" void _main(struct multiboot_data* mbd, unsigned int magic); void _main( struct multiboot_data* mbd, unsigned int magic ) { char * boot_loader_name =(char*) ((long*)mbd)[16]; /* Print a letter to screen to see everything is working: */ unsigned char *videoram = (unsigned char *) 0xb8000; videoram[0] = 65; /* character 'A' */ videoram[1] = 0x07; /* forground, background color. */ } And tried to compile it with g++ G: g++ -o C:\kernel.o -c kernel.cpp -Wall -Wextra -Werror -nostdlib -nostartfiles -nodefaultlibs kernel.cpp: In function `void _main(multiboot_data*, unsigned int)': kernel.cpp:8: warning: unused variable 'boot_loader_name' kernel.cpp: At global scope: kernel.cpp:4: warning: unused parameter 'magic' G: But it don't create any binary file at C:/. What can I do?

    Read the article

  • Converting Bit Field to int

    - by shaharg
    Hi, I have bit field declared this way: typedef struct morder { unsigned int targetRegister : 3; unsigned int targetMethodOfAddressing : 3; unsigned int originRegister : 3; unsigned int originMethodOfAddressing : 3; unsigned int oCode : 4; } bitset; I also have int array, and i want to get int value from this array, that represents the actual value of this bit field (which is actually some kind of machine word that i have the parts of it, and i want the int representation of the whole word). Thanks a lot.

    Read the article

  • MySQL Volleyball Standings

    - by Torez
    I have a database table full of game by game results and want to know if I can calculate the following: GP (games played) Wins Loses Points (2 points for each win, 1 point for each lose) Here is my table structure: CREATE TABLE `results` ( `id` int(10) unsigned NOT NULL auto_increment, `home_team_id` int(10) unsigned NOT NULL, `home_score` int(3) unsigned NOT NULL, `visit_team_id` int(10) unsigned NOT NULL, `visit_score` int(3) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; And a few testing results: INSERT INTO `results` VALUES(1, 1, 21, 2, 25); INSERT INTO `results` VALUES(2, 3, 21, 4, 17); INSERT INTO `results` VALUES(3, 1, 25, 3, 9); INSERT INTO `results` VALUES(4, 2, 7, 4, 22); INSERT INTO `results` VALUES(5, 1, 19, 4, 20); INSERT INTO `results` VALUES(6, 2, 24, 3, 26); Here is what a final table would look like: +-------------------+----+------+-------+--------+ | Team Name | GP | Wins | Loses | Points | +-------------------+----+------+-------+--------+ | Spikers | 4 | 4 | 0 | 8 | | Leapers | 4 | 2 | 2 | 6 | | Ground Control | 4 | 1 | 3 | 5 | | Touch Guys | 4 | 0 | 4 | 4 | +-------------------+----+------+-------+--------+

    Read the article

  • No Binary File Generation

    - by Nathan Campos
    I've just bought a new laptop for me on the travel, then on my free time, I've started to test MinGW on it by trying to compile my own OS that is written in C++, then I've created all the files needed and the kernel.cpp: extern "C" void _main(struct multiboot_data* mbd, unsigned int magic); void _main( struct multiboot_data* mbd, unsigned int magic ) { char * boot_loader_name =(char*) ((long*)mbd)[16]; /* Print a letter to screen to see everything is working: */ unsigned char *videoram = (unsigned char *) 0xb8000; videoram[0] = 65; /* character 'A' */ videoram[1] = 0x07; /* forground, background color. */ } And tried to compile it with g++ G: g++ -o C:\kernel.o -c kernel.cpp -Wall -Wextra -Werror -nostdlib -nostartfiles -nodefaultlibs kernel.cpp: In function `void _main(multiboot_data*, unsigned int)': kernel.cpp:8: warning: unused variable 'boot_loader_name' kernel.cpp: At global scope: kernel.cpp:4: warning: unused parameter 'magic' G: But it don't create any binary file at C:/, what can I do?

    Read the article

  • Doctrine_Table_Exception: Unknown relation alias shoesTable in /home/sadiqsof/public_html/projects/g

    - by Sadiqur Rahman
    I am getting following error message: Doctrine_Table_Exception: Unknown relation alias shoesTable in /home/sadiqsof/public_html/projects/giftshoes/system/database/doctrine/Doctrine/Relation/Parser.php on line 237 My Code is below: ------------BaseShoe------------ <?php // Connection Component Binding Doctrine_Manager::getInstance()->bindComponent('Shoes', 'sadiqsof_giftshoes'); /** * BaseShoes * * This class has been auto-generated by the Doctrine ORM Framework * * @property integer $sku * @property string $name * @property string $keywords * @property string $description * @property string $manufacturer * @property float $sale_price * @property float $price * @property string $url * @property string $image * @property string $category * @property Doctrine_Collection $Viewes * * @package ##PACKAGE## * @subpackage ##SUBPACKAGE## * @author ##NAME## <##EMAIL##> * @version SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $ */ abstract class BaseShoes extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('shoes'); $this->hasColumn('sku', 'integer', 4, array( 'type' => 'integer', 'fixed' => 0, 'unsigned' => false, 'primary' => true, 'autoincrement' => false, 'length' => '4', )); $this->hasColumn('name', 'string', 255, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '255', )); $this->hasColumn('keywords', 'string', 255, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '255', )); $this->hasColumn('description', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('manufacturer', 'string', 20, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '20', )); $this->hasColumn('sale_price', 'float', null, array( 'type' => 'float', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('price', 'float', null, array( 'type' => 'float', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('url', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('image', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('category', 'string', 50, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '50', )); } public function setUp() { parent::setUp(); $this->hasMany('Viewes', array( 'local' => 'sku', 'foreign' => 'sku')); } } --------------ShoesTable-------- <?php class ShoesTable extends Doctrine_Table { function getAllShoes($from = 0, $total = 15) { $q = Doctrine_Query::create() ->from('Shoes') ->limit($total) ->offset($from); return $q->execute(array(), Doctrine::HYDRATE_ARRAY); } } ---------------Shoes Model----------------- <?php /** * Shoes * * This class has been auto-generated by the Doctrine ORM Framework * * @package ##PACKAGE## * @subpackage ##SUBPACKAGE## * @author ##NAME## <##EMAIL##> * @version SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $ */ class Shoes extends BaseShoes { function __construct() { parent::__construct(); $this->shoesTable = Doctrine::getTable('Shoes'); } function getAllShoes() { return $this->shoesTable->getAllShoes(); } }

    Read the article

  • Doctrine_Table_Exception: Unknown relation alias [closed]

    - by Sadiqur Rahman
    I am getting following error message: Doctrine_Table_Exception: Unknown relation alias shoesTable in /home/public_html/projects/giftshoes/system/database/doctrine/Doctrine/Relation/Parser.php on line 237 My Code is below: ------------BaseShoe------------ <?php // Connection Component Binding Doctrine_Manager::getInstance()->bindComponent('Shoes', 'sadiqsof_giftshoes'); /** * BaseShoes * * This class has been auto-generated by the Doctrine ORM Framework * * @property integer $sku * @property string $name * @property string $keywords * @property string $description * @property string $manufacturer * @property float $sale_price * @property float $price * @property string $url * @property string $image * @property string $category * @property Doctrine_Collection $Viewes * * @package ##PACKAGE## * @subpackage ##SUBPACKAGE## * @author ##NAME## <##EMAIL##> * @version SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $ */ abstract class BaseShoes extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('shoes'); $this->hasColumn('sku', 'integer', 4, array( 'type' => 'integer', 'fixed' => 0, 'unsigned' => false, 'primary' => true, 'autoincrement' => false, 'length' => '4', )); $this->hasColumn('name', 'string', 255, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '255', )); $this->hasColumn('keywords', 'string', 255, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '255', )); $this->hasColumn('description', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('manufacturer', 'string', 20, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '20', )); $this->hasColumn('sale_price', 'float', null, array( 'type' => 'float', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('price', 'float', null, array( 'type' => 'float', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('url', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('image', 'string', null, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '', )); $this->hasColumn('category', 'string', 50, array( 'type' => 'string', 'fixed' => 0, 'unsigned' => false, 'primary' => false, 'notnull' => true, 'autoincrement' => false, 'length' => '50', )); } public function setUp() { parent::setUp(); $this->hasMany('Viewes', array( 'local' => 'sku', 'foreign' => 'sku')); } } --------------ShoesTable-------- <?php class ShoesTable extends Doctrine_Table { function getAllShoes($from = 0, $total = 15) { $q = Doctrine_Query::create() ->from('Shoes') ->limit($total) ->offset($from); return $q->execute(array(), Doctrine::HYDRATE_ARRAY); } } ---------------Shoes Model----------------- <?php /** * Shoes * * This class has been auto-generated by the Doctrine ORM Framework * * @package ##PACKAGE## * @subpackage ##SUBPACKAGE## * @author ##NAME## <##EMAIL##> * @version SVN: $Id: Builder.php 6820 2009-11-30 17:27:49Z jwage $ */ class Shoes extends BaseShoes { function __construct() { parent::__construct(); $this->shoesTable = Doctrine::getTable('Shoes'); } function getAllShoes() { return $this->shoesTable->getAllShoes(); } }

    Read the article

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