Please forgive my programming knowledge. I know this is a simple thing, but I do not understand why result is always 0. Why decimal will be fine?
int a = 100;
int b = 200;
decimal c = (a / b) * 100;
Many thanks.
Don't want to learn anything like Adobe Premiere or something...
I have images, or Frames as they are called... Now is there any simple yet elegant application which can put those frames into a timeline and make the animation?
I am after an easy application so if you know of any, please let me know...
Thanks
I've created a custom solution in WordPress that will generate a CSV file to be downloaded by clicking a simple hyperlink, linked directly to this file. Instead of being prompted to download the file to the computer; the CSV opens in the the browser window instead.
FWIW I'm on Media Temple using a vanilla install of WordPress.
I really haven't found normal example of php file where mysql transactions are being used. Can you show me simple example of that?
And one more question. I've already created a lot of programming and didn't use transaction, maybe I can put any php function or smth to header.php that if one mysql_query fails, then others too?
Thank you.
Hi,
It is probably pretty simple but I cannot figure it out: Say I have tables A and B both with the same columns. I need to do SELECT * FROM A,B without having results merged into one row.
I.e. when each table has 2 rows, I need the result to have 4 rows.
EDIT: I know about JOIN but dont know how to join the tables without predicate. I need merge them.
Thanks
i want my thread to sleep when a queue is empty and just wake up when a data is put in it,
should i use condition object? i have never used this object before! and i can,t find a simple example in python
I need to print the contents of a datagridview, simple text in rows and columns, with GDI+ in .NET to paper.
To do this, I need to iterate over the rows, draw lines, iterate over the columns, calculate width, height, wrap the contents if contents do not fit on one line, etc. This is all possible, but is there a library that simplifies the drawing of tables in GDI+ and abstracts some of the difficulties away?
I am learning objective c and am making some small programs. for my current project i am taking a NSBox and changing it's location based on a random number. How do I change the box's location? With C# it was a simple "box.location = anotherLocation" but I can't figure out how to do this in objective c. Any help would be greatly appreciated.
Thanks.
Simple question I think, I am a little unsure as to why
decimal currentPercentage = 0;
currentPercentage = currentPercentage*((decimal)1 / (decimal)daysPerYear--);//or
currentPercentage *= ((decimal)1 / (decimal)daysPerYear--);
Will return 0 everytime but
(decimal)1 / (decimal)daysPerYear--;
will return the decimal I am after. What am I missing here?
in the following link
http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#sysvar_innodb_flush_method
it says:Different values of this variable can have a marked effect on InnoDB performance. For example, on some systems where InnoDB data and log files are located on a SAN, it has been found that setting innodb_flush_method to O_DIRECT can degrade performance of simple SELECT statements by a factor of three.
Why O_DIRECT could slow down the select statement?
Hi. Does anyone know a good C# tutorials (example) step by step?
It should be not a description of libraries, foundations and the OOP concept, and so forth, but the writing of any application step by step. For example, a mail client, telephone directory, a simple graphical editor, audio player.
Thanks!
What I mean is like have to user input a string with multiple variables and get the value of those variable. Like a simple quadratic formula: x^2 + 5x + 10. The user would then enter that and then the program would solve for x. I will be using the BeanShell Interpreter class to interpret the string as an equation. But how would I solve for x?
I've tried to connect to my local machine every time I try and run my program.
I am a nub, so it's probably a simple mistake somewhere.
def connect(self):
self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.conn.connect((self.host,self.port))
That is the code causing the error.
The host and port are defined.
Why is it giving me this error report?
[Errno 10061] No connection could be made because the target machine actively refused it
I have no clue how to create lines with Athens. I took a look at Cairo docs but I cant see how Athens is related to Cairo.
http://zetcode.com/gfx/cairo/basicdrawing/
In the above link I cant find any equivalent for cairo_set_line_width(cr, 1); I tried to look inside Athens but is nowhere to be found. Overall I find the Athens architecture quite confusing though Cairo looks simple. Any idea how to makes this work ?
I have a very simple matlab question. What is the easiest way to find the point of intersection between two vectors. I am not familiar with the various matlab fuctions -- it seems like there should be one for this.
For example if I have one vector from (0,0) to (6,6) and another vector from (0,6) to (6,0), I need to determine that they intersect at (3,3)
Thanks.
Hi, what happens when you cin letter to int variable? I tried simple code to add 2 int numbers, first read them, than add them. But when I enter letter, it just fails and prints tons of numbers to screen. But what causes this error? I mean, I expected it to load and use ASCII code of that letter.
I want to achieve the following exactly: http://geekswithblogs.net/tkokke/archive/2009/04/01/creating-binding-and-styling-a-bubble-chart.aspx
The Silverlight Toolkit is giving me hell. I'm trying to create a simple chart in Visual Studio 2010. I've drawn the chart on the screen, but I can't figure out how to add data to it.
mysql> EXPLAIN SELECT * FROM urls ORDER BY RAND() LIMIT 1;
+----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+
| 1 | SIMPLE | urls | ALL | NULL | NULL | NULL | NULL | 62228 | Using temporary; Using filesort |
+----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+
The above doesn't qualify as efficient,how should I do it properly?
I have a simple page structure like below
/directory/subdir_1/index.php
/directory/subdir_2/index.php
....
(there are no other files in these directories)
is it possible to have 'fake/pretty' urls for the above files as below?
/directory/subdir_1
/directory/subdir_2
...
so this path would show whether the visitor typed that,/directory/subdir_2/ or /directory/subdir_2/index.php.
Many thanks
I've created a simple background effect for some tabs on a page but don't want that effect to fire if the tab has the class 'current'.
I presume there is a way to do this using .hasClass
Here's what I'm using for the effect:
$('ul.htabs a').mouseover(function(){
$(this).stop().animate(
{backgroundPosition:"(0 -810px)"},
{duration:150},
{easing: 'easeOutCubic'})
}).mouseout(function(){
$(this).stop().animate(
{backgroundPosition:"(0 -806px)"},
{duration:150},
{easing: 'easeInCubic'})
});
I can't figure out how to check from within C/C++ if a service is enabled via launchd. I know I can use launchctl from the command line and am currently executing ' launchctl list myServiceName ' from fork/exec.
I've found that boostrap_look_up() might be the way to check this but I can't find enough documentation to condense this down to a simple example.
Can you shed light on this? All I need is a small function to test if my service is actually registered and available.
Is there a tool that implements hyperlink-style navigation between tables via foreign keys? Web-based or native app.
For example, if I have table Users, with a column containing a foreign key reference to table Preferences, such a tool would implement simple 1-click access between the rows of the two tables, automatically creating links based on foreign keys.