How doe i draw a line in a for loop in java?
Im a very beginner in java. How draw a line from _x1, y to _x2,y using
image in a for or a while loop? i also have to take care of the length of
my object in the JLabel. thanx in advance
public void Plotline(int _x1, int _x2, int _y)
{
Color tmp_color = new Color(0);
Thursday, 3 October 2013
Wednesday, 2 October 2013
Center is not Center on Responsive Site
Center is not Center on Responsive Site
I truly apologize if any of these questions (there's a main one, then one
other that is less important) are absolute idiot questions, but I must
admit they have me stumped, so I do appreciate any help that I can get.
First off, here's my site: "Narnia Greenville".
The question is this: The timeline (named thermometer.png) is off center,
although I have followed all the options from here:
"http://css-tricks.com/snippets/css/absolute-center-vertical-horizontal-an-image/",
as well as from several other sites. Plus, if you re-size your window, it
appears to jump from the right to the left at a certain point for no
apparent reason. I can't figure it out, and the last time I attempted a
site like this (I failed miserably) I encountered this same type of
problem. I'm sure the issue should be staring me in the face (and probably
laughing at me), but I can't see it for the life of me. The goal is to get
"thermometer.png" centered both horizontally and vertically on the page,
and on top of all the other images.
Next: The images are HUGE! And take FOREVER to load, so if you're on a
limited internet connection, I suggest moving on to someone else's
question. I'm working on that. As I'm sure you can tell, I'm new to most
of this. (I've been "rebuilding" wordpress themes for most of my limited
web-design experience, and none of it includes this kind of thing. It just
works... LoL.) So anyways, although not a specific question, if you feel
like documenting how you cut down on image loading time, please feel free
to.
Many thanks to anyone who is willing to help me. And again, I apologize if
either of these is stupid question. LoL.
I truly apologize if any of these questions (there's a main one, then one
other that is less important) are absolute idiot questions, but I must
admit they have me stumped, so I do appreciate any help that I can get.
First off, here's my site: "Narnia Greenville".
The question is this: The timeline (named thermometer.png) is off center,
although I have followed all the options from here:
"http://css-tricks.com/snippets/css/absolute-center-vertical-horizontal-an-image/",
as well as from several other sites. Plus, if you re-size your window, it
appears to jump from the right to the left at a certain point for no
apparent reason. I can't figure it out, and the last time I attempted a
site like this (I failed miserably) I encountered this same type of
problem. I'm sure the issue should be staring me in the face (and probably
laughing at me), but I can't see it for the life of me. The goal is to get
"thermometer.png" centered both horizontally and vertically on the page,
and on top of all the other images.
Next: The images are HUGE! And take FOREVER to load, so if you're on a
limited internet connection, I suggest moving on to someone else's
question. I'm working on that. As I'm sure you can tell, I'm new to most
of this. (I've been "rebuilding" wordpress themes for most of my limited
web-design experience, and none of it includes this kind of thing. It just
works... LoL.) So anyways, although not a specific question, if you feel
like documenting how you cut down on image loading time, please feel free
to.
Many thanks to anyone who is willing to help me. And again, I apologize if
either of these is stupid question. LoL.
Overlay pmf of true Poisson distribution over histogram of randomly generated samples
Overlay pmf of true Poisson distribution over histogram of randomly
generated samples
I'm new to both statistics and R. I've generated 100 random samples from a
Poisson distribution with lambda = 2.5 using: samples <- rpois(100,2.5)
I've successfully created a relative frequency histogram of the samples:
hist(samples, prob=TRUE)
Now I need to overlay the pmf of the true Poisson distribution over the
histogram but don't know how to generate the true function. I think this
is probably very simple but just can't figure out what to do. Any help
would be really appreciated.
Thanks!
generated samples
I'm new to both statistics and R. I've generated 100 random samples from a
Poisson distribution with lambda = 2.5 using: samples <- rpois(100,2.5)
I've successfully created a relative frequency histogram of the samples:
hist(samples, prob=TRUE)
Now I need to overlay the pmf of the true Poisson distribution over the
histogram but don't know how to generate the true function. I think this
is probably very simple but just can't figure out what to do. Any help
would be really appreciated.
Thanks!
How to call a value from function set_value in Code Igniter?
How to call a value from function set_value in Code Igniter?
pI have a simple task , and i'm using a MVC methods and CI framework for
this task. I have made a view to input data to database, and it's work,
and i make a 2 anchors, those are an [Update] and [Delete], the function
delete is working, but the update isn't working. After user click anchor
[Update], it will linked to another view(update_view), and i want to show
the content which i've clicked in the (update_view). and i think it use a
set_value to set a second parameter, to show a value in my update_view.
This is my code in a view(update_view)/p precodegt; lt;!-- update_view.php
--gt; gt; lt;!DOCTYPE htmlgt; gt; lt;htmlgt; gt; lt;headgt; gt;
lt;titlegt;lt;/titlegt; gt; lt;/headgt; gt; lt;bodygt; gt;
lt;h2gt;Updatelt;/h2gt; gt; lt;?php echo form_open('site/update'); ?gt;
gt; lt;pgt; gt; lt;labelgt;Judul : lt;/labelgt; gt; lt;input type=text
name=judul id=judul value=lt;?php echo set_value('judul','??')?gt;/gt; gt;
lt;/pgt; gt; lt;pgt; gt; lt;labelgt;Konten : lt;/labelgt; gt; lt;input
type=text name=konten id=konten size=100px value=lt;?php echo
set_value('konten','??')?gt;/gt; gt; lt;/pgt; gt; lt;pgt;lt;input
type=submit value=Ubah /gt;lt;/pgt; gt; lt;?php echo form_close(); ?gt;
gt; lt;/bodygt; gt; lt;/htmlgt; /code/pre pWhat should i put in input tag
in value attributes, i want to show a value in input fields (judul,
konten) from page before where i clicked the anchors. I still can't show a
image for a view before click, because i'm still don't have 10 rep to
share images. so i'will show the coding where the view(options_view) i've
clicked the anchors. This below is the code in a view(options_view) :/p
precodegt; lt;!-- options_view.php --gt; gt; lt;!DOCTYPE htmlgt; gt;
lt;htmlgt; gt; lt;headgt; gt; lt;titlegt;lt;/titlegt; gt; lt;/headgt; gt;
lt;bodygt; gt; lt;h2gt;Createlt;/h2gt; gt; lt;?php echo
form_open('site/create'); ?gt; gt; lt;pgt; gt; lt;labelgt;Judul :
lt;/labelgt; gt; lt;input type=text name=judul id=judul /gt; gt; lt;/pgt;
gt; lt;pgt; gt; lt;labelgt;Konten : lt;/labelgt; gt; lt;input type=text
name=konten id=konten size=100px/gt; gt; lt;/pgt; gt; lt;pgt;lt;input
type=submit value=Simpan /gt;lt;/pgt; gt; lt;?php echo form_close(); ?gt;
gt; lt;hr/gt; gt; lt;h2gt;Readlt;/h2gt; gt; lt;?php if(isset($records)):
foreach($records as $baris) : ?gt; gt; lt;h3gt;lt;?php echo
$baris-gt;judul ?gt;lt;/h3gt; gt; lt;divgt;lt;?php echo $baris-gt;konten
?gt;lt;/divgt; gt; lt;?php echo
anchor(site/view_update/$baris-gt;id,[Update]); ?gt; gt; lt;?php echo
anchor(site/delete/$baris-gt;id,[Delete]); ?gt; gt; lt;?php endforeach;
?gt; gt; lt;?php else : ?gt; gt; lt;h3gt;Tidak ada data.lt;/h3gt; gt;
lt;?php endif; ?gt; gt; lt;/bodygt; gt; lt;/htmlgt; /code/pre pi'm still
doubt, whether i should add code in my controller or my view(set_value).
So anyone can help me to solve this problem. Thank's for help/p
pI have a simple task , and i'm using a MVC methods and CI framework for
this task. I have made a view to input data to database, and it's work,
and i make a 2 anchors, those are an [Update] and [Delete], the function
delete is working, but the update isn't working. After user click anchor
[Update], it will linked to another view(update_view), and i want to show
the content which i've clicked in the (update_view). and i think it use a
set_value to set a second parameter, to show a value in my update_view.
This is my code in a view(update_view)/p precodegt; lt;!-- update_view.php
--gt; gt; lt;!DOCTYPE htmlgt; gt; lt;htmlgt; gt; lt;headgt; gt;
lt;titlegt;lt;/titlegt; gt; lt;/headgt; gt; lt;bodygt; gt;
lt;h2gt;Updatelt;/h2gt; gt; lt;?php echo form_open('site/update'); ?gt;
gt; lt;pgt; gt; lt;labelgt;Judul : lt;/labelgt; gt; lt;input type=text
name=judul id=judul value=lt;?php echo set_value('judul','??')?gt;/gt; gt;
lt;/pgt; gt; lt;pgt; gt; lt;labelgt;Konten : lt;/labelgt; gt; lt;input
type=text name=konten id=konten size=100px value=lt;?php echo
set_value('konten','??')?gt;/gt; gt; lt;/pgt; gt; lt;pgt;lt;input
type=submit value=Ubah /gt;lt;/pgt; gt; lt;?php echo form_close(); ?gt;
gt; lt;/bodygt; gt; lt;/htmlgt; /code/pre pWhat should i put in input tag
in value attributes, i want to show a value in input fields (judul,
konten) from page before where i clicked the anchors. I still can't show a
image for a view before click, because i'm still don't have 10 rep to
share images. so i'will show the coding where the view(options_view) i've
clicked the anchors. This below is the code in a view(options_view) :/p
precodegt; lt;!-- options_view.php --gt; gt; lt;!DOCTYPE htmlgt; gt;
lt;htmlgt; gt; lt;headgt; gt; lt;titlegt;lt;/titlegt; gt; lt;/headgt; gt;
lt;bodygt; gt; lt;h2gt;Createlt;/h2gt; gt; lt;?php echo
form_open('site/create'); ?gt; gt; lt;pgt; gt; lt;labelgt;Judul :
lt;/labelgt; gt; lt;input type=text name=judul id=judul /gt; gt; lt;/pgt;
gt; lt;pgt; gt; lt;labelgt;Konten : lt;/labelgt; gt; lt;input type=text
name=konten id=konten size=100px/gt; gt; lt;/pgt; gt; lt;pgt;lt;input
type=submit value=Simpan /gt;lt;/pgt; gt; lt;?php echo form_close(); ?gt;
gt; lt;hr/gt; gt; lt;h2gt;Readlt;/h2gt; gt; lt;?php if(isset($records)):
foreach($records as $baris) : ?gt; gt; lt;h3gt;lt;?php echo
$baris-gt;judul ?gt;lt;/h3gt; gt; lt;divgt;lt;?php echo $baris-gt;konten
?gt;lt;/divgt; gt; lt;?php echo
anchor(site/view_update/$baris-gt;id,[Update]); ?gt; gt; lt;?php echo
anchor(site/delete/$baris-gt;id,[Delete]); ?gt; gt; lt;?php endforeach;
?gt; gt; lt;?php else : ?gt; gt; lt;h3gt;Tidak ada data.lt;/h3gt; gt;
lt;?php endif; ?gt; gt; lt;/bodygt; gt; lt;/htmlgt; /code/pre pi'm still
doubt, whether i should add code in my controller or my view(set_value).
So anyone can help me to solve this problem. Thank's for help/p
regex may or maynot contain a character
regex may or maynot contain a character
i have some regex i am using in php,
(i cut most of the regex out to make it simpler)
preg_match_all('/D3m57D3m58(.+)D3m59/Uis', $content, $m)
now, this works fine for most of the stuff, but in some examples D3m57 and
D3m58 may be separated by a new line, thus no match
How can i get this to match even if there is a new line inbetween them,
but it still match even if there is not...
i cant alter the string it is matching against
i have some regex i am using in php,
(i cut most of the regex out to make it simpler)
preg_match_all('/D3m57D3m58(.+)D3m59/Uis', $content, $m)
now, this works fine for most of the stuff, but in some examples D3m57 and
D3m58 may be separated by a new line, thus no match
How can i get this to match even if there is a new line inbetween them,
but it still match even if there is not...
i cant alter the string it is matching against
Tuesday, 1 October 2013
Gnuplot: Store plot area dimensions for later use
Gnuplot: Store plot area dimensions for later use
Is it possible to store the dimensions of the plotting space in gnuplot? I
don't mean the whole canvas, rather, the area within the plotting frame.
Is it possible to store the dimensions of the plotting space in gnuplot? I
don't mean the whole canvas, rather, the area within the plotting frame.
How to load a script in a template footer - CodeIgniter
How to load a script in a template footer - CodeIgniter
I'm trying out a more maintainable way to structure my code as learnt by
some tutorials at nettuts+.
I've succeeded in making my header and footer files separate from the main
content of each page so that they are loaded along with each different
page, thus making it easier to manage changes to these two files.
I'm currently wanting to add some jQuery code to my footer, for only one
page. This is where I've hit a wall in thinking. How can I allow this
jQuery code to be present in my footer for only one page, and not all
pages? Could someone please explain?
I'm trying out a more maintainable way to structure my code as learnt by
some tutorials at nettuts+.
I've succeeded in making my header and footer files separate from the main
content of each page so that they are loaded along with each different
page, thus making it easier to manage changes to these two files.
I'm currently wanting to add some jQuery code to my footer, for only one
page. This is where I've hit a wall in thinking. How can I allow this
jQuery code to be present in my footer for only one page, and not all
pages? Could someone please explain?
ERROR: Can't change MAC: interface up or not permission: Invalid argument
ERROR: Can't change MAC: interface up or not permission: Invalid argument
So, I was messing around with aircrack & macchanger and following some
tutorials. I typed the following command into the terminal
macchanger --mac 00:11:22:33:44:55 wlan0
and I got the following error
ERROR: Can't change MAC: interface up or not permission: Invalid argument
I have no clue what this means, so i done some digging through google and
come across one article here and if you go the the third comment from the
bottom, someone else has run into the same problem, and there was a reply
in the second comment from the bottom that simply stated.
As you have guessed, this means that the Linux driver for your device
doesn't allow changing the MAC address (whereas the Windows one does).
Unfortunately, there's not much you can do about it, other than patching
the driver yourself or bugging Realtek about it.
Ok, well why is that so? that's pretty stupid, is there any way to get
around this, or what drivers am I supposed to be looking at replacing?
How do we go about "patching the driver"?
So, I was messing around with aircrack & macchanger and following some
tutorials. I typed the following command into the terminal
macchanger --mac 00:11:22:33:44:55 wlan0
and I got the following error
ERROR: Can't change MAC: interface up or not permission: Invalid argument
I have no clue what this means, so i done some digging through google and
come across one article here and if you go the the third comment from the
bottom, someone else has run into the same problem, and there was a reply
in the second comment from the bottom that simply stated.
As you have guessed, this means that the Linux driver for your device
doesn't allow changing the MAC address (whereas the Windows one does).
Unfortunately, there's not much you can do about it, other than patching
the driver yourself or bugging Realtek about it.
Ok, well why is that so? that's pretty stupid, is there any way to get
around this, or what drivers am I supposed to be looking at replacing?
How do we go about "patching the driver"?
I can't access the system: Error: "unknown filesystem. grub rescue"
I can't access the system: Error: "unknown filesystem. grub rescue"
i'm a fresh ubuntu user and I've installed a double boot with Wind 8 and
Ubuntu 13.04, but since yesterday I'm receiving an error showing:
error: unknown filesystem grub rescue>
The fact is when I do ls (hdX,gptY)/ all I get is "error:unknown
filesystem" again.
And the solutions posted don't work because I don't know why but I can't
access the BIOS pressin F2 or to the boot pressing F12, the simply don't
work since the error.
i'm a fresh ubuntu user and I've installed a double boot with Wind 8 and
Ubuntu 13.04, but since yesterday I'm receiving an error showing:
error: unknown filesystem grub rescue>
The fact is when I do ls (hdX,gptY)/ all I get is "error:unknown
filesystem" again.
And the solutions posted don't work because I don't know why but I can't
access the BIOS pressin F2 or to the boot pressing F12, the simply don't
work since the error.
Subscribe to:
Posts (Atom)