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 59

post #581 of 1143
@Tompsonn, is static linking with C++, usually considered a bad practice?
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
post #582 of 1143
Quote:
Originally Posted by {Unregistered} View Post

@Tompsonn, is static linking with C++, usually considered a bad practice?

No, not really - they both have their ups and downs (applies to any form of static vs. dynamic linking):

- Dynamic linking can reduce resource consumption (DLLs can be shared across processes)
- Dynamic linking allows for bug fixes from the runtime developer to apply to your product without you needing to manually update it and re-distribute it.
- Static linking allows code to run in limited environments (e.g. during boot)
- Static linking makes products easier to distribute (though the product is larger)
- Dynamic linking can cause "DLL hell"
- Dynamic linking can affect performance (DLL load time, which is less of an issue, and code rebasing)
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #583 of 1143
Sorry to sound like a beggar but could someone please help me with my problem? redface.gif
post #584 of 1143
Quote:
Originally Posted by tompsonn View Post

They all need dependencies - where they are directly added in to the executable, or are external to it, is a different story. With Delphi, your program executable has all the required components statically linked in (you can optionally use what is called a Borland Package Library, which is a DLL that is dynamically linked and can be shared across Delphi programs).

The same applies, for example, to the Visual C++ runtime - you can either statically link it, or dynamically link it (dynamic linking requires that the target version of MSVC++ Runtime is installed on the target computer).\

In Delphi, static linking is the default (which is why you may be under the impression that is does not require dependencies).
In Visual C++, dynamic linking is the default.

So... Static linking it brings its own packages that can make itself executable with them

Dynamic linking the packages are on the target computer not with the program?

Any example of dynamic linking would be lets say im installing a game and it tells me I don't have certain version of c++ 2005 and I need to download it on my computer?
Collecting Dust
(13 items)
 
Server
(9 items)
 
 
CPUMotherboardGraphicsRAM
E8400 3.0ghz OC @ 3.8GHz @ 1.36v DFI BLood Iron P35 none OCZ 2x 2gb DDR2 800 CAS @ 5-6-6-21 
Hard DriveOptical DriveOSMonitor
none none loonix ssh is my monitor 
KeyboardPowerCaseMouse
none Corsair 650 watts old pc case Logitech mx518 
Mouse Pad
none! 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 Dual Core Processor 6000+ GX611AA-ABA m8300f onboard 1x 2GB OCZ RAM DDR 
Hard DriveOSMonitorPower
320gb + 1TB HDD xubuntu 14.04 SSH 350 watt 
Case
crappy HP case 
  hide details  
Reply
Collecting Dust
(13 items)
 
Server
(9 items)
 
 
CPUMotherboardGraphicsRAM
E8400 3.0ghz OC @ 3.8GHz @ 1.36v DFI BLood Iron P35 none OCZ 2x 2gb DDR2 800 CAS @ 5-6-6-21 
Hard DriveOptical DriveOSMonitor
none none loonix ssh is my monitor 
KeyboardPowerCaseMouse
none Corsair 650 watts old pc case Logitech mx518 
Mouse Pad
none! 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 Dual Core Processor 6000+ GX611AA-ABA m8300f onboard 1x 2GB OCZ RAM DDR 
Hard DriveOSMonitorPower
320gb + 1TB HDD xubuntu 14.04 SSH 350 watt 
Case
crappy HP case 
  hide details  
Reply
post #585 of 1143
Quote:
Originally Posted by andyroo89 View Post

So... Static linking it brings its own packages that can make itself executable with them

Dynamic linking the packages are on the target computer not with the program?

Any example of dynamic linking would be lets say im installing a game and it tells me I don't have certain version of c++ 2005 and I need to download it on my computer?

Static linking causes the compiler to compile the dependencies directly into the executable, they are smart enough to only compile or statically link what is necessary.

Everything else is spot on smile.gif
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #586 of 1143
Quote:
Originally Posted by 3930K View Post

