Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programmers' lounge. (Programming-related discussions only)
New Posts  All Forums:Forum Nav:

Programmers' lounge. (Programming-related discussions only) - Page 93

post #921 of 926
Quote:
Originally Posted by andyroo89 View Post

Finally I have a use for this


I had some code i was working with a couple months ago I had a packet I sent via UDP where it was basically a struct with a timestamp and a Struct of 3 variables. I could print the Hex values out on both sides and they would match perfectly , but when i read the values from the nested struct on the receive side, they were all incorrect, but the timestamp was correct. I ended up doing ntohl around the nested struct and not the timestamp and everything worked. Not sure why I had to do it there, but it made it work.
Zev's Comp
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-2500K Sandy Bridge 3.3GHz GIGABYTE GA-Z68X-UD3H-B3 LGA 1155 Intel Z68 HDM... EVGA SuperClocked - GeForce GTX 560 Ti 1GB  G.SKILL Ripjaws X Series 8GB 
Hard DrivePowerCase
500gig WD 7200RPM SATA Antec BP550 Plus 550W Continuous Power ATX12V V...  COOLER MASTER ELITE 335 RC-335-KKN1-GP Black S... 
  hide details  
Reply
Zev's Comp
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-2500K Sandy Bridge 3.3GHz GIGABYTE GA-Z68X-UD3H-B3 LGA 1155 Intel Z68 HDM... EVGA SuperClocked - GeForce GTX 560 Ti 1GB  G.SKILL Ripjaws X Series 8GB 
Hard DrivePowerCase
500gig WD 7200RPM SATA Antec BP550 Plus 550W Continuous Power ATX12V V...  COOLER MASTER ELITE 335 RC-335-KKN1-GP Black S... 
  hide details  
Reply
post #922 of 926
Quote:
Originally Posted by Mrzev View Post

I ended up doing ntohl around the nested struct and not the timestamp and everything worked. Not sure why I had to do it there, but it made it work.
If I remember right from my Operating Systems course, it has to do with little-endian/big-endian and networking choosing the one that x86 is not. Also since you were sending/reading raw from the socket, that adds to the issue of having to use ntohl.
The Abyss
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i32100 Asus P8Z77-V LK ASUS GTX 650 Curical DDR3 
RAMHard DriveHard DriveOptical Drive
Kingston DDR3 Crucial M4 WD Black LG GGC-H20L 
CoolingOSMonitorKeyboard
Noctua NH-L12 Windows 8.1 Pro Dell (2048x1152) Logitech Illuminated Keyboard 
PowerCaseMouse
Corsair CX430 Corsair 550d Logiech G5 
  hide details  
Reply
The Abyss
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i32100 Asus P8Z77-V LK ASUS GTX 650 Curical DDR3 
RAMHard DriveHard DriveOptical Drive
Kingston DDR3 Crucial M4 WD Black LG GGC-H20L 
CoolingOSMonitorKeyboard
Noctua NH-L12 Windows 8.1 Pro Dell (2048x1152) Logitech Illuminated Keyboard 
PowerCaseMouse
Corsair CX430 Corsair 550d Logiech G5 
  hide details  
Reply
post #923 of 926
Quote:
Originally Posted by stumped View Post

If I remember right from my Operating Systems course, it has to do with little-endian/big-endian and networking choosing the one that x86 is not. Also since you were sending/reading raw from the socket, that adds to the issue of having to use ntohl.
Yup, so why was 1 variable little endian, and one big endian? They were both in the same UDP packet sent.. .so why would only 1 change? If they were mixed, why would the hex value of the full array show correctly on both sides.
Zev's Comp
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-2500K Sandy Bridge 3.3GHz GIGABYTE GA-Z68X-UD3H-B3 LGA 1155 Intel Z68 HDM... EVGA SuperClocked - GeForce GTX 560 Ti 1GB  G.SKILL Ripjaws X Series 8GB 
Hard DrivePowerCase
500gig WD 7200RPM SATA Antec BP550 Plus 550W Continuous Power ATX12V V...  COOLER MASTER ELITE 335 RC-335-KKN1-GP Black S... 
  hide details  
Reply
Zev's Comp
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-2500K Sandy Bridge 3.3GHz GIGABYTE GA-Z68X-UD3H-B3 LGA 1155 Intel Z68 HDM... EVGA SuperClocked - GeForce GTX 560 Ti 1GB  G.SKILL Ripjaws X Series 8GB 
Hard DrivePowerCase
500gig WD 7200RPM SATA Antec BP550 Plus 550W Continuous Power ATX12V V...  COOLER MASTER ELITE 335 RC-335-KKN1-GP Black S... 
  hide details  
Reply
post #924 of 926
Quote:
Originally Posted by geoxile View Post

