$i=0000;
while($i<=1231)
{
print "$i";
$i++;
}
Does anyone know why this isn't working? It isn't increasing it by
0001
0002
0003
0004
instead by
0
1
2
Thank you in advance.
#!/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?
Hi Guys
I'm looking for a way to print / save flex graphs, preferably without changing the flex code.Is this possible to to from the client with some kind of JavaScript library.If I need to change the flex,is ALIVEPDF the way to go (converting content to pdf first) or are there simpler solutions to this.
Thanks
How can I send trace messages to the console (like print) when I'm running my Django app under manage.py runserver, but have those messages sent to a log file when I'm running the app under Apache?
I reviewed Django logging and although I was impressed with its flexibility and configurability for advanced uses, I'm still stumped with how to handle my simple use-case.
My apologies for not being able to find the answer elsewhere-- this is a newbie question I know.
Python beginner here, I have a list of lists and want to refer to a specific part of that list.
For example
lol = [[1, 2, 4], [6, 7, 8], [9, 10, 14]]
If I just want to print the first item in one of the lists, eg the 1, 6 or 9, how would I do that?
I can only find ways to refer to each of the lists seperately eg lol[0] but not to then refer to an item within that list.
Thank you in advance for your help!
Cheers
I am new bie to xcode may be question is silly but I am lagging with my home work. In a file I want to read a specific character after the string.
I want to read all the character after the space.
ex:
asasasasasas
wewewewewewe
qwqwqwqwqwqw
xyz_ 22 aaaaaaaaaaa bbbbbbbbbbb ccccccccccccccc ddddddddddddd
fgfgfgfgfgfgfg
ererererererer
abc_ 12 bbbbbbbbbb dddddddd
jkjkjkjkjkjkjk
lalallalalalal
everything is fine .. but i want to print after "xyz_ 22" as aaaaaaa
then
bbbb
ccc
Hi,
I jus created a rails application. I created a model using ruby script/generate model Article
next i edited the my articles.rb file by adding these lines in self.up method
def self.up
create_table :articles do |t|
t.string :title
t.text :body
t.string :published_at
t.timestamps
end
end
Now i ran rake db:migrate . But migrate does not work, it simply does no print anything. Anyone knows where i am going wrong?
a = 7
for a in range(10):
if a == 7:
pass
if a == 8:
pass
if a == 9:
pass
else:
print "yes"
how to write it shortly?
#like this or... help
if a ?????[7,8,9]:
pass
Hi i have two value object classes .
package org.array;
import java.util.List;
public class Father {
private String name;
private int age ;
private List<Children> Childrens;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public List<Children> getChildrens() {
return Childrens;
}
public void setChildrens(List<Children> childrens) {
Childrens = childrens;
}
}
second is for children
package org.array;
public class Children {
private String name;
private int age ;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
and i want to print there value i nested a list inside a list here i am putting only a single value inside the objects while in real i have many values . so i am nesting list of children inside father list. how can i print or get the value of child and father both. here is my logic.
package org.array;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ArrayDemo {
public static void main(String[] args) {
List <Father> fatherList = new ArrayList<Father>();
Father father = new Father();
father.setName("john");
father.setAge(25);
fatherList.add(father);
List <Children> childrens = new ArrayList<Children>();
Children children = new Children();
children.setName("david");
children.setAge(2);
childrens.add(children);
father.setChildrens(childrens);
fatherList.add(father);
Iterator<Father> iterator = fatherList.iterator();
while (iterator.hasNext()) {
System.out.println(iterator.toString());
}
}
}
i will be printing the access report. the report will not be printed a regular white paper. it will be printed on top of a paper with checkboxes and fields on it. i need those checkboxes and fields to be printed on according to the access data.
are there any libraries for access that make this easier? is there a feature that will help to print on specific coordinates?
Hello!
Is there any way to obtain this effect in a PHP version prior to 5.3?
class A {
public static function x() {print 'ok'; }
}
$className = 'A';
$className::x();
Thanks!
Palantir
What's going on when the assignment statement executed at Line 4, does compiler ignore the new operator and keep the foo variable being null or something else happen to handle this awkward moment?
public class Foo {
// creating an instance before its constructor has been invoked, suppose the "initializing"
// gets printed in constructor as a result of the next line, of course it will not print it
private Foo foo = new Foo();//Line 4
public Foo() {
System.out.println("initializing");
}
}
<script language="Javascript">
var deviceIphone = "iPhone";
var deviceIpod = "iPod";
//Initialize our user agent string to lower case.
var uagent = navigator.userAgent.toLowerCase();
//**************************
// Detects if the current device is an iPhone.
function DetectiPhone()
{
if (uagent.search(deviceIphone) > -1)
{document.write('<link rel="stylesheet" type="text/css" href="ui/mobile/css/site.css">');
}
etc...
Above is the start of my code. I am trying to change the CSS file depending on what platform the user is using. I currently use media="screen ... " but it doesn't work with the amount of platforms I'm trying to use. I need something a lot more detailed/complex that is why I'm turning to useragents.
Any ideas why the css file doesn't change on my iPhone using the above code?
Better yet, any ideas on another way to change style sheets depending on the users platform/screen resolution?
I have a client server situation in which I receive data using
read(socket, char_buf, BUF_SIZE)
and then try to write it into a log file using
write(filefd, char_buf, strlen(char_buf))
Strangely enough this fails (write returns -1), and yet the errno is set to 0, and I can print the message, AND the log file descriptor works (I write to it before and after this command).
What's going on??
(Working on Linux kernel 2.4 (homework))
I am trying to assign a cell in excel for the user to type the printer name where they want the print out to go and then use that value in the
Application.ActivePrinter = (use the cell value)
Even though I have done the programming assigning a name to the cell and using it in a variable it is giving me an error.
I have set my variable as string, text, object and variant already and it's not working.
Do you know what code should I use to be able to do this?
i am raising exception using
if UserId == '' and Password == '':
raise Exception.MyException , "wrong userId or password"
but i want print the error message on same page
class MyException(Exception):
def __init__(self,msg):
Exception.__init__(self,msg)
I'm loading several external JSON files and want to check if they have been successfully cached before the the next screen is displayed. My strategy is to check the name of the array to see if it an object. My code works perfectly when I check only a single array and hard code the array name into my function. My question is: how can i make this dynamic?
not dynamic: (this works)
$("document").ready(){
checkJSON("nav_items");
}
function checkJSON(){
if(typeof nav_items == "object"){
// success...
}
}
dynamic: (this doesn't work)
$("document").ready(){
checkJSON("nav_items");
checkJSON("foo_items");
checkJSON("bar_items");
}
function checkJSON(item){
if(typeof item == "object"){
// success...
}
}
here is the a larger context of my code:
var loadAttempts = 0;
var reloadTimer = false;
$("document").ready(){
checkJSON("nav_items");
}
function checkJSON(item){
loadAttempts++;
//if nav_items exists
if(typeof nav_items == "object"){
//if a timer is running, kill it
if(reloadTimer != false){
clearInterval(reloadTimer);
reloadTimer = false;
}
console.log("found!!");
console.log(nav_items[1]);
loadAttempts = 0; //reset
// load next screen....
}
//if nav_items does not yet exist, try 5 times, then give up!
else {
//set a timer
if(reloadTimer == false){
reloadTimer = setInterval(function(){checkJSON(nav_items)},300);
console.log(item + " not found. Attempts: " + loadAttempts );
}
else {
if(loadAttempts <= 5){
console.log(item + " not found. Attempts: " + loadAttempts );
} else {
clearInterval(reloadTimer);
reloadTimer = false;
console.log("Giving up on " + item + "!!");
}
}
}
}
This is a module named XYZ.
def func(x)
.....
.....
if __name__=="__main__":
print func(sys.argv[1])
Now I have imported this module in another code and want to use the func. How can i use it?
import XYZ
After this, where to give the argument, and syntax on how to call it, please?
Write an iterative program that finds the largest number of McNuggets that cannot be bought in exact quantity. Your program should print the answer in the following format (where the correct number is provided in place of n):
"Largest number of McNuggets that cannot be bought in exact quantity: n"
I need to print the following values with printf as the follwoing around like this:
printf "[`date +%d"/"%b"/"%G"-"%T`] [WARN] $PARAM1 $PARAM2 $PARAM3
The required output:
[02/Jun/2010-11:08:42] [WARN] val1....val2...val3
can any one please let me know, i need to print/list Alphabetical(A-Z) char to manage Excel cells. Is there any php function to list Alphabetic?
I need result as
A1
B1
C1
D1
...
...
...
OR
A
B
C
...
...
I am using the code from MS to print a form however it looks like the form needs to be visible with a Show/ShowDialog() to work.
I am trying to use the code for a form that I don't want to show.
Any ideas?
Hi,
I have written a small program where the program works differently on different operating systems (xp, win7) The problem is the program reads some float numbers such 2,686.
One operating system (win7) convert it to float true, but on xp it goes wrong and print it 2686. How can I understand which symbol the operation system uses for decimal numbers ?
Thanks.
When I run this code on my computer with the help of "Google App Engine SDK", it displays (in my browser) the HTML code of the Google home page:
from google.appengine.api import urlfetch
url = "http://www.google.com/"
result = urlfetch.fetch(url)
print result.content
How can I make it display the page itself? I mean I want to see that page in my browser the way it would normally be seen by any user of the internet.