Sorry to sound like a beggar but could someone please help me with my problem? redface.gif

well without knowing Big Rational or C# I have a few questions to ask first.

Does
Code:
pow(base, exponentTruncated)
work and return a value when used alone?

if not I would assume you are either calling the method wrong or are inputting values which the method does not take.

If it is returning a value I would sugest saving that returned value into a variable and trying to calcuate the final result with third party variables instead of completing the entire calculation in one go.

Also do you have a API link to the Big Rational page for C#?
Bob's Computer
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 2500K MSI P67A-G45 MSI 6970 Lightning 2GB G Skill Ripjaws X (2x4GB) 1866mhz 9-10-9-28 
Hard DriveOptical DriveCoolingOS
Corsair Force 3 SSD (60GB), X1 WD5000AAKS, X1 W... ASUS DRW-24B1ST/BLK/B/AS Black SATA 24X DVD Burner Noctua NH-C14 Windows 7 64 bit 
MonitorKeyboardPowerCase
Asus VH238H Logitech G510 HALE90 750W NZXT Phantom Black 
MouseMouse PadAudioOther
Logitech G9x SteelSeries 4HD ASUS Xonar DGX / Audio-Technica ATH-AD700 Hauppauge! HVR-1250 TV Tuner 
  hide details  
Reply
Bob's Computer
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 2500K MSI P67A-G45 MSI 6970 Lightning 2GB G Skill Ripjaws X (2x4GB) 1866mhz 9-10-9-28 
Hard DriveOptical DriveCoolingOS
Corsair Force 3 SSD (60GB), X1 WD5000AAKS, X1 W... ASUS DRW-24B1ST/BLK/B/AS Black SATA 24X DVD Burner Noctua NH-C14 Windows 7 64 bit 
MonitorKeyboardPowerCase
Asus VH238H Logitech G510 HALE90 750W NZXT Phantom Black 
MouseMouse PadAudioOther
Logitech G9x SteelSeries 4HD ASUS Xonar DGX / Audio-Technica ATH-AD700 Hauppauge! HVR-1250 TV Tuner 
  hide details  
Reply
post #587 of 1143
Quote:
Originally Posted by Bobicon View Post

Quote:
Originally Posted by 3930K View Post

Sorry to sound like a beggar but could someone please help me with my problem? redface.gif

well without knowing Big Rational or C# I have a few questions to ask first.

Does
Code:
pow(base, exponentTruncated)
work and return a value when used alone?

if not I would assume you are either calling the method wrong or are inputting values which the method does not take.

If it is returning a value I would sugest saving that returned value into a variable and trying to calcuate the final result with third party variables instead of completing the entire calculation in one go.

Also do you have a API link to the Big Rational page for C#?
You mean a Pow(BigRational, BigInteger)? Yes there is, and it does work. And what do you mean with third-party variables?

BigRational is currently in beta. There isn't an API link.
post #588 of 1143
Quote:
Originally Posted by 3930K View Post

You mean a Pow(BigRational, BigInteger)? Yes there is, and it does work. And what do you mean with third-party variables?

BigRational is currently in beta. There isn't an API link.

What I mean by that is do each calculation or function call separately storing them in variables as you go so you know that a value exists then preforming the mathematical calculations (multiplying, subtracting the variables or whatever you need to do) and storing the final result in a variable.

doing it this way would ensure that values exist making it kind of a fool proof method despite the added variables and lines of codes.
Bob's Computer
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 2500K MSI P67A-G45 MSI 6970 Lightning 2GB G Skill Ripjaws X (2x4GB) 1866mhz 9-10-9-28 
Hard DriveOptical DriveCoolingOS
Corsair Force 3 SSD (60GB), X1 WD5000AAKS, X1 W... ASUS DRW-24B1ST/BLK/B/AS Black SATA 24X DVD Burner Noctua NH-C14 Windows 7 64 bit 
MonitorKeyboardPowerCase
Asus VH238H Logitech G510 HALE90 750W NZXT Phantom Black 
MouseMouse PadAudioOther
Logitech G9x SteelSeries 4HD ASUS Xonar DGX / Audio-Technica ATH-AD700 Hauppauge! HVR-1250 TV Tuner 
  hide details  