I guess part of my post got cut off. I'm already moderately familiar with Java and OOP. I just wanted to brush up on up-to-date design patterns and general practices, commonly used libraries, etc.

edit: regarding what I'm interested in, GUI, graphics, concurrency, and possibly graphics tablet input. I've been wanting to create a simple drawing program that can take proper input from a pen

Can anyone help me?
VIII
(17 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k ASUS P8Z68-V Pro Sapphire HD7950 boost Mushkin Enhanced Blackline 8GB, 1600MHz 
Hard DriveHard DriveOptical DriveCooling
Kingston HyperX 3k Samsung Spinpoint F3 1TB ASUS DVD burner Hyper 212+ 
OSMonitorKeyboardPower
Windows 8.1 ASUS VW246H U9BL XFX XXX 650W 
CaseMouseMouse PadAudio
Xigmatek Elysium Logitech G9 Rocketfish Xonar DX 
Audio
ATH AD700 
  hide details  
Reply
VIII
(17 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k ASUS P8Z68-V Pro Sapphire HD7950 boost Mushkin Enhanced Blackline 8GB, 1600MHz 
Hard DriveHard DriveOptical DriveCooling
Kingston HyperX 3k Samsung Spinpoint F3 1TB ASUS DVD burner Hyper 212+ 
OSMonitorKeyboardPower
Windows 8.1 ASUS VW246H U9BL XFX XXX 650W 
CaseMouseMouse PadAudio
Xigmatek Elysium Logitech G9 Rocketfish Xonar DX 
Audio
ATH AD700 
  hide details  
Reply
post #925 of 926
YES!
so, we were planning a release in the next couple weeks and got the update from the contractors today (gov job so yes, we contract stupid stuff out...out of anyone in the office's control, its silly), start to roll through it and like nothing we requested has been completed...they did one part and then nothing else...
some things we can change, other things...nope.
no telling how long it will take to push this back through.
fantastic
new life
(16 items)
 
  
CPUMotherboardGraphicsRAM
3820 @ 4.3giggles sabertooth x79 EVGA gtx 770 ACX @ 1267/1873 mushkin redline 8gb @ 1866 c9  
Hard DriveHard DriveHard DriveHard Drive
crucial m4 128gb WD blue 1tb x2 hitachi deskstar 500gb WD Black 2tb 
Optical DriveCoolingOSMonitor
LG Bluray royale with cheese seidon 240m win 7 x64 acer G245HDL x2 
KeyboardPowerCaseMouse
logitech g710+ corsair 650w switch 810 white rat 7 
  hide details  
Reply
new life
(16 items)
 
  
CPUMotherboardGraphicsRAM
3820 @ 4.3giggles sabertooth x79 EVGA gtx 770 ACX @ 1267/1873 mushkin redline 8gb @ 1866 c9  
Hard DriveHard DriveHard DriveHard Drive
crucial m4 128gb WD blue 1tb x2 hitachi deskstar 500gb WD Black 2tb 
Optical DriveCoolingOSMonitor
LG Bluray royale with cheese seidon 240m win 7 x64 acer G245HDL x2 
KeyboardPowerCaseMouse
logitech g710+ corsair 650w switch 810 white rat 7 
  hide details  
Reply
post #926 of 926
anyone do android programming? I am seeing if I can change the dot to different color or use custom image/icon.



edit; I did some driving earlier and my marker would jump to the new location then back to the old location on the map then back to the new location. Here is the code, I feel like I need to include some way to clear the current location after its been marked on the map or something.

http://pastebin.com/i2gGfVdG
Edited by andyroo89 - Yesterday at 12:01 pm
    
CPUMotherboardGraphicsRAM
E8400 3.0ghz OC @ 3.8GHz @ 1.36v DFI BLood Iron P35 ECS 8800GTS 512MB G.Skill 2x 1gb DDR2 800 CAS @ 5-6-6-21 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200rpm 250GB + 1TB 7200rpm HDD Lite On DVD burner Windows 7 32 bit 21.5 inch Samsung monitor full HD 1080p :D 
KeyboardPowerCaseMouse
microsoft wireless Corsair 650 watts Cooler Master 690 Logitech mx518 
Mouse Pad
fryz mousepad 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
E8400 3.0ghz OC @ 3.8GHz @ 1.36v DFI BLood Iron P35 ECS 8800GTS 512MB G.Skill 2x 1gb DDR2 800 CAS @ 5-6-6-21 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200rpm 250GB + 1TB 7200rpm HDD Lite On DVD burner Windows 7 32 bit 21.5 inch Samsung monitor full HD 1080p :D 
KeyboardPowerCaseMouse
microsoft wireless Corsair 650 watts Cooler Master 690 Logitech mx518 
Mouse Pad
fryz mousepad 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programmers' lounge. (Programming-related discussions only)