• What Do You Need Help With? V6
    7,544 replies, posted
Could really use some help with this problem. I'm trying to make a program that uses ClosedXML and OpenXML. ClosedXML is used for creating and updating the data in a excel file, and the OpenXML is only used for adding an image to an Excel file. It's working okay in some ways but the trouble comes when I try to add in an image to an existing excel file. Since the file is created in ClosedXML, how do I open it using OpenXML and add the image? Here is the code I use for creating the XML and the code I use for updating the image in OpenXML. [url]http://pastebin.com/Z1LyvdxN[/url] I don't really know how to make it work and would really appreciate any feedback with it. Thanks!
I'd like to continue working on my FP app, but the Facepunch API is pretty much dead. I could implement an HTML parser in the app itself, but that might make the app quite a bit slower. I could also setup a server that scrapes FP pages and caches them, but I have no idea where to start with that, plus it'd require me buying a server. Do you guys have any ideas what the simplest or fastest way of scraping FP pages would be?
[QUOTE=Egonny;42226932]plus it'd require me buying a server.[/QUOTE] I haven't really looked at their terms of use but I think [url=https://www.openshift.com/]OpenShift[/url] is quite nice. Last time I checked they have had free plans. Not sure how much traffic you'd get from all the users, but with some caching I guess you could do just fine.
what's the best IDE that also allows for individual .cpp compilation? and not dev-C++
Look what works best for you. A couple to try are Code::Blocks, CodeLite, Eclipse, Emacs, Geany, MSVC (there's a free version), QtCreator, Vim. I myself fancy Vim. It has a more prominent learning-curve, but once you grok the basics (see e.g. vimtutor) you'll be able to use it just fine. I've become quite adept with it. [editline]editline[/editline] A couple more are Kate, Komodo, MonoDevelop, NetBeans, SciTE and SublimeText.
I thought eclipse required you to make projects like visual studio?
I've only used Eclipse for Java a long time ago. I know it can also do C++ stuff, but I don't know if it can simply compile a single file without a project. It might. I know Geany can do this and you can easily configure Vim to do it. Emacs (very) probably, too. The rest might, you'll have to try.
Alright ZeekyHBomb, it's time to go again. Linking my application with lua, using tinycc, causes segmentation faults. I've tried to narrow down the error to this code segment: [code] [...] int ret; ret = luaL_dofile( scriptvm, "scriptfile.lua" ); printf( "%d\n", ret ); // this prints '0' if( ret != 0 ) { // this is where the segfault happens // handle errors here } [/code] Running the application with valgrind yields the following result: [code] Inconsistency detected by ld.so: rtld.c: 1286: dl_main: Assertion `_rtld_local._dl_rtld_map.l_libname' failed! [...] All heap blocks were freed -- no leaks are possible [/code] Now, I'm no debugging and programming expert, far from it as anyone with experience can tell. But the dl_main above had me thinking that maybe I was compiling lua wrong, so I added LDFLAGS='-ldl -lreadline -lcurses' to the make command line, to ensure it was being compiled as such. Recompiled and relinked everything from scratch, same thing happens. Then I tried compiling everything BUT my application with clang, and then compile and link my application using tinycc. Same problem. Now I do realize that tinycc is very unstable and experimental software even today, and if I do the entire process using any other compiler, it works fine now. This is NOT a critical problem, but if I could support tinycc as well as every other compiler out there, it'd be fantastic!
I am trying to learn OpenGL and it is going well but I just have a quick question. It doesn't really matter but it is bugging me. Alpha doesn't seem to do anything? Here is a boilerplate fragment shader. [code] #version 150 in vec3 Color; out vec4 outColor; void main() { outColor = vec4 ( Color, 0.0 ); } [/code] The alpha is 0.0 but the triangle is still visible? So what is alpha for? Or does it have no use and Overv is just pulling my leg?
[QUOTE=mastersrp;42232131]Alright ZeekyHBomb, it's time to go again.[/QUOTE] :v: It's certainly some issue with the dynamic linker. Did you build Lua with tinycc too? Although it still might be some other library, like libc. If it even is due to some weird dependency resolution/loading failure. Does the build with tinycc still use the system linker? Try linking without any additional flags (like -s). You could also try linking statically. While trying to quickly find out what _dl_rtld_map is (which failed) I also discovered [url=http://forum.parallels.com/showthread.php?96248-Linux-executable-on-Mac-shared-folder-cannot-load-shared-object-file]this[/url]. Maybe it's a bug in ld.so. You could try posting a bug-report there (preferably with a minimal testcase). Even if it's not a bug in ld.so, it might give you more insight in how to fix it.
[QUOTE=ZeekyHBomb;42232485]:v: It's certainly some issue with the dynamic linker. Did you build Lua with tinycc too? Although it still might be some other library, like libc. If it even is due to some weird dependency resolution/loading failure. Does the build with tinycc still use the system linker? Try linking without any additional flags (like -s). You could also try linking statically. While trying to quickly find out what _dl_rtld_map is (which failed) I also discovered [URL="http://forum.parallels.com/showthread.php?96248-Linux-executable-on-Mac-shared-folder-cannot-load-shared-object-file"]this[/URL]. Maybe it's a bug in ld.so. You could try posting a bug-report there (preferably with a minimal testcase). Even if it's not a bug in ld.so, it might give you more insight in how to fix it.[/QUOTE] I tried building lua with tinycc and with clang and with gcc. The problem seems to be the linking area, as it works fine when my application is being linked to lua using either clang or gcc, but when I try to use tinycc, then it segfaults at the specified line. I do believe that tinycc must be using their own linker (otherwise how would it ever work with the other ones?). I just tried linking my application with lua statically, and it seems to not work. (lots of undefined references to libm) I have NOT yet tried to compile lua with the -static flag, but I'll give it a go as well. Oh, and one thing I should mention is that I build lua like this: [code] make -C deps/lua/src posix CC=#{cc} SYSLIBS="-ldl -lreadline -lcurses" [/code] No, the #{cc} is not a typo, but you can replace it with ${CC} if you prefer bashism. [editline]18th September 2013[/editline] Alright, I tried changing the lua build command to this [code] make -C deps/lua/src posix CC=#{cc} SYSLIBS="-static -ldl -lm -lreadline -lcurses" [/code] And after this, linking with lua statically still resulted in multiple undefined symbols to things like exp,cos,ceil,atan, so on. A think out of the ordinary though, was the undefined symbol to "__gcc_personality_v0"
It's weird that it reports these undefined symbols. Look at objdump -T /usr/lib/libm.so|egrep ' exp$'. For __gcc_personality_v0, that's in libgcc_s. From the name I'd guess that you only need that when compiling with gcc though. [editline]18th September 2013[/editline] You could also try to work around it by using an alternative libc implementation, like [url=http://www.musl-libc.org/]musl[/url]. [editline]18th September 2013[/editline] [QUOTE=reevezy67;42232440]I am trying to learn OpenGL and it is going well but I just have a quick question. It doesn't really matter but it is bugging me. Alpha doesn't seem to do anything? Here is a boilerplate fragment shader. [code] #version 150 in vec3 Color; out vec4 outColor; void main() { outColor = vec4 ( Color, 0.0 ); } [/code] The alpha is 0.0 but the triangle is still visible? So what is alpha for? Or does it have no use and Overv is just pulling my leg?[/QUOTE] Ensure [url=https://www.opengl.org/wiki/Common_Mistakes#No_Alpha_in_the_Framebuffer]this[/url].
[QUOTE=ZeekyHBomb;42232832]It's weird that it reports these undefined symbols. Look at objdump -T /usr/lib/libm.so|egrep ' exp$'. For __gcc_personality_v0, that's in libgcc_s. From the name I'd guess that you only need that when compiling with gcc though. [/QUOTE] I tried doing that, and it dumps a load of symbols. But given that compilation with gcc and clang works just fine, I wouldn't expect any less.
Someone really needs to buy Zeeky a title. He has helped out more than anyone else in this thread, probably more than everyone else combined. It definitely deserves some recognition, in my opinion.
[QUOTE=ZeekyHBomb;42228084]Look what works best for you. A couple to try are Code::Blocks, CodeLite, Eclipse, Emacs, Geany, MSVC (there's a free version), QtCreator, Vim. I myself fancy Vim. It has a more prominent learning-curve, but once you grok the basics (see e.g. vimtutor) you'll be able to use it just fine. I've become quite adept with it.[/QUOTE] I find Code::Blocks is really underrated. A lot of people think that it is outdated and shit. But if you do not use auto-completion it has got pretty much everything you need. It does everything I want it to do (compile individual files and projects, set up linking to libraries, debug) and is more lightweight (less bloated) and more standards compliant than Visual C++/Studio. No good auto-complete seems to be a dealbreaker for most people. Since I stopped using that, I've memorized 90% of the stuff I use kind of automatically.
[QUOTE=Chris220;42233487]Someone really needs to buy Zeeky a title. He has helped out more than anyone else in this thread, probably more than everyone else combined. It definitely deserves some recognition, in my opinion.[/QUOTE] If you look closely, it says "Gold Member". [img]https://lh3.ggpht.com/--kAiloCHhW4/UVb1Cf2Fh4I/AAAAAAAADk8/u7mVXbq2nGQ/s1600/232408_GoldHomer2.jpg[/img] Seriously though, don't do that. It would just mess with my inferiority complex and feed my god complex. [QUOTE=mastersrp;42233092]I tried doing that, and it dumps a load of symbols. But given that compilation with gcc and clang works just fine, I wouldn't expect any less.[/QUOTE] Functions like exp and cos appear though, right (see the pipe to egrep)? I just remembered that sometimes the order is important. Try shuffling them around.
Reflection can give me a headache. (C#) Consider the following scenario. I can get the properties of a class at runtime without having an instance of it, and then displaying all those properties in an UI so the user can create a new instance of this class. I use a struct called PropertyValue to get the value the user defined for a specific property. This struct has two fields, a PropertyInfo that holds the information of the associated property, and a [I]boxed object[/I] called value. I know that this field can be either a value or a reference type. When the user instantiates the class using an empty constructor, the values are assigned using a method inside this class for each PropertyValue defined, and the name of the PropertyValue.Property is then tested against the current property inside the for loop to see if it's the right property. Now I need to compare the [B]values[/B] of two PropertyValues at runtime, but if I don't unbox it, it'll compare the [I]reference[/I] to this boxed value, which will always return false. Someone please help because this shit is driving me up the wall.
What type is the boxed object? Couldn't you just use Object.Equals?
The boxed type is various things, from primitives to reference types. All I know is that it can be a list, an object that follows a certain interface I made or ints, bools and strings.
Started Java programming, stuck at classes and OOP, same concept I learned from Python last year, confusing as fuck when using it with a new programming language.
[QUOTE=Recurracy;42236003]The boxed type is various things, from primitives to reference types. All I know is that it can be a list, an object that follows a certain interface I made or ints, bools and strings.[/QUOTE] I don't mean the actual (run-time) type, but the type you store it as. [QUOTE=garychencool;42236092]Started Java programming, stuck at classes and OOP, same concept I learned from Python last year, confusing as fuck when using it with a new programming language.[/QUOTE] [url=http://docs.oracle.com/javase/tutorial/java/concepts/index.html]short tutorial[/url] [url=http://docs.oracle.com/javase/tutorial/java/javaOO/index.html]long tutorial[/url]
Oh, the type I use to store it is object.
Alright, so Object.Equals would work, wouldn't it?
I just started regretting I didn't pay attention in maths in school, got basic problem here but I cannot solve it. [IMG]http://i.imgur.com/8UBmksd.png[/IMG] ArlBot is me, I need it to: predict where the enemy is moving and shoot a bullet there. What is available from enemy tank: his speed (in pixels, usually 8) his direction of movement (in degrees, in this case of image current direction is 90) Distance to him from my tank (in pixels) For me: I can get my X and Y (doubt it's relevant here though) I can turn my turret by degrees (relative to current position, so +/- value. - for left, + for right movement. Basically from those available things I need to find a way to predict his spot roughly and shoot there so by the time bullet hits his Y axis, hes on that position with bullet. Thanks.
@arleitiss you also need to be able to get the speed of the bullet. [URL="http://stackoverflow.com/questions/2248876/2d-game-fire-at-a-moving-target-by-predicting-intersection-of-projectile-and-u"]Also this should help. [/URL]
Looking to do some audio file analysis. Need a library I can use to see spikes in audio, other stuff like that. Don't really care what language it's in. Any suggestions?
I am currently fiddling a bit with Google Scripts (based off of Javascript IIRC). I am trying to make a program that I give a URL, and it goes to that URL and gets the content of the page (or the HTML code) so I can search through it and get various phrases to send to a Google Doc. Luckily the very first Google Scripts tutorial is sending things to Google Doc, but I am having trouble accessing websites/URLs/HTML so I can actually start parsing through their content. Anyone more familiar with Javascript know some function that might be able to help me get the raw HTML code or its content?
[QUOTE=cartman300;42238842]@arleitiss you also need to be able to get the speed of the bullet. [URL="http://stackoverflow.com/questions/2248876/2d-game-fire-at-a-moving-target-by-predicting-intersection-of-projectile-and-u"]Also this should help. [/URL][/QUOTE] oh yes, forgot to mention, speed of bullet is available too. It's a thing called robocode
[QUOTE=Zwolf11;42238861]Looking to do some audio file analysis. Need a library I can use to see spikes in audio, other stuff like that. Don't really care what language it's in. Any suggestions?[/QUOTE] In C you can use [url=http://www.mega-nerd.com/libsndfile/]libsndfile[/url] and just read raw samples and do whatever analysis you want on them. [QUOTE=Newbienice99;42238888]I am currently fiddling a bit with Google Scripts (based off of Javascript IIRC). I am trying to make a program that I give a URL, and it goes to that URL and gets the content of the page (or the HTML code) so I can search through it and get various phrases to send to a Google Doc. Luckily the very first Google Scripts tutorial is sending things to Google Doc, but I am having trouble accessing websites/URLs/HTML so I can actually start parsing through their content. Anyone more familiar with Javascript know some function that might be able to help me get the raw HTML code or its content?[/QUOTE] Not really familiar with JavaScript, but [url=https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest]XMLHttpRequest[/url] seems like it would do that job.
[QUOTE=ZeekyHBomb;42234198] Functions like exp and cos appear though, right (see the pipe to egrep)? I just remembered that sometimes the order is important. Try shuffling them around.[/QUOTE] I've tried shuffling them around, and the order is certainly correct right now. I've even tried adding (prepending) -lc, but this changed nothing. [QUOTE=ZeekyHBomb;42232832] You could also try to work around it by using an alternative libc implementation, like [url=http://www.musl-libc.org/]musl[/url]. [/QUOTE] How would I use the musl libc with tinycc? I did try to compile my entire project from scratch with musl just now though, and the binary doesn't segfault at all. But how would I use tinycc with musl? I mean, it doesn't have a -spec flag.
Sorry, you need to Log In to post a reply to this thread.