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
ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Thermopyle posted:

I never know where to point people who are already programmers who want to learn C to understand computers better. I "learned" C from various blog posts and tutorials and that wasn't great.

So what should such a person read?

Look at the book I linked above.

Adbot
ADBOT LOVES YOU

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer

rjmccall posted:

It’s like Song of the South, there are lots of things to appreciate but it needs to be watched with a critical eye and you probably shouldn’t show it to kids.

What would be the Birth of a Nation of programming?

Star War Sex Parrot
Oct 2, 2003

Thermopyle posted:

So what should such a person read?
A computer systems book that uses C. I haven’t read the one ultrafilter linked, but this one is solid too and the one I used:

Computer Systems: A Programmer’s Perspective

Star War Sex Parrot fucked around with this message at 15:35 on Mar 5, 2018

Star War Sex Parrot
Oct 2, 2003

Dominoes posted:

Thanks for the info dudes! I'm tempted to dive back into C after attempting a project with Rust.
If you’re looking for systems project, Stanford’s OS course is using Rust for the first time this quarter. I think the projects are writing a kernel for Raspberry Pi 3. I’m gonna try to do the projects over the summer since I’ve been meaning to play with Rust.

Star War Sex Parrot fucked around with this message at 15:51 on Mar 5, 2018

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

That sounds like a neat project that I might be interested in doing too.

Also, thanks for the reading recommendations. Now to just remember them next time the subject comes up...

Star War Sex Parrot
Oct 2, 2003

Thermopyle posted:

That sounds like a neat project that I might be interested in doing too.
Course page and materials are here:

https://web.stanford.edu/class/cs140e/syllabus/#schedule

It’s a little more abbreviated than I’d like since they’re on the quarter system, but I’m hoping it’s a nice Rust intro.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

LOOK I AM A TURTLE posted:

What would be the Birth of a Nation of programming?

I don’t know if any real programming language approaches quite that level of “groundbreaking but so thoroughly contaminated by its terrible philosophy that it’s best just left to rot in an archive”.

Obviously there are a lot of comedy options.