Reply
Bob's Computer
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 2500K MSI P67A-G45 MSI 6970 Lightning 2GB G Skill Ripjaws X (2x4GB) 1866mhz 9-10-9-28 
Hard DriveOptical DriveCoolingOS
Corsair Force 3 SSD (60GB), X1 WD5000AAKS, X1 W... ASUS DRW-24B1ST/BLK/B/AS Black SATA 24X DVD Burner Noctua NH-C14 Windows 7 64 bit 
MonitorKeyboardPowerCase
Asus VH238H Logitech G510 HALE90 750W NZXT Phantom Black 
MouseMouse PadAudioOther
Logitech G9x SteelSeries 4HD ASUS Xonar DGX / Audio-Technica ATH-AD700 Hauppauge! HVR-1250 TV Tuner 
  hide details  
Reply
post #589 of 1143
Quote:
Originally Posted by Bobicon View Post

Quote:
Originally Posted by 3930K View Post

You mean a Pow(BigRational, BigInteger)? Yes there is, and it does work. And what do you mean with third-party variables?

BigRational is currently in beta. There isn't an API link.

What I mean by that is do each calculation or function call separately storing them in variables as you go so you know that a value exists then preforming the mathematical calculations (multiplying, subtracting the variables or whatever you need to do) and storing the final result in a variable.

doing it this way would ensure that values exist making it kind of a fool proof method despite the added variables and lines of codes.
So like:

var intPart = Bigarational.Pow(base, truncatedExp);
var rest = //what?
return intPart * rest;

Edited by 3930K - 3/31/13 at 4:24am
post #590 of 1143
Quote:
Originally Posted by 3930K View Post

So like:

var intPart = Bigarational.Pow(base, truncatedExp);
var rest = //what?
return intPart * rest;

var intPart = Bigarational.Pow(base, truncatedExp);
var sub = exponent - exponentTruncated
var basemult = base*sub
return int IntPart*basemult

maybe throw some print statements of the variables names in between to test that the values exist before and after the calculations as well.
Bob's Computer
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 2500K MSI P67A-G45 MSI 6970 Lightning 2GB G Skill Ripjaws X (2x4GB) 1866mhz 9-10-9-28 
Hard DriveOptical DriveCoolingOS
Corsair Force 3 SSD (60GB), X1 WD5000AAKS, X1 W... ASUS DRW-24B1ST/BLK/B/AS Black SATA 24X DVD Burner Noctua NH-C14 Windows 7 64 bit 
MonitorKeyboardPowerCase
Asus VH238H Logitech G510 HALE90 750W NZXT Phantom Black 
MouseMouse PadAudioOther
Logitech G9x SteelSeries 4HD ASUS Xonar DGX / Audio-Technica ATH-AD700 Hauppauge! HVR-1250 TV Tuner 
  hide details  
Reply
Bob's Computer
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5 2500K MSI P67A-G45 MSI 6970 Lightning 2GB G Skill Ripjaws X (2x4GB) 1866mhz 9-10-9-28 
Hard DriveOptical DriveCoolingOS
Corsair Force 3 SSD (60GB), X1 WD5000AAKS, X1 W... ASUS DRW-24B1ST/BLK/B/AS Black SATA 24X DVD Burner Noctua NH-C14 Windows 7 64 bit 
MonitorKeyboardPowerCase
Asus VH238H Logitech G510 HALE90 750W NZXT Phantom Black 
MouseMouse PadAudioOther
Logitech G9x SteelSeries 4HD ASUS Xonar DGX / Audio-Technica ATH-AD700 Hauppauge! HVR-1250 TV Tuner 
  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)