本文将为您提供关于WhatIsaComputerSystem?的详细介绍,同时,我们还将为您提供关于ASelf-OrganizedComputerVirusDemoinC、ASP.NETCore3.1
本文将为您提供关于What Is a Computer System?的详细介绍,同时,我们还将为您提供关于A Self-Organized Computer Virus Demo in C、ASP.NET Core 3.1:System.InvalidCastException:无法将“System.Int32”类型的对象转换为“System.Int64”类型、Automapper 错误:System.InvalidOperationException:'缺少从 System.String 到 System.Char 的映射、c# – LINQ to Entities不识别方法’System.String StringConvert(System.Nullable`1 [System.Double])的实用信息。
本文目录一览:- What Is a Computer System?
- A Self-Organized Computer Virus Demo in C
- ASP.NET Core 3.1:System.InvalidCastException:无法将“System.Int32”类型的对象转换为“System.Int64”类型
- Automapper 错误:System.InvalidOperationException:'缺少从 System.String 到 System.Char 的映射
- c# – LINQ to Entities不识别方法’System.String StringConvert(System.Nullable`1 [System.Double])
What Is a Computer System?
What Is a Computer System?
A combination of Five or Six Elements
The term computer is used to describe a device made up of a combination of electronic and electromechanical(part electronic and part mechanical )components. By itself, a computer has no intelligence and is referred to as hardware. A computer doesn''t come to life until it is connected to other parts of a computer system. A computer system is a combination of five elements ( listed here in the order of how expensive it would be replace them in a system, from least to most expensive ):
- Hardware
- Software
- Data/Information
- Procedure
- People
combination n. 结合;组合;联合
electromechanical adj. 电机的;电机学的
五个或者六个元件的组合
计算机用来描述由电子部件和电机(部分是电子的部分是机械的)部件组成的装置。对计算机本身而言,计算机没有智能并被称为硬件。计算机直到它连接计算机系统的其他部分才能正常工作。计算机系统是一个由五个元件组成的联合体。(这里列举出这些元件的顺序以在一个系统中取代它们的成本,从最少到最贵):
- 硬件
- 软件
- 数据 / 信息
- 程序
- 人
When one computer system is set up to communicate with another computer system, connectivity becomes a sixth system element. In other words, the manner in which the various individual systems are connected--for example, by phone lines, microware transmission or satellite--is an element of the total computer system.
connectivity n. 连通性;结合性;接合性;连通图
microware n. 微波
satellite n. 卫星;人造卫星;卫星城;卫星国 v. 通过通讯卫星播送 [传播
当一个计算机系统设置来与其他计算机系统沟通时,连通性成为第六个元件。换句话来说,大多数独立的系统连接采用的方式,举个例子,通过电话线,微波传输或者卫星,是一种总的计算机系统的元件。
Software is the term used to describe the instructions that tell the hardware how to perform a task; without software instructions, the hardware doesn''t know what to do. People operate the computer hardware; they create the computer software instructions and respond to the procedures that those instructions present. You will learn more about software and procedures later. Right now we want to discuss the importance of data and information.
软件这东西是用来描述告诉硬件怎样处理任务的指令的;没有软件指令,硬件不知道做什么。人们操作计算机硬件;他们创造了计算机软件指令并响应那些指令运作的程序。之后你将会学到更多关于软件和程序的知识。现在,我们想讨论数据和信息的重要性。
Conversion of Data into Information
The purpose of a computer system is to convert data into information. Data is raw, unevaluated facts and figures, concepts, or instructions. This raw material is processed into useful information. In other words, information is the product of data processing. This processing includes refining, summarizing, categorizing, and otherwise manipulating the data into a useful form for decision making. For example, the facts and figures contained in a stack of customer orders waiting to be entered into a computer-based order entry system are data; after the data is entered and processed, an output report about how that data affected product inventory would be information.
unevaluated v. 无法预估;无法评价
refine v. 精炼;提纯;澄清;改善
summarize v. 总结;概述;概括;归纳
inventory n. 库存;财产清单;(建筑物里的物品、家具等的)清单 v. 开列清单
计算机系统的目的是为了将数据转化为信息。数据是未加工的,无法评估的事实和数字,概念或者指令。这个未加工的材料处理成有用的信息。换句话说,信息室数据处理后的产物。处理过程包括精炼,总结,分类,另外为决策将信息操作为有用的形式。举个例子,包含在等待输入到基于计算机的订单输入系统的一堆客户订单中的事实资料是数据;在数据进入被处理后,一个关于数据如何影响产品创新的输出报告会成为信息。
People "capture" data in a variety of ways--for example, by reading, listening, or seeing. Then they may record the data on a document. For instance, Roger Shu records his remaining letters in his name, is an element of data, as are the numbers 12/22 and 5, used to indicate the data and the number of overtime hours worked. By themselves, these data elements are useless; we must process them to make them something. The report produced when Roger''s data is run through a computer-based employee records system gives us information--for example, the amount of money due Roger for his overtime work.
record n. 记录;唱片;记载;经历 v. 记录;录制;记载;录(音)
人们用多种方式采集信息 -- 举个例子,通过读,听,或是看。之后他们也许会用文件记录数据。事实上,Roger Shu 用他的名字的形式记录他的剩余的字母就像数字 12/22 和 5,他的名字也是一种信息,常意指数据和加班的数字。就数据本身而言是无用的;我们必须处理它们来使它们成为一些东西。Roger 的数据通过基于计算机的员工记录系统运行时生成的报告为我们提供了信息,例如 Roger 为他的加班工作支付的金额。
A Self-Organized Computer Virus Demo in C
A Program that can modify herself and copy herself to somewhere else and execute it. Just like gene-transformable virus.
Here''s the sample code.
#include "stdio.h"
#include "windows.h"
#define MAX_LOOP 10000
int main(int argc, const char** argv)
{
/*** THE VIRUS LOGIC PART ***/
//GENE_MARK
int a = 0;
printf("GENE PRINT:%d\n", a);
/*** THE VIRUS LOGIC PART ***/
// FILE NAME
char file_name[30] = "test";
// MAKE A COPY OF HERSELF
FILE* source = fopen("test.c", "r");
FILE* descendant = fopen("descendant.c", "w+");
printf("SOURCE FILE OPEN RESULT IS : %d \n", (int)source);
printf("DESCENDANT FILE CREATED: %d \n", (int)descendant);
if(descendant==NULL)
{
printf("ERROR ON CREATING DESCENDANT.\n");
return -1;
}
char buff[100] = {0};
// REPLACE GENE MARK PROGRAM
char letter = 0;
// GENE LINE
int idx = 0;
int loop = 0;
int buff_idx = 0;
while(!feof(source))
{
// ALARM
if(loop>MAX_LOOP)
break;
loop ++;
fread(&letter, sizeof(char), 1, source);
buff[buff_idx] = letter;
buff_idx ++;
if(letter==''\n'')
{
if(idx==9)
{
// TRANSFORM GENE
memset(buff, 0, 100);
buff_idx = 0;
strcat(buff, "int a = 1;\n");
}
fwrite(buff, sizeof(char), strlen(buff), descendant);
// CLEAR BUFFER
memset(buff, 0, 100);
buff_idx = 0;
idx ++;
}
}
// DEAL WITH LEFT LETTERS IN BUFFER
if(strlen(buff)>0)
{
strcat(buff, "\n");
fwrite(buff, sizeof(char), strlen(buff)+1, descendant);
}
// CLOSE ALL FILES
fclose(source);
fclose(descendant);
// until the descendant file is written over
/*** COMPILE HERSELF ***/
char* source_file = "descendant.c";
char* dest_file = "descendant.exe";
char command[100] = {0};
strcat(command, "gcc -o ");
strcat(command, dest_file);
strcat(command, " ");
strcat(command, source_file);
// COMPILATION
system(command);
/***********************/
printf("COPYING MYSELF DONE.\n");
printf("WAITING FOR NEXT INSTRUCTION...\n");
char cmd = getchar();
if(cmd==''Y'')
{
printf("BEGIN EXECUTE THE COPYFILE EXECUTION...\n");
//GENE_MARK
system("descendant.exe");
printf("EXECUTION PROCESS IS ACTIVATED, TASK DONE. EXIT SYSTEM.");
}
else
printf("YOU CHOOSE TO EXIT SYSTEM. BYE!");
return 0;
}
If you have any suggestions or ideas, please feel free comment below, thanks!
ASP.NET Core 3.1:System.InvalidCastException:无法将“System.Int32”类型的对象转换为“System.Int64”类型
如何解决ASP.NET Core 3.1:System.InvalidCastException:无法将“System.Int32”类型的对象转换为“System.Int64”类型
Picture Error
我的控制器:
[HttpDelete("{roomId}")]
public async Task<IActionResult> Delete(string roomId)
{
var affectedResult = await _manageRoomService.Delete(roomId);
if (affectedResult == 0)
return BadRequest();
return Ok();
}
我的服务:我尝试调试,但它在代码块 foreach (var image in images)
中停止。
public async Task<int> Delete(string roomId)
{
var room = await _context.Rooms.FindAsync(roomId);
if (room == null)
throw new EWebHotelException($"Cannot find a room: {roomId}");
var images = _context.RoomImages.Where(i => i.RoomId == roomId);
foreach (var image in images)
{
await _storageService.DeleteFileAsync(image.ImagePath);
}
_context.Rooms.Remove(room);
return await _context.SaveChangesAsync();
}
我在 FileStorageService.cs 中的方法:
public async Task DeleteFileAsync(string fileName)
{
var filePath = Path.Combine(_userContentFolder,fileName);
if (File.Exists(filePath))
{
await Task.Run(() => File.Delete(filePath));
}
}
在 RoomImages 表中,列 Id
的类型为 int 32。
Automapper 错误:System.InvalidOperationException:'缺少从 System.String 到 System.Char 的映射
如何解决Automapper 错误:System.InvalidOperationException:''缺少从 System.String 到 System.Char 的映射
我需要使用 automapper 从 Company 模型中填充 CompanyVM 中的地址字段。一个公司可能有许多地址。最好我想要一个也是主要的活动地址。否则,我只想要一个活动地址。如果不行,给我一个地址。
这是公司模型:
public class Company
{
public int CompanyID { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public string Industry { get; set; }
public string DBA { get; set; }
public string TaxID { get; set; }
public bool Active { get; set; } = true;
public virtual ICollection<Address> Addresses { get; set; } = new List<Address>();
这是地址模型:
public class Address
{
public int AddressID { get; set; }
public string Type { get; set; }
public string Street1 { get; set; }
public string Street2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string ZipCode { get; set; }
public string County { get; set; }
public string Country { get; set; }
public bool Primary { get; set; } = false;
public bool Active { get; set; } = true;
public int? CompanyCompanyID { get; set; }
我需要绘制其中的许多地图,但现在只是想让它为 Street1 工作。
以下是我尝试使用的自动映射器语句:
public class CompanyProfile : Profile
{
public CompanyProfile()
{
CreateMap<Company,CompanyVM>()
.ForMember(vm => vm.Street,opt => opt.MapFrom(model =>
model.Addresses.Where(x => x.CompanyCompanyID != null && x.Active && x.Primary).Select(x => x.Street1) ??
model.Addresses.Where(x => x.CompanyCompanyID != null && x.Active).Select(x => x.Street1) ??
model.Addresses.Where(x => x.CompanyCompanyID != null).Select(x => x.Street1)))
.ReverseMap();
}
}
这是 CompanyVM:
[Grid2(nameof(CompanyID),FavoritesEnabled = true,RecentRecordAction = "Details",FetchDataOnLoad = true
)]
public class CompanyVM : GridRecordVM
{
public virtual int CompanyID { get; set; }
[GridColumn2(TemplateType = GridTemplateType.DefaultDetailLink,IncludeInGeneralSearch = true)]
public virtual string Name { get; set; }
[GridColumn2]
public virtual string Type { get; set; }
[LockedFilter(FilterOperator.IsEqualTo,true)]
public virtual bool Active { get; set; }
[display(Name = "Industry")]
[MaxLength(20,ErrorMessage = "Industry cannot be longer that 20 characters.")]
public string Industry { get; set; }
[display(Name = "DBA")]
[MaxLength(50,ErrorMessage = "DBA name cannot be longer that 50 characters.")]
public string DBA { get; set; }
[display(Name = "Tax Id")]
[MaxLength(50,ErrorMessage = "TaxID name cannot be longer that 50 characters.")]
public string TaxID { get; set; }
[display(Name = "Street",Description = "Street")]
public string Street { get; set; }
//these items set to ignoremap until mapping sorted out
[display(Name = "City",Description = "City")]
[IgnoreMap]
public string City { get; set; }
[display(Name = "State",Description = "State")]
[IgnoreMap]
public string State { get; set; }
[display(Name = "ZipCode",Description = "ZipCode")]
[IgnoreMap]
public string ZipCode { get; set; }
[Phone]
[display(Name = "Phone Number",Description = "Phone Number")]
[IgnoreMap]
public string PhoneNumber { get; set; }
[EmailAddress]
[display(Name = "Email Address",Description = "Email Address")]
[IgnoreMap]
public string EmailAddress { get; set; }
}
抛出运行时错误:system.invalidOperationException: ''Missing map from System.String to System.Char。使用 CreateMap
解决方法
解决方案是将 CreateMap .ForMember 语句格式化如下:
CreateMap<Company,CompanyVM>()
.ForMember(x => x.Street,opt => opt.MapFrom(src =>
src.Addresses.Where(x => x.Active && x.Primary).FirstOrDefault() != null
? src.Addresses.Where(x => x.Active && x.Primary).FirstOrDefault().Street1
: src.Addresses.Where(x => x.Active).FirstOrDefault() != null
? src.Addresses.Where(x => x.Active).FirstOrDefault().Street1
: src.Addresses.FirstOrDefault() != null
? src.Addresses.FirstOrDefault().Street1
: string.Empty))
c# – LINQ to Entities不识别方法’System.String StringConvert(System.Nullable`1 [System.Double])
using System.Data; using System.Data.Objects.sqlClient; e.Result = from n in MyDB.tblBulletins where n.AnncStart <= DateTime.Now && n.AnncEnd > DateTime.Now && n.Approved == true orderby n.AnncStart descending,n.AnncDate descending select new { n.RecID,AnncTitle = n.AnncTitle + " <a href='bulletinAdd.aspx?ID=" + sqlFunctions.StringConvert((double)n.RecID).Trim() + "'><Edit></a>",AnncText = (n.AnncImg == null ? n.AnncText : "<a href='images/bulletin/" + n.AnncImg + "'><img src='images/bulletin/" + n.AnncImg + "'alt='Click for larger image'/></a>" + n.AnncText),Email = (n.Email == null ? "" : "<br/><a href='mailto:" + n.Email + "'>" + n.Email + "</a>"),n.AnncType,n.AnncDate,n.AnncEnd,n.v_EmpBasicInfo.Name };
当我运行这个我得到
LINQ to Entities不会识别方法’System.String StringConvert(System.Nullable`1 [System.Double])’方法,并且此方法不能转换为存储表达式.
n.RecID是sql数据库中的表上的一个int主键(sql Server Standard Edition)
所有我似乎通过搜索找到的人是推荐StringConvert而不是ToString
添加 – 堆栈跟踪:
[NotSupportedException: LINQ to Entities does not recognize the method 'System.String StringConvert(System.Nullable`1[System.Double])' method,and this method cannot be translated into a store expression.] System.Data.Entity.Core.Objects.ELinq.DefaultTranslator.Translate(ExpressionConverter parent,MethodCallExpression call) +194 System.Data.Entity.Core.Objects.ELinq.MethodCallTranslator.TypedTranslate(ExpressionConverter parent,MethodCallExpression linq) +976 System.Data.Entity.Core.Objects.ELinq.TypedTranslator`1.Translate(ExpressionConverter parent,Expression linq) +88 System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) +148 System.Data.Entity.Core.Objects.ELinq.BinaryTranslator.TypedTranslate(ExpressionConverter parent,BinaryExpression linq) +122 System.Data.Entity.Core.Objects.ELinq.TypedTranslator`1.Translate(ExpressionConverter parent,BinaryExpression linq) +87 System.Data.Entity.Core.Objects.ELinq.TypedTranslator`1.Translate(ExpressionConverter parent,Expression linq) +88 System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) +148 System.Data.Entity.Core.Objects.ELinq.NewTranslator.TypedTranslate(ExpressionConverter parent,NewExpression linq) +520 System.Data.Entity.Core.Objects.ELinq.TypedTranslator`1.Translate(ExpressionConverter parent,Expression linq) +88 System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) +148 System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda,DbExpression input) +168 System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda,DbExpression input,DbExpressionBinding& binding) +160 System.Data.Entity.Core.Objects.ELinq.OneLambdaTranslator.Translate(ExpressionConverter parent,MethodCallExpression call,DbExpression& source,DbExpressionBinding& sourceBinding,DbExpression& lambda) +168 System.Data.Entity.Core.Objects.ELinq.SelectTranslator.Translate(ExpressionConverter parent,MethodCallExpression call) +70 System.Data.Entity.Core.Objects.ELinq.SequenceMethodTranslator.Translate(ExpressionConverter parent,SequenceMethod sequenceMethod) +47 System.Data.Entity.Core.Objects.ELinq.MethodCallTranslator.TypedTranslate(ExpressionConverter parent,MethodCallExpression linq) +141 System.Data.Entity.Core.Objects.ELinq.TypedTranslator`1.Translate(ExpressionConverter parent,Expression linq) +88 System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) +148 System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.Convert() +50 System.Data.Entity.Core.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption) +563 System.Data.Entity.Core.Objects.<>c__displayClassb.<GetResults>b__a() +83 System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction(Func`1 func,IDbExecutionStrategy executionStrategy,Boolean startLocalTransaction,Boolean releaseConnectionOnSuccess) +499 System.Data.Entity.Core.Objects.<>c__displayClassb.<GetResults>b__9() +271 System.Data.Entity.sqlServer.DefaultsqlExecutionStrategy.Execute(Func`1 operation) +251 System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +600 System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0() +89 System.Lazy`1.CreateValue() +416 System.Lazy`1.LazyInitValue() +152 System.Lazy`1.get_Value() +75 System.Data.Entity.Internal.LazyEnumerator`1.MoveNext() +40 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +381 System.Linq.Enumerable.ToList(IEnumerable`1 source) +58 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object target,Object[] arguments,Signature sig,Boolean constructor) +0 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,Object[] parameters,Object[] arguments) +92 System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,CultureInfo culture) +108 System.Reflection.MethodBase.Invoke(Object obj,Object[] parameters) +19 System.Web.UI.WebControls.QueryableDataSourceHelper.ToList(IQueryable query,Type dataObjectType) +225 System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +549 System.Web.UI.WebControls.Repeater.GetData() +55 System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +89 System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61 System.Web.UI.WebControls.Repeater.DataBind() +105 System.Web.UI.WebControls.Repeater.EnsureDataBound() +49 System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +15 System.Web.UI.Control.PreRenderRecursiveInternal() +83 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterasyncPoint) +974
解决方法
using System.Data.Entity.sqlServer;
并不是:
using System.Data.Objects.sqlClient;
我们今天的关于What Is a Computer System?的分享已经告一段落,感谢您的关注,如果您想了解更多关于A Self-Organized Computer Virus Demo in C、ASP.NET Core 3.1:System.InvalidCastException:无法将“System.Int32”类型的对象转换为“System.Int64”类型、Automapper 错误:System.InvalidOperationException:'缺少从 System.String 到 System.Char 的映射、c# – LINQ to Entities不识别方法’System.String StringConvert(System.Nullable`1 [System.Double])的相关信息,请在本站查询。
本文标签: