« first day (1457 days earlier)      last day (2554 days later) » 

12:59 AM
-1
Q: Plot markers on google map v2 from database Android Studio

Ryan HigginsI've set up a database which through a textview displays the latitude and longitude of a specific building. there is a go button underneath which loads up my mapsActivity however I can't seem to get the lat and long to be placed on the map. here is my code, any help would be appreciated. Maps A...

 
 
2 hours later…
2:59 AM
Just learned that Windows 10 Technical Preview will stop booting after the expiration date.
My laptop (which hasn't been on, much less updated since early 2016) wouldn't boot, found out that it was because it's the technical preview and it changes the signature of the winload.exe file after expiration.
Had to cheat the BIOS clock to pre-expiration to boot
 
3:48 AM
0
Q: if statements , change form color

KsubyI am running into an issue with this code , every time i click the button on the gui application it automatically turns black no matter if guess is greater or equal to the random number set. It's just evaluating the first statement and nothing else. using System; using System.Collections.Generic...

0
Q: R - how to speed up my code?

fccogI am still waiting for my computer to process with the following code. Since I have 33K files to analyze, I was wondering if any of you could suggest a different way to speed up my code. I would greatly appreciate it! rm(list=ls()) library(bitops) library(RCurl) library(XML) library(stringr) lib...

 
 
1 hour later…
4:58 AM
Monking!
Looks like I missed a star-fest
2
 
5:09 AM
0
Q: Guessing game summary

user137664I created a guessing game where a user tries to guess a number between 1-100. Once the user wins they have the option to play again or quit. I am having trouble with the game summary which is supposed to tell the average number of guesses across all the rounds, the most guesses in any given roun...

 
I think the captions for this TV show is a bot. It printed "ablazive" as a real word.
Probably a neural network, those come up with all sorts of random nonsensical stuff.
I really don’t get what the big deal with artificial intelligence is, I’ve already been faking mine for decades.
 
0
Q: Image downloader for a website v2

Salah EddineThis code takes a website and downloads all .jpg images in the webpage. It supports only websites that have the element and src contains a .jpg link. (Tested here) import random import urllib.request import requests from bs4 import BeautifulSoup def Download_Image_from_Web(url): # var...

 
5:44 AM
0
Q: Pulling Time and Date From Net - C# : Raspberry Pi 2

WerdnaG'day guys, I'm pulling the time and date from the internet because when the user turns the raspberry pi off, it loses it's date and time settings and unfortunately Windows 10 IoT is very slow to correct it.I have tried to use the DateTime method, however i cant seem to work out how to create a ...

 
 
3 hours later…
8:20 AM
@SimonForsberg Just a thought: Does Captain Obvious get notified when questions are deleted or closed? And would it be possible for the chat message here to be marked somehow, so that we see that this question is already deleted or closed?
And if not the message it self could be marked, could Captain Obvious post a reply to his own message?
Shoot, I always mistake Captain Obvious for being a bot, when it's a feed. I also mistook Simon for being the creator, but he created Duga... Anyways, do you know if my thoughts are doable, somehow?
 
9:14 AM
-1
Q: java project - online shopping

Hindi need to write a java program for a grocery .. its like doing online shopping .. i should use case , break , if statements .. but i'm new in java and don't know how to do it ! [![enter image description here][3]][3]

0
Q: Sending a string from anonymous thread to UI with PostMessage?

user1580348I am sending a string from an anonymous thread to the UI with PostMessage in the following code: unit Unit2; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; const WM_SETCA...

 
@CaptainObvious Code not written...
 
@holroy, regarding your comment to one of my answers, I don't see it that way. While I see your point and what you mean by that, I think it's OP's responsibility to try to write its own docstrings. It's a common thing to do, and my choice (as an answerer) to fully do it or let the OP handle it ^_^
 
Kaz
@Phrancis'DROPTABLEUsers-- Thpugh I must admit, auto-caption neural networks are pretty damn impressive these days. Not 100%, but like 80%, which is just incredible.
 
I don't think the answer is ruined just because I explicitly let OP write its own docstrings.
 
9:41 AM
-1
Q: Plain text Sudoku solver in C++ - Runs but non-functional

Nathan PeckSo, I've been asked to make a program that takes in a .txt file made up of 9x9 single digit numbers from 0 - 9, where a 0 denotes an unknown number, and solve it as a Sudoku puzzle. At the moment, the code successfully compiles even though quite obviously some crucial bits and pieces are missing...

 
Monking
 
@holroy Captain Obvious is a RSS feed. It's not capable of anything.
 
0
Q: Caesar chipher in F#

germiI'm trying to broaden my horizon by learning functional programming (coming from OO, specficially C#). For this, I'm implementing some small problems to get a feeling for the language. One of my first is the Caesar cipher. Formal problem statement: Implement a Caesar cipher, both encoding an...

 
 
2 hours later…
11:32 AM
@CaptainObvious Thanks captain. I now "lost" about two hours time to review code in a language I don't know…
5
 
12:05 PM
0
Q: OOP Battleship implementation in Java - part 2

Nilzone-Previous review can be found here I got so many great tips on how to improve, so I've written a new version while trying to implement all the different suggestions. So once again, any insight with regards to clean code, best practices etc. would be greatly appreciated. Board.java package co...

 
 
2 hours later…
1:48 PM
1
Q: Can I avoid `do` in this situation?

Daniel T.The above code works because of the do operator on line 24. Is there a more functional way to get the test to pass, or would you consider this an appropriate use of do? import RxSwift protocol Login { func getCredentials() -> Observable<(email: String, password: String)> func presentAu...

 
2:28 PM
Monking
 
Monking
 
Monking
 
3:19 PM
0
Q: Monty Hall Simulator - Python

NellingtonI'm pretty new to Python (I've been doing it for about 4 months, but not every day) and I've been struggling to get to grips with how to use functions and deploy them efficiently to solve problems. To test my abilities, I created the below program to simulate the Monty Hall problem. The program...

 
@Peilonrayz have 2 minutes ? :)
 
@MrGrj Yeah, sup?
 
suppose you have a list of numbers in py: `[['1', '2', '3'], ['4', '5', '6', '7', '8'], ['1', '2']]` and wach sublist is actually a number. How would you print the sum of these sublists one under another, so that the units will match? Like this:

    123 +
  45678
     12
--------
result here
 
make them all strings, [''.join(w) for w in list], and then you can change them to have the same width, with format, ['{:6>}'.format(w) for w in list], after that, you can add your addition and join them all together
 
@Peilonrayz doing this will return TypeError: non-empty format string passed to object.__format__
 
3:31 PM
@MrGrj huh
The following works fine:
l = [['1', '2', '3'], ['4', '5', '6', '7', '8'], ['1', '2']]
l = ['{:>6}'.format(''.join(w)) for w in l]
l[0] += ' +'
print('\n'.join(l))
 
0
Q: How to lispfy the calculation of lexicographic permutations?

Martin BuchmannJust for fun I studied the generation of lexicographic permutations and came across the following algorithm: (defun lexicographic-permutation% (order n) "Returns the Nth permutation of integers from 0 upto order." (let* ((range (loop :for i :upto order :collect i)) (len (1+ order)) ...

 
@Peilonrayz Yea, got to the same eventually. I was mistyping something. What if the + sign should be placed in front of the second number ?
 
@MrGrj You could build a list of format strings, and have the second as '+ {>4}'.format
 
3:54 PM
@Peilonrayz Have you ever used Tensorflow?
 
@syb0rg Sorry, no, never heard of it, ):
 
@Peilonrayz Never heard of it?! Maybe it's not as prevalent as I thought
@Peilonrayz Now you've heard of it at least ;) tensorflow.org
 
@syb0rg TBF, I've not heard of a lot of things, I use 'pure' Python in my spare time and have to use the Microsoft stack at work, ):
Just wondering @syb0rg, was your comment yesterday asking if there's a better way then you done, or did I change the glob?
 
@Peilonrayz If there's a better way to get it done
 
Hmm, I'll look into it :)
 
4:06 PM
0
Q: PHP MVC load views and model methods

ForDevI'm currently working on a custom PHP MVC. I would like to know if I'm on the right path or if there is a better way to handle it: Here is my core view class. render() is the method in which I render with views and model data on each controller. namespace fordev\app\core; class View { /...

 
4:38 PM
0
Q: Optimize & improving my JS entry file

Robert FyffeI'm looking for some general advice/suggestions on how I can improve or optimize my entry file for loading my JS events. I have something like this currently: /** * Import external dependencies */ import 'jquery'; /** * Import local dependencies */ import gsapEvents from './common/gsapEven...

 
Hmm can I format a formatting thing in Python ?
'{:>6}'.format(''.join(w)) for w in I need that 6 to be {}.format(number)
@Peilonrayz ^
 
@MrGrj {{:>{}}}
 
wuuuuttttt
 
'{{:>{}}}'.format(width).format(data)
 
Oh, I didn't know it supports chain formatting
awesome
^_^
thanks
 
5:09 PM
Ugh ... University assignments are being horrendous ...
> Here watch this collection of incredibly different videos varying in length, nature and topic and write two to three sentences about each video...
Videos range from black&white video from the sixties with 90 minutes length to terrible late 90's, early 2000's advertisements with lengths between 30 seconds and 5 minutes
took almost four hours just for that one subexercise ...
And now I still need three common daily use objects with bad usability...
 
6:05 PM
monking
 
-1
Q: Adjacency List implementation for Graph in Java

aba123I am building up a Graph repository using which i am planing to explore all the Graph algorithms. This is more from a learning perspective only. I have implemented a basic Graph class using Adjacency List and plan to add to this moving further. However would like to get feedback/pointers // No...

 
6:29 PM
0
Q: Max-Heap arraylist based priority queue written in Java

j.jerrod.taylorI have a program that I'm writing that needs to use a priority queue as part of an algorithm. I specifically need to order (String, Integer) pairs for example (Bread, 3), (Beer, 5), (Eggs,2), etc. I'd appreciate any comments on my code style and how I've written my class. import javafx.util.Pai...

 
@MrGrj It does support chain formatting, but it is painful to use due to the amount of braces needed...
 
6:47 PM
@holroy I don't normally recommend chaining it, but in cases like that it's quite nice
 
I've chained it a few times, due to necessity, but it caused be some thinking (no trial and error) to get the braces right.
 
@holroy Yeah, it sure doesn't look nice having stuff like {{{{}:{}{{}}}}}, and that's only like 3 levels deep, ;P
 
Hehe...
 
 
2 hours later…
9:12 PM
0
Q: How to memorize or make java code more effiecent

Don67The following code works, but I was wondering if there a way to memorize or make the code run faster? Note: The following code is designed to compare 2 files to see if there is a sign of plagiarism. //lcsLength() is designed to take in 2 strings which is just a string for each file and has all i...

 
9:32 PM
0
Q: Friend search by user email > returns userID > gets user details

AlexIn the process of learning javascript and react native I've created a friend search feature. I'd have to say the code doesn't seem very performant as I noticed the list doesn't always refresh even though the props are loaded (it would stop loading after n=1), but if I navigate away from the pag...

 
@CaptainObvious This looks like broken code to me...
 
9:58 PM
@CaptainObvious To make it non-broken a lot of code was added. Not sure on how to handle this one...
 
-1
Q: Python Scan Multiple Ports On Multiple Hosts

tyrone 1988I'm new to Python programming, something I'm trying to make is a simple port scanner that checks to see if port 80 and 22 is open on a defined list of hosts. The code is as follows: import socket import time ports = {22,80} hosts = {'192.168.1.190', '192.168.1.106'} s = socket.socket(socket.AF_...

 
10:13 PM
0
Q: Bash script, "flash cards" for Spanish vocabulary

jbrockI use this bash script to review over vocabulary with my dental Spanish class. The script works great for me. However, I am wondering what other ways the same thing could be done. How could it be more efficient? Perhaps the script could me made more readable? Maybe other areas could be made more ...

 
10:27 PM
Hello!
 
Hello @java-devel
 
I'm creating a Learn Morse Java application
0
Q: Morse code translator in Java

java-develI'm writting an application called "Learn Morse" in Java language using Maven tool. Morse code translator is a part of this app. I created encode and decode methods to translate in both sides Morse code and I moved hash map to properties file. I created also helper method to get keys by value. He...

I'm learning Maven, Java and JavaFX
 
@java-devel Looks like a nice question, but you should normally leave it a day or two to bring it to chat, :)
 
-1
Q: Reverse the provided string. Your result must be a string

Margotfunction reverseString(str) { var myAr = str.split(""); newString = myAr.reverse().toString().replace(/,/g,""); return newString; } reverseString("hello");

0
Q: Morse code translator in Java

java-develI'm writing an application called "Learn Morse" in Java using Maven. A Morse code translator is a part of this app. I created encode and decode methods to translate in both sides Morse code and I moved the HashMap to the properties file. I also created a helper method to get keys by value. pl/hu...

0
Q: TypeScript, checking for keys and subkeys and its variants

nottinhillHow to reduce code size? getAlreadySaved(goal: GoalModel): number { if (goal.status && goal.status.investedAmount && !goal.status.pendingIncoming && !goal.status.pendingOutgoing) { return goal.status.investedAmount; } else if (goal.status && goal.status.investedAm...

0
Q: MS SQL Result Comparison

aliI have two tables named Project and ProjectRelations. In Projects table, I hold customerId and Projects' informations where projectId is the PK. And ProjectRelations holds projectId and collaterals that is given for that project. Projects and collaterals have many to many relationship. What I nee...

 
10:45 PM
@java-devel All new questions are automagically brought to the chat, so there is no need to post your question yourself.
 
Ok, I understand
What are you doing?
 
I'm seeing some improvements already
 
@Vogel612 how?
 
0
Q: Does this look okay? I am teaching a beginner level Python course, a hangman implementation:

Josh FrieseI am teaching a Python crash course and thought a hangman rendition would be fruitful. I have an end product that I'll work towards with the hour that I have for the course and I was wondering what could be refactored or implemented to help the exchange of information from myself, intermediate l...

 
@java-devel, Is there any reason why you don't do a simple lookup into some table when encoding from text to morse code?
 
10:57 PM
@holroy Isn't it a lookup into some table: getMorseCode().getOrDefault(
Character.toString(current), " ")?
 
Is it? It seems so messy, somehow...
 
key is char and value is morse code
 
In python this would be something like morse_code[character]... Not a chain of four method calls, and in addition the getMorseCode is quite a few lines... This just doesn't seem to be the simplest way to get this value...
 
getMorseCode() method returns HashMap created basing on properties file (converts properties to HashMap)
 
And this is recreated for each and every character you want to convert?
 
11:02 PM
Yes
 
How do you call it?
 
Is it a faulty for performance?
getMorseCode().getOrDefault(Character.toString(current), " ") - first we create Morse code table, next if character stored in current variable exists in table return it, else return " ". We need also convert char to String.
 
@java-devel I would say so, yes...
@java-devel Not that part, how do you instantiate the Encoder and how do you do the initial call to convert a text.
 
for eg. System.out.println(new Encoder().encoder("abc")); or Encoder encoder = new Encoder(); System.out.println(encoder.encode("abc")); System.out.println(encoder.encode("def"));
 
OK... That's the thingie I was looking for...
 
11:42 PM
Guys
I start work tomorrow
Oh no
D:
 
0
Q: C# Boyer-Moore Byte Array Search

JohnI found this snippet online and modified it by adding a start parameter, just wanted to make sure that I did it right. public static int find(byte[] haystack, byte[] needle, int start) { int[] lookup = new int[256]; for (int index = 0; index < lookup.Length; index++) ...

 

« first day (1457 days earlier)      last day (2554 days later) »