batch-processing

Processing millions of database records in Java [closed]

坚强是说给别人听的谎言 提交于 2019-12-12 10:12:10
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I have a requirement to write a batch job that fetches rows from a database table and based on a certain conditions, write to other

How to rename a folder the same as the filename of the first file inside that folder using Windows batch programming?

那年仲夏 提交于 2019-12-12 06:06:21
问题 I have a group of about 3,000 folders named XYZ-1 through XYZ-3000. Inside those folders are groups of image files and a description text file. Such as: Property123_0001.jpg Property123_0002.jpg Property123_0003.jpg ... Property123_0085.jpg Property123_0086.jpg Z_Description.txt The number of .jpg files differs in each folder, but there's always a single description file. Each directory's image files have a different name, for example `XYZ-1 might contain Property123, while XYZ-10 might

Batch program unexpected when I type something

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 05:41:26
问题 Ok, so I've made a batch game and I'm writing through the tutorial right now. My plan is to make %roll% set /a roll=(%random% %% 7) + 1 Capable of taking away %enhealth% and %yourhealth% :foresttutorial cls echo. echo __________________________ echo | | echo | An enemy appeared! | echo | Enemy health: %enhealth% | echo | Your health: %yourhealth%| echo | | echo | 1. ATK 2. USE POT | echo | 3. GOLD 4. PASS | echo | _________________________| echo. echo Here appears an attack screen! echo Quick

Recommendation for mysqli batch queries

杀马特。学长 韩版系。学妹 提交于 2019-12-12 04:58:15
问题 My use case: I have multiple scripts inserting into a table in the order of several inserts per second. I am seeing performance degradation, so I think there would be performance benefits in "batching queries" and inserting several hundred rows every minute or so. Question: How would I go about doing this using mysqli? My current code uses a wrapper (pastebin), and looks like: $array = array();\\BIG ARRAY OF VALUES (more than 100k rows worth) foreach($array AS $key => $value){ $db -> q(

PHP Batch Processing: send checkbox and radio values of table rows together

狂风中的少年 提交于 2019-12-12 04:56:22
问题 I am generating a table using the result of mysql query with checkboxes and radio buttons in each row like: while($row4 = mysql_fetch_array($q4)) { $pids = $row4['pid']; echo "<tr>"; echo "<td><input type='checkbox' name='pids[]' class='persistentChecks' style='display:inline-block;cursor:pointer;' value=".$pids."></td>"; echo "<td style='text-align:center;font-size:12px;'>".$counter17."</td>"; echo "<td style='text-align:center;font-size:12px;'>".$row4['cname']."</td>"; echo "<td style='text

How to set a variable in these batch loops?

丶灬走出姿态 提交于 2019-12-12 04:49:18
问题 think I'm getting things confused here. I've got a loop that runs all files in a folder for /f "delims=_" %%J in ('forfiles /p "%%F" /m *.ext /c "cmd /c echo @path"') do start "program" /D "c:\program files\path\to\program" /Wait program -r %%J %%J should represent each file if I've set this up / interpretted this correctly. I have another loop that is looking in the xml code for each of these files and searching for a particular pattern using findstr and parsing out the Name from some tags

Looking to include subdirectories as an item to delete

你离开我真会死。 提交于 2019-12-12 04:08:55
问题 This command is pretty basic as I'm just learning, but I'm trying to include subdirectories along with files to be deleted after 14 days. Thanks for any help and guidance. forfiles /p "C:\testFolder" /s /m *.* /c "cmd /c Del @path" /d -14 Thanks and regards! 来源: https://stackoverflow.com/questions/46221946/looking-to-include-subdirectories-as-an-item-to-delete

Batch convert PNGs to individual PDFs while maintaining deep folder hierarchy in bash

不问归期 提交于 2019-12-12 03:46:20
问题 I've found a solution that claims to do one folder, but I have a deep folder hierarchy of sheet music that I'd like to batch convert from png to pdf. What do my solutions look like? I will run into a further problem down the line, which may complicate things. Maybe I should write a script? (I'm a total n00b fyi) The "further problem" is that some of my sheet music spans more than one page, so if the script can parse filenames that include "1of2" and "2of2" to be turned into a single pdf, that

Importing from CSV in Rails. How to do per batches, not all at once?

岁酱吖の 提交于 2019-12-12 03:39:03
问题 def self.import file, organization counter = 0 CSV.foreach(file.path, encoding: 'windows-1251:utf-8', headers: true) do |row| name = (row["First Name"].to_s + " " + row["Last Name"].to_s).titleize customer = Customer.create( name: name, phone: row["Main Phone"], email: row["Main Email"], address: row["Address"], repair_shop: repair_shop ) puts "#{name} - #{customer.errors.full_messages.join(',')}" if customer.errors.any? counter += 1 if customer.persisted? end message = "Imported #{counter}

How to perform batch operation using mysql and php

别来无恙 提交于 2019-12-12 03:32:15
问题 I am trying to insert multiple records using single MySQL query, but i don't want to insert a huge number of records at once. The following code fetches, buildes and inserts the records if(is_array($id_rec)){ $values = ""; foreach($id_rec as $key=>$value){ $values .= "(".(int)$value.",".(int)$id_group."), "; } $values = rtrim($values,", "); $sql = "INSERT IGNORE INTO fu_rec_group_link (id_rec, id_group) VALUES ".$values; $GLOBALS['db']->execute($sql); I have two questions here. Frist Question