• What do you need help with? V4 (January 2012)
    966 replies, posted
Not sure whether to post this here or in Web Dev. Basically I'm trying to write a little blog engine in go. Somewhere along the line, though, it's doing something funky with my URLs. I want to be able to tell if a request is being made over https. I should be able to use the "scheme" field of the [url=http://weekly.golang.org/pkg/net/url/#URL]URL[/url], but it gives me "http" regardless of whether it's HTTP or HTTPS. The web server is lighttpd, and it communicates with the go process using FCGI over a UNIX-domain socket.
why do you need to know if you're running over ssl or not?
For authentication. I don't want to serve a user a session ID over an unsecure connection.
Phone Operating systems. There are plenty of phone operating systems... What language reaches the most operating systems? If I want to reach all phone OS's ... What languages do I have to learn?
[QUOTE=Sprite;34428328]Phone Operating systems. There are plenty of phone operating systems... What language reaches the most operating systems? If I want to reach all phone OS's ... What languages do I have to learn?[/QUOTE] Java Mobile Edition [editline]28th January 2012[/editline] Erh.. Micro Edition, sorry.
Best DB language for polls? SQL or Oracle or other? Just being paranoid-ly safe. I don't know much about the differences. [editline]28th January 2012[/editline] so right now I'm using MySQL [editline]28th January 2012[/editline] [QUOTE=T3hGamerDK;34428751]Java Mobile Edition [editline]28th January 2012[/editline] Erh.. Micro Edition, sorry.[/QUOTE] And this covers all phone OS? I just want to be sure [editline]28th January 2012[/editline] can tables/fields be named 1 letter? I'm trying to reduce expensive string parsing for my requests as much as possible.
It's worse than I thought... it's not even differentiating between GET and POST. FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF. Well, I got that figured out, it was the routing library I was using that was screwing up GET/POST. However, the problem of it dropping the protocol still remains. Web dev sucks. I dunno how people do this and not go insane.
Anyone have any idea how I can test out multi-threading performance gains in C#? ( what type of algo )
Something parallelisable????
Simple Java question here: I'm writing a Java program that uses multiple .java files. The main one I'm writing is called ExtremeHotelBooking.java and the one I'm trying to access is BasicCalendar.java. I need to access one of the constructors in BasicCalendar, but I'm not having much success reaching it. The line of code in question in ExtremeHotelBooking is [code]BasicCalendar basicCal = new BasicCalendar();[/code] and when I try to add something like [code]basicCal.BasicCalendar();[/code] it returns an error. The BasicCalendar constructors are public, so I know that's not the problem. Can someone help me out? [editline]28th January 2012[/editline] Never mind, I figured it out.
Would somebody explain to me in Java how you would format a string? I keep seeing examples like this in the tutorials I'm using: [code]public String toMilitary(){ return String.format("%02d:%02d:%02d", getHour(), ) } [/code] And I don't really get how you implement formatting and where you should, or anything about it. Would someone help?
Hi guys I just started trying to learn DirectX, my C++ isn't the best either but I thought I could catch up on both at the same time, there's this exercise in a book I'm working from which requires I check if my hardware supports the Multisample Types 2 & 16 in both Windowed and Full Screen mode and if it supports those in D3DFMT_X8R8G8B8/D3DFMT_R5G6B5 all of this is supposed to be output to a file. Anyway here's my attempt at coding this (Sorry cant [Code] it stretches the page :suicide:): [img]http://i40.tinypic.com/li6v4.jpg[/img] It all seems fine, I index through each array which I use as variables for the CheckDeviceMultiSampleType function but I get this on my output file: [code] MultiSample Type = 2 Windowed = 1 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 2 Windowed = 1 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 2 Windowed = 1 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 2 Windowed = 1 Format = 23 Support = IS NOT SUPPORTED!!! MultiSample Type = 2 Windowed = 0 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 2 Windowed = 0 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 2 Windowed = 0 Format = 23 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 1 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 1 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 1 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 1 Format = 23 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 0 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 0 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 0 Format = 23 Support = IS NOT SUPPORTED!!! [/code] I don't understand why everything is apparently not supported, surely multisampling is supposed to work in those given formats, I also don't understand why it outputs 2 extra lines for Windowed and 1 Extra Line for not Windowed. Sorry I'm new to all of this but surely there's an easy way to try each of these parameters without having to do each separately and without having to go through making the variables into arrays and indexing them. DAMMIT It was so simple I just realised I put '= D3D_OK' not '== D3D_OK' doesn't matter I just did '(SUCCEEDED(SmpSupport)'. Still don't know what the extra lines are from or if there's an easier way of doing this: [code]MultiSample Type = 2 Windowed = 1 Format = 22 Support = IS SUPPORTED!!! MultiSample Type = 2 Windowed = 1 Format = 22 Support = IS SUPPORTED!!! MultiSample Type = 2 Windowed = 1 Format = 22 Support = IS SUPPORTED!!! MultiSample Type = 2 Windowed = 1 Format = 23 Support = IS SUPPORTED!!! MultiSample Type = 2 Windowed = 0 Format = 22 Support = IS SUPPORTED!!! MultiSample Type = 2 Windowed = 0 Format = 22 Support = IS SUPPORTED!!! MultiSample Type = 2 Windowed = 0 Format = 23 Support = IS SUPPORTED!!! MultiSample Type = 16 Windowed = 1 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 1 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 1 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 1 Format = 23 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 0 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 0 Format = 22 Support = IS NOT SUPPORTED!!! MultiSample Type = 16 Windowed = 0 Format = 23 Support = IS NOT SUPPORTED!!! [/code]
Are there any negative reprocutions of simply moving an object by setting it's co ordinates when it's colliding with something rather than making it's velocity change to go out of the object? [editline]29th January 2012[/editline] And is there a problem with only doing actions every certain amount of game ticks? Like rather than moving the player each frame, you move them only when a tick passed which would be a predetermined amount of time.
So, I can detect collision no problem. The issue is responding to it.
[QUOTE=WTF Nuke;34440758]Are there any negative reprocutions of simply moving an object by setting it's co ordinates when it's colliding with something rather than making it's velocity change to go out of the object?[/QUOTE] If the object doesn't bounce, no. Otherwise, you'll lose momentum. [QUOTE=WTF Nuke;34440758]And is there a problem with only doing actions every certain amount of game ticks? Like rather than moving the player each frame, you move them only when a tick passed which would be a predetermined amount of time.[/QUOTE] No, just interpolate between the last and the next tick each frame.
[QUOTE=WTF Nuke;34440758]Are there any negative reprocutions of simply moving an object by setting it's co ordinates when it's colliding with something rather than making it's velocity change to go out of the object?[/QUOTE] You should be doing both. Update position and velocity.
[QUOTE=Zally13;34438036]Would somebody explain to me in Java how you would format a string? I keep seeing examples like this in the tutorials I'm using: [code]public String toMilitary(){ return String.format("%02d:%02d:%02d", getHour(), ) } [/code] And I don't really get how you implement formatting and where you should, or anything about it. Would someone help?[/QUOTE] Formatting is just a way to print data in a way you find useful. In that example, the "%02d" sequences are the format specifiers. (Can't remember the official name at the moment) The 02 means that up to two digits should print, and 'd' just means that the variable to print is an integer. You should implement formatting any time there isn't a clear way to simply print an object how you want to. Actually, I'm not very sure about Java, but in some languages it's the only (best) way to print numbers.
I've just downloaded the Android SDK and set up a virtual device. When I start it up, it remains like this: [img]http://puu.sh/eZbF[/img] It's been like that for around 15 minutes now -- is that normal? I've tried deleting the virtual device and creating a new one to no avail; I'm thinking I should reinstall the SDK components. [editline]29th January 2012[/editline] Problem fixed... turns out it just takes around half an hour to boot :/
[QUOTE=aerochug;34445225]I've just downloaded the Android SDK and set up a virtual device. When I start it up, it remains like this: [img]http://puu.sh/eZbF[/img] It's been like that for around 15 minutes now -- is that normal? I've tried deleting the virtual device and creating a new one to no avail; I'm thinking I should reinstall the SDK components. [editline]29th January 2012[/editline] Problem fixed... turns out it just takes around half an hour to boot :/[/QUOTE] Welcome to the Android emulator :P
I'm completely new to C++, just making a test program to try out stuff. Anyway, here's the part of the code i'm getting problems with: [code]cin >> (b, ageless); cout <<"Your age is " <<(b, ageless); {if (b < 30) cout <<"You are too young"}[/code] And the problem is, no matter what b is, "You are too young" message ALWAYS pop up. help?
Hi, I'm trying to make a program that calculates your electricity bill, I seem to be having alot of trouble with it. Everything I input returns 30.95 in total, spent ages staring at it and I think if someone has a fresh look it will be a 2 second job haha. [CODE] Public Class Form2 Dim CMR, OMR As Integer Dim ElecUsed, total, StandardCharge As Decimal Private Sub BtnCalcNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCalcNew.Click TxtCurrentMeter.Text = CMR TxtPrevMeter.Text = OMR ElecUsed = CMR - OMR If ElecUsed >= 0 Then If ElecUsed > 150 Then StandardCharge = 12.5 total = (ElecUsed * 0.22) + StandardCharge Else StandardCharge = 25 ElecUsed = ElecUsed - 250 total = ElecUsed * 0.1962 total = total + 55 + StandardCharge '55 = 250 units at higher rate End If Else MsgBox("Your current reading must be higher than your last one", MsgBoxStyle.Exclamation, "ERROR") TxtPrevMeter.Text = "0" TxtCurrentMeter.Text = "0" TxtPrevMeter.Focus() total = 0 End If Label1.Text = ElecUsed LblCalc.Text = total End Sub End Class [/CODE] Thank you so so much its really done my head in haha Changed it to [CODE] Public Class Form2 Dim CMR, OMR As Integer Dim ElecUsed, total, StandardCharge As Decimal Private Sub BtnCalcNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCalcNew.Click TxtCurrentMeter.Text = CMR TxtPrevMeter.Text = OMR ElecUsed = CMR - OMR If ElecUsed >= 0 Then If ElecUsed < 150 Then StandardCharge = 12.5 total = (ElecUsed * 0.22) + StandardCharge ElseIf ElecUsed >= 150 Then StandardCharge = 25 total = (ElecUsed * 0.22) + StandardCharge ElseIf ElecUsed > 250 Then StandardCharge = 25 ElecUsed = ElecUsed - 250 total = ElecUsed * 0.1962 total = total + 55 + StandardCharge '55 = 250 units at higher rate End If Else MsgBox("Your current reading must be higher than your last one", MsgBoxStyle.Exclamation, "ERROR") TxtPrevMeter.Text = "0" TxtCurrentMeter.Text = "0" TxtPrevMeter.Focus() total = 0 End If Label1.Text = ElecUsed LblCalc.Text = total End Sub End Class [/CODE] And all I get for my total is 12.5??????
[QUOTE=Chris220;34445493]Welcome to the Android emulator :P[/QUOTE] Well I've selected the 'Enable snapshot' option now so it retains its state when I close it and opens from wherever I left off, so I don't need to wait ages for it to boot every time :P Too bad I don't have an actual Android device - that would have been much better.
[QUOTE=Roxerg;34445706]I'm completely new to C++, just making a test program to try out stuff. Anyway, here's the part of the code i'm getting problems with: [code]cin >> (b, ageless); cout <<"Your age is " <<(b, ageless); {if (b < 30) cout <<"You are too young"}[/code] And the problem is, no matter what b is, "You are too young" message ALWAYS pop up. help?[/QUOTE] To input 2 things use: [code]cin >> b >> ageless;[/code] To output 2 things use: [code]cout << b << " " << ageless << endl;[/code]
[QUOTE=sim642;34445998]To input 2 things use: [code]cin >> b >> ageless;[/code] To output 2 things use: [code]cout << b << " " << ageless << endl;[/code][/QUOTE] oh gawd what happened. when i enter name (cin >> thingy before the age one i shown) and press enter it does everything in a flash without asking to enter anything else. and there is something else... oh hell i'll just throw in the whole mess i've done since i can't english: [code] #include <iostream> #include <string> using namespace std; int main () { int a; unsigned short int b; unsigned short int race; string nameless; string ageless; string raceless; cout << "Enter your name:\n"; cin >> a >> nameless; cout << "Your name is " << a << nameless << endl; cout << "\nEnter your age\n"; cin >> b >> ageless; cout <<"Your age is " << b << ageless << endl; {if (b < 30) cout <<"You are too young";} {if (b < 30) cout << "\nEnter your race. Available races:"; cout << "\n1-Human\n"; cin >> (race, raceless); cout << "\nYour race is " <<race << raceless;} { if (race == 1); cout << "\nArgonian Wizard: Greetings, Human." <<"\nArgonian Wizard: It says here your name is " <<(a, nameless) <<". Is that correct?\n"; cout <<"\nAnd for now this is the end as i don't have a slightest (or correct) clue on howto let YOU write race's number, but for the program to show race's name"; } cin.get(); return 0; } [/code] what did i do wroooong!? [img]http://www.facepunch.com/fp/emoot/psyduck.gif[/img] [B]edit:[/B] i also tried only changing the certain part of the code from () to multiple << but that resulted in Enter not continuing the program, but instead making a new paragraph... I am too confused.
[QUOTE=Roxerg;34446289]oh gawd what happened. when i enter name (cin >> thingy before the age one i shown) and press enter it does everything in a flash without asking to enter anything else. and there is something else... oh hell i'll just throw in the whole mess i've done since i can't english: what did i do wroooong!? [img]http://www.facepunch.com/fp/emoot/psyduck.gif[/img] [B]edit:[/B] i also tried only changing the certain part of the code from () to multiple << but that resulted in Enter not continuing the program, but instead making a new paragraph... I am too confused.[/QUOTE] ifs should be like this [code]if (blah) { code goes here }[/code]
[QUOTE=Octave;34446752]ifs should be like this [code]if (blah) { code goes here }[/code][/QUOTE] Did, same shiz. Bah. I think i'll just re-do it all.
[QUOTE=Roxerg;34446289]oh gawd what happened. when i enter name (cin >> thingy before the age one i shown) and press enter it does everything in a flash without asking to enter anything else. and there is something else... oh hell i'll just throw in the whole mess i've done since i can't english: what did i do wroooong!? [img]http://www.facepunch.com/fp/emoot/psyduck.gif[/img] [B]edit:[/B] i also tried only changing the certain part of the code from () to multiple << but that resulted in Enter not continuing the program, but instead making a new paragraph... I am too confused.[/QUOTE] I think you might be misunderstanding the use of curly braces ({}). Right now, [code] {if (b < 30) cout << "\nEnter your race. Available races:"; cout << "\n1-Human\n"; cin >> (race, raceless); cout << "\nYour race is " <<race << raceless;} [/code] Means that when b < 30, only the very next line will be run. The other lines run regardless of b's contents. Maybe you meant [code] if (b < 30) { cout << "\nEnter your race. Available races:"; cout << "\n1-Human\n"; cin >> (race, raceless); cout << "\nYour race is " <<race << raceless; } [/code] which will execute the entire block of code only when b < 30.
Is it even possible to have a php file display a different image depending on whether or not the person viewing it in a browser was using widescreen or fullscreen? [editline]e[/editline] Okay, how about a different picture depending on the system time of the person browsing?
[QUOTE=Ardosos;34453717]Is it even possible to have a php file display a different image depending on whether or not the person viewing it in a browser was using widescreen or fullscreen? [editline]e[/editline] Okay, how about a different picture depending on the system time of the person browsing?[/QUOTE] not unless you want it to be slow
[QUOTE=Ac!dL3ak;34453990]not unless you want it to be slow[/QUOTE] What about something timezone dependent, like shows one picture in the AM hours, and a different picture of the same dimensions in the PM hours? Is such a thing even possible?
Sorry, you need to Log In to post a reply to this thread.