Search Results

Search found 4252 results on 171 pages for 'david 85'.

Page 163/171 | < Previous Page | 159 160 161 162 163 164 165 166 167 168 169 170  | Next Page >

  • Which Computer Organization & Architecture book is good for me?

    - by claws
    I'm always interested in learning the inner working of things. I started with C programming and then learnt Operating systems (from stallings) and then linkers & loaders and then assembly language after reading these now I want to go into little more depth. Computer Architecture. I feel that makes everything clear. As per SO archives these are the two good books: Computer Architecture: A Quantitative Approach, 4th Edition Computer Organization and Design, Fourth Edition, ~ David A. Patterson, John L. Hennessy But I've browsed through the contents of these books and found that they don't exactly meet my needs. I want to learn more about caches, Memory Management Unit , mapping b/w virtual memory & physical memory I'm no way interested in other ISAs like MIPS etc.. I'm IA32 and X86-64 fan and I want to stick to it. I'm not a hardware developer I don't want to details like circuit diagrams or How is L1, L2 & L3 caches are implemented? I want to know the parallel processing technologies like HyperThreading at the architecture level but again I don't want to design them. I liked the table of Contents of - Computer Architecture: A Quantitative Approach, 4th Edition but Quantitave Approach? Seriously?? I want to know the details of current technologies and I dont want to spend reading 200 pages of outdated old technologies ( I experienced this while learning ASM}

    Read the article

  • VB.net (aspx) mysql connection

    - by StealthRT
    Hey all i am new to ASP.NET and VB.net code behind. I have a classic ASP page that connects to the mySQL server with the following code: Set oConnection = Server.CreateObject("ADODB.Connection") Set oRecordset = Server.CreateObject("ADODB.Recordset") oConnection.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=xxx.com; PORT=3306; DATABASE=xxx; USER=xxx; PASSWORD=xxx; OPTION=3;" sqltemp = "select * from userinfo WHERE emailAddress = '" & theUN & "'" oRecordset.Open sqltemp, oConnection,3,3 if oRecordset.EOF then ... However, i am unable to find anything to connect to mySQL in ASP.NET (VB.NET). I have only found this peice of code that does not seem to work once it gets to the "Dim conn As New OdbcConnection(MyConString)" code: Dim MyConString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _ "SERVER=xxx.com;" & _ "DATABASE=xxx;" & _ "UID=xxx;" & _ "PASSWORD=xxx;" & _ "OPTION=3;" Dim conn As New OdbcConnection(MyConString) MyConnection.Open() Dim MyCommand As New OdbcCommand MyCommand.Connection = MyConnection MyCommand.CommandText = "select * from userinfo WHERE emailAddress = '" & theUN & "'"" MyCommand.ExecuteNonQuery() MyConnection.Close() I have these import statements also: <%@ Import Namespace=System %> <%@ Import Namespace=System.IO %> <%@ Import Namespace=System.Web %> <%@ Import Namespace=System.ServiceProcess %> <%@ Import Namespace=Microsoft.Data.Odbc %> <%@ Import Namespace=MySql.Data.MySqlClient %> <%@ Import Namespace=MySql.Data %> <%@ Import Namespace=System.Data %> So any help would be great! :o) David

    Read the article

  • Passing html parameters to server odd problem

    - by StealthRT
    Hey all i am having a weird problem with sending data back to my server. This is the code i am using: NSString *theURL =[NSString stringWithFormat:@"http://www.xxx.com/confirm.asp?theID=%@&theName=%@&empID=%@&theComp=%@", theConfirmNum, tmpNBUserRow.userName, labelTxt.text, theID]; NSLog(@"%@,%@,%@,%@", theConfirmNum, tmpNBUserRow.userName, labelTxt.text, theID); NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:theURL]]; [request setHTTPMethod:@"POST"]; NSError *error; NSURLResponse *response; NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSString *data=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding]; if ([data isEqualToString:@"Done"]) I can run the code from the browser and it works just fine using the data i got from the NSLog output. The NSLog output for each value is correct. But for some reason when i put a break on the IF ([data isEqualToString:@"Done"]) it has no return value. I checked each value for what it was sending (and again, it was correct in the NSLog output) and i found that the value "theID" said "Out of scope". Although, again, the NSLog had the value in it correctly? So i searched the forum and found a simular problem. I took their advice and added "RETAIN" to the "theID" value like so: theID = [customObjInstance TID]; [theID retain]; However, that did not solve the issue... Here is the console NSLog output: [Session started at 2010-04-11 01:31:50 -0400.] wait_fences: failed to receive reply: 10004003 wait_fences: failed to receive reply: 10004003 nbTxt(5952,0xa0937500) malloc: *** error for object 0x3c0ebc0: double free *** set a breakpoint in malloc_error_break to debug 2010-04-11 01:32:12.270 nbTxt[5952:207] 5122,Rob S.,5122,NB010203 The NSLog values i am sending is the last line "5122,Rob S.,5122,NB010203" Any help would be great :o) David

    Read the article

  • Query Months help

    - by StealthRT
    Hey all i am in need of some helpful tips/advice on how to go about my problem. I have a database that houses a "signup" table. The date for this table is formated as such: 2010-04-03 00:00:00 Now suppose i have 10 records in this database: 2010-04-03 00:00:00 2010-01-01 00:00:00 2010-06-22 00:00:00 2010-02-08 00:00:00 2010-02-05 00:00:00 2010-03-08 00:00:00 2010-09-29 00:00:00 2010-11-16 00:00:00 2010-04-09 00:00:00 2010-05-21 00:00:00 And i wanted to get each months total registers... so following the example above: Jan = 1 Feb = 2 Mar = 1 Apr = 2 May = 1 Jun = 1 Jul = 0 Aug = 0 Sep = 1 Oct = 0 Nov = 1 Dec = 0 Now how can i use a query to do that but not have to use a query like: WHERE left(date, 7) = '2010-01' and keep doing that 12 times? I would like it to be a single query call and just have it place the months visits into a array like so: do until EOF theMonthArray[0] = "total for jan" theMonthArray[1] = "total for feb" theMonthArray[2] = "total for mar" theMonthArray[3] = "total for apr" ...etc loop I just can not think of a way to do that other than the example i posted with the 12 query called-one for each month. This is my query as of right now. Again, this only populates for one month where i am trying to populate all 12 months all at once. SELECT count(idNumber) as numVisits, theAccount, signUpDate, theActive from userinfo WHERE theActive = 'YES' AND idNumber = '0203' AND theAccount = 'SUB' AND left(signUpDate, 7) = '2010-04' GROUP BY idNumber ORDER BY numVisits; The example query above outputs this: numVisits | theAccount | signUpDate | theActive 2 SUB 2010-04-16 00:00:00 YES Which is correct because i have 2 records within the month of April. But again, i am trying to do all 12 months at one time (in a single query) so i do not tax the database server as much when compared to doing 12 different query's... UPDATE I'm looking to do something like along these lines: if NOT rst.EOF if left(rst("signUpDate"), 7) = "2010-01" then theMonthArray[0] = rst("numVisits") end if if left(rst("signUpDate"), 7) = "2010-02" then theMonthArray[1] = rst("numVisits") end if etc etc.... end if Any help would be great! :) David

    Read the article

  • Is an LSA MSV1_0 subauthentication package needed for some impersonation use cases?

    - by Chris Sears
    Greetings, I'm working with a vendor who has implemented some code that uses a Windows LSA MSV1_0 subauthentication package (MSDN info if you're interested: http://msdn.microsoft.com/en-us/library/aa374786(VS.85).aspx ) and I'm trying to figure out if it's necessary. As far as I can tell, the subauthentication routine and filter allow for hooking or customizing the standard LSA MSV1_0 logon event processing. The issue is that I don't understand why the vendor's product would need these capabilities. I've asked them and they said they use it to perform impersonation. The product definitely does need to do impersonation, but based on my limited win32 knowledge, they could get the functionality they need using the normal auth APIs (LsaLogonUser, ImpersonateLoggedOnUser, etc) without the subauthentication package. Furthermore, I've worked with a number of similar products that all do impersonation, and this is the only one that's used a subauthentication package. If you're wondering why I would care, a previous version of the product had a bug in the subauthentication package dll that would cause lockups or bluescreens. That makes me rather nervous and has me questioning the use of such a low-level, kernel sensitive interface. I'd like to go back to the vendor and say "There's no way you could need an LSA subauth package for impersonation - take it out", but I'm not sure I understand the use cases and possible limitations of the standard win32 authentication/impersonation APIs well enough to make that claim definitively. So, to the win32 security gurus out there, is there any reason you would need an LSA MSV1_0 subauthentication package if all you were doing is impersonation? Thanks in advance for any thoughts!

    Read the article

  • oRecordset in ASP.NET mySQL problem

    - by StealthRT
    I have this mySQL code that connects to my server. It connects just fine: Dim MyConString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _ "SERVER=xxx.com;" & _ "DATABASE=xxx;" & _ "UID=xxx;" & _ "PASSWORD=xxx;" & _ "OPTION=3;" Dim conn As OdbcConnection = New OdbcConnection(MyConString) conn.Open() Dim MyCommand As New OdbcCommand MyCommand.Connection = conn MyCommand.CommandText = "select * from userinfo WHERE emailAddress = '" & theUN & "'"" MyCommand.ExecuteNonQuery() conn.Close() However, i have an old Classic ASP page that uses "oRecordset" to get the data from the mySQL server: Set oConnection = Server.CreateObject("ADODB.Connection") Set oRecordset = Server.CreateObject("ADODB.Recordset") oConnection.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=xxx.com; PORT=3306; DATABASE=xxx; USER=xxx; PASSWORD=xxx; OPTION=3;" sqltemp = "select * from userinfo WHERE emailAddress = '" & theUN & "'" oRecordset.Open sqltemp, oConnection,3,3 And i can use oRecordset as follows: if oRecordset.EOF then.... or strValue = oRecordset("Table_Name").value or oRecordset("Table_Name").value = "New Value" oRecordset.update etc... However, for the life of me, i can not find any .net code that is simular to that of my Classic ASP page!!!!! Any help would be great! :o) David

    Read the article

  • Programming R/Sweave for proper \Sexpr output

    - by deoksu
    Hi I'm having a bit of a problem programming R for Sweave, and the #rstats twitter group often points here, so I thought I'd put this question to the SO crowd. I'm an analyst- not a programmer- so go easy on me my first post. Here's the problem: I am drafting a survey report in Sweave with R and would like to report the marginal returns in line using \Sexpr{}. For example, rather than saying: Only 14% of respondents said 'X'. I want to write the report like this: Only \Sexpr{p.mean(variable)}$\%$ of respondents said 'X'. The problem is that Sweave() converts the results of the expression in \Sexpr{} to a character string, which means that the output from expression in R and the output that appears in my document are different. For example, above I use the function 'p.mean': p.mean<- function (x) {options(digits=1) mmm<-weighted.mean(x, weight=weight, na.rm=T) print(100*mmm) } In R, the output looks like this: p.mean(variable) >14 but when I use \Sexpr{p.mean(variable)}, I get an unrounded character string (in this case: 13.5857142857143) in my document. I have tried to limit the output of my function to 'digits=1' in the global environment, in the function itself, and and in various commands. It only seems to contain what R prints, not the character transformation that is the result of the expression and which eventually prints in the LaTeX file. as.character(p.mean(variable)) >[1] 14 >[1] "13.5857142857143" Does anyone know what I can do to limit the digits printed in the LaTeX file, either by reprogramming the R function or with a setting in Sweave or \Sexpr{}? I'd greatly appreciate any help you can give. Thanks, David

    Read the article

  • Bubble Breaker Game Solver better than greedy?

    - by Gregory
    For a mental exercise I decided to try and solve the bubble breaker game found on many cell phones as well as an example here:Bubble Break Game The random (N,M,C) board consists N rows x M columns with C colors The goal is to get the highest score by picking the sequence of bubble groups that ultimately leads to the highest score A bubble group is 2 or more bubbles of the same color that are adjacent to each other in either x or y direction. Diagonals do not count When a group is picked, the bubbles disappear, any holes are filled with bubbles from above first, ie shift down, then any holes are filled by shifting right A bubble group score = n * (n - 1) where n is the number of bubbles in the bubble group The first algorithm is a simple exhaustive recursive algorithm which explores going through the board row by row and column by column picking bubble groups. Once the bubble group is picked, we create a new board and try to solve that board, recursively descending down Some of the ideas I am using include normalized memoization. Once a board is solved we store the board and the best score in a memoization table. I create a prototype in python which shows a (2,15,5) board takes 8859 boards to solve in about 3 seconds. A (3,15,5) board takes 12,384,726 boards in 50 minutes on a server. The solver rate is ~3k-4k boards/sec and gradually decreases as the memoization search takes longer. Memoization table grows to 5,692,482 boards, and hits 6,713,566 times. What other approaches could yield high scores besides the exhaustive search? I don't seen any obvious way to divide and conquer. But trending towards larger and larger bubbles groups seems to be one approach Thanks to David Locke for posting the paper link which talks above a window solver which uses a constant-depth lookahead heuristic.

    Read the article

  • Problem with javascript onclick function string

    - by StealthRT
    Hey all, i have been trying for a few minutes on this problem and i can not seem to figure out how to correct it. I tend to have the hardest time doing stuff like this when it involves more than one varable within the function. Here is the code: var tempString = "thePrompt('Are you sure you wish to delete this?', 'theDel('" + IDnum + "', '" + theTitle + "', \'" + temperDay + "\', \'" + temperMonth + "\', \'" + temperYear + "\', \'" + DDiff + "\')"; html += "<div id='theTable" + IDnum + "' class='fc-event fc-event-hori fc-corner-left fc-corner-right' style='position:absolute; margin-top: 15px; z-index:8;left:"+left+"px'><div id='apDEL' style='position:relative;width:0px;height:0px;z-index:1000; top:-13px; left:2px; float:left;'><img src='img/xCal.png' width='15' height='15' alt='' border='0' onclick=\"" + tempString + "\" /></div>" + (ETC ETC...) The error i keep getting is this: Error: missing ) after argument list Line: 1, Column: 68 Source Code: thePrompt('Are you sure you wish to delete this posting?', 'theDel('105', '50 points for visiting us today!!!!', '13', '3', '2010', '2') And its pointing to the '105'. As always, any help would be wonderful! :o) David

    Read the article

  • Need help using libpng to read an image

    - by jonathanasdf
    Here is my function... I don't know why it's not working. The resulting image looks nothing like what the .png looks like. But there's no errors either. bool Bullet::read_png(std::string file_name, int pos) { png_structp png_ptr; png_infop info_ptr; FILE *fp; if ((fp = fopen(file_name.c_str(), "rb")) == NULL) { return false; } png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (png_ptr == NULL) { fclose(fp); return false; } info_ptr = png_create_info_struct(png_ptr); if (info_ptr == NULL) { fclose(fp); png_destroy_read_struct(&png_ptr, NULL, NULL); return false; } if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); fclose(fp); return false; } png_init_io(png_ptr, fp); png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_SWAP_ALPHA | PNG_TRANSFORM_EXPAND, NULL); png_uint_32 width = png_get_image_width(png_ptr, info_ptr); png_uint_32 height = png_get_image_height(png_ptr, info_ptr); imageData[pos].width = width; imageData[pos].height = height; png_bytepp row_pointers; row_pointers = png_get_rows(png_ptr, info_ptr); imageData[pos].data = new unsigned int[width*height]; for (unsigned int i=0; i < height; ++i) { memcpy(&imageData[pos].data[i*width], &row_pointers[i], width*sizeof(unsigned int)); } png_destroy_read_struct(&png_ptr, &info_ptr, NULL); fclose(fp); for (unsigned int i=0; i < height; ++i) { for (unsigned int j=0; j < width; ++j) { unsigned int val = imageData[pos].data[i*width+j]; if (val != 0) { unsigned int a = ((val >> 24)); unsigned int r = (((val - (a << 24)) >> 16)); unsigned int g = (((val - (a << 24) - (r << 16)) >> 8)); unsigned int b = (((val - (a << 24) - (r << 16) - (g << 8)))); // for debugging std::string s(AS3_StringValue(AS3_Int(i*width+j))); s += " "; s += AS3_StringValue(AS3_Int(val)); s += " "; s += AS3_StringValue(AS3_Int(a)); s += " "; s += AS3_StringValue(AS3_Int(r)); s += " "; s += AS3_StringValue(AS3_Int(g)); s += " "; s += AS3_StringValue(AS3_Int(b)); AS3_Trace(AS3_String(s.c_str())); } } } return true; } ImageData is just a simple struct to keep x, y, width, and height, and imageData is an array of that struct. struct ImageData { int x; int y; int width; int height; unsigned int* data; }; Here is a side by side screenshot of the input and output graphics (something I made in a minute for testing), and this was after setting alpha to 255 in order to make it show up (because the alpha I was getting back was 1). Left side is original, right side is what happened after reading it through this function. Scaled up 400% for visibility. Here is a log of the traces: 0 16855328 1 1 49 32 1 16855424 1 1 49 128 2 16855456 1 1 49 160 3 16855488 1 1 49 192 4 16855520 1 1 49 224 5 16855552 1 1 50 0 6 16855584 1 1 50 32 7 16855616 1 1 50 64 8 16855424 1 1 49 128 9 16855456 1 1 49 160 10 16855488 1 1 49 192 11 16855520 1 1 49 224 12 16855552 1 1 50 0 13 16855584 1 1 50 32 14 16855616 1 1 50 64 15 16855648 1 1 50 96 16 16855456 1 1 49 160 17 16855488 1 1 49 192 18 16855520 1 1 49 224 19 16855552 1 1 50 0 20 16855584 1 1 50 32 21 16855616 1 1 50 64 22 16855648 1 1 50 96 23 16855680 1 1 50 128 24 16855488 1 1 49 192 25 16855520 1 1 49 224 26 16855552 1 1 50 0 27 16855584 1 1 50 32 28 16855616 1 1 50 64 29 16855648 1 1 50 96 30 16855680 1 1 50 128 31 16855712 1 1 50 160 32 16855520 1 1 49 224 33 16855552 1 1 50 0 34 16855584 1 1 50 32 35 16855616 1 1 50 64 36 16855648 1 1 50 96 37 16855680 1 1 50 128 38 16855712 1 1 50 160 39 16855744 1 1 50 192 40 16855552 1 1 50 0 41 16855584 1 1 50 32 42 16855616 1 1 50 64 43 16855648 1 1 50 96 44 16855680 1 1 50 128 45 16855712 1 1 50 160 46 16855744 1 1 50 192 47 16855776 1 1 50 224 48 16855584 1 1 50 32 49 16855616 1 1 50 64 50 16855648 1 1 50 96 51 16855680 1 1 50 128 52 16855712 1 1 50 160 53 16855744 1 1 50 192 54 16855776 1 1 50 224 55 16855808 1 1 51 0 56 16855616 1 1 50 64 57 16855648 1 1 50 96 58 16855680 1 1 50 128 59 16855712 1 1 50 160 60 16855744 1 1 50 192 61 16855776 1 1 50 224 62 16855808 1 1 51 0 63 16855840 1 1 51 32 64 16855648 1 1 50 96 65 16855680 1 1 50 128 66 16855712 1 1 50 160 67 16855744 1 1 50 192 68 16855776 1 1 50 224 69 16855808 1 1 51 0 70 16855840 1 1 51 32 71 16855872 1 1 51 64 72 16855680 1 1 50 128 73 16855712 1 1 50 160 74 16855744 1 1 50 192 75 16855776 1 1 50 224 76 16855808 1 1 51 0 77 16855840 1 1 51 32 78 16855872 1 1 51 64 79 16855904 1 1 51 96 80 16855712 1 1 50 160 81 16855744 1 1 50 192 82 16855776 1 1 50 224 83 16855808 1 1 51 0 84 16855840 1 1 51 32 85 16855872 1 1 51 64 86 16855904 1 1 51 96 87 16855936 1 1 51 128 88 16855744 1 1 50 192 89 16855776 1 1 50 224 90 16855808 1 1 51 0 91 16855840 1 1 51 32 92 16855872 1 1 51 64 93 16855904 1 1 51 96 94 16855936 1 1 51 128 95 16855968 1 1 51 160 96 16855776 1 1 50 224 97 16855808 1 1 51 0 98 16855840 1 1 51 32 99 16855872 1 1 51 64 100 16855904 1 1 51 96 101 16855936 1 1 51 128 102 16855968 1 1 51 160 103 16856000 1 1 51 192 104 16855808 1 1 51 0 105 16855840 1 1 51 32 106 16855872 1 1 51 64 107 16855904 1 1 51 96 108 16855936 1 1 51 128 109 16855968 1 1 51 160 110 16856000 1 1 51 192 111 16856032 1 1 51 224 112 16855840 1 1 51 32 113 16855872 1 1 51 64 114 16855904 1 1 51 96 115 16855936 1 1 51 128 116 16855968 1 1 51 160 117 16856000 1 1 51 192 118 16856032 1 1 51 224 119 16856064 1 1 52 0 120 16855872 1 1 51 64 121 16855904 1 1 51 96 122 16855936 1 1 51 128 123 16855968 1 1 51 160 124 16856000 1 1 51 192 125 16856032 1 1 51 224 126 16856064 1 1 52 0 127 16856096 1 1 52 32 128 16855904 1 1 51 96 129 16855936 1 1 51 128 130 16855968 1 1 51 160 131 16856000 1 1 51 192 132 16856032 1 1 51 224 133 16856064 1 1 52 0 134 16856096 1 1 52 32 135 16856128 1 1 52 64 136 16855936 1 1 51 128 137 16855968 1 1 51 160 138 16856000 1 1 51 192 139 16856032 1 1 51 224 140 16856064 1 1 52 0 141 16856096 1 1 52 32 142 16856128 1 1 52 64 143 16856160 1 1 52 96 144 16855968 1 1 51 160 145 16856000 1 1 51 192 146 16856032 1 1 51 224 147 16856064 1 1 52 0 148 16856096 1 1 52 32 149 16856128 1 1 52 64 150 16856160 1 1 52 96 151 16856192 1 1 52 128 152 16856000 1 1 51 192 153 16856032 1 1 51 224 154 16856064 1 1 52 0 155 16856096 1 1 52 32 156 16856128 1 1 52 64 157 16856160 1 1 52 96 158 16856192 1 1 52 128 159 16856224 1 1 52 160 160 16856032 1 1 51 224 161 16856064 1 1 52 0 162 16856096 1 1 52 32 163 16856128 1 1 52 64 164 16856160 1 1 52 96 165 16856192 1 1 52 128 166 16856224 1 1 52 160 167 16856256 1 1 52 192 168 16856064 1 1 52 0 169 16856096 1 1 52 32 170 16856128 1 1 52 64 171 16856160 1 1 52 96 172 16856192 1 1 52 128 173 16856224 1 1 52 160 174 16856256 1 1 52 192 175 16856288 1 1 52 224 176 16856096 1 1 52 32 177 16856128 1 1 52 64 178 16856160 1 1 52 96 179 16856192 1 1 52 128 180 16856224 1 1 52 160 181 16856256 1 1 52 192 182 16856288 1 1 52 224 183 16856320 1 1 53 0 184 16856128 1 1 52 64 185 16856160 1 1 52 96 186 16856192 1 1 52 128 187 16856224 1 1 52 160 188 16856256 1 1 52 192 189 16856288 1 1 52 224 190 16856320 1 1 53 0 192 16856160 1 1 52 96 193 16856192 1 1 52 128 194 16856224 1 1 52 160 195 16856256 1 1 52 192 196 16856288 1 1 52 224 197 16856320 1 1 53 0 200 16856192 1 1 52 128 201 16856224 1 1 52 160 202 16856256 1 1 52 192 203 16856288 1 1 52 224 204 16856320 1 1 53 0 208 16856224 1 1 52 160 209 16856256 1 1 52 192 210 16856288 1 1 52 224 211 16856320 1 1 53 0 216 16856256 1 1 52 192 217 16856288 1 1 52 224 218 16856320 1 1 53 0 224 16856288 1 1 52 224 225 16856320 1 1 53 0 232 16856320 1 1 53 0 Was stuck on this for a couple of days.

    Read the article

  • Debugging Maya plug-ins: can't get output or debugger to engage

    - by brainjam
    I'm not a total beginner at Maya, but this is my first time trying to write a plug-in for it. I've downloaded the 30-day eval version of Maya2011 (32bit version on 64bit Windows 7), and have tried building a couple of plug-ins with VC 2008 Express. The first one is helloWorldCmd from the sample directory ..\devkit\plug-ins, and it basically doesn't work until you convert the line cout<<"Hello World"<<endl; to cerr<<"Hello World"<<endl;, but I can live with that. The second one is the SelectRingContext2 example from David Gould's book. The plug-in works as advertised, but I cannot get any debugging output from it. I've tried putting cout, cerr,printf, and MGlobal::displayInfo into the doIt() method, and can't get a peep. I also haven't figured out how to run the plug-in in a debugger. I'm afraid I'm missing something easy but slightly obscure, like a flag somewhere. Anybody out there have any hints? Edit: Turns out the action is happening in the redoIt() method. So I can get MGlobal::displayInfo and cerr producing output. Still don't know why cout and printf don't work, and I'm not sure how to run in the debugger. When I run maya -d (which some of the online advice says I should do) it just shows the output window but never loads the rest.

    Read the article

  • Passing VB Callback function to C dll - noob is stuck.

    - by WaveyDavey
    Callbacks in VB (from C dll). I need to pass a vb function as a callback to a c function in a dll. I know I need to use addressof for the function but I'm getting more and more confused as to how to do it. Details: The function in the dll that I'm passing the address of a callback to is defined in C as : PaError Pa_OpenStream( PaStream** stream, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, double sampleRate, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, void *userData ); where the function is parameter 7, *streamCallback. The type PaStreamCallback is defines thusly: typedef int PaStreamCallback( const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData ); In my vb project I have: Private Declare Function Pa_OpenStream Lib "portaudio_x86.dll" _ ( ByVal stream As IntPtr _ , ByVal inputParameters As IntPtr _ , ByVal outputParameters As PaStreamParameters _ , ByVal samprate As Double _ , ByVal fpb As Double _ , ByVal paClipoff As Long _ , ByVal patestCallBack As IntPtr _ , ByVal data As IntPtr) As Integer (don't worry if I've mistyped some of the other parameters, I'll get to them later! Let's concentrate on the callback for now.) In module1.vb I have defined the callback function: Function MyCallback( ByVal inp As Byte, _ ByVal outp As Byte, _ ByVal framecount As Long, _ ByVal pastreamcallbacktimeinfo As Byte, _ ByVal pastreamcallbackflags As Byte, _ ByVal userdata As Byte) As Integer ' do clever things here End Function The external function in the dll is called with err = Pa_OpenStream( ptr, _ nulthing, _ outputParameters, _ SAMPLE_RATE, _ FRAMES_PER_BUFFER, _ clipoff, _ AddressOf MyCallback, _ dataptr) This is broken in the declaration of the external function - it doesn't like the type IntPtr as a function pointer for AddressOf. Can anyone show me how to implement passing this callback function please ? Many thanks David

    Read the article

  • Vim with Powershell

    - by Kevin Berridge
    I'm using gvim on Windows. In my _vimrc I've added: set shell=powershell.exe set shellcmdflag=-c set shellpipe=> set shellredir=> function! Test() echo system("dir -name") endfunction command! -nargs=0 Test :call Test() If I execute this function (:Test) I see nonsense characters (non number/letter ASCII characters). If I use cmd as the shell, it works (without the -name), so the problem seems to be with getting output from powershell into vim. Interestingly, this works great: :!dir -name As does this: :r !dir -name UPDATE: confirming behavior mentioned by David If you execute the set commands mentioned above in the _vimrc, :Test outputs nonsense. However, if you execute them directly in vim instead of in the _vimrc, :Test works as expected. Also, I've tried using iconv in case it was an encoding problem: :echo iconv( system("dir -name"), "unicode", &enc ) But this didn't make any difference. I could be using the wrong encoding types though. Anyone know how to make this work?

    Read the article

  • IUsable: controlling resources in a better way than IDisposable

    - by Ilya Ryzhenkov
    I wish we have "Usable" pattern in C#, when code block of using construct would be passed to a function as delegate: class Usable : IUsable { public void Use(Action action) // implements IUsable { // acquire resources action(); // release resources } } and in user code: using (new Usable()) { // this code block is converted to delegate and passed to Use method above } Pros: Controlled execution, exceptions The fact of using "Usable" is visible in call stack Cons: Cost of delegate Do you think it is feasible and useful, and if it doesn't have any problems from the language point of view? Are there any pitfalls you can see? EDIT: David Schmitt proposed the following using(new Usable(delegate() { // actions here }) {} It can work in the sample scenario like that, but usually you have resource already allocated and want it to look like this: using (Repository.GlobalResource) { // actions here } Where GlobalResource (yes, I know global resources are bad) implements IUsable. You can rewrite is as short as Repository.GlobalResource.Use(() => { // actions here }); But it looks a little bit weird (and more weird if you implement interface explicitly), and this is so often case in various flavours, that I thought it deserve to be new syntactic sugar in a language.

    Read the article

  • Flex through Flash Builder 4; Connecting to a dynamic XML feed: "The response is not a valid XML or

    - by jtromans
    I am learning how to use Flex with Adobe Flash Builder 4 standalone. I am working my through the Adobe Flash Build 4 Bible by David Gassner. This has led me to create my own micro problems to try and solve. I am trying to connect to a dynamix XML feed created by the following aspx page: generate_xml.aspx When I create the data connection through the Data/Service panel, I can pick between XML and HTTP. I figured because the generate_xml.aspx has to generate the XML file first, I should use the HTTP service as opposed to the XML. The HTTP service offers GET, which seems to be the kinda thing I want. However, I am really struggling to do this. I keep getting: "The response is not a valid XML or a JSON string" The actual STATIC generated XML file that is created by this page works perfectly when I save it and manually connect with the XML service. Therefore I know my XML code is properly formatted and contains no other HTML of JavaScript. I figure my problem occurs because the page itself is .aspx, but I cannot work out how to successfully ask Flex to request the output of this page, rather than the page itself.

    Read the article

  • XML Comparison?

    - by CrazyNick
    I got a books.xml file from http://msdn.microsoft.com/en-us/library/ms762271(VS.85).aspx and just saved it with two different names, removed few lines from the second file and tried to compare the files using the below powershell code: clear-host $xml = New-Object XML $xml = [xml](Get-Content D:\SharePoint\Powershell\Comparator\Comparator_Config.xml) $xml.config.compare | ForEach-Object { $strFile1 = get-Content $.source; $strFile2 = get-Content $.destination; $diff  = Compare-Object $strFile1 $strFile2; $result1 = $diff | where {$.SideIndicator -eq "<=" } | select InputObject; $result2 = $diff | where {$.SideIndicator -eq "=" } | select InputObject; Write-host "nEntries are differ in First web.config filen"; $result1 | ForEach-Object {write-host $.InputObject}; Write-host "nEntries are differ in Second web.config filen" ;$result2 | ForEach-Object {write-host $.InputObject}; $.parameters | ForEach-Object { write-host $.parameter } } and it is working perfectly and giving me the below results: Entries are differ in First web.config file < price36.95< /price < descriptionMicrosoft Visual Studio 7 is explored in depth, looking at how Visual Basic, Visual C++, C#, and ASP+ are integrated into a comprehensive development environment.< /description Entries are differ in Second web.config file < price< /price < description< /description however I wan to know the root node of the above mentioned nodes, is that possible to find? if so, how?

    Read the article

  • Creating a service (SERVICE_ACCEPT_SESSIONCHANGE)

    - by Ron
    Hi there, I am trying to create a service following the example documented in the link below: http://msdn.microsoft.com/en-us/library/bb540475(v=VS.85).aspx What I am interested in is to be able to catch user "lock" and "unlock" workstation events. Using the code on from the example provided, I modified the following: Line 15: Original: VOID WINAPI SvcCtrlHandler( DWORD ); Modified: DWORD WINAPI SvcCtrlHandler( DWORD, DWORD, LPVOID, LPVOID ); Line 141: Original: gSvcStatusHandle = RegisterServiceCtrlHandler( SVCNAME, SvcCtrlHandler); Modified: gSvcStatusHandle = RegisterServiceCtrlHandlerEx( SVCNAME, SvcCtrlHandler, NULL); Line 244: Original: SvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; Modified: gSvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP|SERVICE_ACCEPT_SESSIONCHANGE; Line 266: Original: VOID WINAPI SvcCtrlHandler( DWORD dwCtrl ) { // Handle the requested control code. switch(dwCtrl) { case SERVICE_CONTROL_STOP: ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 0); // Signal the service to stop. SetEvent(ghSvcStopEvent); ReportSvcStatus(gSvcStatus.dwCurrentState, NO_ERROR, 0); return; case SERVICE_CONTROL_INTERROGATE: break; default: break; } }` Modified: DWORD WINAPI SvcCtrlHandler( DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext ) { DWORD dwErrorCode = NO_ERROR; switch(dwControl) { case SERVICE_CONTROL_STOP: ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 0); // Signal the service to stop. SetEvent(ghSvcStopEvent); ReportSvcStatus(gSvcStatus.dwCurrentState, NO_ERROR, 0); break; case SERVICE_CONTROL_INTERROGATE: break; case SERVICE_CONTROL_SESSIONCHANGE: ReportSvcStatus(gSvcStatus.dwCurrentState, NO_ERROR, 0); break; default: break; } return dwErrorCode; } With the changes above, my service compiled and install fine. But when I try to start my service on my Windows 2000 machine, it does not start properly (it will be stuck on the "starting" status) Can anyone please advise? Thank you in advance, Ron

    Read the article

  • More than 100 connection to sql server 2008 in "sleeping" status - Solved

    - by Allende
    I have a big trouble here, well at my server. I have an ASP .net web (framework 4.x) running on muy server, all the transactions/select/update/insert are made with ADO.NET. Well my problem is that after being using for a while (a couple of updates/selects/inserts) sometimes I got more than 100 connections on "sleeping" status when check for the connections on sql server with this query: SELECT spid, a.status, hostname, program_name, cmd, cpu, physical_io, blocked, b.name, loginame FROM master.dbo.sysprocesses a INNER JOIN master.dbo.sysdatabases b ON a.dbid = b.dbid where program_name like '%TMS%' ORDER BY spid I've been checking my code and closing every time I make a connection, I'm gonna test the new class, but I'm afraid the problem doesn't be fixed. It suppose that the connection pooling, keep the connections to re-use them, but until I see don't re-use them always. Any idea besides check for close all the connections open after use them? SOLVED(now I have just one and beautiful connection on "sleeping" status): Besides the anwser of David Stratton, I would like to share this link that help explain really well how the connection pool it works: http://dinesql.blogspot.com/2010/07/sql-server-sleeping-status-and.html Just to be short, you need to close every connection (sql connection objects) in order that the connection pool can re-use the connection and use the same connectinos string, to ensure this is highly recommended use one of the webConfig. Be careful with dataReaders you sould close its connection to (that was what make got out of my mind for while).

    Read the article

  • libpng cannot read an image properly

    - by jonathanasdf
    Here is my function... I don't know why it's not working. The resulting image looks nothing like what the .png looks like. But there's no errors either. bool Bullet::read_png(std::string file_name, int pos) { png_structp png_ptr; png_infop info_ptr; FILE *fp; if ((fp = fopen(file_name.c_str(), "rb")) == NULL) { return false; } png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (png_ptr == NULL) { fclose(fp); return false; } info_ptr = png_create_info_struct(png_ptr); if (info_ptr == NULL) { fclose(fp); png_destroy_read_struct(&png_ptr, NULL, NULL); return false; } if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); fclose(fp); return false; } png_init_io(png_ptr, fp); png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_SWAP_ALPHA | PNG_TRANSFORM_EXPAND, NULL); png_uint_32 width = png_get_image_width(png_ptr, info_ptr); png_uint_32 height = png_get_image_height(png_ptr, info_ptr); imageData[pos].width = width; imageData[pos].height = height; png_bytepp row_pointers; row_pointers = png_get_rows(png_ptr, info_ptr); imageData[pos].data = new unsigned int[width*height]; for (unsigned int i=0; i < height; ++i) { memcpy(&imageData[pos].data[i*width], &row_pointers[i], width*sizeof(unsigned int)); } png_destroy_read_struct(&png_ptr, &info_ptr, NULL); fclose(fp); for (unsigned int i=0; i < height; ++i) { for (unsigned int j=0; j < width; ++j) { unsigned int val = imageData[pos].data[i*width+j]; if (val != 0) { unsigned int a = ((val >> 24)); unsigned int r = (((val - (a << 24)) >> 16)); unsigned int g = (((val - (a << 24) - (r << 16)) >> 8)); unsigned int b = (((val - (a << 24) - (r << 16) - (g << 8)))); // for debugging std::string s(AS3_StringValue(AS3_Int(i*width+j))); s += " "; s += AS3_StringValue(AS3_Int(val)); s += " "; s += AS3_StringValue(AS3_Int(a)); s += " "; s += AS3_StringValue(AS3_Int(r)); s += " "; s += AS3_StringValue(AS3_Int(g)); s += " "; s += AS3_StringValue(AS3_Int(b)); AS3_Trace(AS3_String(s.c_str())); } } } return true; } ImageData is just a simple struct to keep x, y, width, and height, and imageData is an array of that struct. struct ImageData { int x; int y; int width; int height; unsigned int* data; }; Here is a side by side screenshot of the input and output graphics (something I made in a minute for testing), and this was after setting alpha to 255 in order to make it show up (because the alpha I was getting back was 1). Left side is original, right side is what happened after reading it through this function. Scaled up 400% for visibility. Here is a log of the traces: 0 16855328 1 1 49 32 1 16855424 1 1 49 128 2 16855456 1 1 49 160 3 16855488 1 1 49 192 4 16855520 1 1 49 224 5 16855552 1 1 50 0 6 16855584 1 1 50 32 7 16855616 1 1 50 64 8 16855424 1 1 49 128 9 16855456 1 1 49 160 10 16855488 1 1 49 192 11 16855520 1 1 49 224 12 16855552 1 1 50 0 13 16855584 1 1 50 32 14 16855616 1 1 50 64 15 16855648 1 1 50 96 16 16855456 1 1 49 160 17 16855488 1 1 49 192 18 16855520 1 1 49 224 19 16855552 1 1 50 0 20 16855584 1 1 50 32 21 16855616 1 1 50 64 22 16855648 1 1 50 96 23 16855680 1 1 50 128 24 16855488 1 1 49 192 25 16855520 1 1 49 224 26 16855552 1 1 50 0 27 16855584 1 1 50 32 28 16855616 1 1 50 64 29 16855648 1 1 50 96 30 16855680 1 1 50 128 31 16855712 1 1 50 160 32 16855520 1 1 49 224 33 16855552 1 1 50 0 34 16855584 1 1 50 32 35 16855616 1 1 50 64 36 16855648 1 1 50 96 37 16855680 1 1 50 128 38 16855712 1 1 50 160 39 16855744 1 1 50 192 40 16855552 1 1 50 0 41 16855584 1 1 50 32 42 16855616 1 1 50 64 43 16855648 1 1 50 96 44 16855680 1 1 50 128 45 16855712 1 1 50 160 46 16855744 1 1 50 192 47 16855776 1 1 50 224 48 16855584 1 1 50 32 49 16855616 1 1 50 64 50 16855648 1 1 50 96 51 16855680 1 1 50 128 52 16855712 1 1 50 160 53 16855744 1 1 50 192 54 16855776 1 1 50 224 55 16855808 1 1 51 0 56 16855616 1 1 50 64 57 16855648 1 1 50 96 58 16855680 1 1 50 128 59 16855712 1 1 50 160 60 16855744 1 1 50 192 61 16855776 1 1 50 224 62 16855808 1 1 51 0 63 16855840 1 1 51 32 64 16855648 1 1 50 96 65 16855680 1 1 50 128 66 16855712 1 1 50 160 67 16855744 1 1 50 192 68 16855776 1 1 50 224 69 16855808 1 1 51 0 70 16855840 1 1 51 32 71 16855872 1 1 51 64 72 16855680 1 1 50 128 73 16855712 1 1 50 160 74 16855744 1 1 50 192 75 16855776 1 1 50 224 76 16855808 1 1 51 0 77 16855840 1 1 51 32 78 16855872 1 1 51 64 79 16855904 1 1 51 96 80 16855712 1 1 50 160 81 16855744 1 1 50 192 82 16855776 1 1 50 224 83 16855808 1 1 51 0 84 16855840 1 1 51 32 85 16855872 1 1 51 64 86 16855904 1 1 51 96 87 16855936 1 1 51 128 88 16855744 1 1 50 192 89 16855776 1 1 50 224 90 16855808 1 1 51 0 91 16855840 1 1 51 32 92 16855872 1 1 51 64 93 16855904 1 1 51 96 94 16855936 1 1 51 128 95 16855968 1 1 51 160 96 16855776 1 1 50 224 97 16855808 1 1 51 0 98 16855840 1 1 51 32 99 16855872 1 1 51 64 100 16855904 1 1 51 96 101 16855936 1 1 51 128 102 16855968 1 1 51 160 103 16856000 1 1 51 192 104 16855808 1 1 51 0 105 16855840 1 1 51 32 106 16855872 1 1 51 64 107 16855904 1 1 51 96 108 16855936 1 1 51 128 109 16855968 1 1 51 160 110 16856000 1 1 51 192 111 16856032 1 1 51 224 112 16855840 1 1 51 32 113 16855872 1 1 51 64 114 16855904 1 1 51 96 115 16855936 1 1 51 128 116 16855968 1 1 51 160 117 16856000 1 1 51 192 118 16856032 1 1 51 224 119 16856064 1 1 52 0 120 16855872 1 1 51 64 121 16855904 1 1 51 96 122 16855936 1 1 51 128 123 16855968 1 1 51 160 124 16856000 1 1 51 192 125 16856032 1 1 51 224 126 16856064 1 1 52 0 127 16856096 1 1 52 32 128 16855904 1 1 51 96 129 16855936 1 1 51 128 130 16855968 1 1 51 160 131 16856000 1 1 51 192 132 16856032 1 1 51 224 133 16856064 1 1 52 0 134 16856096 1 1 52 32 135 16856128 1 1 52 64 136 16855936 1 1 51 128 137 16855968 1 1 51 160 138 16856000 1 1 51 192 139 16856032 1 1 51 224 140 16856064 1 1 52 0 141 16856096 1 1 52 32 142 16856128 1 1 52 64 143 16856160 1 1 52 96 144 16855968 1 1 51 160 145 16856000 1 1 51 192 146 16856032 1 1 51 224 147 16856064 1 1 52 0 148 16856096 1 1 52 32 149 16856128 1 1 52 64 150 16856160 1 1 52 96 151 16856192 1 1 52 128 152 16856000 1 1 51 192 153 16856032 1 1 51 224 154 16856064 1 1 52 0 155 16856096 1 1 52 32 156 16856128 1 1 52 64 157 16856160 1 1 52 96 158 16856192 1 1 52 128 159 16856224 1 1 52 160 160 16856032 1 1 51 224 161 16856064 1 1 52 0 162 16856096 1 1 52 32 163 16856128 1 1 52 64 164 16856160 1 1 52 96 165 16856192 1 1 52 128 166 16856224 1 1 52 160 167 16856256 1 1 52 192 168 16856064 1 1 52 0 169 16856096 1 1 52 32 170 16856128 1 1 52 64 171 16856160 1 1 52 96 172 16856192 1 1 52 128 173 16856224 1 1 52 160 174 16856256 1 1 52 192 175 16856288 1 1 52 224 176 16856096 1 1 52 32 177 16856128 1 1 52 64 178 16856160 1 1 52 96 179 16856192 1 1 52 128 180 16856224 1 1 52 160 181 16856256 1 1 52 192 182 16856288 1 1 52 224 183 16856320 1 1 53 0 184 16856128 1 1 52 64 185 16856160 1 1 52 96 186 16856192 1 1 52 128 187 16856224 1 1 52 160 188 16856256 1 1 52 192 189 16856288 1 1 52 224 190 16856320 1 1 53 0 192 16856160 1 1 52 96 193 16856192 1 1 52 128 194 16856224 1 1 52 160 195 16856256 1 1 52 192 196 16856288 1 1 52 224 197 16856320 1 1 53 0 200 16856192 1 1 52 128 201 16856224 1 1 52 160 202 16856256 1 1 52 192 203 16856288 1 1 52 224 204 16856320 1 1 53 0 208 16856224 1 1 52 160 209 16856256 1 1 52 192 210 16856288 1 1 52 224 211 16856320 1 1 53 0 216 16856256 1 1 52 192 217 16856288 1 1 52 224 218 16856320 1 1 53 0 224 16856288 1 1 52 224 225 16856320 1 1 53 0 232 16856320 1 1 53 0 Was stuck on this for a couple of days.

    Read the article

  • Python and csv help

    - by user353064
    I'm trying to create this script that will check the computer host name then search a master list for the value to return a corresponding value in the csv file. Then open another file and do a find an replace. I know this should be easy but haven't done so much in python before. Here is what I have so far... masterlist.txt (tab delimited) Name UID Bob-Smith.local bobs Carmen-Jackson.local carmenj David-Kathman.local davidk Jenn-Roberts.local jennr Here is the script that I have created thus far #GET CLIENT HOST NAME import socket host = socket.gethostname() print host #IMPORT MASTER DATA import csv, sys filename = "masterlist.txt" reader = csv.reader(open(filename, "rU")) #PRINT MASTER DATA for row in reader: print row #SEARCH ON HOSTNAME AND RETURN UID #REPLACE VALUE IN FILE WITH UID #import fileinput #for line in fileinput.FileInput("filetoreplace",inplace=1): # line = line.replace("replacethistext","UID") # print line Right now, it's just set to print the master list. I'm not sure if the list needs to be parsed and placed into a dictionary or what. I really need to figure out how to search the first field for the hostname and then return the field in the second column. Thanks in advance for your help, Aaron

    Read the article

  • Parsing basic math equations for children's educational software?

    - by Simucal
    Inspired by a recent TED talk, I want to write a small piece of educational software. The researcher created little miniature computers in the shape of blocks called "Siftables". [David Merril, inventor - with Siftables in the background.] There were many applications he used the blocks in but my favorite was when each block was a number or basic operation symbol. You could then re-arrange the blocks of numbers or operation symbols in a line, and it would display an answer on another siftable block. So, I've decided I wanted to implemented a software version of "Math Siftables" on a limited scale as my final project for a CS course I'm taking. What is the generally accepted way for parsing and interpreting a string of math expressions, and if they are valid, perform the operation? Is this a case where I should implement a full parser/lexer? I would imagine interpreting basic math expressions would be a semi-common problem in computer science so I'm looking for the right way to approach this. For example, if my Math Siftable blocks where arranged like: [1] [+] [2] This would be a valid sequence and I would perform the necessary operation to arrive at "3". However, if the child were to drag several operation blocks together such as: [2] [\] [\] [5] It would obviously be invalid. Ultimately, I want to be able to parse and interpret any number of chains of operations with the blocks that the user can drag together. Can anyone explain to me or point me to resources for parsing basic math expressions? I'd prefer as much of a language agnostic answer as possible.

    Read the article

  • Deploying ASP.NET MVC to IIS6: pages are just blank

    - by BryanGrimes
    I have an MVC app that is actually on a couple other servers but I didn't do the deploy. For this deploy I have added the wildcard to aspnet_isapi.dll which has gotten rid of the 404 error. But the pages are not pulling up, rather everything is just blank. I can't seem to find any IIS configuration differences. The Global asax.cs file does have routing defined, but as I've seen on a working server, that file isn't just hanging out in the root or anything so obvious. What could I be missing here? All of the servers are running IIS6 and I have compared the setups and they look the same to me at this point. Thanks... Bryan EDIT for the comments thus far: I've looked in the event logs with no luck, and scoured various IIS logs per David Wang: blogs.msdn.com. Below is the Global.asax.cs file... public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("error.axd"); // for Elmah // For deployment to IIS6 routes.Add(new Route ( "{controller}.mvc/{action}/{id}", new RouteValueDictionary(new { action = "Index", id = (string)null }), new MvcRouteHandler() )); routes.MapRoute( "WeeklyTimeSave", "Time/Save", new { controller = "Time", action = "Save" } ); routes.MapRoute( "WeeklyTimeAdd", "Time/Add", new { controller = "Time", action = "Add" } ); routes.MapRoute( "WeeklyTimeEdit", "Time/Edit/{id}", new { controller = "Time", action = "Edit", id = "" } ); routes.MapRoute( "FromSalesforce", "Home/{id}", new { controller = "Home", action = "Index", id = "" }); routes.MapRoute( "Default2", "{controller}/{id}", new { controller = "Home", action = "Index", id = "" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); } protected void Application_Start() { RegisterRoutes(RouteTable.Routes); } } Maybe this is as stupid as the asax file not being somewhere it needs to be, but heck if I know at this point.

    Read the article

  • Does GetSystemInfo (on Windows) always return the number of logical processors?

    - by mhughes
    Reading up on this, and specifically reading the Microsoft docs, it looks like it should be returning the number of PHYSICAL processors, and that you should use GetLogicalProcessorInformation to figure out how many LOGICAL processors you have. Here's the doc I found on the SYSTEM_INFO structure: http://msdn.microsoft.com/en-us/library/ms724958(v=VS.85).aspx And here's the doc on GetLogicalProcessorInformation: (spaces added to get through spam filter) http:// msdn.microsoft.com/ en-us/ library/ ms683194.aspx Reading up on it further though, in most of the discussions I've found on this topic, developers say to that GetSystemInfo (and the SYSTEM_INFO structure) report the number of LOGICAL processors. When I search again, I find that MS did release some info on this (and a hot fix), here (spaces added to get through spam filter): http:// support. microsoft.com/ kb/936235 Reading that, it sounds like on Xp, pre-service Pack 3, GetSystemInfo reports the number of LOGICAL processors in the SYSTEM_INFO structure. It also reads to me that on Windows Vista and Windows 7, GetSystemInfo should be reporting the number of PHYSICAL processors (different to Windows XP pre-service Pack 3). Does anyone know what it actually does? Does GetSystemInfo really report the number of physical processors (on the same computer) differently, depending on which OS it's running on?

    Read the article

  • WSMethodInvocationSetCallBack symbol not found after importing files generated from WSMakeStubs

    - by racingcow
    Hello, I am pretty new to Objective-C, and I am trying to write an iPhone app to call a simple web service. I used WSMakeStubs to point to my WSDL file, and it generated 4 files for me... WSGeneratedObj.h WSGeneratedObj.m CtServices2.h CtServices2.m I added only the WSGeneratedObj.h and WSGeneratedObj.m files into a new iPhone app, added in the mobile core services framework from... /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks/MobileCoreServices.framework ...and then compiled. I get the following errors... Building target “iMagioSearch2” of project “iMagioSearch2” with configuration “Debug” Checking Dependencies Ld /Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/Debug-iphonesimulator/iMagioSearch2.app/iMagioSearch2 normal i386 cd /Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2 setenv MACOSX_DEPLOYMENT_TARGET 10.5 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk -L/Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/Debug-iphonesimulator -F/Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/Debug-iphonesimulator -filelist /Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/iMagioSearch2.build/Debug-iphonesimulator/iMagioSearch2.build/Objects-normal/i386/iMagioSearch2.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -framework MobileCoreServices -o /Users/Teresa/Desktop/iMagioSearch2/iMagioSearch2/build/Debug-iphonesimulator/iMagioSearch2.app/iMagioSearch2 Undefined symbols: "_kWSSOAPBodyEncodingStyle", referenced from: _kWSSOAPBodyEncodingStyle$non_lazy_ptr in WSGeneratedObj.o "_WSMethodInvocationCreate", referenced from: -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o "_kWSSOAPMethodNamespaceURI", referenced from: _kWSSOAPMethodNamespaceURI$non_lazy_ptr in WSGeneratedObj.o "_WSMethodInvocationUnscheduleFromRunLoop", referenced from: -[WSGeneratedObj getResultDictionary] in WSGeneratedObj.o -[WSGeneratedObj unscheduleFromRunLoop:mode:] in WSGeneratedObj.o "_WSMethodResultIsFault", referenced from: -[WSGeneratedObj isFault] in WSGeneratedObj.o "_kWSMethodInvocationResult", referenced from: _kWSMethodInvocationResult$non_lazy_ptr in WSGeneratedObj.o "_WSMethodInvocationSetProperty", referenced from: -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o "_WSMethodInvocationScheduleWithRunLoop", referenced from: -[WSGeneratedObj getResultDictionary] in WSGeneratedObj.o -[WSGeneratedObj scheduleOnRunLoop:mode:] in WSGeneratedObj.o "_kWSHTTPExtraHeaders", referenced from: _kWSHTTPExtraHeaders$non_lazy_ptr in WSGeneratedObj.o "_WSMethodInvocationSetParameters", referenced from: -[WSGeneratedObj setParameters:values:names:] in WSGeneratedObj.o "_WSMethodInvocationSetCallBack", referenced from: -[WSGeneratedObj createInvocationRef:methodName:protocol:style:soapAction:methodNamespace:] in WSGeneratedObj.o ld: symbol(s) not found collect2: ld returned 1 exit status Does anyone know of anything I can check or why I might be getting this error? Thanks, David

    Read the article

  • java inserting special characters with preparedstatement fails

    - by phill
    I am using an HTML form which sends <input type=hidden name=longdesc value='SMARTNET%^" 8X5XNBD'> this is done by the following javascript code: function masinsert(id) { var currentTime=new Date(); var button = document.getElementById("m"+id); button.onclick=""; button.value="Inserting"; var itemdescription = document.getElementById("itemdescription"+id).value; function handleHttpResponse() { if (http.readyState == 4) { button.value="Item Added"; } } var http = getHTTPObject(); // We create the HTTP Object var tempUrl = "\AInsert"; tempUrl += "itemdescription="+itemdescription+"&"+"itemshortdescription="+itemdescription.substring(0,37)+; alert(tempUrl); http.open("GET", tempUrl, true); http.onreadystatechange = handleHttpResponse; http.send(null); } to a java servlet. AInsert.java in the AInsert.java file, I do a String itemdescription = request.getParameter("longdesc"); which then sends the value to a preparedstatement to run an insert query. In the query, there are sometimes special characters which throw it off. For example, when I run the following insert into itemdescription (longdesc) values ('SMARTNET%^" 8X5XNBD') here is the actual snippet: PreparedStatement ps = conn.prepareStatement("INSERT INTO itemdescription (longdesc) values(?)"); ps.setString(1, itemdescription); ps.executeUpdate(); It will produce an error saying : Cannot insert the value NULL into column 'LongDesc', table 'App.dbo.itemdescription'; column does not allow nulls. Insert fails I have tried urlencode/urldecode String encodedString = URLEncoder.encode(longdesc, "UTF-8"); String decitemdescription = URLDecoder.decode(itemdescription, "UTF-8"); and i've also tried these functions //BEGIN URL Encoder final static String[] hex = { "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07", "%08", "%09", "%0a", "%0b", "%0c", "%0d", "%0e", "%0f", "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17", "%18", "%19", "%1a", "%1b", "%1c", "%1d", "%1e", "%1f", "%20", "%21", "%22", "%23", "%24", "%25", "%26", "%27", "%28", "%29", "%2a", "%2b", "%2c", "%2d", "%2e", "%2f", "%30", "%31", "%32", "%33", "%34", "%35", "%36", "%37", "%38", "%39", "%3a", "%3b", "%3c", "%3d", "%3e", "%3f", "%40", "%41", "%42", "%43", "%44", "%45", "%46", "%47", "%48", "%49", "%4a", "%4b", "%4c", "%4d", "%4e", "%4f", "%50", "%51", "%52", "%53", "%54", "%55", "%56", "%57", "%58", "%59", "%5a", "%5b", "%5c", "%5d", "%5e", "%5f", "%60", "%61", "%62", "%63", "%64", "%65", "%66", "%67", "%68", "%69", "%6a", "%6b", "%6c", "%6d", "%6e", "%6f", "%70", "%71", "%72", "%73", "%74", "%75", "%76", "%77", "%78", "%79", "%7a", "%7b", "%7c", "%7d", "%7e", "%7f", "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87", "%88", "%89", "%8a", "%8b", "%8c", "%8d", "%8e", "%8f", "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97", "%98", "%99", "%9a", "%9b", "%9c", "%9d", "%9e", "%9f", "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%a7", "%a8", "%a9", "%aa", "%ab", "%ac", "%ad", "%ae", "%af", "%b0", "%b1", "%b2", "%b3", "%b4", "%b5", "%b6", "%b7", "%b8", "%b9", "%ba", "%bb", "%bc", "%bd", "%be", "%bf", "%c0", "%c1", "%c2", "%c3", "%c4", "%c5", "%c6", "%c7", "%c8", "%c9", "%ca", "%cb", "%cc", "%cd", "%ce", "%cf", "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", "%d8", "%d9", "%da", "%db", "%dc", "%dd", "%de", "%df", "%e0", "%e1", "%e2", "%e3", "%e4", "%e5", "%e6", "%e7", "%e8", "%e9", "%ea", "%eb", "%ec", "%ed", "%ee", "%ef", "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7", "%f8", "%f9", "%fa", "%fb", "%fc", "%fd", "%fe", "%ff" }; /** * Encode a string to the "x-www-form-urlencoded" form, enhanced * with the UTF-8-in-URL proposal. This is what happens: * * <ul> * <li><p>The ASCII characters 'a' through 'z', 'A' through 'Z', * and '0' through '9' remain the same. * * <li><p>The unreserved characters - _ . ! ~ * ' ( ) remain the same. * * <li><p>The space character ' ' is converted into a plus sign '+'. * * <li><p>All other ASCII characters are converted into the * 3-character string "%xy", where xy is * the two-digit hexadecimal representation of the character * code * * <li><p>All non-ASCII characters are encoded in two steps: first * to a sequence of 2 or 3 bytes, using the UTF-8 algorithm; * secondly each of these bytes is encoded as "%xx". * </ul> * * @param s The string to be encoded * @return The encoded string */ public static String encode(String s) { StringBuffer sbuf = new StringBuffer(); int len = s.length(); for (int i = 0; i < len; i++) { int ch = s.charAt(i); if ('A' <= ch && ch <= 'Z') { // 'A'..'Z' sbuf.append((char)ch); } else if ('a' <= ch && ch <= 'z') { // 'a'..'z' sbuf.append((char)ch); } else if ('0' <= ch && ch <= '9') { // '0'..'9' sbuf.append((char)ch); } else if (ch == ' ') { // space sbuf.append('+'); } else if (ch == '-' || ch == '_' // unreserved || ch == '.' || ch == '!' || ch == '~' || ch == '*' || ch == '\'' || ch == '(' || ch == ')') { sbuf.append((char)ch); } else if (ch <= 0x007f) { // other ASCII sbuf.append(hex[ch]); } else if (ch <= 0x07FF) { // non-ASCII <= 0x7FF sbuf.append(hex[0xc0 | (ch >> 6)]); sbuf.append(hex[0x80 | (ch & 0x3F)]); } else { // 0x7FF < ch <= 0xFFFF sbuf.append(hex[0xe0 | (ch >> 12)]); sbuf.append(hex[0x80 | ((ch >> 6) & 0x3F)]); sbuf.append(hex[0x80 | (ch & 0x3F)]); } } return sbuf.toString(); } //end encode and //decode url private static String unescape(String s) { StringBuffer sbuf = new StringBuffer () ; int l = s.length() ; int ch = -1 ; int b, sumb = 0; for (int i = 0, more = -1 ; i < l ; i++) { /* Get next byte b from URL segment s */ switch (ch = s.charAt(i)) { case '%': ch = s.charAt (++i) ; int hb = (Character.isDigit ((char) ch) ? ch - '0' : 10+Character.toLowerCase((char) ch) - 'a') & 0xF ; ch = s.charAt (++i) ; int lb = (Character.isDigit ((char) ch) ? ch - '0' : 10+Character.toLowerCase ((char) ch)-'a') & 0xF ; b = (hb << 4) | lb ; break ; case '+': b = ' ' ; break ; default: b = ch ; } /* Decode byte b as UTF-8, sumb collects incomplete chars */ if ((b & 0xc0) == 0x80) { // 10xxxxxx (continuation byte) sumb = (sumb << 6) | (b & 0x3f) ; // Add 6 bits to sumb if (--more == 0) sbuf.append((char) sumb) ; // Add char to sbuf } else if ((b & 0x80) == 0x00) { // 0xxxxxxx (yields 7 bits) sbuf.append((char) b) ; // Store in sbuf } else if ((b & 0xe0) == 0xc0) { // 110xxxxx (yields 5 bits) sumb = b & 0x1f; more = 1; // Expect 1 more byte } else if ((b & 0xf0) == 0xe0) { // 1110xxxx (yields 4 bits) sumb = b & 0x0f; more = 2; // Expect 2 more bytes } else if ((b & 0xf8) == 0xf0) { // 11110xxx (yields 3 bits) sumb = b & 0x07; more = 3; // Expect 3 more bytes } else if ((b & 0xfc) == 0xf8) { // 111110xx (yields 2 bits) sumb = b & 0x03; more = 4; // Expect 4 more bytes } else /*if ((b & 0xfe) == 0xfc)*/ { // 1111110x (yields 1 bit) sumb = b & 0x01; more = 5; // Expect 5 more bytes } /* We don't test if the UTF-8 encoding is well-formed */ } return sbuf.toString() ; } but the decoding doesn't change it back to the original special characters. Any ideas? thanks in advance UPDATE: I tried adding these two statements to grab the request String itemdescription = URLDecoder.decode(request.getParameter("itemdescription"), "UTF-8"); String itemshortdescription = URLDecoder.decode(request.getParameter("itemshortdescription"), "UTF-8"); System.out.println("processRequest | short descrip "); and this is failing as well if that helps. UPDATE2: I created an html form and did a direct insert with the encoded itemdescription such as and the insertion works correctly with the special charaters and everything. I guess there is something going on with my javascript submit. Any ideas on this?

    Read the article

< Previous Page | 159 160 161 162 163 164 165 166 167 168 169 170  | Next Page >