peak debt
Mar 11, 2001
b& :(
Nap Ghost
I'm trying to write an SQL statement that depending on a parameter either displays all results, or filters them. So I tried to be clever and wrote something like

code:
SELECT * FROM items WHERE property like @filter
And defined @filter to be one of the following values

code:
SELECT property FROM items UNION SELECT '%'
That was intended to list all valid values plus '%' so the user could select whatever they wanted to see. But, unfortunately, in SQL it seems that
code:
'abc' like 'abc'
is false which kinda threw a wrench in that elegant plan.

Does anybody with more experience in SQL know if there is a kind of best practice to formulate a WHERE statement that can either grab all items or only a subset?

Shy
Mar 20, 2010

Uh why would that be false? Can you post the rest of it?
If you want a predetermined no filter value you can write something like
SQL code:
SELECT * FROM items WHERE @filter = 'all' OR property = @filter

peak debt
Mar 11, 2001
b& :(
Nap Ghost
Ah sorry I was stupid and defined the variable as char(20) instead of varchar(20) so it padded it with spaces and that failed the check.

And the OR is a good idea too.

Vegetable
Oct 22, 2010

As part of a job interview, I've been asked to use a Salesforce developer account to design and present a customized CRM system.

It looks like a very simple assignment: the client has salespeople who sell stuff and give samples, and you wanna track these sales records in addition to any customer feedback. I can't use standard Salesforce objects and must use custom ones.

Problem is I have no Salesforce experience and the website is completely mystifying. I'm supposed to walk an audience through "the configured solution in Salesforce.com as part of your presentation."

Am I being asked to create an app? Develop a schema? What is the end product supposed to be?

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun
What's a good book on designing distributed systems?

my cat is norris
Mar 11, 2010

#onecallcat

Maybe I should ask here instead of in Haus of Tech Support, derp. I need help changing this PowerShell script to target a subfolder of the Documents directory:

code:
#Example CSV file with columns titled DIRECTORY and ONEDRIVEURL:
$csvFile = "C:\users\mycatisnorris\OneDriveMigrationTest.csv"
 
#load the CSV file into a table
$table = Import-Csv $csvFile -Delimiter ","
 
#Convert your password to a SecureString
$mypassword = ConvertTo-SecureString "notmyrealpassword" -AsPlainText -Force
 
#Cycle through each row
foreach ($row in $table)
{
#connect to the destination OneDrive URL
$dstSite = Connect-Site -Url $row.ONEDRIVEURL -UserName [email]notmyrealemail@fakedomain.com[/email] -Password $mypassword
 
#select destination document library, named Documents by default in OneDrive
$dstList = Get-List -Name Documents -Site $dstSite
 
#Copy the content from your source directory to the Documents document library in OneDrive
Import-Document -SourceFolder $row.DIRECTORY -DestinationList $dstList -InsaneMode
}
The "destination document library" is the bit I need to modify. I want to target a subfolder of the root "Documents" called "Migration".

Source script from: https://en.share-gate.com/blog/onedrive-for-business-migration-powershell

Mr Shiny Pants
Nov 12, 2012

Ghost of Reagan Past posted:

What's a good book on designing distributed systems?

Anything that discusses Erlang?

The Fool
Oct 16, 2003


my cat is norris posted:

Maybe I should ask here instead of in Haus of Tech Support, derp. I need help changing this PowerShell script to target a subfolder of the Documents directory:

code:
#Example CSV file with columns titled DIRECTORY and ONEDRIVEURL:
$csvFile = "C:\users\mycatisnorris\OneDriveMigrationTest.csv"
 
#load the CSV file into a table
$table = Import-Csv $csvFile -Delimiter ","
 
#Convert your password to a SecureString
$mypassword = ConvertTo-SecureString "notmyrealpassword" -AsPlainText -Force
 
#Cycle through each row
foreach ($row in $table)
{
#connect to the destination OneDrive URL
$dstSite = Connect-Site -Url $row.ONEDRIVEURL -UserName [email]notmyrealemail@fakedomain.com[/email] -Password $mypassword
 
#select destination document library, named Documents by default in OneDrive
$dstList = Get-List -Name Documents -Site $dstSite
 
#Copy the content from your source directory to the Documents document library in OneDrive
Import-Document -SourceFolder $row.DIRECTORY -DestinationList $dstList -InsaneMode
}
The "destination document library" is the bit I need to modify. I want to target a subfolder of the root "Documents" called "Migration".

Source script from: https://en.share-gate.com/blog/onedrive-for-business-migration-powershell

After briefly looking through the other commands available in the module you're using, it doesn't look like it'll be easy. The issue is the Import-Document specifically only takes a document library as an argument there doesn't appear to be a way built in to the cmdlet.

You may need to get dirty with some .NET and use the Sharepoint CSOM.

Try asking in the powershell thread ( https://forums.somethingawful.com/showthread.php?threadid=3286440) too though, someone else may have a better answer.

Mr Shiny Pants
Nov 12, 2012

my cat is norris posted:

Maybe I should ask here instead of in Haus of Tech Support, derp. I need help changing this PowerShell script to target a subfolder of the Documents directory:

code:
#Example CSV file with columns titled DIRECTORY and ONEDRIVEURL:
$csvFile = "C:\users\mycatisnorris\OneDriveMigrationTest.csv"
 
#load the CSV file into a table
$table = Import-Csv $csvFile -Delimiter ","
 
#Convert your password to a SecureString
$mypassword = ConvertTo-SecureString "notmyrealpassword" -AsPlainText -Force
 
#Cycle through each row
foreach ($row in $table)
{
#connect to the destination OneDrive URL
$dstSite = Connect-Site -Url $row.ONEDRIVEURL -UserName [email]notmyrealemail@fakedomain.com[/email] -Password $mypassword
 
#select destination document library, named Documents by default in OneDrive
$dstList = Get-List -Name Documents -Site $dstSite
 
#Copy the content from your source directory to the Documents document library in OneDrive
Import-Document -SourceFolder $row.DIRECTORY -DestinationList $dstList -InsaneMode
}
The "destination document library" is the bit I need to modify. I want to target a subfolder of the root "Documents" called "Migration".

Source script from: https://en.share-gate.com/blog/onedrive-for-business-migration-powershell

Why not map the drive over WebDav and use regular filecopy? Be sure to strip any characters not allowed on a webserver otherwise sharepoint will throw a fit.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

rjmccall posted:

I don’t know if any real programming language approaches quite that level of “groundbreaking but so thoroughly contaminated by its terrible philosophy that it’s best just left to rot in an archive”.

Obviously there are a lot of comedy options.

Perl. Hugely influential, inspired the next generation of language designers, contains many subtle touches of brilliance, brought together some of the best and most popular pieces of what came before it into one package, shouldn’t be touched with a ten foot pole.

Pixelboy
Sep 13, 2005

Now, I know what you're thinking...

lifg posted:

Perl. Hugely influential, inspired the next generation of language designers, contains many subtle touches of brilliance, brought together some of the best and most popular pieces of what came before it into one package, shouldn’t be touched with a ten foot pole.

This is probably one of the best summations of perl I've seen in a long, long time

Woodsy Owl
Oct 27, 2004

Vegetable posted:

As part of a job interview, I've been asked to use a Salesforce developer account to design and present a customized CRM system.

It looks like a very simple assignment: the client has salespeople who sell stuff and give samples, and you wanna track these sales records in addition to any customer feedback. I can't use standard Salesforce objects and must use custom ones.

Problem is I have no Salesforce experience and the website is completely mystifying. I'm supposed to walk an audience through "the configured solution in Salesforce.com as part of your presentation."

Am I being asked to create an app? Develop a schema? What is the end product supposed to be?

Yes you’re being asked to build an app (a collection of SObject tabs)


Is this a Salesforce development job? If no, then the are probably testing your initiative and willingness to learn stuff quickly. Are there any more constraints or requirements to be task? How well executed does Order management have to be? How many UIs are they looking for?

This task can be completed without any code, probably. Every SObjevt has a standard UI called a Page Layout. These include a form for updating custom fields on the object and Related Lists (which are just a table of related SObjects [Example: accounts are 1:inf Contacts, so a Related List on the Account Page Layout would be all the Contacts related to Account])).

Above everything, use Salesforce Classic for now. Plenty of accessible examples and StackOferflow stuff.

The rub here is that using the standard Page Layout to manage orders is slow and inefficient when a Salesperson has to manually create a new OrderItem and relate it to an Order and Product.But this is probably all you’ll have time for so just stick to Page Layouts.

Do this:
1. Create custom SObjects (Customer, Salesperson, Order, OrderItem, Product, Commissions)
2 add custom fields to implement your scheme (relate Orders to Customrrs and Salespersons, etc)
3. Edit page layouts to add the necessary fields on each SObject along with relevant Related Lists (customers should have related list orders, salesperson has Related list order, order has Related list orderitem)

There is no escaping he User object. You have to use these as this is how a salesperson is credentialed and would be able to log in to SFdC and use the app. Create a Salesperson Profile. Salespersons
should be able to create orders and order items. Salespersons should not be able to edit their own commission rate. Salespersons should be able to create an order item by clicking New on the OrderItems Related list, create Customers, etc. Basically just Revoke FLs for objects and fiefs Salespersons shouldn’t be touching, and remove irrelevant stuff from the Page Layouts.

Add dummy data. When you demonstrate it you need to show two parts: from an admins perspective (adding products and salespersons) and a salespersons perspective (creating customers, orders, order items). Use the Log In feature to demonstrate a salesperson using the app.

Create an ER diagram and present that also when demonstrating. Also Emphasize that you used no code to do the task, Salesforce diehards love the notion of “clicks not code”). Show where you used Related Lists in Page Layouts. Show that Salesperson can’t access fields that they shouldn’t (eg if you had a CommissionsRate field on the order or Salesperson SObjects then a Salesperson-profiled User should not
Be able to edit that)

Edit: typed on a phone, please ignore bad spalling, The Grammies, etc

Edit 2: just make a field CustomerFeedback on Order for customer feedback

Woodsy Owl fucked around with this message at 07:12 on Mar 10, 2018

ufarn
May 30, 2009
I have file.txt:

code:
foo,123
bar,123
baz,215
(...)
qux,131
And I have whatiwant.txt:

code:
bar
(...)
qux
I want to fetch all the lines from file.txt and only display the ones with the strings from whatiwant.txt. Is there a native way to do this in grep or elsewhere?

I know about grep -v and grep -o, but rather than try some custom bozo stuff like grep -i <(cat emotes.txt | tr '\n' '|') file.txt (which doesn't work anyway) or whatever, I'd rather use something more idiomatic.

Surely grep has more native support for this use case?

Volguus
Mar 3, 2009

ufarn posted:

I have file.txt:
grep -f whatiwant.txt -o file.txt

Volguus fucked around with this message at 18:55 on Mar 12, 2018

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
Grep has a -f flag that lets you pull keys from a file. So you should just need `grep -f whatiwant.txt file.txt`

TheCoach
Mar 11, 2014
So coworker has his hands full trying to make a web based kiosk interface on a machine that runs windows 10.
Said kiosk has to have printing functionality where you press a button on that web interface in a browser and it shits out a piece of paper with some stuff printed on it. Kiosk machine has a printer connected via usb for this task.

Is there a piece of software that runs in command line and can pull printer status in an easily parseable format(at the very least if it's ready to print or not).

Also what would be the best way to send print commands to that printer in the kiosk in general? the requirements there are:
* no prompts for user
* utf-8 support
* print a specific payload and not the page the browser is currently on.

EDIT:
The printer is EPSON TM-88V Receipt (with no network module, usb only)

TheCoach fucked around with this message at 11:54 on Mar 14, 2018

nielsm
Jun 1, 2009



I would suggest installing a small printer server program that runs on the kiosk machine itself. Have it take HTTP connections on localhost and make print jobs based off that. This assumes that you are developing the main webapp too and can have it send AJAX requests to the print server program.

TheCoach
Mar 11, 2014
Yeah the web app is on our end.
Any recommendations for what print server package to use? Free would be highly preferable.

nielsm
Jun 1, 2009



My suggestion was to write your own. Depending on how simple or complex the printjob is you can probably solve it with some simple template files that can be loaded, filled in, and sent to printer. A small C# app can probably do it.

TheCoach
Mar 11, 2014
Sadly all we have here are PHP and javascript folks so this might prove problematic.

Volguus
Mar 3, 2009

TheCoach posted:

Sadly all we have here are PHP and javascript folks so this might prove problematic.

Whenever I hear an X language developer saying that "I can't program in Y, I am an X developer" I feel like punching them in the face. In reality, I just fire their rear end. It is perfectly acceptable to say: "Y language sucks donkey balls, I don't like it", but to refuse to work in it for 5 minutes, that's not acceptable.

And C# is not set in stone, was just suggested because it is easy. VB would work too (and just as easy). Or, go with plain old win32 apis.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



TheCoach posted:

Sadly all we have here are PHP and javascript folks so this might prove problematic.

https://johnnycode.com/2010/03/05/using-a-template-to-programmatically-create-pdfs-with-c-and-itextsharp/ and you don't even need Visual Studio to compile it: https://www.monodevelop.com/

TheCoach
Mar 11, 2014
Yeah I know, code is code but the question here is time and budget and if the client does not want to pay the thing doesn't go further.

Generating an actual PDF is really not the problem you can easily do that in PHP on the web app end of it, the issue was initiating the print from the web interface and a print server is the correct way to do it. I did dig up some code a dude did to setup a simple service for that in asp and if it comes to that that's what we'll do.

The client however suddenly remembered they have in-house team that does their apps and will probably take the kiosk end of this themselves, which makes more sense than a bunch of Magento devs building their very first C# app and hoping it doesn't fall over when used.

I'm not personally working on this and just wanted to get some opinions on how do you solve something like this.

nielsm
Jun 1, 2009



When you're targeting a receipt printer you don't want to make PDF files anyway, they usually take some text-based format with escape codes for formatting, barcodes, and graphics.

If you'd had a network-enabled version of the printer, I'd have suggested you used the built-in webserver (on the printer) that takes some XML format and prints it.

nielsm fucked around with this message at 15:53 on Mar 14, 2018

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



nielsm posted:

When you're targeting a receipt printer you don't want to make PDF files anyway, they usually take some text-based format with escape codes for formatting, barcodes, and graphics.

Didn't know that - never had the 'pleasure' of working with one

Volguus
Mar 3, 2009

nielsm posted:

When you're targeting a receipt printer you don't want to make PDF files anyway, they usually take some text-based format with escape codes for formatting, barcodes, and graphics.

If you'd had a network-enabled version of the printer, I'd have suggested you used the built-in webserver (on the printer) that takes some XML format and prints it.

You mean postscript? Not all printers know PS, but there's a fair amount of them that do.

The Fool
Oct 16, 2003


Volguus posted:

You mean postscript? Not all printers know PS, but there's a fair amount of them that do.

He doesn't. A lot of POS receipt printers take actual plain text as their input with a couple escape characters for tabs and newlines, and that's it.

Mr Shiny Pants
Nov 12, 2012
When talking about printers POS is nicely ambiguous here.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Volguus posted:

You mean postscript? Not all printers know PS, but there's a fair amount of them that do.

ZPL is a common one

Volguus
Mar 3, 2009

Bob Morales posted:

ZPL is a common one

Are there printers other than the Zebra ones that know ZPL?

TheCoach
Mar 11, 2014

nielsm posted:

When you're targeting a receipt printer you don't want to make PDF files anyway, they usually take some text-based format with escape codes for formatting, barcodes, and graphics.

If you'd had a network-enabled version of the printer, I'd have suggested you used the built-in webserver (on the printer) that takes some XML format and prints it.

Yeah it's kind of bizarre that the company cheaped out and did not provision printers with the network module installed. Manufacturer provides full php SDK for working with a network enabled version of the model so it would have been perfect.

Jimbot
Jul 22, 2008

So a friend of mine got accepted to the Lambda School for a part time computer science course. He's been wanting to get into programming for a long time (for a better paying job) but keeps hitting a wall when he tries to self-teach himself. Does anyone have any experience with this place or know someone who has? Is it legit? He got accepted and is enthusiastic but doesn't want to get involved with something won't help him learn the material or might end up being a scam or something.

Any info would be appreciated. He's looked around and has only found glowing reviews, but just wants to make sure before he commits to the course and gets his hopes up if it ends up being junk.

Adbot
ADBOT LOVES YOU

Doctor Malaver
May 23, 2007

Ce qui s'est passé t'a rendu plus fort
I'm looking for a JS library or a small web app (no flash) for making exercises with flow diagrams. We ask the user to construct a diagram based on something they learned previously and they move around shapes and draw arrows and write stuff into labels, and we check whether they got it right. Anyone knows of something like that?

Sorry if the explanation is poor. I'm not a developer, just helping with research.

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