« first day (1369 days earlier)      last day (3572 days later) » 

user2932587
12:13 AM
@carlspring sorry, can't help ya. I've never even heard of it.
 
4:47 AM
@carlspring may i ?
 
5:38 AM
Anyone there?
 
@AbhijeetPanwar yeah
 
I am facing problem in calling apython script..
1
Q: Calling a python script through java?

Abhijeet PanwarI have written a code to call a python script through java,I have tried it using both Runtime.exec() and process builder but by both the ways I am facing same problem. My code is : Process pr=Runtime.getRuntime().exec("/usr/bin/python /home/abhijeet/delete.py"); pr.waitFor(); System.out.prin...

Have tried alot..But could't find error in this
@ItachiUchiha
 
@AbhijeetPanwar code seems good to me
 
Hmm.. but it's not working for me
 
6:23 AM
Hi guys i just want to know the best practice in struts xml, whether all action tags can be placed in single xml or its better to place action tags in separate xml files
 
 
3 hours later…
9:53 AM
@kiheru @Kylar @ItachiUchiha Can someone help me with connection pooling in my java web app? A bit urgent.
Anyone?
 
10:10 AM
@Appu tell me !
 
@ItachiUchiha I never used connection pooling before. So, I have followed this viralpatel.net/blogs/… But it seems the db connection isn't successful. Because the code whatever that is there after query execution line in servlet doesn't get executed. It shows blank
 
10:35 AM
@Appu what is the problem
The blog is very easy
 
@ItachiUchiha I folowed as it is except it is detailed for oracle. But I did for mysql, it doesn't throw any error. Just the execution doesn't happen.
 
did you change driverClassName="oracle.jdbc.driver.OracleDriver"
 
@ItachiUchiha Yep replaced with driverClassName="com.mysql.jdbc.Driver"
 
url="jdbc:oracle:thin:@xxx:1525:dbname" as well ?
 
yep jdbc:mysql://blah blah @ItachiUchiha
 
 
1 hour later…
11:57 AM
14 hours ago, by rink.attendant.6
Does "util" in java.util.* stand for "Utility" or "Utilities"?
@rink.attendant.6 I think "util" stands for "utility classes" - I have a package dedicated to utility classes too, like com.gmail.inverseconduit.util.ArrayUtils
 
 
2 hours later…
2:19 PM
I just created my first Python function.
def backLinkUpLevels(up_levels=1):
    dotDotSlash = "../"
    output = '<P><A HREF="'
    while(up_levels > 0):
        output += dotDotSlash
        up_levels-=1
    return  output + '"><CODE>&lt;&lt;BACK</CODE></A></P>'
Ain't she a beaut?
 
How nice! ... I don't think you have to use a bracket in the while loop.
Wait, what does it do? xD
 
(Why thank you!!) What do you mean, bracket?
 
while up_levels > 0:
 
Ohhhhh.
 
Java habits eh? :D
 
2:28 PM
:D
 
Oh wait *takes a closer look*
 
No. That doesn't work. You have to have them.
(Naw, it does. ;)
 
It's actually pretty nice, it generates a link that takes you back through a specified layer of directories?
 
I'm going through the Django tutorial. It's to add a back link to each of these views.
The "details" view calls it with backLinkUpLevels(), the others with backLinkUpLevels(2).
 
2:34 PM
The urls are
:)
polls/[poll#],
polls/[poll#]/vote,
polls/[poll#]/results
So yes, back link back up to polls
Each view is just a trivial web page.
Sorry to Python up this Java board.
 
Hi
 
@Karl Greetings!
 
Good morning, @Karl.
 
How y'all?
 
Scroll up for my very first and very impressive Python function.
Do not mind the exploding head.
 
2:42 PM
I don't read Python...Can you translate
 
It returns an HTML back link with a certain number of "../" as the url.
 
Oh....
 
def backLinkUpLevels(up_levels=1): # Define function with default value for parameter as 1 if it's not given
    dotDotSlash = "../"            # Feed a string literal to be used
    output = '<P><A HREF="'        # Feed a string literal to build the output
    while(up_levels > 0):
        output += dotDotSlash # Write ../ into the value we're building for output
        up_levels-=1 # Decrement value, continue looping if > 0
    return  output + '"><CODE>&lt;&lt;BACK</CODE></A></P>' # Add suffix and push the completed HTML
 
I see
 
Karl, you are seriously impressed. I can just feel i t. ;)
 
2:46 PM
ZZZZZZZZZZZZZZZzzzzzzzzzzzzzzzzzzzzzzzzzzzzz............Huh................. 4! ............. This is not Math class? Oh....I'm SERIOUSLY impressed!
 
Thank you... Thank you... Thank you... No really...
I'm going through the Django tutorial. My first Python.
 
Maybe it would of been more impressing if it was "Hello World!".
 
Sorry, I'm still buzzing from the INCREDIBLE race I did last night on Forza 5. 16 of the BEST cars EVER built on a single track! I DOMINATED!
 
Figuratively? ;)
 
16 1960s beetles on the same track some of them even breaking 90 MPH!
For [VERY] short periods
I have a car that is maxed out [based on the game] on the ratings. It's good for giving me $$$, but I put a quarter lap on the #2 car each time I go around...Get's booring
 
2:59 PM
You get money for it?
Virtual money.
 
Correct. Based on position finishing
...and how often you drive the car brand
 
You play with your kids?
 
Yes
It's my son's X1, so I kinda have to. :P
Overpriced, under featured console...
NOT impressed!
My extremes are a 1963 Beetle-STOCK.
 
Such a shame that not as many programmers realize num % 2 can be rewritten as num & 1. ;)
 
