Posts

java - SQL Input String was not in a correct format on XML -

i formatting .xml file contains coding of .swf game (through .xmls , .dats), however, it's runable server using mysql. i adding items on dat1.xml (basically main .xml), won't post .xml here (it's 79823 lines long) code goes this: code <object type="unique id shown 0x000-0xffff" id="item name"> <class>equipment</class> <item/> <texture> <file>texture .png file</file> <index></index> </texture> <slottype>9</slottype> <description>self explainatory</description> <bagtype>4</bagtype> <feedpower>feed in-game pets</feedpower> <soulbound/> (soulbound = cannot traded) <displayid>name display in-game</displayid> when finished adding new items, tried run server.exe (which selects dat1.xml, among other .xmls items coded correctly server-sided), when server reaches dat1.xml, error shows up: sys...

linux - Could pthread mutex with PTHREAD_PROCESS_SHARED attribute be used to synchronize two unrelated process(not father and child)? -

we use pthread mutex pthread_process_shared attribute synchronize father , child process: 1,mmap 2,pthread_mutexattr_init , pthread_mutexattr_setpshared 3,fork but if want synchronize 2 unrelated process(not father , child) using phtread mutex, how? please give example?

vb.net - Excel find the sum of every 6th column in a loop -

Image
i have excel sheet have inserted blank columns through macro need find sum of every 6 columns , store values in empty column? trying step 7 7 isnt working. need empty columns have average of last 6 columns the code have tried is sub sum_of_every_6th_column() dim ilastcol integer ilastcol = cells(1, columns.count).end(xltoleft).column ' same ctrl+right arrow colx = 7 ilastcol step 8 '?? unable understand can come here next end sub try code, alter per needs, sub sumcols() dim long, j long, k long j = 0 k = 1 cells(rows.count, 1).end(xlup).row = 1 cells(k, columns.count).end(xltoleft).column + 1 if isempty(cells(k, i)) cells(k, i) = j j = 0 else j = j + cells(k, i) end if next next k end sub

assembly - How to read image file and display on screen in windows tasm dosbox -

Image
im learning graphical programming in tasm using dosbox. ive been using bunch of loops draw square blocks of pixels , hard. want know if theres way read image , display it. know how read txt file maybe start. pls help you need write/use image loader or use own image file format. bmp may simple has in compression pixel formats etc still can focus on specific type of bmp , ignore others... back in days of ms-dos using 256 color pcx images palette used 256 color video modes. here nasm linez game example: color lines - simple game in c++/the checking algorithm see pcx: subroutine. decodes loaded pcx file memory ds:0 raw vga image @ es:di . beware support 64 kbyte size limit !!! visualize image have copy es:di content videoram (assuming a000:0000 ) example rep movsd or can set es:di in first place (but flicker). this pcx loader not use palette image need encode ... (the routines change vga palette included in source need extract rgb values pcx think @...

java - Bitmap drawn in a rectangle, now rotate 90 and scale it to the same rectangle -

Image
i have bitmap drawn in rectangle. want rotate bitmap 90 degree , draw oriented bitmap in same rectangle bound, may need scale it. above oriented image not scaled fit rectangle bound of original rectangle (see first image, normal one) , remove lower part of image. below code snippet. suggestion ? sourceimagerect.left = 0; sourceimagerect.top = 0; sourceimagerect.right = bmp.getwidth(); sourceimagerect.bottom = bmp.getheight(); destimagerect.top = desttop; destimagerect.left = destleft; destimagerect.right = destleft + destwidth; destimagerect.bottom = desttop + destheight; canvas.save(canvas.matrix_save_flag); canvas.rotate(90, (destleft + (destwidth / 2)), (desttop + (destheight / 2))); canvas.drawbitmap(bmp, sourceimagerect, destimagerect, null); canvas.restore(); last image exact required output need. i writed tool java class named imagescaleutil.java several days ago. helping can useful information on it. you can use it, this: ```java bitmap ta...

python - styling issue in navigation bar with django -

Image
i have styling issue in navigation bar when next button enabled, has issue error in next page button: but when button disabled, got fixed error fixed: here code navigation.html <div class="col-6 col-offset-3 text-center pagination-set"> <nav aria-label=""> {% if queryset.has_other_pages %} <ul class="pagination"> {% if queryset.has_previous %} <li class="page-item"> <a class="page_link" href="?page={{ queryset.previous_page_number }}">&laquo;</a> </li> {% else %} <li class="page-item disabled"> <a class="page-link"><span class="page-link">&laquo;</span></a> </li> {% endif %} {% in page_range %} {% ...

swift - Enum Case not found in type -

enum operator: character { case substract = "-" case add = "+" case multiply = "*" case divide = "/" } i have enum above , function declared below checks if have valid operator. e.g. isoperator("+") func isoperator(_ symbol: character)-> operator? { let op = operator(rawvalue: symbol) switch op { case .substract, .add, .multiply, .divide: return op default: return nil } } what compiler returns here "enum case not found in type" means cases defined in switch statement (.add .. etc) not available in operator type. why compiler not able find case since op operator type swift inver types atuomatically? yes, because let op = operator(rawvalue: symbol) optional , in switch case matching exact values. can apply optional in case while comparing. below. func isoperator(_ symbol: character)-...