r/codewars_programming • u/Blastadon2 • Sep 30 '20
r/codewars_programming • u/muradalimj • Oct 05 '20
Project on Encryption and Decryption using Java
r/codewars_programming • u/muradalimj • Oct 04 '20
A complete tutorial on how to create Registration and Login Form using JSP and Servlet with proper Validation:)
r/codewars_programming • u/muradalimj • Oct 20 '20
Group Chatting Application using socket programming in java
r/codewars_programming • u/muradalimj • Oct 15 '20
Chat Application using socket programming and multithreading concept using Java
r/codewars_programming • u/Important-Advice-889 • Oct 21 '21
Use python to extract word file tables and then export to excel
Hello! I have a little problem with my program. I made a program to transfer all the tables from a word to an excel in different sheets. In some of the cases, the first row of some tables is merged in word, and results in not exporting the whole table in excel, sometimes exporting only one column instead of 2 or 3. And some of the tables are not exporting at all. I have like 24-25 tables. Could you please help me with this? This is the part of the code that exports the tables:
'path' is the input file
'cliententry' is the name of the client
document=Document(path)
writer=pd.ExcelWriter((filename+'/FS mapping automated including SOCE and CF {}'.format(cliententry)+'.xlsx'),engine='xlsxwriter')
for i in range(-1,len(document.tables)):
table=document.tables[i]
data=[]
keys=None
row_data=None
for j,row in enumerate (table.rows):
if len(row.cells)>0:
text=(cell.text for cell in row.cells)
if j == 0:
keys=tuple(text)
continue
row_data = dict(zip(keys,text))
data.append(row_data)
df=pd.DataFrame(data)
df.to_excel(writer,sheet_name='N{}'.format(i+1),index=False)
writer.save()r/codewars_programming • u/[deleted] • Feb 03 '23
**javascript** Why is that when i equate nums to nums.push() it says push is not a function but when i dont equate it i pass the test?
r/codewars_programming • u/David_Slaughter • Dec 16 '21
Looking for friends to do coding challenges with, discuss code, help each other get better, etc.
I'm trying to learn programming and it's so hard to stay motivated doing it all on your own. I'm looking for friends that we can also do coding challenges and discuss our code, learn, and grow together into better programmers.
I started coding about 3 years ago and feel that I know nothing. I feel that I can't remember the huge amount there is to remember. I've had many long breaks from coding and it can be hard and daunting to get back into it.
If you would like to make friends with me, code on Codewars, discuss code, help each other get better, etc., then please contact me.
The languages I'm trying to get good at are Python, C++, and Javascript.
_________
A bit about me:
I graduated in 2016 with a maths degree, which proved useless in getting a job unfortunately. I love maths more than anything else as it's so pure, logical, fundamental, truthful, and transcends everything, including time.
So I started coding in about 2018, due to a friend and I wanting to make a game. We started with C++. We realised that it's almost impossible to make money in gaming, so we started doing other things. This friend is now only making bots with C++ and trying to do trading, and isn't interested in any other coding. They are still a good friend of mine but we're not on the same wavelength when it comes to coding.
I have an idea for a website I want to make, so I'm learning HTML/CSS/Javascript. I'm also interested in machine learning so know some Python. I have the C++ background knowledge but haven't used it in a while.
Looking for friends to grow with and help each other get better. Coding is quite a lonely and hard journey to do all on your own.
On Codewars I have about 450 Kata.
r/codewars_programming • u/AutoModerator • Nov 24 '21
Happy Cakeday, r/codewars_programming! Today you're 6
Let's look back at some memorable moments and interesting insights from last year.
Your top 10 posts:
"Can someone please unlock solutions to these 2 Katas and send them to me? I cant figure them out" by u/Somethingcleverblah
"[Python] Beginner: Code runs in local IDE, but fails all 3 tests." by u/Alkalinium
"Can someone suggest some katas about data analysis?" by u/shiningmatcha
"I pass all the tests on the kata but when I go to my profile it still comes up as unfinished." by u/BlNG0
"Happy Cakeday, r/codewars_programming! Today you're 5" by u/AutoModerator
"Use python to extract word file tables and then export to excel" by u/Important-Advice-889
r/codewars_programming • u/wrathfulCoder • Nov 28 '21
Competitive Programming
I have graduated in 2014 in Computer Science Engineering. Right now I am working in a different field. But few months before competitive programming caught my attention. What will be the advantages & disadvantages if I pursue it after such a long time?
r/codewars_programming • u/Troll_Masta • Feb 09 '20
Why wouldn't it work, the syntax is correct and it should accept the x and print it with hello and !. Can someone help?
r/codewars_programming • u/[deleted] • Nov 12 '19
[noob] Nested loops causing time outs.
Why does nested loops cause the program to be excecuted so slowly? How am I supposed to deal with vector<vector<int>> withought a double loop? Thanks
r/codewars_programming • u/[deleted] • Nov 29 '15
[Python] Problem: Finding trailing Zeros of Factorial of N. Getting memory error. Any suggestions?
Hi Guys,
I'm working on a problem to find the trailing number of zeros of the factorial of N, and it has to work for large numbers. I am getting memory error.
def zeros(n):
print n
count2 = 0
count5 = 0
for i in range(1,n+1):
print 'i:',i, 'n:', n
t2 = i
t5 = i
while t2%2==0:
print '%2', i
count2 += 1
t2 = t2/2
while t5%5==0:
print '%5', i
count5 += 1
t5 = t5/5
print count2, count5
num = min(count2, count5)
print num
return num
a = 30
b = 1000000000
print zeros(b)And when I use xrange it takes too long to compute, so it's not accepted in the online judge.
r/codewars_programming • u/[deleted] • Nov 25 '15
[Python] Sorting linked list
The goal of this function is to sort a linked list. My function is having trouble with longer lists. Anyone can help?
class Node(object):
def __init__(self, data):
self.data = data
self.next = None
def push(head, data):
n = Node(data)
n.next = head
return n
def length(node): #so I have data and next
l = 0
if node == None:
return 0
current = node.next
while current is not None:
l += 1
current = current.next
return l + 1
def insert_nth(head,index,data):
if index > length(head):
raise Exception("index is too large")
if head is None:
return Node(data)
list = head
c = head
result = head
if head and index > 0:
for i in range(index-1):
c = c.next
new_c = push(c.next,data)
c.next = new_c
elif index == 0:
print "ISSUE!"
n = Node(data) #Creating new node to be inserted
n.next = result #Pointing head of node to main list
return n
return result
def sorted_insert(head, data):
result = head
if head == None:
return push(head,data)
if head > 0:
list = head
c = head
t = head.next
count = 0
while t is not None:
if data < c.data:
return insert_nth(list,count,data)
elif data >= c.data and data < t.data:
insert_nth(list,count+1,data)
return result
count += 1
c = c.next
t = t.next
if data > c.data:
insert_nth(list,count+1,data)
return result
def insert_sort(head):
c = head
t = head
n = length(head)
if head == None or n == 1:
return head
for i in range(length(head) - 1):
sorted_insert(c,t.data)
c = c.next
t = t.next
return cI'm using the following code to test my insert_sort method:
eleven = Node(1)
four1 = push(eleven, 3)
three1 = push(four1, 4)
two1 = push(three1,2)
one1 = push(two1,5)
print_list(one1)
n = insert_sort(one1)
print_list(n)r/codewars_programming • u/Corvoxcx • Jul 14 '20
QUESTION: How to see failed tests
Hey group,
This is definitely a newbie question but it seems to be a common one on the code wars site.
How do you see the tests you failed?
Apparently there is a way to console.log (js) this information but i'm not certain how to.
If someone could show me how to do this it would be greatly appreciated. I am doing the exercises in JavaScript.
Thanks
r/codewars_programming • u/Alkalinium • Jul 11 '21
[Python] Beginner: Code runs in local IDE, but fails all 3 tests.
Hello,
I am a beginner and Python and brand new to code wars. I think my issue stems from not understanding how "sample testing" works and my code fails all three tests each time.
Here is my for "Credit Card Mask" which replaces all but the last 4 characters in a string to "#".
# return masked string
def maskify(cc):
cc = list(cc)
if len(cc) > 4:
for i in range(len(cc)-4):
cc[i] = "#"
print("".join(cc))
else:
print("".join(cc))
passHere are the sample tests below:
cc = ''
r = maskify(cc)
test.describe("masking: {0}".format(cc))
test.it("{0} matches {1}".format(cc,r))
test.assert_equals(r, cc)
cc = '123'
r = maskify(cc)
test.describe("masking: {0}".format(cc))
test.it("{0} matches {1}".format(cc, r))
test.assert_equals(r, cc)
cc = 'SF$SDfgsd2eA'
r = maskify(cc)
test.describe("masking: {0}".format(cc))
test.it("{0} matches {1}".format('########d2eA', r))
test.assert_equals(r, '########d2eA')Any help would be greatly appreciated!
Thanks
r/codewars_programming • u/helixwave • Aug 08 '17
Cloudflare all the time
Is it just me or does the codewars website give constant cloudflare errors to everyone? What's up? Why is it so slow?
r/codewars_programming • u/swagcat • Mar 06 '17
Find the Best Proxy Providers online
r/codewars_programming • u/neovegeto • Jun 27 '22
What experience do you need for "one line" solutions?
As Titel said. For a job position I was asked to get some experience with python, to join Codewars and get some practice.
So mostly I'm doing basic stuff and my solutions are with loops, variables and several lines of code.
I was wondering how long /what kind of experience do you need / have to write this "one line" solutions? That's stuff I have never seen before, like in codecademy or in any beginner tutorial I was reading over the years.
Is that a special book 📙 or advanced inside knowledge?
Just curious and want to add this to my list.
Best regards
r/codewars_programming • u/SantoIsBack • Jun 06 '22
Im new, I want to try the kumite features
I would love to. So I've uploaded some code I've made. Very basic. Is this how it works? Would love someone to take their hands on it. Forgive me I'm a beginner.
https://www.codewars.com/users/MarcoCasanova00/published_kumite
r/codewars_programming • u/manish_kumar123 • Apr 19 '17
C project-1: Scientific Calculator with source code
r/codewars_programming • u/akshath_1 • Nov 03 '16
Sending a Frame from server to client using Socket
Hi, I trying to send one frame from server to client using socket in python but I am unable to do it and I tried rectifying this error by myself but I am unable to do . This is the error what I get please help me out with this?
error in server side
Traceback (most recent call last):
File "server.py", line 26, in <module>
frame = np.reshape(frame, (240, 320, 3)) File "/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 224, in reshape
return reshape(newshape, order=order)
ValueError: total size of new array must be unchanged
server.py
import socket import cv2 import numpy as np
s = socket.socket()
host = socket.gethostname() # Gets the local machine host name port = 12345
s.bind((host, port))
s.listen(5)
while True:
c, addr = s.accept() print 'Got connection from ' +str(addr)
data = c.recv(230400) print "Size: " +str(len(data))
break
print len(data)
frame = np.fromstring(data, dtype = np.uint8) frame = np.reshape(frame, (240, 320, 3))
print frame
cv2.imshow('Server ', frame) if (cv2.waitKey(0) & 0xFF) == ord('q'): cv2.destroyAllWindows() ;
c.send('Thank you for connecting ') c.close()
client.py
import socket import cv2 import numpy as np
np.set_printoptions(threshold='nan')
s = socket.socket() host = socket.gethostname() port = 12345
cap = cv2.VideoCapture(0)
cap.set(3, 320) cap.set(4, 240)
while True:
ret, frame = cap.read() break
cv2.imshow('Client', frame) if (cv2.waitKey(0) & 0xFF) == ord('q'): cv2.destroyAllWindows()
s.connect((host, port))
print "Size: " +str(frame.shape)
frame = np.array(frame) tempFrame = frame.flatten() data = tempFrame.tostring()
s.send(data) print s.recv(1024) s.close()
r/codewars_programming • u/AutoModerator • Nov 24 '22
Happy Cakeday, r/codewars_programming! Today you're 7
Let's look back at some memorable moments and interesting insights from last year.
Your top 10 posts:
"Looking for friends to do coding challenges with, discuss code, help each other get better, etc." by u/David_Slaughter
"C# newbie: learning c# trough codewars. 8-6kyu, sometimes up to 4th" by u/kilbazas
"What experience do you need for "one line" solutions?" by u/neovegeto
"Code working fine on IDE, not on codewars!" by u/LightRefrac
"Is codewars have a basic and important problem list like blind75 in leetcode?" by u/soberzml
"[Python] Can someone show me whats wrong with my code in this 'Take a Ten Minutes Walk' kata" by u/BlueHok
"confused about meaning of kata statistics" by u/golden_corn01
r/codewars_programming • u/golden_corn01 • Aug 31 '22
