OpenAL is such a huge thing, and the documentation doesn't tell what values are acceptable for properties. That's really bad.
I'm using the document: "OpenAL_Programmers_Guide.pdf"
Whenever I look up a property I'm left in the dark what value might be ok. For example, take AL_PITCH. What value?
Maybe someone wrote a better one? Or is there something like a wiki place with more details?
I have 2 arrays with different sizes, in some cases one array can have more elements than the other array. However, I always need to compare the arrays using the same id. I need to get the other value with the same id in the other array
I have tried this, but the problem happens when I compare the two arrays in a loop when the other array has more elements than one, because duplicate the loop and data , and it does not work.
Here is what I've tried:
<?php
/// Actual Data Arrays ///
$data_1=array("a1-fruits","b1-apple","c1-banana","d1-chocolate","e1-pear");
$data_2=array("b1-cars","e1-eggs");
///
for ($i=0;$i<count($data_1);$i++)
{
/// Explode ID $data_1 ///
$exp_id=explode("-",$data_1[$i]);
///
for ($h=0;$h<count($data_2);$h++)
{
/// Explode ID $data_2 ///
$exp_id2=explode("-",$data_2[$h]);
///
if ($exp_id[0]=="".$exp_id2[0]."")
{
print "".$data_2[$h]."";
print "<br>";
}
else
{
print "".$data_1[$i]."";
print "<br>";
}
///
}
///
}
?>
I want the following values :
"a1-fruits"
"b1-cars"
"c1-banana"
"d1-chocolate"
"e1-eggs"
Yet, I get this (which isn't what I want):
a1-fruits
a1-fruits
b1-cars
b1-apple
c1-banana
c1-banana
d1-chocolate
d1-chocolate
e1-pear
e1-eggs
I tried everything I know and try to understand how I can do this because I don't understand how to compare these two arrays. The other problem is when one size has more elements than the other, the comparison always gives an error.
I FIND THE SOLUTION TO THIS AND WORKING IN ALL :
<?php
/// Actual Data Arrays ///
$data_1=array("a1-fruits","b1-apple","c1-banana","d1-chocolate","e1-pear");
$data_2=array("b1-cars","e1-eggs","d1-chocolate2");
///
for ($i=0;$i<count($data_1);$i++)
{
$show="bad";
/// Explode ID $data_1 ///
$exp_id=explode("-",$data_1[$i]);
///
for ($h=0;$h<count($data_2);$h++)
{
/// Explode ID $data_2 ///
$exp_id2=explode("-",$data_2[$h]);
///
if ($exp_id2[0]=="".$exp_id[0]."")
{
$show="ok";
print "".$data_2[$h]."<br>";
}
///
}
if ($show=="bad")
{
print "".$data_1[$i]."";
print "<br>";
}
///
}
?>
file.each_line do |line|
#skip the first one/not a user
3.times { next } if first == 1
first = 2
end
How can I get the 'next' to well, "next" the iteration of the each_line, instead of the 3.times iteration? Also, how can I write this to look better (ie: first == 1 looks bad)
Hey,
im using a connection to a server in my php script, opened with fsockopen() and i want it to share between different pages so i serialized it and saved it in a session variable but it seems that that ia a bad idea because when i do this nothing happens...
Not even an error.
The problem is that this connection requires a handshake so i cant reconnect everytime
Another question, whats the timeout of fsockopen or does the connection stay alive if the. original php script which called it is closed?
Hello,
I have got four classes A, B, C and D.
Class A has a member b of class
B.
Class B has a member c of class C.
A has a member D* dpointer;
This hierarchy has to be preserved (in fact this is a GUI with app, window, panel as A, B and C).
Now B and C must use a method from *dpointer.
Is there something more elegant than giving dpointer as a member of B and C ? Is it bad ?
In a spring mvc + spring core app, we have have a view layers, a facade, a service layer, a dao layer and a stored-proc based persistance layer.
The service layer is unaware of the clients that utilitize its methods. Is it fine to propagate raw http requests into the service layer? Or is it bad practice and a violation of the loose coupling principles?
If it is, then what's a clean workaround?
I'm new to Doctrine and ActiveRecord.
How should I filter a table after it has been loaded? (i suppose this is preferred over sending multiple queries?)
Is this 'good' or 'bad'?
class UserTable extends Doctrine_Table {
function filterByGroup($group) {
$ut = new UserTable();
foreach($this as $u) {
if($u->group = $group) $ut->add($u);
}
return $ut;
}
}
Hello,
when my user enters data validated as wrong a red circle with a white exclamation mark is shown in the right part of the textbox with the wrong data. The error message is only shown when the user hovers the textbox with wrong data.
Do you think that is a bad User experience ?
I could show the red error message text to the right side of the textboxes if there would still be space...
I am working in Train Traffic Controller software project.
My responsibility in this project is to develop the visual railroad GUI.
By now I am using some svg graphics in that GUI.
I prefer them because of their scalability talents.
Is it good or bad idea to use svg in a desktop application?
Any suggestions?
First time I am bit disappointed in StackOverflow cause my http://stackoverflow.com/questions/2571727/c-concurrency-vs-java-concurrency-which-is-neatly-designed-which-is-better question was closed.
My intension was just trying to gather knowledge from programming guru's who worked in both the programming technologies. Rather closing this question, please help me by discussing what is good, bad, and ugly in multi-threading part in both the platforms.
It is also welcome, if someone would like to compare with .Net 4.0 with JDK 6 (or JDK 7)
I've done 'git pull', and received a merge conflict. I know that the other version of the file is good, and that mine is bad (all my changes should be abandoned). How do I do this?
unmerged: _widget.html.erb
You are in the middle of a conflicted merge.
I was wondering if anyone new how to get access the metadata (the date in particular) from jpg, arw and dng files.
I've recently lost the folder structure after a merge operation gone-bad and would like to rename the recovered files according to the metadata.
I'm planning on creating a little C++ app to dig into each file and get the metadata.
any input is appreciated.
( alternatively, if you know of an app that already does this I'd like to know :)
I was happily running my CentOS 5.4 before something bad happened that somehow corrupted the 'nautilus' package. It stopped me from using the default Gnome Desktop.
Then I installed (using yum) the KDE and nautilus later on. Now, KDE is running perfectly with one exception that it takes around 10 minutes before showing up the Login Screen and only a blue screen with mouse pointer keeps showing during those 10 minutes.
Thanks in Anticipation.
Regards, Talal
Yet another newbie question..
Let's say I have an user table in declarative mode:
class User(Base):
__tablename__ = 'user'
id = Column(u'id', Integer(), primary_key=True)
name = Column(u'name', String(50))
When I have a list of users identifiers, I fetch them from db with:
user_ids = [1, 2, 3, 4, 5]
users = Session.query(User).filter(User.id.in_(user_ids)).all()
I dislike using in_ because I think I learned it has bad performance on indexed fields
(is that true/false?).
Anyway, is there a better way doing that query?
Thanks!
Is there any good framework for comparing whole objects?
now i do
assertEquals("[email protected]", obj.email);
assertEquals("5", obj.shop);
if bad email is returned i never get to know if it had the right shop, i would like to get a list of incorrect fields.
Hi,
In class design, is it a bad habit if one method calls another method in the same class (For example, 3 methods call 1 method in the same class).
Thanks
The idea behind the question is -
Just say No! to C# Regions
It is said that "the reason to use #region tags because all the things they are hiding is just really bad code."
How do you use regions effectively?
When I look back my codes that written earlier time, I found something terribly bad.
Whenever I want to delete a record in the database, I did like this :
$.post("deleteAction.do",{recordId:10});
I cannot prevent a malicious user visit my database operation url directly :
deleteAction.do?recordId=10
What's the solution for this kind of problem ?
#!/usr/bin/perl
use strict;
use warnings;
my $s = "sad day
Good day
May be Bad Day
";
$s =~ s/\w+ \w+/_/gm;
print $s;
I am trying to substitute all spaces between words with _, but it is not working. What is wrong with that?
players = {}
function newPlayer(name)
players[name]={x = 200, y = 100} --assign each player their x and y coordinates, which is x: 200 and y: 100
end
function checkPosition(name?) -- Do i need a parameter?
if players[name].x == 200 and players[name].y == 100 then --says players[name].x is a nil value
print("good")
else
print("bad")
end
end
Error: attempt to index ? (a nil value)
Current Situation: The code above says players[name].x is a nil value, I would like to know why since i thought i assigned it in the function newPlayer.
Hi everyone,
I work in a small company and we - as many others = use google analytics to monitor how well/bad our site is doing.
To access this information we put the google account's details (username and pwd) and off we go.
I now want to share this information with one of my clients but I don't want to give him my google account.
can anybody suggest the best way or the best practices to achieve this ?
Many Thanks
Lp
I just spent some time reading http://stackoverflow.com/questions/2768248/is-md5-really-that-bad (I highly recommend!).
In it, it talks about hash collisions. Maybe I'm missing something here, but can't you just encrypt your password using, say, MD5 and then, say, SHA-1 (or any other, doesn't matter.) Wouldn't this increase the processing power required to brute-force the hash and reduce the possibility of collision?
How do I restrict a string to whitelisted characters?
// "HOW am I to understand; this is, BAD"
$str = restrictTo($str,"0-9a-z,. ");
// " am I to understand this is, "
Is there an inbuilt function in PHP that does something close? I can't formulate a regular expression for this though :(
I have the code:
private void Button1_Click (object sender, EventArgs e)
(
Form2 f2 = new Form2 ();
f2.Show ();
)
how to make so that Form2 when you click on Button1 not opened for the second time, if it is open?
sorry for bad english