I have an Audi Team Joest R18 e-tron quattro. Hybrid that will break 160 on the short straightaways.
???
Elaborate Uni
 
3:05 PM
Anything module 2 is equal to using bitshift AND to extract the last bit, so.
It's like how num % 4 == num & 3.
I was revising this question:
-2
Q: Program showing false positives for Prime Numbers

user3769494After compiling all numbers are showing Prime. Please point out any type of logical errors. int i, num, res; boolean flag = false; Scanner sc = new Scanner(System.in); System.out.println("Enter number for Prime:"); num = sc.nextInt(); for(i = 2; i <= num / 2; i++) { res = num % 2; if(re...

 
Is the bitshift more efficient?
 
Theoretically yes. Practically, the compiler understands that and picks it up in bytecodes.
Bitshift is not an arithmetic operation, the machine only has to pass bits through the counter, so they're preferable if you work with low-level languages.
 
Explain how they are the same, please.
 
Given a number int number = 127: The result for number % 2 is either 1 or 0, depending on whether it's odd or even. A module operation is performed, taking number to divide by two and take the remainder of 1 (127 / 2 = 63 ... 1). So number % 2 => 1.
But because it's a number, here's how it looks like in binary:
127 & 1 returns bits in 1 and 1111111 which are equal, so you get the final bit, 1. So 127 & 1 = 1.
And this is how 3 looks like in binary:
127 & 3 effectively extracts the last two bits from 127, which is effectively equal to 127 % 4 (dividing 127 by 4 and taking the remainder).
 
Is the 15 and 0 on the bottom important?
 
3:15 PM
It indicates the 15th and 0-eth bit in the dword. I screenshotted MS Calculator.
 
Just checked that 0x11 is not a word byte in java (but instead a hexadecimal number), so you can't do number & 0x11, but that would definitely be more understandable if it was possible.
 
If the last bit is a 1, it's odd,...
 
Maths are confusing, right?
 
@Unihedron I'm not getting the 127 & 1 = 1. I'm not familiar with using a single ampersand. I know it's a non-short circuit.
Oh. "It returns the bits that are equal"
So
1111111
0000001
----------
 
3:25 PM
Ampersand is the bitwise AND operator. Consider the following:
`13 & 7` would be, when written in binary, `0x1101 & 0x0111 = 0x0101` = 5
 
0000001
Yeah. I got it now :)
 
Bitwise operations are abusively used in Chess engines. That's why they can perform many operations quickly.
 
It's the intersection between two binary numbers.
 
Got it.
So "mod 2" is equivalent to "the least significant bit is 1"?
And mod 4 is the "last two least significant bits are one"
 
3:34 PM
Yes, that's to consider taking the remainder of division in binary: % 0x0010 vs & 0x0001. This works for any % 2^n and & 2^n-1. I'm surprised they didn't document this though, % 2 is about as common as << 1 (bitshift notation for * 2) gets used.
 
3:47 PM
Is anyone aware of Ajax in java web app?
 
Mmm, delicious Ajax I have yet to mess with.
 
That's to keep the app squeaky clean?
 
Musta been Ajaxed
 
4:05 PM
hello guys.
How to handle Themes efficiently...I checked yahoo application..app has theme selection from Grid and looks awesome..My question is what is the best way to handle it...save the state of theme in shared-pref and set background accordingly?
 
@Indiandroid Hi there!
 
@Unihedron :)
 
Sounds like... transient fields to use, but I'm not absolutely sure (It's midnight over here)
 
@Unihedron thanks for quick reply...I hope somebody has solution in this room..right now I m comparing the value from Shared-pref and set activity and other views bg.
 
There's a +500 bounty on this question... ._.
0
Q: WebApplicationContext not being shut down on Servlet Context reload

Marko TopolnikWhen I redeploy my Spring-based WAR on Tomcat (by copying the new WAR to webapps), the existing WebApplicationContext doesn't seem to shut down properly. I see these lines in the log: org.apache.catalina.startup.HostConfig reload INFO: Reloading context [] org.apache.catalina.core.StandardContex...

 
4:41 PM
Seems ajax word has been used after my ping. But I don't know if someone has time and could help me
 
 
3 hours later…
7:27 PM
Just finished my first Google Docs scripting job. Python, Django, Java, and Google scripting, all in one day. :)
And I'm still working through Maven nonsense with sonatype support.
About to start codingbat for Python.
 

« first day (1369 days earlier)      last day (3572 days later) »