Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Urthor
Jul 28, 2014

leper khan posted:

The Russians just used java

Unfortunately the Russian's code was used by another project, that was used by another project, which was used by another project, and one of the middle projects used node.js :(

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Urthor posted:

Unfortunately the Russian's code was used by another project, that was used by another project, which was used by another project, and one of the middle projects used node.js :(

Also, the Java code actually caused a shitload of brief service interruptions due to poor garbage collection in a runtime. This is because that JRE couldn't be updated past 1.1 because of reliance on specific bugs in that specific JRE and the use of internal values the JRE should have, but didn't, prohibit access to. Everyone is afraid to touch the house of cards because it appears to rely on a compiler bug of some kind as well.

NASA was able to reuse a FOSS project that was made with their needs as a possibility but not a specific requirement, so they not only received the code for effectively free, they got updates.

Buck Turgidson
Feb 6, 2011

𓀬𓀠𓀟𓀡𓀢𓀣𓀤𓀥𓀞𓀬
two questions:

anyone know any good common lisp books? if it helps to narrow it down i am already decently familiar with scheme. don't mind if it doesn't have a professional/serious focus, just asking out of interest.

to what extent do front-end web developers reuse code between projects? i was talking to one of my friends about this and it sounded like they basically end up doing things from the ground up for each project, even though many projects had a large number of shared, sometimes almost identical requirements. is this normal? if it's not obvious I know jack poo poo about web development, or js for that matter, so I don't know how feasible code reuse is.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Buck Turgidson posted:

two questions:

anyone know any good common lisp books? if it helps to narrow it down i am already decently familiar with scheme. don't mind if it doesn't have a professional/serious focus, just asking out of interest.

to what extent do front-end web developers reuse code between projects? i was talking to one of my friends about this and it sounded like they basically end up doing things from the ground up for each project, even though many projects had a large number of shared, sometimes almost identical requirements. is this normal? if it's not obvious I know jack poo poo about web development, or js for that matter, so I don't know how feasible code reuse is.

the frameworks and tools change so quickly that most of the time all that copy and pasting the old code will get you is a bunch of whining in code reviews about trivialities like let vs. var, or the code might not even be relevant due to the nature of the framework. most of the time the stuff you'd copy between projects is probably in an npm package somewhere anyway.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I would guess that all the frameworks and libraries are people trying to reuse their code on their next project, but I know better.

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'
My experience has been that projects that look like they share functionality are quite often subtly different enough that it's easier to start from a clean slate rather than trying to work around an increasingly frankensteined local framework. The reusable stuff is more like institutional knowledge.

But also "ground up" probably means something like "let create-react-app build a new project for you", which is like 90% of all the stuff that you would reuse

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Does anybody use Gitlab? Have they had any success getting a merge request from a fork to run on the parent project's pipeline. Their documentation claims it can but the Run Pipeline button isn't available in that tab for me.

This makes it looks like I should be able to do it:
https://docs.gitlab.com/ee/ci/pipel...-forked-project

Our own IT is just a bunch of contracted 1st level support that doesn't actually know the tool and just rehash that pipelines can only be run under the CI/CD menu. This even as they literally read that documentation. They see the first half and ignore the second half. I'm getting pretty pissed off over it.

necrotic
Aug 2, 2005
I owe my brother big time for this!
Do you have the Developer role on the parent repo?

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

necrotic posted:

Do you have the Developer role on the parent repo?

The Owner role.

Gin_Rummy
Aug 4, 2007
Anyone in here good with ML? I'm trying to filter out email spam with a Naive Bayesian model, but I am getting ValueErrors between my training/test sets and the actual data I want to apply the model to.

code:
#import training data
df = pd.read_csv('emails.csv')

#check for duplicates and remove
df.drop_duplicates(inplace = True)

#download stop words package
nltk.download('stopwords')

def process_text(text):
    #remove punctuation, stop words, return list of clean text words
    nopunc = [char for char in text if char not in string.punctuation]
    nopunc = ''.join(nopunc)
    clean_words = [word for word in nopunc.split() if word.lower() not in stopwords.words('english')]
    return clean_words

#convert database to a matrix of tokens
from sklearn.feature_extraction.text import CountVectorizer
message_bow = CountVectorizer(analyzer = process_text).fit_transform(df['text'].fillna(' '))

#split data into training and testing sets
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(message_bow, df['spam'].fillna(' '), test_size = 0.20, random_state = 0)

