穿孔纸带 Punched tape

       看到穿孔纸带, 了解了它的历史, 佩服前辈们的智慧。 来看看维基百科:


Punched tape or perforated paper tape is a form of data storage, consisting of a long strip of paper in which holes are punched to store data. Now effectively obsolete, it was widely used during much of the twentieth century for teleprintercommunication, for input to computers of the 1950s and 1960s, and later as a storage medium for minicomputers and CNC machine tools.

Origin[edit]

A paper tape, constructed from punched cards, in use in a Jacquard loom. The large holes on each edge are  sprocket holes, used to pull the paper tape through the loom.

Paper tapes constructed from punched cards were widely used throughout the 19th century for controlling looms. Perforated paper tapes were first used byBasile Bouchon in 1725 to control looms. However, the paper tapes were expensive to create, fragile, and difficult to repair. By 1801 Joseph Marie Jacquard had developed machines to create paper tapes by tying punched cards in a sequence. The resulting paper tape, also called a "chain of cards", was stronger and simpler both to create and to repair. (See Jacquard loom).

This led to the concept of communicating data not as a stream of individual cards, but one "continuous card", or a tape. Many professional embroidery operations still refer to those individuals who create the designs and machine patterns as "punchers", even though punched cards and paper tape were eventually phased out, after many years of use, in the 1990s.

In 1846, 

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是基于 Android Studio 的事件安排,设置闹钟提醒且带有打卡功能的代码: 1. 创建一个新的 Android Studio 项目。 2. 在项目的布局文件中添加一个 TextView,一个 Button 和一个 TimePicker。 3. 在 MainActivity.java 文件中添加以下代码: ```java public class MainActivity extends AppCompatActivity { private TextView mTextView; private Button mButton; private TimePicker mTimePicker; private AlarmManager mAlarmManager; private PendingIntent mPendingIntent; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTextView = findViewById(R.id.text_view); mButton = findViewById(R.id.button); mTimePicker = findViewById(R.id.time_picker); mAlarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); Intent intent = new Intent(this, AlarmReceiver.class); mPendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0); mButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { int hour = mTimePicker.getHour(); int minute = mTimePicker.getMinute(); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.set(Calendar.HOUR_OF_DAY, hour); calendar.set(Calendar.MINUTE, minute); mAlarmManager.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), mPendingIntent); Toast.makeText(MainActivity.this, "Alarm set for " + hour + ":" + minute, Toast.LENGTH_SHORT).show(); } }); } } ``` 4. 创建一个 AlarmReceiver 类,用于接收闹钟提醒广播,并添加以下代码: ```java public class AlarmReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "Alarm received", Toast.LENGTH_SHORT).show(); //TODO: Add punch function here } } ``` 5. 在 AlarmReceiver 类中添加打卡功能的代码,例如: ```java SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putBoolean("punched", true); editor.apply(); ``` 6. 在 MainActivity.java 中添加读取打卡状态的代码,例如: ```java SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); boolean punched = sharedPreferences.getBoolean("punched", false); if (punched) { mTextView.setText("You have punched"); } else { mTextView.setText("You have not punched"); } ``` 7. 运行应用程序,并设置闹钟提醒。当闹钟响起时,应用程序将显示“Alarm received”,并且打卡状态将更新为“已打卡”。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值