#create and train naive bayes classifier
from sklearn.naive_bayes import MultinomialNB
classifier = MultinomialNB().fit(X_train, y_train)
pred = classifier.predict(X_train)
pred = classifier.predict(X_test)

df_2 = pd.read_csv('Contact_Us_2.csv')
from sklearn.feature_extraction.text import CountVectorizer
df2_contents = CountVectorizer(analyzer = process_text).fit_transform(df_2['Message'].fillna(' '))
final_pred = classifier.predict(df2_contents)
This is my code which spits out the following errors.

code:
Traceback (most recent call last):
  File "c:\......\forms_ml_spam.py", line 91, in <module>
    final_pred = classifier.predict(df2_contents)
  File "C:\.........\Python\Python39\lib\site-packages\sklearn\naive_bayes.py", line 82, in predict
    X = self._check_X(X)
  File "C:\............\Python\Python39\lib\site-packages\sklearn\naive_bayes.py", line 519, in _check_X
    return self._validate_data(X, accept_sparse="csr", reset=False)
  File "C:\............\Python\Python39\lib\site-packages\sklearn\base.py", line 580, in _validate_data
    self._check_n_features(X, reset=reset)
  File "C:\.........\Python\Python39\lib\site-packages\sklearn\base.py", line 395, in _check_n_features
    raise ValueError(
ValueError: X has 249 features, but MultinomialNB is expecting 1211 features as input.
Not really sure where to begin troubleshooting this tbh.

Macichne Leainig
Jul 26, 2012

by VG
What is the shape of X_train versus df2_contents? I suspect you might find that X_train is something along the lines of (N, 1211) and df2_contents is (N, 249) where N is the number of samples for each dataset.

I'm more of a CV ML person and not NLP, but my gut feeling is that there might be some funky usage of CountVectorizer going on. (I inform you that I don't know much about NLP to basically say don't trust my gut.)

Maybe use CountVectorizer in a pipeline kind of like in this sklearn example? https://scikit-learn.org/stable/aut...e-extraction-py

CarForumPoster
Jun 26, 2013

⚡POWER⚡

Gin_Rummy posted:

Anyone in here good with ML? I'm trying to filter out email spam with a Naive Bayesian model, but I am getting ValueErrors between my training/test sets and the actual data I want to apply the model to.

code:
#import training data
df = pd.read_csv('emails.csv')

#check for duplicates and remove
df.drop_duplicates(inplace = True)

#download stop words package
nltk.download('stopwords')

def process_text(text):
    #remove punctuation, stop words, return list of clean text words
    nopunc = [char for char in text if char not in string.punctuation]
    nopunc = ''.join(nopunc)
    clean_words = [word for word in nopunc.split() if word.lower() not in stopwords.words('english')]
    return clean_words

#convert database to a matrix of tokens
from sklearn.feature_extraction.text import CountVectorizer
message_bow = CountVectorizer(analyzer = process_text).fit_transform(df['text'].fillna(' '))

#split data into training and testing sets
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(message_bow, df['spam'].fillna(' '), test_size = 0.20, random_state = 0)

#create and train naive bayes classifier
from sklearn.naive_bayes import MultinomialNB
classifier = MultinomialNB().fit(X_train, y_train)
pred = classifier.predict(X_train)
pred = classifier.predict(X_test)

df_2 = pd.read_csv('Contact_Us_2.csv')
from sklearn.feature_extraction.text import CountVectorizer
df2_contents = CountVectorizer(analyzer = process_text).fit_transform(df_2['Message'].fillna(' '))
final_pred = classifier.predict(df2_contents)
This is my code which spits out the following errors.

code:
Traceback (most recent call last):
  File "c:\......\forms_ml_spam.py", line 91, in <module>
    final_pred = classifier.predict(df2_contents)
  File "C:\.........\Python\Python39\lib\site-packages\sklearn\naive_bayes.py", line 82, in predict
    X = self._check_X(X)
  File "C:\............\Python\Python39\lib\site-packages\sklearn\naive_bayes.py", line 519, in _check_X
    return self._validate_data(X, accept_sparse="csr", reset=False)
  File "C:\............\Python\Python39\lib\site-packages\sklearn\base.py", line 580, in _validate_data
    self._check_n_features(X, reset=reset)
  File "C:\.........\Python\Python39\lib\site-packages\sklearn\base.py", line 395, in _check_n_features
    raise ValueError(
ValueError: X has 249 features, but MultinomialNB is expecting 1211 features as input.
Not really sure where to begin troubleshooting this tbh.

Without reading the code or thinking about it, if youre tokenizing by word are you asking it to make preds on words it wasn't trained on?

Gin_Rummy
Aug 4, 2007
Highly probable, though I can't say for sure. The training set was massive... thousands and thousands of emails.

defmacro
Sep 27, 2005
cacio e ping pong

Gin_Rummy posted:

Highly probable, though I can't say for sure. The training set was massive... thousands and thousands of emails.

That looks like the issue to me. You're making a separate CountVectorizer for the second dataset, so it's vectorizing things differently. Use
code:
message_bow.transform(df_2...
instead.

Gin_Rummy
Aug 4, 2007

defmacro posted:

That looks like the issue to me. You're making a separate CountVectorizer for the second dataset, so it's vectorizing things differently. Use
code:
message_bow.transform(df_2...
instead.

Is "transform" the proper library call? Different variations of message_bow.transform, fit, and fit_transform have given me a new type of value error. If I am no longer using "CountVectorizer" would I still be able to call my analyzer, which was meant to parse my input text?

code:
ValueError: Unknown label type: (array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ' ', 0.0], dtype=object),)

Protocol7 posted:

What is the shape of X_train versus df2_contents? I suspect you might find that X_train is something along the lines of (N, 1211) and df2_contents is (N, 249) where N is the number of samples for each dataset.

I'm more of a CV ML person and not NLP, but my gut feeling is that there might be some funky usage of CountVectorizer going on. (I inform you that I don't know much about NLP to basically say don't trust my gut.)

Maybe use CountVectorizer in a pipeline kind of like in this sklearn example? https://scikit-learn.org/stable/aut...e-extraction-py

X_train and df2_contents both print in the following format:

code:
(X, YY)    Z

Example:
(0, 1071)     3
(0, 1044)     6
(0, 1141)     9
(0, 1039)     1
(0, 1209)     2

Gin_Rummy fucked around with this message at 23:47 on Nov 3, 2021

CarForumPoster
Jun 26, 2013

⚡POWER⚡

Gin_Rummy posted:

Highly probable, though I can't say for sure. The training set was massive... thousands and thousands of emails.

Yea you need to add a step where you make sure all of your real world words exist in your model. Handle the ones you dont however you want, (e.g. display them, drop them, etc.)

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Do feature selection on your words and you'll stop having this problem. You might also get better results.

defmacro
Sep 27, 2005
cacio e ping pong

Gin_Rummy posted:

Is "transform" the proper library call? Different variations of message_bow.transform, fit, and fit_transform have given me a new type of value error. If I am no longer using "CountVectorizer" would I still be able to call my analyzer, which was meant to parse my input text?

<snip>

Ah sorry, I remembered the syntax incorrectly. You'll want to do something like this:

code:
vectorizer = CountVectorizer(analyzer = process_text)
message_bow = vectorizer.fit_transform(df['text'].fillna(' '))
...
df2 = vectorizer.fit(df_2['Message'].fillna(' '))
...
The vectorizer object will still have the appropriate analyzer for subsequent calls.

The three methods of a vectorizer do the following things:
* fit fits the words to the vectorizer and updates it's internal state
* transform, given an existing fitted vectorizer, returns the transformed vectors
* fit_transform does both

A contrived example:

code:
>>> import sklearn
>>> from sklearn.feature_extraction.text import CountVectorizer
>>> vectorizer = CountVectorizer()
>>> df = vectorizer.fit_transform("wu tang clan ain't nothing to gently caress with".split())
>>> df.todense()
matrix([[0, 0, 0, 0, 0, 0, 0, 1],
        [0, 0, 0, 0, 1, 0, 0, 0],
        [0, 1, 0, 0, 0, 0, 0, 0],
        [1, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 1, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 1, 0, 0],
        [0, 0, 1, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 1, 0]])
>>> df2 = vectorizer.transform("well here are some words you can gently caress with".split())
>>> df2.todense()
matrix([[0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 1, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 1, 0]])
>>> df.shape
(8, 8)
>>> df2.shape
(9, 8)
Note the last two rows in both dataframes are the same, because it was the same word. Also note the all zero vectors in df2, showing the vectorizer doesn't know the words. Importantly, the shapes are right. Each dataframe has 8 column features corresponding to the 8 words known by the vectorizer when it was fit. It's important that the inputs to the vectorizer are the same shape like in the example above both are a list of individual words. Or in your example, likely a list of messages you want to classify as spam vs. ham.

defmacro fucked around with this message at 14:42 on Nov 4, 2021

fritz
Jul 26, 2003

Postgres admin trouble: I had a database running in a container. The data lived in persistent storage, but the configs apparently did not.

I'm in a new container, and can see all the data files, but can't figure out how to restart the cluster / reload the db.

necrotic
Aug 2, 2005
I owe my brother big time for this!
Just put that volume at the data folder and it should start up as normal, assuming you have your new configs ready. Is it failing to start with some error?

fritz
Jul 26, 2003

necrotic posted:

Just put that volume at the data folder and it should start up as normal, assuming you have your new configs ready. Is it failing to start with some error?

I was trying to use pg_createcluster -D /opt/scratch 10 scratch. That said I didn't have postgresql.conf, so I made a blank one and tried again. That said I didn't have pg_hba.conf, so I copied one I had sitting around (and re-made the blank one which got deleted???), repeat with pg_ident.conf, and then it says 'Error: cluster configuration already exists'.

I don't know what all config files I need to have, or if I should be using something other than pg_createcluster.

I'm installing postgres using apt-get install postgresql postgresql-contrib and working as the postgres user.

EDIT: Started a new container, installed postgres, started db with /etc/init.d/postgresql start (the apt-get message said to use pg_ctl which didn't seem to want to work?), and after that I was able to do the same dance and get it going.

fritz fucked around with this message at 18:32 on Nov 4, 2021

Guildenstern Mother
Mar 31, 2010

Why walk when you can ride?
Can anyone give me any hints (no flat out answers please) as to why this is running so slow? I'm passing most of my tests except it times out on hackerrank when given large sets of data. I'm taking in a string array and testing to see if the strings within the query params (query entries look like "31-50") start and end with vowels.

code:
public static List<Integer> hasVowels(List<String> strArr, List<String> query) {
      List<Character> vowels = new ArrayList<>();
            vowels.add('a');
            vowels.add('e');
            vowels.add('i');
            vowels.add('o');
            vowels.add('u');
            int counter = 0;
            String one = "";
            String two = "";
            List<Integer> matches = new ArrayList<>();
          
            for(int i = 0; i < query.size(); i++){
                
                String toSplit = query.get(i);
                String []splitArr = toSplit.split("-");
                
                 one = splitArr[0];
                 two = splitArr[1];
                int x = Integer.parseInt(one) -1;
                
                int y = Integer.parseInt(two);
                
                List<String> toCheck = strArr.subList(x, y);
                
                    for (int j =0; j < toCheck.size(); j++){
                        String check = toCheck.get(j);
                        if(vowels.contains(check.charAt(0)) && vowels.contains(check.charAt(check.length()-1))){
                            counter++;
                                
                    }
                    }matches.add(counter);
                    counter = 0;
            }
            
            
            return matches;
    
    }

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Frequently, when a programming puzzle involves multiple questions over the same data set, and you know all the questions up-front, the trick to making it fast is to re-use work between questions instead of solving it from scratch each time.

Gin_Rummy
Aug 4, 2007
Just reporting back to thank you all for the ML guidance. I was able to sort through most of the problems and get it working! Now I have to ask if anyone can recommend a good way to "call" my trained model in another script/instance?

I am thinking if I pickle my classifier and the vectorizer (and probably the bag of words too?), I can call each of the files in another script... however I don't seem to be able to pickle the analyzer (my process_text function) with my vectorizer, which makes it DOA in any new script.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Predictive model markup language

defmacro
Sep 27, 2005
cacio e ping pong

Gin_Rummy posted:

Just reporting back to thank you all for the ML guidance. I was able to sort through most of the problems and get it working! Now I have to ask if anyone can recommend a good way to "call" my trained model in another script/instance?

I am thinking if I pickle my classifier and the vectorizer (and probably the bag of words too?), I can call each of the files in another script... however I don't seem to be able to pickle the analyzer (my process_text function) with my vectorizer, which makes it DOA in any new script.

An error would help! I googled and found this saying you might just need to import it, but it's from a decade ago so who knows.

GreenBuckanneer
Sep 15, 2007

I guess a general question I have is this:

I feel like I should pick a language to learn, not really for pleasure, but for work. Work doesn’t really have a specific thing for me to learn, and I don’t really know what I want to learn here.

(ideally speaking I want to get out of helldesk, not out of lack of interest in computer/tech, but l don’t want to work with bottom feeder computer users anymore. If wishes were fishes I would want to try doing game development, as probably over-saturated as that is, but that’s not even remotely the same as the work I do now.)

That being the case, what should I learn? I used to take classes on HTML/Javascript/Java/C (basic)/CSS ages ago when I was in school, but nothing really since then. I do like messing around with JQL at work for the filters and dashboards, since we use JIRA for customer facing tickets :barf: but their position wants stuff like, LEAN and development on a large scale (out of my element)

I was thinking maybe Python would be useful here, but IDK really and wanted some suggestions or a “do this” directive

edit: I forgot I also tried learning VB in high school, and VB.net back then too. Never been especially good with math, but I did end up getting a C in Calculus 2 in college... (I found pre-calc and Calc 1 way harder. It made much more sense for inverse equations than regular ones...)

GreenBuckanneer fucked around with this message at 05:22 on Nov 11, 2021

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

GreenBuckanneer posted:

I guess a general question I have is this:

I feel like I should pick a language to learn, not really for pleasure, but for work. Work doesn’t really have a specific thing for me to learn, and I don’t really know what I want to learn here.

(ideally speaking I want to get out of helldesk, not out of lack of interest in computer/tech, but l don’t want to work with bottom feeder computer users anymore. If wishes were fishes I would want to try doing game development, as probably over-saturated as that is, but that’s not even remotely the same as the work I do now.)

That being the case, what should I learn? I used to take classes on HTML/Javascript/Java/C (basic)/CSS ages ago when I was in school, but nothing really since then. I do like messing around with JQL at work for the filters and dashboards, since we use JIRA for customer facing tickets :barf: but their position wants stuff like, LEAN and development on a large scale (out of my element)

I was thinking maybe Python would be useful here, but IDK really and wanted some suggestions or a “do this” directive

A significant portion of the games industry uses Unity. Though there may be less overlap with the portion of the industry you dream about working in. Experience with C# will get you pretty far there, and there are almost infinite openings working on enterprise C# Microsoft stack stuff.

If your only goal is employability as an engineer, it's hard to go wrong with C#. JavaScript also, but then you'd have to work with JavaScript developers.


Python might be an easier transition if you're already janitoring shell scripts.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Take a look at the newbie programming thread. There are a lot of people who are a few months ahead of you there, and some who might be looking to hire them as well.

Toast Museum
Dec 3, 2005

30% Iron Chef

GreenBuckanneer posted:

I guess a general question I have is this:

I feel like I should pick a language to learn, not really for pleasure, but for work. Work doesn’t really have a specific thing for me to learn, and I don’t really know what I want to learn here.

(ideally speaking I want to get out of helldesk, not out of lack of interest in computer/tech, but l don’t want to work with bottom feeder computer users anymore. If wishes were fishes I would want to try doing game development, as probably over-saturated as that is, but that’s not even remotely the same as the work I do now.)

That being the case, what should I learn? I used to take classes on HTML/Javascript/Java/C (basic)/CSS ages ago when I was in school, but nothing really since then. I do like messing around with JQL at work for the filters and dashboards, since we use JIRA for customer facing tickets :barf: but their position wants stuff like, LEAN and development on a large scale (out of my element)

I was thinking maybe Python would be useful here, but IDK really and wanted some suggestions or a “do this” directive

If you're in a support role in a Windows ecosystem, PowerShell. You'll start finding real-world uses for it almost immediately, which makes it a lot easier to learn and retain. And since it's built on .NET, it's a good prelude to learning C#. That may not be the most direct route to game development, but it might lead from helpdesk to a more interesting DevOps position.

CarForumPoster
Jun 26, 2013

⚡POWER⚡

GreenBuckanneer posted:

I guess a general question I have is this:

I feel like I should pick a language to learn, not really for pleasure, but for work. Work doesn’t really have a specific thing for me to learn, and I don’t really know what I want to learn here.

(ideally speaking I want to get out of helldesk, not out of lack of interest in computer/tech, but l don’t want to work with bottom feeder computer users anymore. If wishes were fishes I would want to try doing game development, as probably over-saturated as that is, but that’s not even remotely the same as the work I do now.)

That being the case, what should I learn? I used to take classes on HTML/Javascript/Java/C (basic)/CSS ages ago when I was in school, but nothing really since then. I do like messing around with JQL at work for the filters and dashboards, since we use JIRA for customer facing tickets :barf: but their position wants stuff like, LEAN and development on a large scale (out of my element)

I was thinking maybe Python would be useful here, but IDK really and wanted some suggestions or a “do this” directive

Python.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Toast Museum posted:

If you're in a support role in a Windows ecosystem, PowerShell. You'll start finding real-world uses for it almost immediately, which makes it a lot easier to learn and retain. And since it's built on .NET, it's a good prelude to learning C#. That may not be the most direct route to game development, but it might lead from helpdesk to a more interesting DevOps position.

Yes this would be the most immediate thing they could do. I have to add a personal counterpoint to this that I find PowerShell's syntax to be the most opposed to the syntax of the languages I'm otherwise using for programming standalone applications right now. I'd also emphasize they they be careful with how they wind up getting into that because they want to become a hirable programmer elsewhere and not just "that guy" at their current company. I'm plagued with that problem right now and that's just from Python programming.

Synonymous
May 24, 2011

That was a nice distraction.
Are there any tips or guides to help make IntelliJ's GUI designer less... dreadful?

I'm trying to use it for a Java project for uni and the weirdness of pasting stuff directly "against" other elements is reminding me of my shitful time with AEM building websites.

It's really hard to manually add any code to format the frames as well. Sizing the window for example

I've had a look for tutorials (especially videos) but everyone seems to want to use Eclipse and build the whole thing manually using null layouts

Sorry if this is a dumb question, I'm extremely new

Synonymous fucked around with this message at 14:25 on Nov 12, 2021

Volguus
Mar 3, 2009

Synonymous posted:

Are there any tips or guides to help make IntelliJ's GUI designer less... dreadful?

I'm trying to use it for a Java project for uni and the weirdness of pasting stuff directly "against" other elements is reminding me of my shitful time with AEM building websites.

It's really hard to manually add any code to format the frames as well. Sizing the window for example

I've had a look for tutorials (especially videos) but everyone seems to want to use Eclipse and build the whole thing manually using null layouts

Sorry if this is a dumb question, I'm extremely new

For Java I would really recommend writing the layouts by hand. They are powerful, easy to grasp and you end up in the end with a more maintainable code than if you would go with a designer. Any designer. Start here: https://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html

There are other layouts that people swear by, but they are not in the standard library (as far as I know): https://www.miglayout.com/ . If you can use whatever library you want, then MiG layout may be even easier than all the others.

1337JiveTurkey
Feb 17, 2005

My big piece of advice for making Swing more sane is use the model interfaces, don't use the default models. Too many people screw up by trying to make a new layer that moves data between the real model and the DefaultWhateverModel when the default models are very limited.

GreenBuckanneer
Sep 15, 2007

Rocko Bonaparte posted:

Yes this would be the most immediate thing they could do. I have to add a personal counterpoint to this that I find PowerShell's syntax to be the most opposed to the syntax of the languages I'm otherwise using for programming standalone applications right now. I'd also emphasize they they be careful with how they wind up getting into that because they want to become a hirable programmer elsewhere and not just "that guy" at their current company. I'm plagued with that problem right now and that's just from Python programming.

Yeah I don't want to be "that guy". I'm already "that guy" who does the helpdesk call stats, though, I wrote up a whole step by step document they can have if they wanted someone else to do it. It's a bunch of excel busy work I don't care for. I could make it nicer with pivot tables but :effort:

Spatial
Nov 15, 2007

Volguus posted:

There are other layouts that people swear by, but they are not in the standard library (as far as I know): https://www.miglayout.com/ . If you can use whatever library you want, then MiG layout may be even easier than all the others.
+1, MigLayout is the gold standard for UI layout.

Literally re-implemented it when I needed to do UI layout in a different language. There's just no comparison.

Gin_Rummy
Aug 4, 2007

defmacro posted:

An error would help! I googled and found this saying you might just need to import it, but it's from a decade ago so who knows.

Figured it out without an import, but thanks!

My model now operates and runs semi-effectively, with a 75% accuracy score. Can anyone recommend the best way to keep refining it from here? Can I add my now-filtered/properly tagged emails to my original dataset and re-run the original script to generate a new weighted algo? Or is there a way to manually adjust my weights in sklearn to directly affect my accuracy?

EDIT: Never mind, I trained it with a different set of data and have achieved 88%, which from a cursory Google search may actually be quite acceptable.

Gin_Rummy fucked around with this message at 00:10 on Nov 15, 2021

Gin_Rummy
Aug 4, 2007
Anyone know of some good resources for building a board game (not like chess, but more like trivial pursuit) in React? The official intro to React tutorial uses tic tac toe, which I have been able to adapt somewhat, but I’ve reached a point where I might need more input to guide my next path of thinking.

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


What specifically are you struggling with?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply