content
stringlengths
228
999k
pred_label
stringclasses
1 value
pred_score
float64
0.5
1
Ovilia Ovilia - 1 year ago 195 MySQL Question MySQL stored procedure caused `Commands out of sync` Call procedure works all right in MySQL terminal, but in PHP, caused Commands out of sync; you can't run this command nowCommands out of sync; you can't run this command now My procedure is delimiter $$ create procedure getMostSimilar (IN vU_ID INT, IN voffset INT, IN vsize INT) BEGIN set @offset = voffset; set @size = vsize; set @uid = vU_ID; prepare SimilarStmt from "SELECT U_ID, getSimilarity(U_ID, ?) AS similar FROM Answer WHERE U_ID != ? GROUP BY U_ID ORDER BY similar DESC LIMIT ?, ?"; execute SimilarStmt using @uid, @uid, @offset, @size; deallocate prepare SimilarStmt; END $$ where getSimilarity is a function. In PHP: function getMostSimilar($U_ID, $offset, $size){ $query = sprintf("CALL getMostSimilar(%s, %s, %s)", $U_ID, $offset, $size); $result = mysql_query($query); print mysql_error(); if (!$result){ return $query; } $ans = array(); $len = 0; while($row = mysql_fetch_assoc($result)){ $ans[$len] = $row; $len++; } return $ans; } What should I do now? Thanks! Answer Source C.5.2.14. Commands out of sync If you get Commands out of sync; you can't run this command now in your client code, you are calling client functions in the wrong order. This can happen, for example, if you are using mysql_use_result() and try to execute a new query before you have called mysql_free_result(). It can also happen if you try to execute two queries that return data without calling mysql_use_result() or mysql_store_result() in between. http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html EDIT I think you need to rewrite the getMostSimilar stored procedure, instead of using prepare and execute (which I thinks is fooling mysql) if you use the parameters in the procedure like in this example I think your error will be fixed. HTH Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download
__label__pos
0.582817
earlgrey 0.1.2 • Public • Published Earl Grey Join the chat at https://gitter.im/breuleux/earl-grey Earl Grey (website) is a new language that compiles to JavaScript (ES6). Here's a quick rundown of its amazing features: • Python-like syntax • Fully compatible with the node.js ecosystem • Generators and async/await (no callback hell!) • Powerful, deeply integrated pattern matching • Used for assignment, function declaration, looping, exceptions... • A DOM-building DSL with customizable behavior • A very powerful hygienic macro system! • Define your own control structures or DSLs • Macros integrate seamlessly with the language • Macro libraries! Test with earl-mocha, build with earl-gulp, make dynamic pages with earl-react, etc. • And much more! Resources Examples Counting all words in a block of test. Note that count-words is a variable name, not a subtraction (it is equivalent to the name countWords, if that's the notation you prefer). count-words(text) = counts = new Map() words = text.split(R"\W+") words each word -> current-count = counts.get(word) or 0 counts.set(word, current-count + 1) consume(counts.entries()).sort(compare) where compare({w1, c1}, {w2, c2}) = c2 - c1 {x, y, ...} is the notation for arrays in Earl Grey. Objects are denoted {field = value, field2 = value2, ...} Generators: the following defines a generator for the Fibonacci sequence and then prints all the even Fibonacci numbers less than 100. It shows off a little bit of everything: gen fib() = var {a, b} = {0, 1} while true: yield a {a, b} = {b, a + b} fib() each > 100 -> break n when n mod 2 == 0 -> print n The each operator accepts multiple clauses, which makes it especially easy to work on heterogenous arrays. Asynchronous: EG has async and await keywords to facilitate asynchronous programming, all based on Promises. Existing callback-based functionality can be converted to Promises using promisify: require: request g = promisify(request.get) async getXKCD(n = "") = response = await g('http://xkcd.com/{n}/info.0.json') JSON.parse(response.body) async: requests = await all 1..10 each i -> getXKCD(i) requests each req -> print req.alt Classes: class Person: constructor(name, age) = @name = name @age = age advance-inexorably-towards-death(n > 0 = 1) = @age += n say-name() = print 'Hello! My name is {@name}!' alice = Person("alice", 25) Pattern matching acts like a better switch or case statement. It can match values, types, extract values from arrays or objects, etc. match thing: 0 -> print "The thing is zero" < 0 -> print "The thing is negative" R"hello (.*)"? x -> ;; note: R"..." is a regular expression print 'The thing is saying hello' Number? x or String? x -> print "The thing is a number or a string" {x, y, z} -> print 'The thing is an array of three things, {x}, {y} and {z}' {=> name} -> print 'The thing has a "name" field' else -> print "I don't know what the thing is!" Package Sidebar Install npm i earlgrey Weekly Downloads 32 Version 0.1.2 License MIT Last publish Collaborators • breuleux
__label__pos
0.953865
Posts Tagged ‘Nicholad Carr’ Pancakes and Worms The worm of conscience still begnaw thy soul. Margaret, in Richard III In a brief statement first published on Edge in March, 2005, dramatist Richard Foreman released an impassioned cri de coeur into the flow: Cathedral-like Old Structure The notion that hyperconnectivity creates a diminished subjectivity and reduces the depth of individual intellectual experience has been taken up by several others, most notably by Nicholas Carr in his book The Shallows, in which he persuasively outlines how web-based discourse and enquiry impacts our neurobiology: flattening cognition and emotions, thereby hollowing out our capacity for moral judgement and empathy. In what for me is the most significant passage in the book, Carr references the important work of Antonio Damasio, whose experiments suggest that such judgements and evaluations are inherently slow. As Carr writes: In one recent experiment, Damasio and his colleagues had subjects listen to stories describing people experiencing physical or psychological pain. The subjects were then put into a magnetic resonance imaging machine and their brains were scanned as they were asked to remember the stories. The experiment revealed that while the human brain reacts very quickly to demonstrations of physical pain – when you see someone injured, the primitive pain centers in your brain activate almost instantaneously – the more sophisticated mental processes of empathizing with psychological suffering unfolds much more slowly. It takes time, the researchers discovered, for the brain “to transcend immediate involvement of the body” and begin to understand and to feel “the psychological and moral dimensions of a situation”. In Too Big To Know, David Weinberger argues that our traditional conceptions of authoritative knowledge, and of Foreman’s complex inner density, all derive from qualities and limitations intrinsic to the printed page and book, and that as we pass into “the expertise of clouds”, the nature and structure of knowledge production fundamentally changes. Thus we must rethink our understanding of intelligence within the context of networks, “where the smartest person in the room is the room.” I have no argument with Weinberger, as far as he goes. Indeed, his skillful discussion of how networks dissolve traditional power structures within academia and bureaucracies strikes me as accurate and illuminating. Yet strong as he is when discussing the impact of the web on scientific knowledge in particular, he evades the deeper dimensions of Carr’s critique, particularly regarding the “nobler instincts” of moral consciousness. House of Pancakes: New Structure? The worm of conscience needs a rich and dense soil to sustain its penetrations; the lifelong self-examination that is essential to our humanity. What sort of soil does webbed intelligence offer to the worm? Is the network Too Big To Gnaw? Weinberger’s final chapter focuses on those qualities that make for good netizens, urging us to open access; provide hooks; link everything; include everyone; teach everyone. Laudable as such normative behaviors may be, what about those pesky ancient questions of virtue, justice and wisdom; the conduct of a good life, and the character of a civilization? Or perhaps the new structure of knowledge production is “too smart” for such old fashioned aspirations? Towards the end of his book, Nicholas Carr writes: What matters in the end is not our becoming but what we become. In the 1950s, Martin Heidegger observed that the looming “tide of technological revolution” could “so captivate, bewitch, dazzle, and beguile man that calculative thinking may someday come to be accepted and practiced as the only way of thinking.” Our ability to engage in “meditative thinking,” which he saw as the very essence of our hunanity, might become a victim of headlong progress. The tumultuous advance of technology could, like the arrival of the locomotive at the Concord station, drown out the refined perceptions, thoughts, and emotions that arise only through contemplation and reflection. The “frenziedness of technology,” Heidegger wrote, threatens to “entrench itself everywhere”. It may be that we are now entering the final stage of that entrenchment. We are welcoming the frenziedness into our souls. Returning briefly to Foreman and his theater: Over the years, I have had several occasions to witness the feverish lumberjacking taking place inside the darkened chambers of Foreman’s Ontological-Hysteric theater. Several of the devices used by Foreman to clear cut the dead wood of previous achievements from our assembled sensoria, including rapid and sudden changes in the intensity and volume of light and sound, all too closely resemble the sort of brutal wood chipping of existential platforms developed by the CIA (among others) within the Total Theater of “no touch” psychological torture. On each occasion of my own attendance, I left Foreman’s theater of sensual and cognitive disorientation feeling exhausted, rather than illuminated; pacified, rather than provoked; flattened, rather than engaged. Come to think of it, I left his theater as less of a person, and more of a pancake. Could it be that the Ontological-Hysteric theater anticipated and represented for its audience Heidegger’s frenziedness of technology, the final stage of which Foreman now decries? The gods pound on our heads, and play with us all. Total Theater: Wake Up Mr. Sleepy
__label__pos
0.843717
Connection Issue with my Database I am having a connection issue with my database. One database is on a server which I can connect to and the other is on the IIS of a laptop computer. I can see and open the database on the laptop via Enterprise Manager. I can see the tables as well. I have given the db on the laptop a user name and password which works in Enterprise Manager. I have also just used the SA access which works. The problem is that when I try to connect via my webpage it says that the server does not exist. The following connection works: "Driver={SQL Server};Server=PWCCORE;Database=Veneer;UID=sa;PWD=sharky7676" These connections were modeled after the connection above and do not work. 1)      "Driver={SQL Server};Server=PWC109;Database=Veneer;UID=jcoats;PWD=deovin" 2)      "Driver={SQL Server};Server=PWC109/VENEER;Database=Veneer;" 3)      "Driver={SQL Server};Server=PWC109/VENEER;Database=Veneer;UID=sa;PWD=" 4)      "Driver={SQL Server};Server=PWC109;Database=Veneer;UID=jcoats;PWD=deovin" 5)      "Driver={SQL Server};Server=PWC109;Database=Veneer;UID=sa;PWD=" 6)      "Driver={SQL Server};Server=PWC109;Database=Veneer; This is the error that I get for the code above: Technical Information (for support personnel) "      Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. /pwc109/tbl_RM_Materials_Insert_Scarf.asp, line 10 "      Browser Type: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) "      Page: GET /pwc109/tbl_RM_Materials_Insert_Scarf.asp This is the page that generates the error message: ------------------------------------------------------------------------------------------------------------------- <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include file="Connections/veneermove.asp" --> <!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" --> <% Dim rs_Supplier Dim rs_Supplier_cmd Dim rs_Supplier_numRows Set rs_Supplier_cmd = Server.CreateObject ("ADODB.Command") rs_Supplier_cmd.ActiveConnection = MM_veneermove_STRING rs_Supplier_cmd.CommandText = "SELECT supplier_name FROM dbo.tbl_suppliers ORDER BY supplier_name DESC" rs_Supplier_cmd.Prepared = true Set rs_Supplier = rs_Supplier_cmd.Execute rs_Supplier_numRows = 0 %> <% Dim rs_Location Dim rs_Location_numRows Set rs_Location = Server.CreateObject("ADODB.Recordset") rs_Location.ActiveConnection = MM_veneermove_STRING rs_Location.Source = "SELECT LocationNum FROM dbo.tbl_location ORDER BY LocationNum DESC" rs_Location.CursorType = 0 rs_Location.CursorLocation = 2 rs_Location.LockType = 1 rs_Location.Open() rs_Location_numRows = 0 %> <% Dim rs_Grade Dim rs_Grade_cmd Dim rs_Grade_numRows Set rs_Grade_cmd = Server.CreateObject ("ADODB.Command") rs_Grade_cmd.ActiveConnection = MM_veneermove_STRING rs_Grade_cmd.CommandText = "SELECT grade FROM dbo.tbl_grades ORDER BY grade DESC" rs_Grade_cmd.Prepared = true Set rs_Grade = rs_Grade_cmd.Execute rs_Grade_numRows = 0 %> <% Dim rs_Thickness Dim rs_Thickness_numRows Set rs_Thickness = Server.CreateObject("ADODB.Recordset") rs_Thickness.ActiveConnection = MM_veneermove_STRING rs_Thickness.Source = "SELECT thickness FROM dbo.tbl_thickness ORDER BY thickness DESC" rs_Thickness.CursorType = 0 rs_Thickness.CursorLocation = 2 rs_Thickness.LockType = 1 rs_Thickness.Open() rs_Thickness_numRows = 0 %> <% Dim rs_Grades Dim rs_Grades_numRows Set rs_Grades = Server.CreateObject("ADODB.Recordset") rs_Grades.ActiveConnection = MM_veneermove_STRING rs_Grades.Source = "SELECT grade FROM dbo.tbl_grades" rs_Grades.CursorType = 0 rs_Grades.CursorLocation = 2 rs_Grades.LockType = 1 rs_Grades.Open() rs_Grades_numRows = 0 %> <% Dim rs_Quantity Dim rs_Quantity_cmd Dim rs_Quantity_numRows Set rs_Quantity_cmd = Server.CreateObject ("ADODB.Command") rs_Quantity_cmd.ActiveConnection = MM_veneermove_STRING rs_Quantity_cmd.CommandText = "SELECT quantity_count FROM dbo.tbl_scarf_count ORDER BY quantity_count DESC" rs_Quantity_cmd.Prepared = true Set rs_Quantity = rs_Quantity_cmd.Execute rs_Quantity_numRows = 0 %> <% Dim rs_Status Dim rs_Status_cmd Dim rs_Status_numRows Set rs_Status_cmd = Server.CreateObject ("ADODB.Command") rs_Status_cmd.ActiveConnection = MM_veneermove_STRING rs_Status_cmd.CommandText = "SELECT status FROM dbo.tbl_status ORDER BY status DESC" rs_Status_cmd.Prepared = true Set rs_Status = rs_Status_cmd.Execute rs_Status_numRows = 0 %> <% if (cStr(cStr(Request.Form("RM_Grade"))) <> "") then Session("GradeDropDownList") = "" & cStr(cStr(Request.Form("RM_Grade"))) & "" end if%> <% if (cStr(cStr(Request.Form("RM_Supplier"))) <> "") then Session("SupplierDropDownList") = "" & cStr(cStr(Request.Form("RM_Supplier"))) & "" end if%> <% if (cStr(cStr(Request.Form("RM_Location"))) <> "") then Session("LocationDropDownList") = "" & cStr(cStr(Request.Form("RM_Location"))) & "" end if%> <% if (cStr(cStr(Request.Form("RM_Thickness"))) <> "") then Session("ThicknessDropdownList") = "" & cStr(cStr(Request.Form("RM_Thickness"))) & "" end if%> <% if (cStr(cStr(Request.Form("RM_Quantity"))) <> "") then Session("QuantityDropdownList") = "" & cStr(cStr(Request.Form("RM_Quantity"))) & "" end if%> <% if (cStr(cStr(Request.Form("RM_Status"))) <> "") then Session("StatusDropdownList") = "" & cStr( Session("StatusDropdownList") ) & "" end if %> <% ' Declare variables: Dim WADAInsertForm Dim strRM_Thickness ' Read in the data entered into the form: strRM_Thickness = Request.Form("RM_Thickness") ' Do data validation: WADAInsertForm = True If strRM_Thickness = "" Then WADAInsertForm = False ' Since I'm illustrating how to maintain the form's data, ' I'll force the form to fail validation so that the page ' will always display the form no matter what values are ' entered. In order to actually use a form of this type ' you should remove or comment out the following line: WADAInsertForm = False ' Read in the data entered into the form: strRM_Thickness = Request.Form("RM_Thickness") ' WA Application Builder Insert if (cStr(Request.Form("Insert.x")) <> "") then Session("RM_BCODE") = Request.Form("RM_BCODE") Session("RM_Location") = Request.Form("RM_Location") Session("RM_Supplier") = Request.Form("RM_Supplier") Session("RM_Grade") = Request.Form("RM_Grade") Session("RM_Thickness") = Request.Form("RM_Thickness") Session("RM_Quantity") = Request.Form("RM_Quantity") Session("RM_Status") = Request.Form("RM_Status") WA_connection = MM_veneermove_STRING WA_table = "dbo.tbl_RM_Materials" WA_sessionName = "WADA_Insert_dbotbl_RM_Materials" WA_redirectURL = "tbl_RM_Materials_Insert_Scarf.asp" WA_keepQueryString = false WA_indexField = "RM_ID" WA_fieldNamesStr = "RM_BCODE|RM_DateTime|RM_PurchOrd|RM_Location|RM_Supplier|RM_Grade|RM_Thickness|RM_Quantity|RM_Status|RM_Product" WA_fieldValuesStr = "" & cStr(cStr(Request.Form("RM_BCODE"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_DateTime"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_PurchOrd"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Location"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Supplier"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Grade"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Thickness"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Quantity"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Status"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Product"))) & "" WA_columnTypesStr = "',none,''|',none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''" WA_comparisonStr = " LIKE | = | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE " WA_fieldNames = Split(WA_fieldNamesStr,"|") WA_fieldValues = Split(WA_fieldValuesStr,"|") WA_columns = Split(WA_columnTypesStr,"|") WA_comparisions = Split(WA_comparisonStr, "|") insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1) set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = WA_connection MM_editCmd.CommandText = "INSERT INTO " & WA_table & " (" & insertParamsObj(1) & ") VALUES (" & insertParamsObj(2) & ")" MM_editCmd.Execute() MM_editCmd.ActiveConnection.Close() obj = WA_AB_generateWhereClause(WA_fieldNames, WA_columns, WA_fieldValues, WA_comparisions) sqlstr = "SELECT " & WA_indexField & " FROM " & WA_table & " WHERE " & obj & " ORDER BY " & WA_indexField & " DESC" set WA_AppBuilderRecordset = Server.CreateObject("ADODB.Recordset") WA_AppBuilderRecordset.ActiveConnection = WA_connection WA_AppBuilderRecordset.Source = sqlstr WA_AppBuilderRecordset.CursorType = 0 WA_AppBuilderRecordset.CursorLocation = 2 WA_AppBuilderRecordset.LockType = 1 WA_AppBuilderRecordset.Open() if (NOT WA_AppBuilderRecordset.EOF) then Session(WA_sessionName) = WA_AppBuilderRecordset.Fields.Item(WA_indexField).Value WA_AppBuilderRecordset.Close() if (WA_redirectURL <> "") then if (WA_keepQueryString AND Request.QueryString <> "" AND Request.QueryString.Count > 0) then if (inStr(WA_redirectURL,"?") > 0) then WA_redirectURL = WA_redirectURL & "&" else WA_redirectURL = WA_redirectURL & "?" end if WA_redirectURL = WA_redirectURL & Request.QueryString end if Response.Redirect(WA_redirectURL) end if end if %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>tbl_RM_Materials_Insert_Scarf</title> <link href="file:///C|/Inetpub/wwwroot/PACINET/Veneermove/WA_DataAssist/styles/Modular_Pacifica.css" rel="stylesheet" type="text/css" /> <link href="file:///C|/Inetpub/wwwroot/PACINET/Veneermove/WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- body { background-color: #EBD7FF; } .style2 {font-size: 16px} .style3 { color: #FF0000; font-style: italic; } a:link { color: #1E23F9; } a:hover { color: #000000; } a:active { color: #FF0000; } body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; } --> </style> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> </head> <body onload="document.forms['WADAInsertForm'].RM_BCODE.focus();"> <div id="Layer1" style="position:absolute; left:350px; top:145px; width:222px; height:21px; z-index:1"><strong><span class="style2">SCARF SAW INSERTION PAGE </span></strong></div> <div class="WADAInsertContainer"> <form action="tbl_RM_Materials_Insert_Scarf.asp" method="post" name="WADAInsertForm" id="WADAInsertForm"> <div class="WADAHeaderText">Make selections first, then scan barcode to submit</div> <table class="WADADataTable" cellpadding="0" cellspacing="0" border="0"> <tr> <th class="WADADataTableHeader"><div align="left">BCODE:</div></th> <td class="WADADataTableCell"><input name="RM_BCODE" type="text" id="RM_BCODE" value="" size="20" /></td> </tr> <tr> <th class="WADADataTableHeader"><div align="left">Date Time:</div></th> <td class="WADADataTableCell"><input type="text" readonly name="RM_DateTime" id="RM_DateTime" value="<%response.write( now())%>" size="20" /></td> </tr> <tr> <th class="WADADataTableHeader"></th> <td class="WADADataTableCell"><input type="hidden" readonly name="RM_PurchOrd" id="RM_PurchOrd" size="20" /></td> </tr> <tr> <th class="WADADataTableHeader"><div align="left">Location:</div></th> <td class="WADADataTableCell"> <select name="RM_Location"> <% While (NOT rs_Location.EOF) %> <option value="<%=(rs_Location.Fields.Item("LocationNum").Value)%>" <%If (Not isNull(Session("LocationDropDownList"))) Then If (CStr(rs_Location.Fields.Item("LocationNum").Value) = CStr(Session("LocationDropDownList"))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_Location.Fields.Item("LocationNum").Value)%></option> <% rs_Location.MoveNext() Wend If (rs_Location.CursorType > 0) Then rs_Location.MoveFirst Else rs_Location.Requery End If %> </select></td> </tr> <tr> <th class="WADADataTableHeader"><div align="left">Supplier:</div></th> <td class="WADADataTableCell"> <select name="RM_Supplier"> <% While (NOT rs_Supplier.EOF) %> <option value="<%=(rs_Supplier.Fields.Item("supplier_name").Value)%>" <%If (Not isNull(Session("SupplierDropDownList"))) Then If (CStr(rs_Supplier.Fields.Item("supplier_name").Value) = CStr(Session("SupplierDropDownList"))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_Supplier.Fields.Item("supplier_name").Value)%></option> <% rs_Supplier.MoveNext() Wend If (rs_Supplier.CursorType > 0) Then rs_Supplier.MoveFirst Else rs_Supplier.Requery End If %> </select></td> </tr> <tr> <th class="WADADataTableHeader"><div align="left">Grade:</div></th> <td class="WADADataTableCell"> <select name="RM_Grade"> <% While (NOT rs_Grades.EOF) %> <option value="<%=(rs_Grades.Fields.Item("grade").Value)%>" <%If (Not isNull(Session("GradeDropDownList"))) Then If (CStr(rs_Grades.Fields.Item("grade").Value) = CStr(Session("GradeDropDownList"))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_Grades.Fields.Item("grade").Value)%></option> <% rs_Grades.MoveNext() Wend If (rs_Grades.CursorType > 0) Then rs_Grades.MoveFirst Else rs_Grades.Requery End If %> </select></td> </tr> <tr> <th class="WADADataTableHeader"><div align="left">Thickness:</div></th> <td class="WADADataTableCell"> <select name="RM_Thickness"> <% While (NOT rs_Thickness.EOF) %> <option value="<%=(rs_Thickness.Fields.Item("thickness").Value)%>" <%If (Not isNull(Session("ThicknessDropdownList"))) Then If (CStr(rs_Thickness.Fields.Item("thickness").Value) = CStr(Session("ThicknessDropdownList"))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_Thickness.Fields.Item("thickness").Value)%></option> <% rs_Thickness.MoveNext() Wend If (rs_Thickness.CursorType > 0) Then rs_Thickness.MoveFirst Else rs_Thickness.Requery End If %> </select></td> </tr> <tr> <th class="WADADataTableHeader"><div align="left">Quantity:</div></th> <td class="WADADataTableCell"> <select name="RM_Quantity"> <% While (NOT rs_Quantity.EOF) %> <option value="<%=(rs_Quantity.Fields.Item("quantity_count").Value)%>" <%If (Not isNull(Session("QuantityDropdownList"))) Then If (CStr(rs_Quantity.Fields.Item("quantity_count").Value) = CStr(Session("QuantityDropdownList"))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_Quantity.Fields.Item("quantity_count").Value)%></option> <% rs_Quantity.MoveNext() Wend If (rs_Quantity.CursorType > 0) Then rs_Quantity.MoveFirst Else rs_Quantity.Requery End If %> </select></td> </tr> <tr> <th class="WADADataTableHeader"><div align="left">Status:</div></th> <td class="WADADataTableCell"> <select name="RM_Status"> <% While (NOT rs_Status.EOF) %> <option value="<%=(rs_Status.Fields.Item("status").Value)%>" <%If (Not isNull(Session("StatusDropdownList"))) Then If (CStr(rs_Status.Fields.Item("status").Value) = CStr(Session("StatusDropdownList"))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_Status.Fields.Item("status").Value)%></option> <% rs_Status.MoveNext() Wend If (rs_Status.CursorType > 0) Then rs_Status.MoveFirst Else rs_Status.Requery End If %> </select></td> </tr> <tr> <th class="WADADataTableHeader"><div align="left"></div></th> <td class="WADADataTableCell"><input type="hidden" readonly name="RM_Product" id="RM_Product" size="20" /></td> </tr> </table> <div class="WADAButtonRow"> <table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="WADADataNavButtonCell" nowrap="nowrap"><input name="Insert" type="image" id="Insert" value="Insert" onClick="return confirm('Are you sure you would like to insert this record?')" src="WA_DataAssist/images/Pacifica/Modular_insert.gif" alt="Insert" width="56" height="17" hspace="0" vspace="0" border="0" /></td> <td class="WADADataNavButtonCell" nowrap="nowrap"><a href="tbl_RM_Materials_Results.asp"><img src="WA_DataAssist/images/Pacifica/Modular_cancel.gif" alt="Cancel" name="Cancel" width="56" height="17" border="0" id="Cancel" /></a></td> </tr> </table> <input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="" > </div> </form> <table width="550" border="0"> <tr> <td> <p><strong><span class="style3">MAKE ALL SELECTIONS AS APPROPRIATE PRIOR TO SCANNING! </span>Once selections have been made place cursor in &quot;BCODE&quot; field. You may now scan barcode to submit unit to floor inventory.</strong></p> </td> </tr> </table> <table width="175" border="0"> <tr> <td width="175"><div align="center"><a href="Scarf_Instructions.htm" class="WADAHeaderText">Page Instructions</a></div></td> </tr> </table> <table border="0"> <tr> <td> </form> <form name="form2" method="post" action="http://localhost/pwc109/tbl_RM_Materials_Results.asp"> <input type="submit" name="Submit" value="Floor Inventory"> </form> </td> </tr> </table></p> </div> </body> </html> <% rs_Supplier.Close() Set rs_Supplier = Nothing %> <% rs_Location.Close() Set rs_Location = Nothing %> <% rs_Grade.Close() Set rs_Grade = Nothing %> <% rs_Thickness.Close() Set rs_Thickness = Nothing %> <% rs_Grades.Close() Set rs_Grades = Nothing %> <% rs_Quantity.Close() Set rs_Quantity = Nothing %> <% rs_Status.Close() Set rs_Status = Nothing %> ------------------------------------------------------------------------------------------------------------------- This is the connection page. ------------------------------------------------------------------------------------------------------------------- <% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' DesigntimeType="ADO" ' HTTP="false" ' Catalog="" ' Schema="" Dim MM_veneermove_STRING MM_veneermove_STRING = "Driver={SQL Server};Server=PWCCORE;Database=Veneer;UID=sa;PWD=sharky7676" ' The line of code above will not connect to the second db while used as the MM_veneermove_STRING. ' The "dsn=PWC109" does work when using the Application tool in Dreamweaver. ' The line below will connect to the first db when used as the MM_veneermove_STRING ' "Driver={SQL Server};Server=PWCCORE;Database=Veneer;UID=sa;PWD=sharky7676" ' "Driver={SQL Server};Server=PWC109/VENEER;Database=Veneer;UID=jcoats;PWD=deovin" ' Shouldn't this work best when you change the connection file this way you don't have to fix all the pages with the new code. ' "dsn=PWC109\VENEER;uid=jcoats;pwd=deovin;" %> I am having a connection issue with my database. One database is on a server which I can connect to and the other is on the IIS of a laptop computer. I can see and open the database on the laptop via Enterprise Manager. I can see the tables as well. I have given the db on the laptop a user name and password which works in Enterprise Manager. I have also just used the SA access which works. The problem is that when I try to connect via my webpage it says that the server does not exist. The following connection works on the server based database: "Driver={SQL Server};Server=PWCCORE;Database=Veneer;UID=sa;PWD=sharky7676" These connections were modeled after the connection above and do not work when tried on the IIS based laptop database. The name of the server on the laptop in Enterprise Manager shows up as "PWC109/VENEER" but I have tried it just as "PWC109" which does not either. 1) "Driver={SQL Server};Server=PWC109;Database=Veneer;UID=jcoats;PWD=deovin" 2) "Driver={SQL Server};Server=PWC109/VENEER;Database=Veneer;" 3) "Driver={SQL Server};Server=PWC109/VENEER;Database=Veneer;UID=sa;PWD=" 4) "Driver={SQL Server};Server=PWC109;Database=Veneer;UID=jcoats;PWD=deovin" 5) "Driver={SQL Server};Server=PWC109;Database=Veneer;UID=sa;PWD=" 6) "Driver={SQL Server};Server=PWC109;Database=Veneer; This is the error that I get for the code above: Technical Information (for support personnel) " Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. /pwc109/tbl_RM_Materials_Insert_Scarf.asp, line 10 " Browser Type: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) " Page: GET /pwc109/tbl_RM_Materials_Insert_Scarf.asp Open in new window James CoatsComputer Info. Sys. StudentAsked: Who is Participating?   newbiealCommented: Here are some good troubleshooting tips: http://www.teratrax.com/articles/sql_server_access_denied.html 0 Question has a verified solution. Are you are experiencing a similar issue? Get a personalized answer when you ask a related question. Have a better answer? Share it in a comment. All Courses From novice to tech pro — start learning today.
__label__pos
0.899712
Branching, Merging and Unit Testing More on branching and merging vs. sharing and pinning Branching and merging in TFS provide a more robust way to accomplish what sharing and pinning are often used for in VSS. In TFS, you would branch a directory (source), using the “branch source target” command, to the desired location (target). Then when there are changes in the source that you need in the target, you would use the “merge source target” command to propagate the changes. The merge command remembers what changes have have been brought over to the target, so it brings the target up to date with the source by only merging changes that have not been merged. [UPDATE]: And a sample here: A simple example using branch and merge Here’s a simple example that uses the command line. The biggest differences between this and a “real-world“ example are the number of files involved (you may have thousands) and that you would probably have conflicts for a subset of the files (e.g., the same file was edited both in the source and in the target, resulting in the need to do a 3-way content merge). Why Unit Testing in Visual Studio Team System agree with you that Unit Testing has enough value to stand as a feature across all versions of Visual Studio. However, several of our tools in Team System fit into that category: Profiling, Static Analysis, etc. Our approach wasn’t really to ask, “Is this tool valuable enough to help all developers?”… We build most of our tools with that target in mind. Instead, we tried to ask the question, “Where can this tool provide the most value?” and in our current thinking the answer is along the lines of “as a feature integrated with the rest of the product lifecycle tools found in Team System.” Over time, we may revisit this decision, but for the 2005 version, we feel confident that this is the right choice. Comments (0)
__label__pos
0.654976
Book Image Learn C Programming By : Jeff Szuhay Book Image Learn C Programming By: Jeff Szuhay Overview of this book C is a powerful general-purpose programming language that is excellent for beginners to learn. This book will introduce you to computer programming and software development using C. If you're an experienced developer, this book will help you to become familiar with the C programming language. This C programming book takes you through basic programming concepts and shows you how to implement them in C. Throughout the book, you'll create and run programs that make use of one or more C concepts, such as program structure with functions, data types, and conditional statements. You'll also see how to use looping and iteration, arrays, pointers, and strings. As you make progress, you'll cover code documentation, testing and validation methods, basic input/output, and how to write complete programs in C. By the end of the book, you'll have developed basic programming skills in C, that you can apply to other programming languages and will develop a solid foundation for you to advance as a programmer. Table of Contents (33 chapters) 1 Section 1: C Fundamentals 10 Section 2: Complex Data Types 19 Section 3: Memory Manipulation 22 Section 4: Input and Output 28 Section 5: Building Blocks for Larger Programs Manipulating a structure consisting of other structures The operations we want to perform on a Hand structure include the following: • InitializeHand(): Sets the initial values of a Hand structure to a valid state • AddCardToHand(): Receives a dealt card from the deck to the hand • PrintHand(): Prints out the contents of the hand With our current definition of Hand, we will need a way to determine which card in the hand we want to manipulate. To do this, we need a function: • GetCardInHand(): Gets a pointer to a specific card within the hand. This method is used by other Hand functions to both set card values within a hand and to retrieve card values. You can add the following function prototypes to carddeck_2.c: voidInitializeHand( Hand* pHand ); voidAddCardToHand(Hand* pHand , Card* pCard ); voidPrintHand(Hand* pHand , char* pHandStr , char* pLeadStr ); Card* GetCardInHand(Hand* pHand ...
__label__pos
0.902585
Take the 2-minute tour × Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free. I am trying to get an interpolation of one color to another shade of the same color. (for eg: sky blue to dark blue and then back). I stumbled upon some code that could be used if the range was from 0-255 or 0-1. However, in my case, I have the RGB codes for Color1 and Color2, and want the rotation to occur. Color 1: 151,206,255 Color 2: 114,127,157 Any ideas how to go about this? share|improve this question      Normally you would do the interpolation in another colour space, e.g. HSV, and convert the interpolated HSV values back to RGB. –  Paul R Nov 21 '12 at 8:19      Your color codes seems to be RGB... –  Synxis Nov 21 '12 at 8:20      @PaulR: Why is that we won't use RGB in interpolation? –  user1240679 Nov 21 '12 at 8:21      @Synxis: These are RGB in fact and I was thinking of interpolation in RGB terms. Didn't know about HSV stuff ;/ –  user1240679 Nov 21 '12 at 8:23 2   The HSV colour space corresponds much more closely to colour as it is perceived by humans - if you want a "natural" interpolation between two colours you therefore want to use a colour space that varies in an appropriate way - e.g. you don't want the perceived brightness to change as you interpolate. –  Paul R Nov 21 '12 at 8:25 5 Answers 5 up vote 3 down vote accepted I suggest you convert RGB to HSV, then adjust its components, then convert back to RGB. Wikipedia has an article about it, and it's been discussed here before: HSL to RGB color conversion Algorithm to convert RGB to HSV and HSV to RGB? Also many frameworks have conversion functions, for example Qt has QColor class. But the question was about the actual interpolation... here's a trivial interpolation function: // 0 <= stepNumber <= lastStepNumber int interpolate(int startValue, int endValue, int stepNumber, int lastStepNumber) { return (endValue - startValue) * stepNumber / lastStepNumber + startValue; } So call that for all color components you want to interpolate, in a loop. With RBG interpolation, you need to interpolate every component, in some other color space you may need to interpolate just one. share|improve this answer      And the interpolation ? –  user1240679 Nov 21 '12 at 8:25      If you want an example loop, you could add some more info to the question, like how do you get the colors, what the color struct/class looks like, and where do you want to put the results (series of colors). –  hyde Nov 21 '12 at 8:54      HSV is only an improvement over RGB if the hue values are widely separated. –  Mark Ransom Apr 24 at 16:13 Convert your RGB colors to HSV then interpolate each component (not only the color, see end of answer), afterwards you can convert back to RGB. You can do RGB interpolation, but the results are better with HSV, because in this space color is separated from luminance and saturation (Wikipedia article on HSV). HSV interpolation is more "logical" than the RGB one, because with the latter you can get extra colors while interpolating. Some code for interpolation: template<typename F> ColorRGB interpolate(ColorRGB a, ColorRGB, b, float t, F interpolator) { // 0.0 <= t <= 1.0 ColorHSV ca = convertRGB2HSV(a); ColorHSV cb = convertRGB2HSV(b); ColorHSV final; final.h = interpolator(ca.h, cb.h, t); final.s = interpolator(ca.s, cb.s, t); final.v = interpolator(ca.v, cb.v, t); return convertHSV2RGB(final); } int linear(int a, int b, float t) { return a * (1 - t) + b * t; } // use: result = interpolate(color1,color2,ratio,&linear); share|improve this answer I know this is little bit old, but is worthy if someone is searching for it. First of all, you can do interpolation in any color space, including RGB, which, in my opinion, is one of the easiest. Let's assume the variation will be controlled by a fraction value between 0 and 1 (e.g. 0.3), where 0 means full color1 and 1 means full color2. The theory: Result = (color2 - color1) * fraction + color1 Applying: As the RGB has 3 channels (red, green and blue) we have to perform this math for each one of the channels. Using your example colors: color1: 151,206,255 color 2: 114,127,157 R = (114-151) * fraction + 151 G = (127-206) * fraction + 206 B = (157-255) * fraction + 255 Simple like that! share|improve this answer I see that you have tagged this question under "openframeworks" tag. so all you need to do is use the method ofColor::getLerped or ofColor::lerp getLerped returns new value, while lerp modifies the color. for example: ofColor c1(151,206,255); ofColor c2(114,127,157); float p = 0.2f; ofColor c3 = c1.getLerped(c2, p); or c1.lerp(c2, 0.3f); share|improve this answer I have adapted Synxis's C example (above) into an executable JavaScript program. The program interpolates the color yellow, from red and green. The input and output is in RGB-space, but the interpolation is handled in the HSV-space. I also added an RGB interpolation example. As you can see below, a dark-yellow is produced if you interpolate red and green in RGB-space. /** Main */ var red = { r : 255, g : 0, b : 0 }; var green = { r : 0, g : 255, b : 0 }; var yellow = interpolateHsv(red, green, 0.5, linear); var darkYellow = interpolateRgb(red, green, 0.5, linear); document.body.innerHTML = 'Yellow: ' + JSON.stringify(yellow, null, ' ') + '<br />' + 'Dark Yellow: ' + JSON.stringify(darkYellow, null, ' '); /** * Returns an HSV interpolated value between two rgb values. * * @param {Object} rgbA - rgb() tuple * @param {Object} rgbB - rgb() tuple * @param {Number} threshold - float between [0.0, 1.0] * @param {function} interpolatorFn - interpolator function * @return {Object} rbg */ function interpolateHsv(rgbA, rgbB, threshold, interpolatorFn) { var hsvA = rgbToHsv(rgbA); var hsvB = rgbToHsv(rgbB); threshold = toArray(threshold, 3); return hsvToRgb({ h : interpolatorFn(hsvA.h, hsvB.h, threshold[0]), s : interpolatorFn(hsvA.s, hsvB.s, threshold[1]), v : interpolatorFn(hsvA.v, hsvB.v, threshold[2]) }); } /** * Returns an RGB interpolated value between two rgb values. * * @param {Object} rgbA - rgb() tuple * @param {Object} rgbB - rgb() tuple * @param {Number} threshold - float between [0.0, 1.0] * @param {function} interpolatorFn - interpolator function * @return {Object} rbg */ function interpolateRgb(rgbA, rgbB, threshold, interpolatorFn) { threshold = toArray(threshold, 3); return { r : ~~interpolatorFn(rgbA.r, rgbB.r, threshold[0]), g : ~~interpolatorFn(rgbA.g, rgbB.g, threshold[1]), b : ~~interpolatorFn(rgbA.b, rgbB.b, threshold[2]) }; } /** * Returns an interpolated value between two values. * * @param {Number} valueA - color channel int value * @param {Number} valueB - color channel int value * @param {Number} threshold - float between [0.0, 1.0] * @param {function} interpolatorFn - interpolator function * @return {int} */ function linear(valueA, valueB, threshold) { return valueA * (1 - threshold) + valueB * threshold; } /** * Converts an RGB color value to HSV. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSV_color_space. * Assumes r, g, and b are contained in the set [0, 255] and * returns h, s, and v in the set [0, 1]. * * @param {Object} rgb - Color in rgb mode * @return {Object} - Color in hsv mode */ function rgbToHsv(rgb) { var r = rgb.r / 255, g = rgb.g / 255, b = rgb.b / 255; var max = Math.max(r, g, b), min = Math.min(r, g, b); var h, s, v = max; var d = max - min; s = max === 0 ? 0 : d / max; if (max == min) { h = 0; // achromatic } else { switch(max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } return { h : h, s : s, v : v }; } /** * Converts an HSV color value to RGB. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSV_color_space. * Assumes h, s, and v are contained in the set [0, 1] and * returns r, g, and b in the set [0, 255]. * * @param {Object} hsv - Color in hsv mode * @return {Object} - Color in rgb mode */ function hsvToRgb(hsv){ var r, g, b, i, f, p, q, t, h = hsv.h, s = hsv.s, v = hsv.v; i = Math.floor(h * 6); f = h * 6 - i; p = v * (1 - s); q = v * (1 - f * s); t = v * (1 - (1 - f) * s); switch(i % 6){ case 0: r = v, g = t, b = p; break; case 1: r = q, g = v, b = p; break; case 2: r = p, g = v, b = t; break; case 3: r = p, g = q, b = v; break; case 4: r = t, g = p, b = v; break; case 5: r = v, g = p, b = q; break; } return { r : r * 255, g : g * 255, b : b * 255 }; } function isNumeric(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function toArray(arr, size) { var isNum = isNumeric(arr); arr = !Array.isArray(arr) ? [arr] : arr; for (var i = 1; i < size; i++) { if (arr.length < size) { arr.push(isNum ? arr[0] : 0); } } return arr; } share|improve this answer Your Answer   discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged or ask your own question.
__label__pos
0.986996
Skip site navigation (1) Skip section navigation (2) WIP: explain analyze with 'rows' but not timing From: Tomas Vondra <tv(at)fuzzy(dot)cz> To: pgsql-hackers(at)postgreSQL(dot)org Subject: WIP: explain analyze with 'rows' but not timing Date: 2011-12-23 00:37:43 Message-ID: [email protected] (view raw or whole thread) Thread: Lists: pgsql-hackers Hi all, most of the time I use auto_explain, all I need is duration of the query and the plan with estimates and actual row counts. And it would be handy to be able to catch long running queries with estimates that are significantly off (say 100x lower or higher compared to actual row numbers). The gettimeofday() calls are not exactly cheap in some cases, so why to pay that price when all you need is the number of rows? The patch attached does this: 1) adds INSTRUMENT_ROWS, a new InstrumentOption - counts rows without timing (no gettimeofday() callse) - if you want timing info, use INSTRUMENT_TIMER 2) adds new option "TIMING" to EXPLAIN, i.e. EXPLAIN (ANALYZE ON, TIMING ON) SELECT ... 3) adds auto_explain.log_rows_only (false by default) - if you set this to 'true', then the instrumentation will just count rows, without calling gettimeofday() It works quite well, except one tiny issue - when the log_rows_only is set to false (so that auto_explain requires timing), it silently overrides the EXPLAIN option. So that even when the user explicitly disables timing (TIMING OFF), it's overwritten and the explain collects the timing data. I could probably hide the timing info, but that'd make the issue even worse (the user would not notice that the timing was actually enabled). Maybe the right thing would be to explicitly disable timing for queries executed with "EXPLAIN (TIMING OFF)". Any other ideas how to make this work reasonably? The patch does not implement any checks (how far is the estimate from the reality) yet, that'll be round two. regards Tomas Attachment: explain-analyze-rows-only.diff Description: text/plain (7.4 KB) Responses pgsql-hackers by date Next:From: Nikhil SontakkeDate: 2011-12-23 03:25:26 Subject: Re: Review: Non-inheritable check constraints Previous:From: Phil SorberDate: 2011-12-23 00:01:21 Subject: Re: WIP patch: Improve relation size functions such as pg_relation_size() to avoid producing an error when called against a no longer visible relation Privacy Policy | About PostgreSQL Copyright © 1996-2016 The PostgreSQL Global Development Group
__label__pos
0.682061
Linux Virtualization As a system admin, I need to use additional hard drives for to provide more storage space or to separate system data from user data. This procedure, adding physical block devices to virtualized guests, describes how to add a hard drive on the host to a virtualized guest using VMWare software running Linux as guest. It is possible to add or remove a SCSI device explicitly, or to re-scan an entire SCSI bus without rebooting a running Linux VM guest. This how to is tested under Vmware Server and Vmware Workstation v6.0 (but should work with older version too). All instructions are tested on RHEL, Fedora, CentOS and Ubuntu Linux guest / hosts operating systems. { 34 comments } I’ve Windows Vista installed as a guest under Ubuntu Linux using VMWARE Workstation 6.0. This is done for testing purpose and browsing a few site that only works with Internet Explorer. Since I only use it for testing I made 16GB for Vista and 5GB for CentOS and 5GB in size for FreeBSD guest operating systems. However, after some time I realized I’m running out of disk space under both CentOS and Vista. Adding a second hard drive under CentOS solved my problem as LVM was already in use. Unfortunately, I needed to double 32GB space without creating a new D: drive under Windows Vista. Here is a simple procedure to increase your Virtual machine’s disk capacity by resizing vmware vmdk file. { 31 comments } I’ve already written about setting the MTU (Maximum Transmission Unit) under Linux including Jumbo frames (FreeBSD specific MTU information is here). With this quick tip you can increase MTU size to get a better networking performance. { 0 comments } Virtualization is the latest buzz word. You may wonder computers are getting cheaper every day, why should I care and why should I use virtualization? Virtualization is a broad term that refers to the abstraction of computer resources such as: 1. Platform Virtualization 2. Resource Virtualization 3. Storage Virtualization 4. Network Virtualization 5. Desktop Virtualization This article describes why you need virtualization and list commonly used FOSS and proprietary Linux virtualization software. { 27 comments } VirtualBox is a virtual emulator like VMWare workstation. It has many of the features VMWare has, as well as some of its own. I really like new Opensource VirtualBox from Sun. It is light on resources. Here is a quick tip – you can convert a VMware virtual machine (image) to a VirtualBox machine (image) using qemu-img utility, without reinstalling the GUEST operating system { 8 comments } I’ve already written about creating a partition size larger than 2TB under Linux using GNU parted command with GPT. In this tutorial, I will provide instructions for booting to a flat 2TB or larger RAID array under Linux using the GRUB boot loader. { 3 comments } Dunnington is Intel’s first multi-core CPU – features a single-die six- (or hexa) core design with three unified 3 MB L2 caches (resembling three merged 45 nm dual-core Wolfdale dies), and 96 KB L1 cache (Data) and 16 MB of L3 cache. It features 1066 MHz FSB, fits into the Tigerton’s mPGA604 socket, and is compatible with the Caneland chipset. These processors support DDR2-1066 (533 MHz), and have a maximum TDP below 130 W. They are intended for blades and other stacked computer systems. { 2 comments }
__label__pos
0.794367
skip to main content SciTech ConnectSciTech Connect Title: Authenticated sensor interface device A system and method for the secure storage and transmission of data is provided. A data aggregate device can be configured to receive secure data from a data source, such as a sensor, and encrypt the secure data using a suitable encryption technique, such as a shared private key technique, a public key encryption technique, a Diffie-Hellman key exchange technique, or other suitable encryption technique. The encrypted secure data can be provided from the data aggregate device to different remote devices over a plurality of segregated or isolated data paths. Each of the isolated data paths can include an optoisolator that is configured to provide one-way transmission of the encrypted secure data from the data aggregate device over the isolated data path. External data can be received through a secure data filter which, by validating the external data, allows for key exchange and other various adjustments from an external source. Authors: ; Publication Date: OSTI Identifier: 1329294 Report Number(s): 9,473,300 13/666,502 DOE Contract Number: AC09-08SR22470 Resource Type: Patent Resource Relation: Patent File Date: 2012 Nov 01 Research Org: Savannah River Site (SRS), Aiken, SC (United States) Sponsoring Org: USDOE Country of Publication: United States Language: English Subject: 99 GENERAL AND MISCELLANEOUS; 97 MATHEMATICS AND COMPUTING
__label__pos
0.996041
Rails validation spec fails (but code works in development env) I’m not sure if this is the best way to validate a foreign key in rails, but I am using the following validation to do so (Rails 3, Rspec 2): class Item < ActiveRecord::Base validates :manufacturer_id, :inclusion => { :in => Manufacturer.all.collect { |m| m.id } } end While I can create a new valid Item record in the console with the code above, it doesn’t work in my spec. The contents of my spec: describe Item do it “is valid when a manufacturer with manufacturer_id is in the database” do @manufacturer = Manufacturer.create! @item = Item.new(:manufacturer_id => @manufacturer.id) puts “VALIDATION ERRORS: #{@item.errors}” puts “ID WE’RE CHECKING FOR IN THE DB: #{@item.manufacturer.id}” puts “IDs THAT ARE IN THE DB: #{Manufacturer.all.collect { |m| m.id }.to_s}” @item.should be_valid end Which fails with: Item VALIDATION ERRORS: {:manufacturer_id=>[“is not included in the list”]} ID WE’RE CHECKING FOR IN THE DB: 2 IDs THAT ARE IN THE DB: [1, 2] is valid when a manufacturer with manufacturer_id is in the database (FAILED - 1) Failures: 1. Item valid when manufacturer_id is in database Failure/Error: @item.should be_valid expected valid? to return true, got false ./spec/models/item_spec.rb:47:in `block (2 levels) in <top (required)>’ As you can see in the information I printed with the spec output, the ID of the manufacturer is clearly in the array which the validation is using to check inclusion. Any reason why this wouldn’t work in the test env, but it would in development? Thanks for your help! Dave Hi there, di you ever find the answer? I am having the same issue now, really weird. I came across the same issue. I was trying to accomplish exactly the same thing like the original poster (make sure that association is with an actual record in the DB). I came across the same issue too, and after a little debugging the core the solution is to use Proc. This has to do with loading mechanics, IMO: when you run the spec, first the model definition is loaded, there are no records in the DB yet, so :in option is just empty array (I debugged this to be true). But if you use Proc in that place, then the query to get records from DB is executed “lazily”; by that time your spec has correct context setup (manufacturers table populated) and thus you get correct behavior from spec. In your case you should use: validates :manufacturer_id, :inclusion => { :in => Proc.new { Manufacturer.all.collect { |m| m.id } } }
__label__pos
0.848075
Beefy Boxes and Bandwidth Generously Provided by pair Networks Clear questions and runnable code get the best and fastest answer   PerlMonks   Re: split string into hash of hashes... by punch_card_don (Curate) on Mar 03, 2013 at 16:52 UTC ( #1021520=note: print w/replies, xml ) Need Help?? in reply to split string into hash of hashes... Update: Working this out for myself demonstrated to me that this is just a clunky version of Rolf's more elegant code, above. But it makes each operation more clear to my less expert eyes. This is a case where autovivification and hashrefs are your friends. With a helping hand from some creative data structure manipulation. You have two issues: 1. how to create a hash of hashes without knowing the depth of the structure in advance. 2. How to include a value for the entire dimension three levels from the bottom, knowing, as others have pointed out, that an element cannot contain at once a value and a reference to the lower levels of the structure. The solution to (1) is autovivifciation and hash refs. The solution to (2) is to pad your hash with dummy elements down to the lowest dimension. #!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; $Data::Dumper::Sortkeys = 1; print "Content-type:text/html\n\n"; my $line1 = 'HKEY_LOCAL_MACHINE\SOFTWARE\Vendor\Product\CurrentVersion +\Tokens\Encotone\SerialNumberUserAttribute=12345'; my $line2 = 'LanMan:= ; REG_SZ'; my @line1_parts = split(/[=\\]/, $line1); my @line2_parts = split(/:= ;/, $line2); my %hash; my $href = {}; my $i; for $i (0 .. $#line1_parts) { if ($i == 0) { # for the first time around, create the first level of the str +ucture, itself as a hash. Autovivification means that simply referri +ng to it creates it. No need to put anything in it yet. $hash{$line1_parts[$i]} = {}; #create a hash reference to that element (which is itself a ha +sh); $href = \%{ $hash{$line1_parts[$i]} }; } elsif ($i == $#line1_parts) { # last time around, create the acutal hash elements you want, +filling in down to the bottom level with dummy elements for the Seria +lNumberUserAttribute. $href->{'dummy'} = $line1_parts[$i]; $href->{$line2_parts[0]}{'Value'}=""; $href->{$line2_parts[0]}{'Type'}=$line2_parts[1]; } else { # each next time around, create the next level of the structur +e, itself as a hash, tacked onto the hash that the hash ref points to $href->{ $line1_parts[$i] } = {}; # move the hash ref to this new hash $href = \%{ $href->{$line1_parts[$i]} }; } } print "<pre>\n"; print Dumper(\%hash); print "</pre>\n"; Output: $VAR1 = { 'HKEY_LOCAL_MACHINE' => { 'SOFTWARE' => { 'Vendor' => { 'Product' => { 'CurrentVersion' => { 'Tokens' => { 'Encotone' => { 'SerialNumberUserAttribute' => { 'LanMan' => { 'Type' => ' REG_SZ', 'Value' => '' }, 'dummy' => '12345' } } } } } } } } Time flies like an arrow. Fruit flies like a banana. Log In? Username: Password: What's my password? Create A New User Node Status? node history Node Type: note [id://1021520] help Chatterbox? and all is quiet... How do I use this? | Other CB clients Other Users? Others lurking in the Monastery: (12) As of 2018-06-19 18:33 GMT Sections? Information? Find Nodes? Leftovers? Voting Booth? Should cpanminus be part of the standard Perl release? Results (114 votes). Check out past polls. Notices?
__label__pos
0.860688
Binary to hexadecimal conversion, Electrical Engineering Binary  to Hexadecimal  Conversion To convert a binary  number  into  hexadecimal  divide the number into group  of four  bits  each starting from the least significant bit. Then  put  equivalent hexadecimal digital for each group . Binary  to Hexadecimal  Conversion of Example 1772_Binary to Hexadecimal Conversion.PNG Example :  Convert 101111100110110012 to hexadecimal.  Solution : Divide  it in  groups of four  bits each (0001)1        (0111)7                (1100)c                 (1101)D                (1001)9 Express each  group in octal  Therefore  10111110110110012. = 17CD916.     Posted Date: 4/3/2013 5:57:38 AM | Location : United States Related Discussions:- Binary to hexadecimal conversion, Assignment Help, Ask Question on Binary to hexadecimal conversion, Get Answer, Expert's Help, Binary to hexadecimal conversion Discussions Write discussion on Binary to hexadecimal conversion Your posts are moderated Related Questions why is a delay line used in the vertical selection of oscilloscope? What is use of co-processor in a typical microprocessor based system. This is a processor that works in parallel with the major processor. This has its own set of specialized i what is a armature reaction ?? give some concepts on double rotating field theory?? thanks hi there i just need help for Electrical Engineering Design Report about any topic (prefer charger and inverter) which should be include Summary,Table of contents,Introduction,Body Explain the operation of IRET instruction.  What memory locations contain the vector for an INT 34 instruction? The Interrupt return (IRET) instruction is utilized only along w advantages and disadvantaages of superposition
__label__pos
0.955652
Passing numbers on a connector Tealium Expert Tealium Expert We have some number visitor attributes which store integers.  But when they are passed to Adobe Campaign via the Audience Connector, they are passing decimal numbers (ie "1" becomes "1.0").  Is there a way to stop this and force it to pass integers?   1 REPLY 1 Passing numbers on a connector Tealium Employee Hi @BenStephenson  If you email [email protected] telling them the account and profile, they can enable a beta feature for you.  This feature allows you to specify that a number attribute is a decimal (the default) or an integer.  This is done on the attribute, not the connector, but does change how the attribute is formatted when being sent in connector payloads.
__label__pos
0.865258
  Abstract classes I have this problem that this is my second semester in programming and i have assignments like this which i cannot understand since the teacher in Poland do not explain very well. i understand the usage of abstract classes, how they can be used and for what reasons, but what i dont understand in this example is how to (reference to the current user, or making a command like kate.buys(carrot)) i just need some help understanding this material Problem 1.4 Write a set of classes representing shopping in a supermarket. * Purchase: name of product, unit price, quantity. * Cart: contains a list (collection) of products put into this cart, reference to the current user (object of class Customer) etc. * Customer: name, reference to the currently used cart, list of bills (objects of class Bill) for purchases already completed and paid. Customer having a cart can put products into the cart (kate.buys(carrot)) and pay for all products at checkout (object of class CheckOut) receiving the Bill. *CheckOut: remembers customers who already have paid (kate.pays(checkout) and/or checkout.checksOut(kate) and their bills (which are also rememered by Customers). CheckOut can be asked for a report (object of class Report). * Bill: represents bill with customers's name, date, list of products, amount paid etc. * Report: report of checkout with list of bills paid at this checkout. _______________________________________________________________________________ 1 2 3 4 5 6 7 public abstract class Purchase { public abstract String getNameOfProduct(); public abstract int getUnitPrice(); public abstract int setQuantity(int a); } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 public class Bread extends Purchase{ int amount = 0; @Override public String getNameOfProduct() { return "Bread"; } @Override public int getUnitPrice() { return 3 * amount; } @Override public int setQuantity(int a) { return amount += a; } public int getQuantity(){ return amount; } } 1 2 3 4 5 6 7 8 9 import java.util.*; public class Cart{ List<String> sCart = new ArrayList<String>(); public void addItem(String item){ sCart.add(item); } } 1 2 3 4 5 6 7 8 9 10 11 public abstract class Customer{ String name; public void setName(String n){ name = n; } public String getName(){ return name; } } This is C++ forum, not a java one. In C++ if some class is abstract you cannot use object of this class. You should develop also inherited non-abstract class and then you can create objects of this new non-abstract class. I suppose that everything is similar in java. my bad, how do i remove post Topic archived. No new replies allowed.
__label__pos
0.965348
Home Microsoft SQL Server Operators: SELECT   SELECT Anything The SELECT operator can be used, among other things, to display a value. The SELECT keyword uses the following syntax: SELECT What Based on this, to use it, where it is needed, type SELECT followed by a number, a word, a string, or an expression. To display a sentence using SELECT, type it in single-quotes on the right side of this operator. Here is an executed example: SELECT As mentioned already, unlike PRINT, SELECT can be used to display more than one value. The values must be separated by commas. Here is an example: SELECT N'Hourly Salary', 24.85 This would produce: Nesting a SELECT Statement When you create a SELECT statement, what is on the right side of SELECT must be a value. Here is an example: SELECT 226.75; Based on this definition, instead of just being a value, the thing on the right side of SELECT must be able to produce a value. As we will see in the next sections, you can create algebraic operation on the right side of SELECT. Because we mentioned that the thing on the right side must produce a result, you can as well use another SELECT statement that it itself evaluates to a result. To distinguish the SELECT sections, the second one should be included in parentheses. Here is an example: SELECT (SELECT 448.25); GO When one SELECT statement is created after another, the second is referred to as nested. Just as you can nest one SELECT statement inside of another, you can also nest one statement in another statement that itself is nested. Here is an example: SELECT (SELECT (SELECT 1350.75)); GO SELECT This AS That In the above introductions, we used either PRINT or SELECT to display something in the query window. One of the characteristics of SELECT is that it can segment its result in different sections. SELECT represents each value in a section called a column. Each column is represented with a name also called a caption. By default, the caption displays as "(No column name)". If you want to use your own caption, on the right side of an expression, type the AS keyword followed by the desired caption. The item on the right side of the AS keyword must be considered as one word. Here is an example: SELECT 24.85 AS HourlySalary; This would produce: You can also include the item on the right side of AS in single-quotes. Here is an example: SELECT 24.85 AS N'HourlySalary'; If the item on the right side of AS is in different words, you should include it in single-quotes or put them in inside of an opening square bracket "[" and a closing square bracket "]". Here is an example: SELECT 24.85 AS 'Hourly Salary'; If you create different sections, separated by a comma, you can follow each with AS and a caption. Here is an example: SELECT N'James Knight' As FullName, 20.48 AS Salary; This would produce: SELECT this AS that The above statement could also be written as follows: SELECT N'James Knight' As [Full Name], 20.48 AS [Hourly Salary]; Home Copyright © 2007-2011 FunctionX.com, Inc.
__label__pos
0.868621
  [Search] [txt|html|pdf|bibtex] [Tracker] [WG] [Email] [Diff1] [Diff2] [Nits] From: draft-ietf-stox-presence-09 Proposed Standard Obsoleted by: 8048 Internet Engineering Task Force (IETF) P. Saint-Andre Request for Comments: 7248 &yet Category: Standards Track A. Houri ISSN: 2070-1721 IBM J. Hildebrand Cisco Systems, Inc. May 2014 Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Presence Abstract This document defines a bidirectional protocol mapping for the exchange of presence information between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP). Status of This Memo This is an Internet Standards Track document. This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741. Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7248. Copyright Notice Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Saint-Andre, et al. Standards Track [Page 1] RFC 7248 SIP-XMPP Interworking: Presence May 2014 Table of Contents 1. Introduction ....................................................2 2. Intended Audience ...............................................3 3. Terminology .....................................................3 4. Subscriptions to Presence Information ...........................4 4.1. Overview ...................................................4 4.2. XMPP to SIP ................................................5 4.2.1. Establishing a Presence Subscription ................5 4.2.2. Refreshing a Presence Subscription ..................9 4.2.3. Cancelling a Presence Subscription .................10 4.3. SIP to XMPP ...............................................12 4.3.1. Establishing a Presence Subscription ...............12 4.3.2. Refreshing a Presence Subscription .................14 4.3.3. Cancelling a Presence Subscription .................17 5. Notifications of Presence Information ..........................17 5.1. Overview ..................................................17 5.2. XMPP to SIP ...............................................19 5.3. SIP to XMPP ...............................................22 6. Requests for Presence Information ..............................24 6.1. XMPP to SIP ...............................................24 6.2. SIP to XMPP ...............................................25 7. Security Considerations ........................................26 8. References .....................................................27 8.1. Normative References ......................................27 8.2. Informative References ....................................27 Appendix A. Acknowledgements ......................................29 1. Introduction In order to help ensure interworking between presence systems that conform to the instant message / presence requirements [RFC2779], it is important to clearly define protocol mappings between such systems. Within the IETF, work has proceeded on two presence technologies: o Various extensions to the Session Initiation Protocol ([RFC3261]) for presence, in particular [RFC3856] o The Extensible Messaging and Presence Protocol (XMPP), which consists of a formalization of the core XML streaming protocols developed originally by the Jabber open-source community; the relevant specifications are [RFC6120] for the XML streaming layer and [RFC6121] for basic presence and instant-messaging extensions One approach to helping ensure interworking between these protocols is to map each protocol to the abstract semantics described in [RFC3860]; although that is the approach taken by both [RFC3922] and Saint-Andre, et al. Standards Track [Page 2] RFC 7248 SIP-XMPP Interworking: Presence May 2014 [SIMPLE-CPIM-MAPPING], to the best of our knowledge that approach has never been implemented. The approach taken in this document is to directly map semantics from one protocol to another (i.e., from SIP/ SIMPLE (SIP for Instant Messaging and Presence Leveraging Extensions) to XMPP and vice versa), since that is how existing systems solve the interworking problem. The architectural assumptions underlying such direct mappings are provided in [RFC7247], including mapping of addresses and error conditions. The mappings specified in this document cover basic presence functionality. Mapping of more advanced functionality (e.g., so-called "rich presence") is out of scope for this document. 2. Intended Audience The documents in this series are intended for use by software developers who have an existing system based on one of these technologies (e.g., SIP) and would like to enable communication from that existing system to systems based on the other technology (e.g., XMPP). We assume that readers are familiar with the core specifications for both SIP [RFC3261] and XMPP [RFC6120], with the base document for this series [RFC7247], and with the following presence-related specifications: o "A Presence Event Package for the Session Initiation Protocol (SIP)" [RFC3856] o "Presence Information Data Format (PIDF)" [RFC3863] o "Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence" [RFC6121] o "SIP-Specific Event Notification" [RFC6665] 3. Terminology A number of terms used here (user, contact, subscription, notification, etc.) are explained in [RFC3261], [RFC3856], [RFC6120], and [RFC6121]. This document uses some, but not all, of the terms defined in the Model for Presence and Instant Messaging [RFC2778]. In flow diagrams, SIP traffic is shown using arrows such as "***>", whereas XMPP traffic is shown using arrows such as "...>". The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. Saint-Andre, et al. Standards Track [Page 3] RFC 7248 SIP-XMPP Interworking: Presence May 2014 4. Subscriptions to Presence Information 4.1. Overview Both XMPP and presence-aware SIP systems enable entities (often, but not necessarily, human users) to subscribe to the presence of other entities. XMPP presence subscriptions are specified in [RFC6121]. Presence subscriptions using a SIP event package for presence are specified in [RFC3856]. As described in [RFC6121], XMPP presence subscriptions are managed using XMPP <presence/> stanzas of type "subscribe", "subscribed", "unsubscribe", and "unsubscribed". The main subscription states are: o "none" (neither the user nor the contact is subscribed to the other's presence information) o "from" (the user has a subscription from the contact) o "to" (the user has a subscription to the contact's presence information) o "both" (both user and contact are subscribed to each other's presence information) As described in [RFC3856], SIP presence subscriptions are managed through the use of SIP SUBSCRIBE events sent from a SIP user agent to an intended recipient who is most generally referenced by a Presence URI of the form <pres:user@domain> but who might be referenced by a SIP or SIPS (Session Initiation Protocol Secure) URI of the form <sip:user@domain> or <sips:user@domain>. In practice, 'pres' URIs are rarely used, which is why the examples in this document use 'sip' URIs. The subscription models underlying XMPP and SIP differ mainly in the fact that XMPP presence subscriptions are long-lived (indeed permanent if not explicitly cancelled, so that a subscription need never be refreshed during any given presence "session"), whereas SIP presence subscriptions are short-lived (the default time-to-live of a SIP presence subscription is 3600 seconds, as specified in Section 6.4 of [RFC3856], so that a subscription needs to be explicitly refreshed if it will have the appearance of being permanent or even of lasting as long as the duration of a presence "session"). This disparity has implications for the handling of subscription cancellations in either direction and, from the SIP side, subscription refreshes. Saint-Andre, et al. Standards Track [Page 4] RFC 7248 SIP-XMPP Interworking: Presence May 2014 4.2. XMPP to SIP 4.2.1. Establishing a Presence Subscription The following diagram illustrates the protocol flow for establishing a presence subscription from an XMPP user to a SIP user, as further explained in the text and examples after the diagram. XMPP XMPP XMPP-to-SIP SIP-to-XMPP SIP SIP User Server Gateway Gateway Server User | | | | | | | (F1) XMPP | | | | | | subscribe | | | | | |..........>| | | | | | | (F2) XMPP | | | | | | subscribe | | | | | |...........>| | | | | | | (F3) SIP SUBSCRIBE | | | | |**************************>| | | | | | | (F4) SIP | | | | | | SUBSCRIBE | | | | | |**********>| | | | | | (F5) SIP | | | | | | 200 OK | | | | | (F6) SIP |<**********| | | | | 200 OK | (F7) SIP | | | | |<***********| NOTIFY | | | | | |<**********| | | | | (F8) SIP | | | | | | NOTIFY | | | | | |<***********| | | | | | (F9) SIP | | | | | | 200 OK | | | | | |***********>| | | | | | | (F10) SIP | | | (F11) XMPP subscribed | | 200 OK | | |<..........................| |**********>| | | (F12) XMPP presence | | | | |<..........................| | | | (F13) XMPP| | | | | | subscribed| | | | | |<..........| | | | | | (F14) XMPP| | | | | | presence | | | | | |<..........| | | | | Saint-Andre, et al. Standards Track [Page 5] RFC 7248 SIP-XMPP Interworking: Presence May 2014 An XMPP user (e.g., [email protected]) initiates a subscription by sending a subscription request to a contact (e.g., [email protected]), and the contact either accepts or declines the request. If the contact accepts the request, the user will have a subscription to the contact's presence information until (1) the user unsubscribes or (2) the contact cancels the subscription. The subscription request is encapsulated in a <presence/> stanza of type "subscribe": Example 1: XMPP User Subscribes to SIP Contact (F1) | <presence from='[email protected]' | to='[email protected]' | type='subscribe'/> Upon receiving such a <presence/> stanza, the XMPP server to which Juliet has connected needs to determine the identity of the domainpart in the 'to' address, which it does by following the procedures explained in Section 5 of [RFC7247]. If the domain is a SIP domain, the XMPP server will hand off the <presence/> stanza to an associated XMPP-to-SIP gateway or connection manager that natively communicates with presence-aware SIP servers. The XMPP-to-SIP gateway is then responsible for translating the XMPP subscription request into a SIP SUBSCRIBE request addressed from the XMPP user to the SIP user: Example 2: SIP Transformation of XMPP Subscription Request (F3) | SUBSCRIBE sip:[email protected] SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Max-Forwards: 70 | CSeq: 123 SUBSCRIBE | Contact: <sip:x2s.example.com;transport=tcp> | Accept: application/pidf+xml | Expires: 3600 | Content-Length: 0 Saint-Andre, et al. Standards Track [Page 6] RFC 7248 SIP-XMPP Interworking: Presence May 2014 Once the XMPP-to-SIP gateway has passed the SIP SUBSCRIBE off to the SIP server (via the SIP-to-XMPP gateway) and the SIP server has delivered the SIP SUBSCRIBE to the SIP user (F3 and F4; no example shown for F4), the SIP user would then send a response indicating acceptance of the subscription request: Example 3: SIP Accepts Subscription Request (F6) | SIP/2.0 200 OK | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=ffd2 | To: <sip:[email protected]>;tag=j89d | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | CSeq: 234 SUBSCRIBE | Contact: <sip:simple.example.net;transport=tcp> | Expires: 3600 | Content-Length: 0 In accordance with [RFC6665], the XMPP-to-SIP gateway SHOULD consider the subscription state to be "neutral" until it receives a NOTIFY message. Therefore, the SIP user or SIP-to-XMPP gateway at the SIP user's domain SHOULD immediately send a NOTIFY message containing a Subscription-State header whose value contains the string "active" (see Section 5). Saint-Andre, et al. Standards Track [Page 7] RFC 7248 SIP-XMPP Interworking: Presence May 2014 Example 4: SIP User Sends Presence Notification (F7) | NOTIFY sip:192.0.2.1 SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=yt66 | To: <sip:[email protected]>;tag=bi54 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Subscription-State: active;expires=499 | Max-Forwards: 70 | CSeq: 8775 NOTIFY | Contact: <sip:simple.example.net;transport=tcp> | Content-Type: application/pidf+xml | Content-Length: 193 | | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:[email protected]'> | <tuple id='ID-orchard'> | <status> | <basic>open</basic> | <show xmlns='jabber:client'>away</show> | </status> | </tuple> | </presence> In response, the presence-aware SIP-to-XMPP gateway would send a 200 OK to the SIP user (not shown here, since it is not translated into an XMPP stanza). Upon receiving the first NOTIFY with a subscription state of active, the XMPP-to-SIP gateway MUST generate a <presence/> stanza of type "subscribed": Example 5: XMPP User Receives Acknowledgement from SIP Contact (F13) | <presence from='[email protected]' | to='[email protected]' | type='subscribed'/> Saint-Andre, et al. Standards Track [Page 8] RFC 7248 SIP-XMPP Interworking: Presence May 2014 As described in Section 5, the gateway MUST also generate a presence notification addressed to the XMPP user: Example 6: XMPP User Receives Presence Notification from SIP Contact (F14) | <presence from='[email protected]/orchard' | to='[email protected]'/> 4.2.2. Refreshing a Presence Subscription It is the responsibility of the XMPP-to-SIP gateway to set the value of the Expires header and to periodically renew the subscription on the SIP side of the gateway so that the subscription appears to be permanent to the XMPP user. For example, the XMPP-to-SIP gateway SHOULD send a new SUBSCRIBE request to the SIP user whenever the XMPP user initiates a presence session with the XMPP server by sending initial presence to its XMPP server. The XMPP-to-SIP gateway also SHOULD send a new SUBSCRIBE request to the SIP user whenever the SIP presence subscription is scheduled to expire during the XMPP user's active presence session. The rules regarding SIP SUBSCRIBE requests for the purpose of establishing and refreshing a presence subscription are provided in [RFC6665]. Those rules also apply to XMPP-to-SIP gateways. Furthermore, an XMPP-to-SIP gateway MUST consider the XMPP subscription to be permanently cancelled (and so inform the XMPP user) if it receives a SIP response of 403, 489, or 603. By contrast, it is appropriate to consider a SIP response of 423 or 481 to be a transient error and to maintain the long-lived XMPP presence subscription. [RFC6665] explains more detailed considerations about the handling of SIP responses in relation to subscription requests and refreshes. Finally, see the security considerations section (Section 7) of this document for important information and requirements regarding the security implications of subscription refreshes. Saint-Andre, et al. Standards Track [Page 9] RFC 7248 SIP-XMPP Interworking: Presence May 2014 4.2.3. Cancelling a Presence Subscription The following diagram illustrates the protocol flow for cancelling an XMPP user's presence subscription to a SIP user, as further explained in the text and examples after the diagram. XMPP XMPP XMPP-to-SIP SIP-to-XMPP SIP SIP User Server Gateway Gateway Server User | | | | | | | (F15) XMPP| | | | | |unsubscribe| | | | | |..........>| | | | | | | (F16) XMPP | | | | | | unsubscribe| | | | | |...........>| | | | | | | (F17) SIP SUBSCRIBE | | | | | Expires: 0 | | | | | |**************************>| | | | | | | (F18) SIP | | | | | | SUBSCRIBE | | | | | | Expires: 0| | | | | |**********>| | | | | | (F19) SIP | | | | | | 200 OK | | | | | |<**********| | | | | (F20) SIP | | | | | | 200 OK | | | | | |<***********| | | | (F21) XMPP unsubscribed | | | | |<..........................| | | | (F22) XMPP| | | | | | unsubscribed | | | | |<..........| | | | | | | | | | | At any time after subscribing, the XMPP user can unsubscribe from the contact's presence. This is done by sending a <presence/> stanza of type "unsubscribe": Example 7: XMPP User Unsubscribes from SIP Contact (F15) | <presence from='[email protected]' | to='[email protected]' | type='unsubscribe'/> Saint-Andre, et al. Standards Track [Page 10] RFC 7248 SIP-XMPP Interworking: Presence May 2014 The XMPP-to-SIP gateway is responsible for translating the unsubscribe command into a SIP SUBSCRIBE request with the Expires header set to a value of zero: Example 8: SIP Transformation of XMPP Unsubscribe (F17) | SUBSCRIBE sip:[email protected] SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=j89d | Call-ID: 9D9F00DF-FCA9-4E7E-B970-80B638D5218A | Event: presence | Max-Forwards: 70 | CSeq: 789 SUBSCRIBE | Contact: <sip:x2s.example.com;transport=tcp> | Accept: application/pidf+xml | Expires: 0 | Content-Length: 0 Upon sending the transformed unsubscribe, the XMPP-to-SIP gateway SHOULD send a <presence/> stanza of type "unsubscribed" addressed to the XMPP user: Example 9: XMPP User Receives Unsubscribed Notification (F22) | <presence from='[email protected]' | to='[email protected]' | type='unsubscribed'/> Saint-Andre, et al. Standards Track [Page 11] RFC 7248 SIP-XMPP Interworking: Presence May 2014 4.3. SIP to XMPP 4.3.1. Establishing a Presence Subscription The following diagram illustrates the protocol flow for establishing a presence subscription from a SIP user to an XMPP user, as further explained in the text and examples after the diagram. SIP SIP SIP-to-XMPP XMPP-to-SIP XMPP XMPP User Server Gateway Gateway Server User | | | | | | | (F23) SIP | | | | | | SUBSCRIBE | | | | | |**********>| | | | | | | (F24) SIP | | | | | | SUBSCRIBE | | | | | |***********>| | | | | | | (F25) XMPP subscribe | | | | |..........................>| | | | | | | (F26) XMPP| | | | | | subscribe | | | | | |..........>| | | | | | (F27) XMPP| | | | | | subscribed| | | | | |<..........| | | | | (F28) XMPP | | | | | | subscribed | | | | | |<...........| | | | (F29) SIP 200 OK | | | | |<**************************| | | | (F30) SIP | | | | | | 200 OK | | | | | |<**********| | | | | | | | | | | Saint-Andre, et al. Standards Track [Page 12] RFC 7248 SIP-XMPP Interworking: Presence May 2014 A SIP user initiates a subscription to a contact's presence information by sending a SIP SUBSCRIBE request to the contact. The following is an example of such a request: Example 10: SIP User Subscribes to XMPP Contact (F23) | SUBSCRIBE sip:[email protected] SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=xfg9 | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Max-Forwards: 70 | CSeq: 263 SUBSCRIBE | Contact: <sip:simple.example.net;transport=tcp> | Accept: application/pidf+xml | Content-Length: 0 Notice that the Expires header was not included in the SUBSCRIBE request; this means that the default value of 3600 (i.e., 3600 seconds = 1 hour) applies. Upon receiving the SUBSCRIBE, the SIP server needs to determine the identity of the domain portion of the Request-URI or To header, which it does by following the procedures explained in Section 5 of [RFC7247]. If the domain is an XMPP domain, the SIP server will hand off the SUBSCRIBE to an associated SIP-to-XMPP gateway or connection manager that natively communicates with XMPP servers. The SIP-to-XMPP gateway is then responsible for translating the SUBSCRIBE into an XMPP subscription request addressed from the SIP user to the XMPP user: Example 11: XMPP Transformation of SIP SUBSCRIBE (F25) | <presence from='[email protected]' | to='[email protected]' | type='subscribe'/> In accordance with [RFC6121], once it receives the stanza from the XMPP-to-SIP gateway, the XMPP user's server MUST deliver the presence subscription request to the XMPP user (or, if a subscription already exists in the XMPP user's roster, the XMPP server SHOULD auto-reply with a <presence/> stanza of type "subscribed"). Saint-Andre, et al. Standards Track [Page 13] RFC 7248 SIP-XMPP Interworking: Presence May 2014 If the XMPP user approves the subscription request, the XMPP server then MUST return a <presence/> stanza of type "subscribed" addressed from the XMPP user to the SIP user. The XMPP-to-SIP gateway is responsible for translating the <presence/> stanza of type "subscribed" into a SIP 200 OK response. If the XMPP user declines the subscription request, the XMPP server then MUST return a <presence/> stanza of type "unsubscribed" addressed from the XMPP user to the SIP user and the XMPP-to-SIP gateway MUST transform that stanza into an empty SIP NOTIFY message with a Subscription-State of "terminated" and a reason of "rejected": Example 12: Subscription Request Rejected | NOTIFY sip:192.0.2.2 SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=ur93 | To: <sip:[email protected]>;tag=pq72 | Call-ID: AA5A8BE5-CBB7-42B9-8181-6230012B1E11 | Event: presence | Subscription-State: terminated;reason=rejected | Max-Forwards: 70 | CSeq: 232 NOTIFY | Contact: <sip:x2s.example.com;transport=tcp> | Content-Type: application/pidf+xml | Content-Length: 0 4.3.2. Refreshing a Presence Subscription For as long as a SIP user is online and interested in receiving presence notifications from the XMPP contact, the user's SIP user agent is responsible for periodically refreshing the subscription by sending an updated SUBSCRIBE request with an appropriate value for the Expires header. In response, the presence-aware SIP-to-XMPP gateway MUST send a SIP NOTIFY to the user agent (per [RFC6665]); if the gateway has meaningful information about the availability state of the XMPP user (e.g., obtained from the core presence session in the XMPP server) then the NOTIFY MUST communicate that information (e.g., by including a PIDF body [RFC3863] with the relevant data), whereas if the gateway does not have meaningful information about the availability state of the XMPP user then the NOTIFY MUST be empty as allowed by [RFC6665]. Saint-Andre, et al. Standards Track [Page 14] RFC 7248 SIP-XMPP Interworking: Presence May 2014 Once the SIP user ends its presence session, it is the responsibility of the presence-aware SIP-to-XMPP gateway to properly handle the difference between short-lived SIP presence subscriptions and long- lived XMPP presence subscriptions. The gateway has two options when the SIP user's subscription expires: o Cancel the subscription (i.e., treat it as temporary) and send an XMPP <presence/> stanza of type "unsubscribe" to the XMPP contact; this honors the SIP semantic but will seem strange to the XMPP contact (since it will appear that the SIP user has cancelled a long-lived subscription). o Maintain the subscription (i.e., treat it as long-lived), and 1. send a SIP NOTIFY request to the SIP user containing a PIDF document specifying that the XMPP contact now has a basic status of "closed", including a Subscription-State of "terminated" with a reason of "timeout" 2. send an XMPP <presence/> stanza of type "unavailable" to the XMPP contact; this violates the letter of the SIP semantic but will seem more natural to the XMPP contact Which of these options a presence-aware SIP-to-XMPP gateway chooses is up to the implementation. If the implementation chooses the first option, the protocol generated would be as follows: Example 13: XMPP Handling of Temporary Subscription Expiry | <presence from='[email protected]' | to='[email protected]' | type='unsubscribe'/> Saint-Andre, et al. Standards Track [Page 15] RFC 7248 SIP-XMPP Interworking: Presence May 2014 If the implementation chooses the second option, the protocol generated would be as follows: Example 14: SIP Handling of Long-Lived Subscription Expiry | NOTIFY sip:192.0.2.2 SIP/2.0 | Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=ur93 | To: <sip:[email protected]>;tag=pq72 | Call-ID: 2B44E147-3B53-45E4-9D48-C051F3216D14 | Event: presence | Subscription-State: terminated;reason=timeout | Max-Forwards: 70 | CSeq: 232 NOTIFY | Contact: <sip:x2s.example.com;transport=tcp> | Content-Type: application/pidf+xml | Content-Length: 194 | | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:[email protected]'> | <tuple id='ID-balcony'> | <status> | <basic>closed</basic> | </status> | </tuple> | </presence> Example 15: XMPP Handling of Long-Lived Subscription Expiry | <presence from='[email protected]' | to='[email protected]' | type='unavailable'/> Saint-Andre, et al. Standards Track [Page 16] RFC 7248 SIP-XMPP Interworking: Presence May 2014 4.3.3. Cancelling a Presence Subscription At any time, the SIP user can cancel the subscription by sending a SUBSCRIBE message whose Expires header is set to a value of zero ("0"): Example 16: SIP User Cancels Subscription | SUBSCRIBE sip:[email protected] SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=yt66 | Call-ID: 717B1B84-F080-4F12-9F44-0EC1ADE767B9 | Event: presence | Max-Forwards: 70 | CSeq: 8775 SUBSCRIBE | Contact: <sip:simple.example.net;transport=tcp> | Expires: 0 | Content-Length: 0 As above, upon receiving such a request, a presence-aware SIP-to-XMPP gateway is responsible for doing one of the following: o Cancel the subscription (i.e., treat it as temporary) and send an XMPP <presence/> stanza of type "unsubscribe" to the XMPP contact. o Maintain the subscription (i.e., treat it as long-lived), and 1. send a SIP NOTIFY request to the SIP user containing a PIDF document specifying that the XMPP contact now has a basic status of "closed" 2. send a SIP SUBSCRIBE request to the SIP user with an Expires header set to a value of "0" (zero) when it receives XMPP presence of type "unavailable" from the XMPP contact 3. send an XMPP <presence/> stanza of type "unavailable" to the XMPP contact 5. Notifications of Presence Information 5.1. Overview Both XMPP and presence-aware SIP systems enable entities (often, but not necessarily, human users) to send presence notifications to other entities. At its most basic, the term "presence" refers to information about an entity's "on/off" availability for communication on a network. Often, this basic concept is supplemented by information that further specifies the entity's context or status Saint-Andre, et al. Standards Track [Page 17] RFC 7248 SIP-XMPP Interworking: Presence May 2014 while available for communication; these availability states commonly include "away" and "do not disturb". Some systems and protocols extend the concepts of presence and availability even further and refer to any relatively ephemeral information about an entity as a kind of presence; categories of such "extended presence" include geographical location (e.g., GPS coordinates), user mood (e.g., grumpy), user activity (e.g., walking), and ambient environment (e.g., noisy). In this document, we focus on the "least common denominator" of network availability only, although future documents might address broader notions of presence, including availability states and extended presence. [RFC6121] defines how XMPP <presence/> stanzas can indicate availability (via absence of a 'type' attribute) or lack of availability (via a 'type' attribute with a value of "unavailable"). SIP presence using a SIP event package for presence is specified in [RFC3856]. As described in [RFC6121], XMPP presence information about an entity is communicated by means of an XML <presence/> stanza sent over an XML stream. In this document we will assume that such a <presence/> stanza is sent from an XMPP client to an XMPP server over an XML stream negotiated between the client and the server, and that the client is controlled by a human user. In general, XMPP presence is sent by the user to the user's server and then broadcast to all entities who are subscribed to the user's presence information. As described in [RFC3856], presence information about an entity is communicated by means of a SIP NOTIFY event sent from a SIP user agent to an intended recipient who is most generally referenced by a Presence URI of the form <pres:user@domain> but who might be referenced by a SIP or SIPS URI of the form <sip:user@domain> or <sips:user@domain>. This document addresses basic presence or network availability only, not the various extensions to SIP and XMPP for "rich presence" such as [RFC4480], [XEP-0107], and [XEP-0108]. Saint-Andre, et al. Standards Track [Page 18] RFC 7248 SIP-XMPP Interworking: Presence May 2014 5.2. XMPP to SIP When Juliet interacts with her XMPP client to modify her presence information (or when her client automatically updates her presence information, e.g., via an "auto-away" feature), her client generates an XMPP <presence/> stanza. The syntax of the <presence/> stanza, including required and optional elements and attributes, is defined in [RFC6121]. The following is an example of such a stanza: Example 17: XMPP User Sends Presence Notification | <presence from='[email protected]/balcony'/> Upon receiving such a stanza, the XMPP server to which Juliet has connected broadcasts it to all subscribers who are authorized to receive presence notifications from Juliet (this is similar to the SIP NOTIFY method). For each subscriber, broadcasting the presence notification involves either delivering it to a local recipient (if the hostname in the subscriber's address matches one of the hostnames serviced by the XMPP server) or attempting to route it to the foreign domain that services the hostname in the subscriber's address. Thus, the XMPP server needs to determine the identity of the domainpart in the 'to' address, which it does by following the procedures discussed in [RFC7247]. If the domain is a SIP domain, the XMPP server will hand off the <presence/> stanza to an associated XMPP-to-SIP gateway or connection manager that natively communicates with presence-aware SIP servers (no example shown). The XMPP-to-SIP gateway is then responsible for translating the XMPP <presence/> stanza into a SIP NOTIFY request and included PIDF document from the XMPP user to the SIP user. Example 18: SIP Transformation of XMPP Presence Notification | NOTIFY sip:192.0.2.2 SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=gh19 | To: <sip:[email protected]>;tag=yt66 | Contact: <sip:[email protected]>;gr=balcony | Call-ID: 2B44E147-3B53-45E4-9D48-C051F3216D14 | Event: presence | Subscription-State: active;expires=599 | Max-Forwards: 70 | CSeq: 157 NOTIFY | Contact: <sip:x2s.example.com;transport=tcp> | Content-Type: application/pidf+xml | Content-Length: 192 | Saint-Andre, et al. Standards Track [Page 19] RFC 7248 SIP-XMPP Interworking: Presence May 2014 | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:[email protected]'> | <tuple id='ID-balcony'> | <status> | <basic>open</basic> | <show xmlns='jabber:client'>away</show> | </status> | </tuple> | </presence> The mapping of XMPP syntax elements to SIP syntax elements SHOULD be as shown in the following table. (Mappings for elements not mentioned are undefined.) +-----------------------------+---------------------------+ | XMPP Element or Attribute | SIP Header or PIDF Data | +-----------------------------+---------------------------+ | <presence/> stanza | "Event: presence" (1) | +-----------------------------+---------------------------+ | XMPP resource identifier | tuple 'id' attribute (2) | +-----------------------------+---------------------------+ | from | From | +-----------------------------+---------------------------+ | id | CSeq (3) | +-----------------------------+---------------------------+ | to | To | +-----------------------------+---------------------------+ | type | basic status (4) (5) | +-----------------------------+---------------------------+ | xml:lang | Content-Language | +-----------------------------+---------------------------+ | <priority/> | priority for tuple (6) | +-----------------------------+---------------------------+ | <show/> | no mapping (7) | +-----------------------------+---------------------------+ | <status/> | <note/> | +-----------------------------+---------------------------+ Table 1: Presence Syntax Mapping from XMPP to SIP Note the following regarding these mappings: (1) Only an XMPP <presence/> stanza that lacks a 'type' attribute or whose 'type' attribute has a value of "unavailable" SHOULD be mapped by an XMPP-to-SIP gateway to a SIP NOTIFY request, since those are the only <presence/> stanzas that represent notifications. Saint-Andre, et al. Standards Track [Page 20] RFC 7248 SIP-XMPP Interworking: Presence May 2014 (2) The PIDF schema defines the tuple 'id' attribute as having a datatype of "xs:ID"; because this datatype is more restrictive than the "xs:string" datatype for XMPP resourceparts (in particular, a number is not allowed as the first character of an ID), prepending the resourcepart with "ID-" or some other alphabetic string when mapping from XMPP to SIP is RECOMMENDED. (3) In practice, XMPP <presence/> stanzas often do not include the 'id' attribute. (4) Because the lack of a 'type' attribute indicates that an XMPP entity is available for communications, the gateway SHOULD map that information to a PIDF basic status of "open". Because a 'type' attribute with a value of "unavailable" indicates that an XMPP entity is not available for communications, the gateway SHOULD map that information to a PIDF basic status of "closed". (5) When the XMPP-to-SIP gateway receives XMPP presence of type "unavailable" from the XMPP contact, it SHOULD (a) send a SIP NOTIFY request to the SIP user containing a PIDF document specifying that the XMPP contact now has a basic status of "closed" and (b) send a SIP SUBSCRIBE request to the SIP user with an Expires header set to a value of "0" (zero). (6) The value of the XMPP <priority/> element is an integer between -128 and +127, whereas the value of the PIDF <contact/> element's 'priority' attribute is a decimal number from zero to one inclusive, with a maximum of three decimal places. If the value of the XMPP <priority/> element is negative, an XMPP-to- SIP gateway MUST NOT map the value. If an XMPP-to-SIP gateway maps positive values, it SHOULD treat XMPP priority 0 as PIDF priority 0 and XMPP priority 127 as PIDF priority 1, mapping intermediate values appropriately so that they are unique (e.g., XMPP priority 1 to PIDF priority 0.007, XMPP priority 2 to PIDF priority 0.015, and so on up through mapping XMPP priority 126 to PIDF priority 0.992; note that this is an example only and that the exact mapping is up to the implementation). (7) Some implementations support custom extensions to encapsulate detailed information about availability; however, there is no need to standardize a PIDF extension for this purpose, since PIDF is already extensible and thus the <show/> element (qualified by the 'jabber:client' namespace) can be included directly in the PIDF XML. The examples in this document illustrate this usage, which is RECOMMENDED. The most useful values are likely "away" and "dnd", although note that the latter value merely means "busy" and does not imply that a server or client ought to block incoming traffic while the user Saint-Andre, et al. Standards Track [Page 21] RFC 7248 SIP-XMPP Interworking: Presence May 2014 is in that state. Naturally, a gateway can choose to translate a custom extension into an established value of the <show/> element [RFC6121] or translate a <show/> element into a custom extension that the gateway knows is supported by the user agent of the intended recipient. Unfortunately, this behavior does not guarantee that information will not be lost; to help prevent information loss, a gateway ought to include both the <show/> element and the custom extension if the gateway cannot suitably translate the custom value into a <show/> value. 5.3. SIP to XMPP When Romeo changes his presence, his SIP user agent generates a SIP NOTIFY request for any active subscriptions. The syntax of the NOTIFY request is defined in [RFC3856]. The following is an example of such a request: Example 19: SIP User Sends Presence Notification | NOTIFY sip:192.0.2.1 SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=yt66 | To: <sip:[email protected]>;tag=bi54 | Contact: <sip:[email protected]>;gr=orchard | Call-ID: C33C6C9D-0F4A-42F9-B95C-7CE86B526B5B | Event: presence | Subscription-State: active;expires=499 | Max-Forwards: 70 | CSeq: 8775 NOTIFY | Contact: <sip:simple.example.net;transport=tcp> | Content-Type: application/pidf+xml | Content-Length: 193 | | <?xml version='1.0' encoding='UTF-8'?> | <presence xmlns='urn:ietf:params:xml:ns:pidf' | entity='pres:[email protected]'> | <tuple id='ID-orchard'> | <status> | <basic>closed</basic> | </status> | </tuple> | </presence> Saint-Andre, et al. Standards Track [Page 22] RFC 7248 SIP-XMPP Interworking: Presence May 2014 Upon receiving the NOTIFY, the SIP server needs to determine the identity of the domain portion of the Request-URI or To header, which it does by following the procedures discussed in [RFC7247]. If the domain is an XMPP domain, the SIP server will hand off the NOTIFY to an associated SIP-to-XMPP gateway or connection manager that natively communicates with XMPP servers. The SIP-to-XMPP gateway is then responsible for translating the NOTIFY into an XMPP <presence/> stanza addressed from the SIP user to the XMPP user: Example 20: XMPP Transformation of SIP Presence Notification | <presence from='[email protected]' | to='[email protected]/balcony' | type='unavailable'/> The mapping of SIP syntax elements to XMPP syntax elements SHOULD be as shown in the following table. (Mappings for elements not mentioned are undefined.) +---------------------------+-----------------------------+ | SIP Header or PIDF Data | XMPP Element or Attribute | +---------------------------+-----------------------------+ | basic status | type (1) | +---------------------------+-----------------------------+ | Content-Language | xml:lang | +---------------------------+-----------------------------+ | CSeq | id (2) | +---------------------------+-----------------------------+ | From | from | +---------------------------+-----------------------------+ | priority for tuple | <priority/> (3) | +---------------------------+-----------------------------+ | To | to | +---------------------------+-----------------------------+ | <note/> | <status/> | +---------------------------+-----------------------------+ | <show/> | <show/> (4) | +---------------------------+-----------------------------+ Table 2: Presence Syntax Mapping from SIP to XMPP Saint-Andre, et al. Standards Track [Page 23] RFC 7248 SIP-XMPP Interworking: Presence May 2014 Note the following regarding these mappings: (1) A PIDF basic status of "open" SHOULD be mapped to no 'type' attribute, and a PIDF basic status of "closed" SHOULD be mapped to a 'type' attribute whose value is "unavailable". (2) This mapping is OPTIONAL. (3) See the notes following Table 1 of this document regarding mapping of presence priority. (4) If a SIP implementation supports the <show/> element (qualified by the 'jabber:client' namespace) as a PIDF extension for availability status as described in the notes following Table 1 of this document, the SIP-to-XMPP gateway is responsible for including that element in the XMPP presence notification. 6. Requests for Presence Information Both SIP and XMPP provide methods for requesting presence information about another entity. 6.1. XMPP to SIP In XMPP, a request for presence information is completed by sending a <presence/> stanza of type "probe": Example 21: XMPP Server Sends Presence Probe on Behalf of XMPP User | <presence from='[email protected]/chamber' | to='[email protected]' | type='probe'/> Note: As described in [RFC6121], presence probes are used by XMPP servers to request presence on behalf of XMPP users; XMPP clients are discouraged from sending presence probes, since retrieving presence is a service that servers provide. Saint-Andre, et al. Standards Track [Page 24] RFC 7248 SIP-XMPP Interworking: Presence May 2014 An XMPP-to-SIP gateway would transform the presence probe into its SIP equivalent, which is a SUBSCRIBE request with an Expires header value of zero: Example 22: SIP Transformation of XMPP Presence Probe | SUBSCRIBE sip:[email protected] SIP/2.0 | Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=ffd2 | Call-ID: 5BCF940D-793D-43F8-8972-218F7F4EAA8C | Event: presence | Max-Forwards: 70 | CSeq: 123 SUBSCRIBE | Contact: <sip:x2s.example.com;transport=tcp> | Accept: application/pidf+xml | Expires: 0 | Content-Length: 0 As described in [RFC3856], this cancels any subscription but causes a NOTIFY to be sent to the subscriber, just as a presence probe does (the transformation rules for presence notifications have been previously described in Section 5.2 of this document). 6.2. SIP to XMPP In SIP, a request for presence information is effectively completed by sending a SUBSCRIBE with an Expires header value of zero: Example 23: SIP User Sends Presence Request | SUBSCRIBE sip:[email protected] SIP/2.0 | Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk | From: <sip:[email protected]>;tag=yt66 | Call-ID: 717B1B84-F080-4F12-9F44-0EC1ADE767B9 | Event: presence | Max-Forwards: 70 | CSeq: 8775 SUBSCRIBE | Contact: <sip:simple.example.net;transport=tcp> | Expires: 0 | Content-Length: 0 Saint-Andre, et al. Standards Track [Page 25] RFC 7248 SIP-XMPP Interworking: Presence May 2014 When honoring the long-lived semantics of an XMPP presence subscription, a presence-aware SIP-to-XMPP gateway SHOULD translate such a SIP request into a <presence/> stanza of type "probe" if it does not already have presence information about the contact: Example 24: XMPP Transformation of SIP Presence Request | <presence from='[email protected]' | to='[email protected]' | type='probe'/> 7. Security Considerations Detailed security considerations for presence protocols are given in [RFC2779], for SIP-based presence in [RFC3856] (see also [RFC3261]), and for XMPP-based presence in [RFC6121] (see also [RFC6120]). The mismatch between long-lived XMPP presence subscriptions and short-lived SIP presence subscriptions introduces the possibility of an amplification attack launched from the XMPP network against a SIP presence server (since each long-lived XMPP presence subscription would typically result in multiple subscription refresh requests on the SIP side of a gateway). Therefore, access to an XMPP-to-SIP gateway SHOULD be restricted in various ways; among other things, only an XMPP service that carefully controls account provisioning and provides effective methods for the administrators to control the behavior of registered users ought to host such a gateway (e.g., not a service that offers open account registration), and a gateway ought to be associated only with a single domain or trust realm (e.g., a gateway hosted at simple.example.com ought to allow only users within the example.com domain to access the gateway, not users within example.org, example.net, or any other domain). If a SIP presence server receives communications through an XMPP-to-SIP gateway from users who are not associated with a domain that is so related to the hostname of the gateway, it SHOULD (based on local service provisioning) refuse to service such users or refuse to receive traffic from the gateway. As a further check, whenever an XMPP-to- SIP gateway seeks to refresh an XMPP user's long-lived subscription to a SIP user's presence, it MUST first send an XMPP <presence/> stanza of type "probe" from the address of the gateway to the "bare Jabber ID (JID)" ([email protected]) of the XMPP user, to which the user's XMPP server MUST respond in accordance with [RFC6121]; this puts an equal burden on the XMPP server and the SIP server. Saint-Andre, et al. Standards Track [Page 26] RFC 7248 SIP-XMPP Interworking: Presence May 2014 8. References 8.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002. [RFC3856] Rosenberg, J., "A Presence Event Package for the Session Initiation Protocol (SIP)", RFC 3856, August 2004. [RFC3863] Sugano, H., Fujimoto, S., Klyne, G., Bateman, A., Carr, W., and J. Peterson, "Presence Information Data Format (PIDF)", RFC 3863, August 2004. [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence Protocol (XMPP): Core", RFC 6120, March 2011. [RFC6121] Saint-Andre, P., "Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence", RFC 6121, March 2011. [RFC6665] Roach, A., "SIP-Specific Event Notification", RFC 6665, July 2012. [RFC7247] Saint-Andre, P., Houri, A., and J. Hildebrand, "Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Architecture, Addresses, and Error Handling", RFC 7247, May 2014. 8.2. Informative References [RFC2778] Day, M., Rosenberg, J., and H. Sugano, "A Model for Presence and Instant Messaging", RFC 2778, February 2000. [RFC2779] Day, M., Aggarwal, S., Mohr, G., and J. Vincent, "Instant Messaging / Presence Protocol Requirements", RFC 2779, February 2000. [RFC3860] Peterson, J., "Common Profile for Instant Messaging (CPIM)", RFC 3860, August 2004. Saint-Andre, et al. Standards Track [Page 27] RFC 7248 SIP-XMPP Interworking: Presence May 2014 [RFC3922] Saint-Andre, P., "Mapping the Extensible Messaging and Presence Protocol (XMPP) to Common Presence and Instant Messaging (CPIM)", RFC 3922, October 2004. [RFC4480] Schulzrinne, H., Gurbani, V., Kyzivat, P., and J. Rosenberg, "RPID: Rich Presence Extensions to the Presence Information Data Format (PIDF)", RFC 4480, July 2006. [SIMPLE-CPIM-MAPPING] Campbell, B. and J. Rosenberg, "CPIM Mapping of SIMPLE Presence and Instant Messaging", Work in Progress, June 2002. [XEP-0107] Saint-Andre, P. and R. Meijer, "User Mood", XSF XEP 0107, October 2008, <http://xmpp.org/extensions/xep-0107.html>. [XEP-0108] Meijer, R. and P. Saint-Andre, "User Activity", XSF XEP 0108, October 2008, <http://xmpp.org/extensions/xep-0108.html>. Saint-Andre, et al. Standards Track [Page 28] RFC 7248 SIP-XMPP Interworking: Presence May 2014 Appendix A. Acknowledgements The authors wish to thank the following individuals for their feedback: Chris Christou, Fabio Forno, Adrian Georgescu, Philipp Hancke, Saul Ibarra Corretge, Markus Isomaki, Olle Johansson, Paul Kyzivat, Salvatore Loreto, Michael Lundberg, Daniel-Constantin Mierla, and Tory Patnoe. Dave Crocker provided helpful and detailed feedback on behalf of the Applications Area Directorate. Ben Laurie performed a review on behalf of the Security Directorate, resulting in improvements to the security considerations. During IESG review, Pete Resnick caught several oversights in the document with regard to interoperability. The authors gratefully acknowledge the assistance of Markus Isomaki and Yana Stamcheva as the working group chairs and Gonzalo Camarillo as the sponsoring Area Director. Some text in this document was borrowed from [RFC3922]. Peter Saint-Andre wishes to acknowledge Cisco Systems, Inc., for employing him during his work on earlier versions of this document. Saint-Andre, et al. Standards Track [Page 29] RFC 7248 SIP-XMPP Interworking: Presence May 2014 Authors' Addresses Peter Saint-Andre &yet EMail: [email protected] Avshalom Houri IBM Rorberg Building, Pekris 3 Rehovot 76123 Israel EMail: [email protected] Joe Hildebrand Cisco Systems, Inc. 1899 Wynkoop Street, Suite 600 Denver, CO 80202 USA EMail: [email protected] Saint-Andre, et al. Standards Track [Page 30]
__label__pos
0.588729
Welcome to the Creatures Wiki! Log in and join the community. YEAR From Creatures Wiki Jump to navigation Jump to search YEAR is a CAOS function that returns the number of in-game years that have passed in the world. Usage[edit] Syntax: YEAR Returns the number of years that have passed in the world - how many times every season has passed. This starts at 0 for a brand-new world. Example[edit] Typing the following into the CAOS Command Line will return the number of game years passed: outs vtos year This could also be used by a very long-lived agent (perhaps a tree that grows very slowly, for example): **where ov00 is the year the agent was born, ov01 the season, and ov02 the day setv va99 year subv va99 ov00 doif va99 eq 2 doif sean eq ov01 doif date eq ov02 **code to grow another stage, or start flowering, etc, here Notes[edit] • In C2, the first year is 0000 AD, said to be the first chronicled year After Disaster. • In C3/DS, the Creature History displays real-world time by default, but if the GAME variable "c3_after_shee_dates" is set to something other than 0 (for example, with the command "setv game "c3_after_shee_dates" 1"), it will use in-game time. The displayed year is set to the current in-game year plus 127, implying that the Shee left Albia over a hundred years before the games - at least on a creature timescale. See Also[edit]
__label__pos
0.580827
Location: PHPKode > projects > PhpRechnung > phpRechnung/include/pdf.inc.php <?php /* pdf.inc.php phpRechnung - is easy-to-use Web-based multilingual accounting software. Copyright (C) 2001 - 2008 Edy Corak < phprechnung at ecorak dot net > This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once('phprechnung.inc.php'); require_once('company_settings.inc.php'); define('FPDF_FONTPATH','font/'); define('EUR',chr(128)); require_once('mc_table.php'); $pdf=new PDF_MC_Table(); $pdf->Open(); $pdf->AddPage(); $pdf->AliasNbPages(); if($METHOD_OF_PAY_DATE != 0) { if ($Type != 'DeliveryNote') { $pdf->SetY(140); } else { $pdf->SetY(135); } } else { $pdf->SetY(135); } $pdf->SetFont($PDFFont,'',$PDFFontsize1); require_once('pos_pdf.inc.php'); $pdf->Ln(5); $pdf->SetFont($PDFFont,'',$PDFFontsize2); $pdf->SetWidths(array(170,25)); $pdf->SetAligns(array(R,R)); // See if the company currency is set to EUR end print the Euro char // if($CompanyCurrency == 'EUR') { $Currency = EUR; } else { $Currency = $CompanyCurrency; } if ($Type != 'DeliveryNote') { if($TaxFree == "1") { // If TaxFree is set to yes than display only total amount // otherwise display subtotal..., tax..., amount // $pdf->SetFont($PDFFont,'B',$PDFFontsize2); // Check if we need to calculate temporary or saved positions // if($tmpPos != '1') { $pdf->Row(array($a[invoice_amount].' '.$Currency.':',Format_Number($TOTAL))); } else { $pdf->Row(array($a[invoice_amount].' '.$Currency.':',Format_Number($TOTAL_AMOUNT))); } } else { // Subtotal 1 // if(!empty($Subtotal1)) { // Check if we need to calculate temporary or saved positions // // if($tmpPos != '1') // { // $pdf->Row(array($a[invoice_subtotal].' '.$TAX1_DESC.':',Format_Number($SUBTOTAL1))); // } // else // { $pdf->Row(array($a[invoice_subtotal].' '.$Tax1_Desc.':',Format_Number($Subtotal1))); // } } // Subtotal 2 // if(!empty($Subtotal2)) { // Check if we need to calculate temporary or saved positions // // if($tmpPos != '1') // { // $pdf->Row(array($a[invoice_subtotal].' '.$TAX2_DESC.':',Format_Number($SUBTOTAL2))); // } // else // { $pdf->Row(array($a[invoice_subtotal].' '.$Tax2_Desc.':',Format_Number($Subtotal2))); // } } // Subtotal 3 // if(!empty($Subtotal3)) { // Check if we need to calculate temporary or saved positions // // if($tmpPos != '1') // { // $pdf->Row(array($a[invoice_subtotal].' '.$TAX3_DESC.':',Format_Number($SUBTOTAL3))); // } // else // { $pdf->Row(array($a[invoice_subtotal].' '.$Tax3_Desc.':',Format_Number($Subtotal3))); // } } // Subtotal 4 // if(!empty($Subtotal4)) { // Check if we need to calculate temporary or saved positions // // if($tmpPos != '1') // { // $pdf->Row(array($a[invoice_subtotal].' '.$TAX4_DESC.':',Format_Number($SUBTOTAL4))); // } // else // { $pdf->Row(array($a[invoice_subtotal].' '.$Tax4_Desc.':',Format_Number($Subtotal4))); // } } // Tax 1 // if(!empty($Tax1)) { // Check if we need to calculate temporary or saved positions // // if($tmpPos != '1') // { // $pdf->Row(array($a[invoice_tax1].' '.$TAX1_DESC.':',Format_Number($TAX1))); // } // else // { $pdf->Row(array($a[invoice_tax1].' '.$Tax1_Desc.':',Format_Number($Tax1))); // } } // Tax 2 // if(!empty($Tax2)) { // Check if we need to calculate temporary or saved positions // // if($tmpPos != '1') // { // $pdf->Row(array($a[invoice_tax2].' '.$TAX2_DESC.':',Format_Number($TAX2))); // } // else // { $pdf->Row(array($a[invoice_tax2].' '.$Tax2_Desc.':',Format_Number($Tax2))); // } } // Tax 3 // if(!empty($Tax3)) { // Check if we need to calculate temporary or saved positions // // if($tmpPos != '1') // { // $pdf->Row(array($a[invoice_tax3].' '.$TAX3_DESC.':',Format_Number($TAX3))); // } // else // { $pdf->Row(array($a[invoice_tax3].' '.$Tax3_Desc.':',Format_Number($Tax3))); // } } // Total amount // $pdf->SetFont($PDFFont,'B',$PDFFontsize2); // Check if we need to calculate temporary or saved positions // if($tmpPos != '1') { $pdf->Row(array($a[invoice_amount].' '.$Currency.':',Format_Number($TOTAL))); } else { $pdf->Row(array($a[invoice_amount].' '.$Currency.':',Format_Number($TOTAL_AMOUNT))); } } // Total sum paid // if ($SUM_PAID > 0) { $pdf->SetFont($PDFFont,'',$PDFFontsize2); $pdf->SetWidths(array(195)); $pdf->SetAligns(array(L)); $pdf->Row(array($a['transaction'].':')); foreach($paid as $paidresult) { $pdf->Row(array($paidresult['PAYMENT_DATE'].' [ '.$paidresult['METHOD_OF_PAY'].' ]'.' '.Format_Number($paidresult['SUM_PAID']).' '.$Currency)); } } } $pdf->Ln(5); // Message // $pdf->SetFont($PDFFont,'',$PDFFontsize1); $pdf->SetWidths(array(195)); $pdf->SetAligns(array(C)); $pdf->Row(array($MESSAGEID)); // PDF Subject, Creator etc. // $pdf->SetTitle($Subject); $pdf->SetSubject($Subject); $pdf->SetAuthor($CompanyName); $pdf->SetCreator($a['programname']); // Check where to send the pdf output // if(!empty($sendfile)) { // Send output to file // $pdf->Output($sendfile); } else { // Send output to browser. If you choose // save as, this is the default file name // format: date-id.pdf example 20071113-1.pdf // if pdf plugin is used, only the filename // will be displayed e.g. print_pdf.php // $pdf->Output("$PrintD-$ID.pdf","I"); } ?> Return current item: PhpRechnung
__label__pos
0.77983
Sign up × Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free. Can't really understand what's going wrong here? It's just a simple exception with an array out of bounds. public class Days { public static void main (String args[]) { String[] dayArray = new String [4]; { dayArray [0] = "monday"; dayArray [1] = "tuesday"; dayArray [2] = "wednesday"; dayArray [3] = "Thursday"; dayArray [4] = "Friday"; try { System.out.println("The day is " + dayArray[5]); } catch(ArrayIndexOutOfBoundsException Q) { System.out.println(" invalid"); Q.getStackTrace(); } System.out.println("End Of Program"); } } } Does anybody have any ideas as too why this won't run? I'm getting the error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 at Days.main(Days.java:14) share|improve this question 1   It is straightforward you declare array with 5 element and you use 6'th element that not exist and out of bound –  SjB Nov 18 '09 at 13:50 5 Answers 5 up vote 2 down vote accepted Array are limited on creation. In your example, it has a size of 4 fields. With a 0-indexed array it means you can access these fields, not any more: dayArray [0] = "monday"; dayArray [1] = "tuesday"; dayArray [2] = "wednesday"; dayArray [3] = "Thursday"; share|improve this answer      ah so my array was too small. i wanst aware of that. –  OVERTONE Nov 18 '09 at 13:49 You should declare it as capable of 5 items, not 4, in its declaration. new String [5]; share|improve this answer 1   Exactly. For convenience, here's the Arrays Tutorial: java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html –  BalusC Nov 18 '09 at 13:43      and 5th element is dayArray[4] –  ziftech Nov 18 '09 at 13:44 When appropriate, let the compiler do the counting for you: String[] dayArray = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", }; This way, you can add or remove elements without having to change the array length in another place. Less typing, too. share|improve this answer You array has a size of 4, and you are adding 5 elements. share|improve this answer You're defining five elements for a four element array. Java uses zero based indexes. share|improve this answer Your Answer   discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged or ask your own question.
__label__pos
0.662268
Take the tour × Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required. Meteorites hit the surface of the moon, treat as an infinite plane. The meteorites that have hit the moon over the last 1 million yrs can be modeled as a Poisson process with constant intensity lambda. Suppose that each meteorite leaves a circular crater of random radius, and the craters' radii are i.i.d. from a distribution having density f. Assume that f(r) = 0 for r suciently large. For a bounded (Borel) set A, let V (A) be the area of A that is not covered by a crater from a meteorite that hit in the last million years. Since this is a Poisson process, how can we get the E(Area of A not covered by a crater from a meteorite that hit in the last million years) and the Var(Area of A not covered by a crater from a meteorite that hit in the last million years) I do note that E(X) = 1/p share|improve this question add comment 2 Answers up vote 1 down vote accepted I am not happy with your notation, but one approach is to look at a ring of inner radius $r$ and outer radius $r+\delta r$ (and so of area about $2 \pi r \delta r$ in the limit), calculate the probability either that the ring is not hit or that it is hit and all the meteorites hitting the ring (reducing to 1 in the limit) leave a crater of radius less than $r$. This is the probability that the centre of the ring is not covered by a crater caused by a hit on the ring. You now want to multiply all the different ring probabilities together. One way to do this is by adding up the logarithms of the probabilities and then taking the anti-logarithm, so in the limit integrate the logarithms of the probabilities over $r$ and take the anti-logarithm. That will give you the probability that a particular point is not covered by a crater, and so the expected fraction of $A$ which is not covered by a crater. The variance is harder. share|improve this answer add comment There is a long road to compute the expectation of the non covered area, and a shorter road. Both roads start with the random set $C$ of the points of the plane which are not covered by a meteorite and with the expression $$ \mathrm E(|A\cap C|)=\mathrm E\int_A[x\in C]\,\mathrm dx=\int_A\mathrm P(x\in C)\mathrm dx=p\,|A|, $$ with $p=\mathrm P(0\in C)$ since the invariance by translation of the meteorite process shows that $\mathrm P(x\in C)$ does not depend on $x$. Hence the task is to compute $p$. The long road: Let $\mathcal M$ denote the random set of the centers of meteorites. Let $\mathcal R=(R(x))_{x\in\mathcal M}$ where, for every $x$ in $\mathcal M$, $R(x)$ denotes the radius of the meteorite centered at $x$. Then, $$ \mathrm P(0\in C\mid \mathcal M,\mathcal R)=\prod_{x\in \mathcal M}[R(x)\lt\|x\|], $$ hence, since conditionally on $\mathcal M$, $\mathcal R$ is a collection of i.i.d. random variables, $$ \mathrm P(0\in C\mid \mathcal M)=\prod_{x\in \mathcal M}\mathrm P(R\lt\|x\|), $$ where $R$ denotes any random variable distributed like the radii $R(x)$. Now comes into play the hypothesis that $R$ is almost surely bounded, say by $r$. Then the product over $x$ in $\mathcal M$ can be restricted to a product over $\mathcal M\cap B$ where $B=\{x\mid\|x\|\leqslant r\}$. This new Poisson process has total intensity $\mu=\lambda\pi r^2$ and, conditionally on its size, its points are uniformly distributed in $B$. Thus, $$ \mathrm P(0\in C)=\sum_{n\geqslant0}\mathrm e^{-\mu}\frac{\mu^n}{n!}\int_{B^n}\prod_{k=1}^n\mathrm P(R\lt\|x_k\|)\cdot\prod_{k=1}^n\frac{\mathrm dx_k}{\pi r^2}. $$ The integral over $B^n$ is a product, hence $p=\mathrm e^{-\mu+\mu J/(\pi r^2)}$, with $$ J=\int_{B}\mathrm P(R\lt\|x\|)\mathrm dx=\mathrm E\int_B[R\lt\|x\|]\mathrm dx=\mathrm E(\pi r^2-\pi R^2). $$ Finally, $$ p=\mathrm e^{-\lambda\pi\mathrm E(R^2)},\quad\text{hence}\quad\color{red}{\mathrm E(|A\cap C|)=\mathrm e^{-\lambda\pi\mathrm E(R^2)}\,|A|}. $$ The shorter road: Consider the process of the centers of the meteorites covering the point $0$. This is a nonhomogenous Poisson process, obtained by a thinning of the original Poisson process, where one keeps a point $x$ with probability $\mathrm P(R\gt\|x\|)$. Thus the intensity at $x$ of the thinned Poisson process is $\lambda(x)=\lambda\mathrm P(R\gt\|x\|)$ and its total intensity is $$ \nu=\int_{\mathbb R^n}\lambda(x)\mathrm dx=\lambda\int_{\mathbb R^n}\mathrm P(R\gt\|x\|)\mathrm dx=\lambda\mathrm E\int[R\gt\|x\|]\mathrm dx=\lambda\mathrm E(\pi R^2), $$ To conclude, observe that $0$ is not covered if and only if the thinned Poisson process is empty, and that this happens with probability $\mathrm e^{-\nu}$. Note: The argument above extends to any distribution of $R$. It shows that $\mathrm E(|A\cap C|)$ is always given by the formula above. Thus, if $R^2$ is integrable, $|A\cap C|$ has positive measure with positive probability, for every $A$ of positive measure, but, if $R^2$ is not integrable, $|C|=0$ almost surely. The same applies to any dimension and to any random objects instead of disks. The condition to check in this extended setting is whether the random volume $V$ of these objects is integrable or not and the formula for any point $x$ of the space to be not covered becomes $$ \color{purple}{\mathrm P(x\in C)=\mathrm e^{-\lambda\mathrm E(V)}}. $$ share|improve this answer add comment Your Answer   discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged or ask your own question.
__label__pos
0.948104
cw_describealarms.ts - AWS Code Sample cw_describealarms.ts /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 ABOUT THIS NODE.JS EXAMPLE: This example works with AWS SDK for JavaScript version 3 (v3), which is pending release. The preview version of the SDK is available at https://github.com/aws/aws-sdk-js-v3. This example is in the 'AWS SDK for JavaScript v3 Developer Guide' at https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/cloudwatch-examples-creating-alarms.html. Purpose: cw_describealarms.ts demonstrates how to retrieve information about Amazon CloudWatch alarms. Inputs (replace in code): - REGION Running the code: ts-node cw_describealarms.ts */ // Import required AWS SDK clients and commands for Node.js const { CloudWatchClient, DescribeAlarmsCommand } = require("@aws-sdk/client-cloudwatch"); // Set the AWS Region const REGION = "REGION"; //e.g. "us-east-1" // Set the parameters const params = { StateValue: "INSUFFICIENT_DATA" }; // Create CloudWatch service object const cw = new CloudWatchClient(REGION); const run = async () => { try { const data = await cw.send(new DescribeAlarmsCommand(params)); console.log("Success", data); data.MetricAlarms.forEach(function (item, index, array) { console.log(item.AlarmName); }); } catch (err) { console.log("Error", err); } }; run();
__label__pos
0.894932
back to article Microsoft finally says adios to Autorun After a decade of abuse, Autorun is finally being retired in older versions of Windows. On Tuesday, Microsoft began pushing an update that changes the way Windows Server 2008 and earlier versions of the OS respond when USB thumb drives and other portable media are plugged in. Until now, those versions dutifully executed code … COMMENTS This topic is closed for new posts. Page: 1. Paul Slater Autorun attacks from CD "..Microsoft has yet to see in-the-wild attacks that exploit Autorun on “shiny media.”..." Err, Sony DRM? 1. Anonymous Coward Go Those are exactly the partners mentioned by Microsoft who did not want autorun to be removed. Geddit ? 2. Anonymous Coward Anonymous Coward Alright, I'll grant you that But apart from the Sony DRM, other rootkits, annoying pop ups, trojans, viruses, spyware and generally running stuff we don't want, what have the autoruns ever done to us? 2. Robot Unhappy Microsoft does not go far enough It is not enough to have Autorun turned off by default. There must be no possibility of it being re-activated, not even by tweaking the registry. In other words, total excision of Autorun. 1. Anonymous Coward Anonymous Coward No... People who know what they are doing may have good reasons to use autorun, better that it is hidden away as a registry setting that only those who need it can use. 1. Anonymous Coward Anonymous Coward re: People who know what they are doing Why would such people have any need for Autorun in the first place? 1. Anonymous Coward WTF? re: re: People who know what they are doing Puzzled by thumbsdowns. 2. Anteaus Thumb Up Too true... Even after setting NoDriveTypeAutoRun to 0xFF I've had it mysteriously come back on. This page: http://windowssecrets.com/comp/071108#story1 documents a useful additional piece of protection, which if autorun does manage to launch, redirects it to perform a useless action instead of executing the commands in autorun.inf. I tested this idea with autorun ON and some simulated malware on removeable media, and it does seem to protect the computer. 3. Steen Hive Autorun Does anyone know what the hell use it ever was? 1. Boris the Cockroach Silver badge Gates Horns yes It was so users did'nt have to click on the CD drive icon on their desktops to start a program on the disc 2. Steve Coffman Thumb Down Yeah... I've seen quite a few CDs that launch via autorun Adobe Reader or Macromedia products (now Adobe) that are included on the disc to pull up an index or menu of documents contained on the CD... it's done for those people not smart enough (or perhaps too lazy) to be to open the CD manually and then the appropriate application or document file themselves...of course it seemed like a good idea at the time it was developed to have this functionality but we all know the problems that it has led to years later... 1. Glyn 2 Gates Horns sounds familiar "it's done for those people not smart enough (or perhaps too lazy) to be to open the CD manually and then the appropriate application or document file themselves" Sounds like the entire of Windows 7 "of course it seemed like a good idea at the time it was developed to have this functionality but we all know the problems that it has led to years later.." We'll see (or rather in W7 we won't see as it keeps everything as hidden as possible) 3. Darryl Yeah It was for software and driver developers so that they could pop up a useless resource hogging animated thing with sound and crap as soon as you plugged in a CD. Doesn't matter that all anybody ever did was click on the "Install the damn software" button, which could've been much easier if they'd just included on the box: 1) Insert CD 2) Browse to CD in Explorer 3) Double-click on setup.exe Instead, a lot of them seemed to put more effort and energy into their flashy autorun screens than they did in their software. 1. Marty Coat problem.... "2) Browse to CD in Explorer" some people today still have problems with this step.... I have lost count how many times i have hat to tell people, "hold down the key with the windows logo on it and press E... blah blah blah" 1. Wize @Marty Changing the name of the file browser from File Manager to Explorer didn't help much. Me: Start Explorer User starts Internet Explorer 2. Anonymous Coward Flame Even though I am replying: The title is required, and must contain letters and/or digits. > Instead, a lot of them seemed to put more effort and energy into > their flashy autorun screens than they did in their software. There's a reason they (proprietary software makers) do that, making the sure the user does not gain empowerment. If the user had to follow the same simple steps to do something then they might gain understanding of the computer. If the users have to deal with different things to achieve the same ends, or face interfaces that look different with similar products, then the users are much less likely to gain an understanding of the system. And when someone does not have understanding but has to use a system, they become dependent on third parties to progress on that system. And that is where industry steps in, to "monetize" the people's needs. The software industry is also mature enough that it recognises this, and so very few (if any) proprietary products dare try to empower the user. They dazzle with shiny-shiny, and let the user think they have witnessed some magic. Actually providing what the user might really need, empowerment, is not going to be forthcoming from proprietary software vendors (and to a lesser degree some Free software, the stuff that copies proprietary paradigms, like dumbing shit down to chase the mass-market (eg Firefox)). A parallel to this is the times tables. I'm sure you can imagine how a person could learn their times tables by rote, yet still not understand the principles behind multiplication. That person would be fine with multiplication right up until the point where they need to work out more than 12x12. To do more, they need third party help, a calculator. But a person who understands multiplication does not need the services of a calculator company, they can work it out in their head, or on paper. Proprietary software gets in the way of people's understanding of computers, and that lack of understanding is used to sell software. And software that varies little between versions, and is basically the same stuff re-heated with a few extras slung in. That is why so much effort is spent on the autorun BS. 4. Peter Gathercole Silver badge WTF? It was used very often to kick off a software installer. Even people like PCW used to use it for their cover-mounted CD and DVD's. I've installed a recent HP printer, and it used autorun (the installation instructions did document how to run it without auto run, but it was phrased like "If the installer program doesn't automatically start, open the CD, and ....."). My significant other (worded to attempt to not to upset the Moderatorix) has some craft software that needs the CD inserted explicitly in the D: drive (and heaven forbid if your CD is not the D: drive), and the instructions for this expect autorun to work, and do not contain an alternative. I keep explaining this, and she keeps telling me that her computer is broken because the software does not start. Grrrrrrrr. I think too many of the people commenting here are in the Windows support business, where they are in control of any software installation, and do not talk to home and SOHO businesses where simplicity and hand-holding is essential for people who just use computers as tools. I can't be so old that this has passed out of memory, can I? 4. Tom 35 Silver badge Microsoft has yet to see in-the-wild attacks that exploit Autorun on “shiny media.” Like the Sony root kit? I guess that falls under "resistance from some partners who rely on the feature to install programs". 5. Filippo good riddance And a healthy "fuck you" to everyone who ever manufactured a piece of hardware that installs its drivers via Autorun. 6. Jean-Luc Silver badge Gates Horns Stop having the marketing department run security, please. "Microsoft didn't retire Autorun sooner was the resistance from some partners who rely on the feature to install programs that accompany their hardware" So, basically, some dumb bozos who can't be bothered to do things in a safe manner got us years of malware crud? And the rest of M$'s customers got ignored? What this reminds me of is how long it took M$ to turn off auto-running code in Outlook. IIRC they said something like "our users benefit from this integration". Finally turned it off after years of aggravation and after it was obvious to world and dog that this approach was an oft-repeated accident that had happened again and again. Prior to that, users also had to tinker with the settings to turn it off. Come on guys. I know you won't get everyone to love you. But the least you can do is pay some attention when obvious security risks come to light and lock things down rather than pretend all is well. BTW, U3 blows too, regardless of it being a security risk or not. 1. Anonymous Coward Linux I love you That finally made Microsoft do something. I'll never forgive them for Outlook Express. Penguin. Because they hate HTML email too. 2. Robert E A Harvey BTW, U3 blows too, I took great pleasure, whenever I removed U3 from a stick, in filling in the box which asked why. 7. Jan Hargreaves Thumb Up autorun not on win7? is autorun renamed to something different in windows 7 cos it is still happily working for me (64 bit home premium). Steen Hive - it opens up the explorer window when the device is ready, saves me having to go start, my computer. i also use autorun for having custom icons for my partitions (i have 5). it was nice to do this for usb sticks too. always seemed to impress people at internet cafes etc (yeah i know being cute for no reason haha). security essentials has picked up any bad versions of autorun so far for me (e.g. copying files to friend's usb sticks or wiping mine having used it outside) 1. This post has been deleted by its author 1. A J Stiles Muddy Mildred And they said /etc/asterisk/extensions.conf was hard to understand. 1. Steven Davison Chuckle "And they said /etc/asterisk/extensions.conf was hard to understand." depends who wrote it and how old it was... :P 2. Anonymous Coward Anonymous Coward win 7 & vista don't autorun anything, they do still pop up a dialog asking you what you want to do though, with autorun.inf entries at the top. It's how it should have worked from the start, a kind of halfway house catering for the people who are too lazy/stupid to browse to the files on their own, but without the security issues of autorunning anything. 3. Silver Re: autorun not on win7? That's AutoPlay. The difference between AutoRun and AutoPlay is that AutoRun just blindly went off and ran whatever EXE the autorun.inf file told it to run. Whereas AutoPlay looks at the content of the CD/DVD and then pops up a menu presenting you with some options (eg. view the pictures on this CD) and asking you what you want to do next. AutoPlay solves the problem of people who don't know how to go browse the contents of a CD and find the setup.exe file vs those who don't want some virus riddled exe to startup as soon as they pop the disk in the drive. 8. Anonymous Coward Pirate I'm sure others have said it, cause I read it, but still I don't think saying SONY in big bold letters is large enough yet, so yet another who's going to say it. Anything legal ever happen in regards to that? cause seriously .... 1. Anonymous Coward FAIL IIRC... Sony got beaten with a disintegratingly wet noodle. If you or I had done it we'd be in jail but it was a company doing it so .... 9. Buzzword Go Obvious solution The obvious solution is to have Windows show a dialog box: "You have inserted a CD / DVD / USB stick. Do you want to run the setup program? (This may make changes to your computer)" For bona fide application or game install discs, the user would pick yes; otherwise no. As it stands, when I plug in my digital camera I get the default Windows prompt asking me if I want to run a particular application with it. Seems simple enough. 1. John Bailey Boffin In theory, yes.. In reality.. Bwhaaaaaaa... You made a logical assessment of what should happen. That was your first mistake. In reality.. Popup window comes up and user clicks OK. Clicking OK is how one closes a popup. The most dire warnings get put through a mental filter and come out as "Click OK to close this nasty scary popup". Reading popups is dangerous. It must be avoided at all costs. Because if you have read the popup, you might be responsible for what happens next. Then you can't tell your computer repair serf that you don't know what happened. And picking that MP3 player or USB stick up off the street couldn't possibly have wrecked the work network... could it? 2. Stacy Stop You've never worked with users have you? :) There are two camps of non techie users that I know of. Ignorant: I don't know, and I don't care These people just click yes to everything and cause a friend / relation many hours of grief trying to clean up their system Ignorant, but scared: OMG! What has popped up on the screen, the world is going to end These people generally have clean computers, if only because they never get turned on. These people cause friends / relations hours of grief as everything they need to do online is done over the phone, with said person giving information and the friend / relation filling in the form (Yes I am bitter at wasting my time) But I think that it means anything that a techie thinks is a good solution is likely to fail at the first hurdle for a real user. I am including my own solutions to regular problems here (how hard can it be to teach someone to press two buttons? Very aparently.) So if you use your pop up window I think it would just be people not clicking on it ever, or clicking on it regardless. The biggest security threat to a computer is the person sitting behind it... 1. Anonymous Coward Happy You have strange user... ..most of mine sit in front of the computers, not behind them :-) 1. Stacy Happy Title, what title... I think that are interchangable, but I do hear lots of people complain that their partners spend all night behind the computer... I can just go for PEBAK if you want? And really, you had to be annonymous for that comment! Coward :) 10. Pypes Headmaster Usefulness. IIRC there was a USB based file transfer gadget (2 USB cables with some sort of box-of-hostmode-tricks in the middle, or a fancy pants null modem cable if you prefer) that had it's drivers embedded in the device so that plugging it in to a computer would fire up the transfer software with no need to install anything. This thing was marketed through infomercials to the computer illiterate as an easy means of shifting data from their desktop to their laptop etc. I know this all sounds pretty idiotic to us reg readers, but to the computer illiterate (and their tech savvy children / grandchildren) the "plug it in and it works" functionality was a pretty useful feature. That said, having the OS execute any old code if happens to find on a USB device just because you plugged it in is and always will be a fucking stupid idea. 11. Only wankers enable all the spam option by default on new user sign ups Alert I saw a screensaver password bypasser for 9x using autorun > Adam Shostack, a program manager for Microsoft's > Trustworthy Computing group, said here that Microsoft > has yet to see in-the-wild attacks that exploit Autorun > on “shiny media.” Apart from the obvious Sony rootkit, I remember seeing a download years ago that used autorun to bypass the screensaver on windows 95. If the screensaver was password protected, you could pop in a CD, it would autorun, switching off the screensaver's password and allowing the attacker to get to a desktop that was meant to be inaccessible Yes, I know, 9x, no real security. But it is still an attack that used autorun on shiny media. Your sweeping PR statements are no match for my memory, Shostack! 1. Anonymous Coward Anonymous Coward Windows 9x Screesaver Passwords In Windows 9x you could just click cancel on the password screen to get past. 1. Gordon Barret Alien (untitled) Not so - you could click Cancel on the Windows Login screen to get logged in as the previous user, but not so on the Screensaver password prompt - clicking Cancel there just went back into the screensaver. 12. bofh80 Jobs Horns Lies, Lies, Lies Viewpoint Media Player is a very viral dvd player that comes packed onto loads of DVD movies, and it installs itself without asking. I have seen XP come to a crawl just because of this stupid thing, not on my XP build tho, i disabled those Security flaws for my customers over 2 years ago. I get the occasional person I have to explain to double click on my computer. Apart from that and ofc the stupid 3g sticks and their stupid modeswitch. I wouldn't mind, it's just another of the 500 to 1000+ registry entries that are wrong by default. How else are the MCP's going to make any money? ::) 13. Lord Zedd Gates Horns Who still uses windows? Who still runs Windows Update on 95, 98, Me, 2000 or NT? Or for that matter, who still uses them? 1. Paul Crawford Silver badge Thumb Down @Who still uses windows? A depressingly large number, I'm afraid. However, while I still use XP and 2000, it is a VM on Linux now, and I generally disable networking and USB access wherever I can, in addition to having turned off autorun on ALL drives by the registry tricks. Really, as already said in these posts, autorun was a dumb idea in the first place and only sustained by those who cared not two hoots about security and freedom from crud ware. 2. Jay 2 FAIL Patches, we don' need no steenkin' patches etc... I'm pretty sure whoever is using them, isn't going to do any updates! 3. jonathan keith Paris Hilton Win98 I've got a Win 98 box still running, for my old games. It's going nowhere until X-Wing or Tie Fighter get remade properly. Paris, because she's good for old games too, allegedly. 14. blackworx Registry? As I recall I don't think it took registry fiddling or running fixes to turn AR off. You just had to know where to look. 15. James Boag Coffee/keyboard Sir you own me a new keyboard Microsoft's Trustworthy Computing group ! 16. Wibble Stop Hope Apple follow soon Apple still enable auto run on the Mac. They don't even have a temp disable key - hold down the shift key - like windows did. 1. Kar98 Flame What? What are you smoking? There's no auto-run on OS X. The disk gets mounted, but that is all. 17. Willington Automatic for the people? "Adding the change to the official Windows Update mechanism means millions of users will turn it off automatically." Not so. There were 10 updates for Vista yesterday and only 9 of them were automatic. Guess which one wasn't! 18. Tron Late software giant is late. Closing the stable door after the horse has bolted, got out into the sheep field and scared them all, been captured, returned to the stables, had a long and productive working life in a variety of capacities, spent a short retirement giving children rides before being carted off to the glue factory, shot in the head with a bolt, boiled down, made into glue and sold in newsagents up and down the land. Page: This topic is closed for new posts. Biting the hand that feeds IT © 1998–2019
__label__pos
0.608312
Main Content magic Sintaxis Descripción ejemplo M = magic(n) devuelve una matriz de n por n construida a partir de los enteros 1 a n2 cuyas filas y columnas sumen lo mismo. El orden n debe ser un escalar igual a o mayor que 3 para crear un cuadrado mágico válido. Ejemplos contraer todo Calcule el cuadrado mágico de tercer orden M. M = magic(3) M = 3×3 8 1 6 3 5 7 4 9 2 La suma de los elementos de cada columna y la suma de los elementos de cada fila son iguales. sum(M) ans = 1×3 15 15 15 sum(M,2) ans = 3×1 15 15 15 Examine visualmente los patrones en las matrices de un cuadrado mágico con órdenes entre 9 y 24 utilizando imagesc. Los patrones muestran que magic utiliza tres algoritmos diferentes, en función de si el valor de mod(n,4) es 0, 2 o impar. for n = 1:16 subplot(4,4,n) ord = n+8; m = magic(ord); imagesc(m) title(num2str(ord)) axis equal axis off end Figure contains 16 axes objects. Axes object 1 with title 9 contains an object of type image. Axes object 2 with title 10 contains an object of type image. Axes object 3 with title 11 contains an object of type image. Axes object 4 with title 12 contains an object of type image. Axes object 5 with title 13 contains an object of type image. Axes object 6 with title 14 contains an object of type image. Axes object 7 with title 15 contains an object of type image. Axes object 8 with title 16 contains an object of type image. Axes object 9 with title 17 contains an object of type image. Axes object 10 with title 18 contains an object of type image. Axes object 11 with title 19 contains an object of type image. Axes object 12 with title 20 contains an object of type image. Axes object 13 with title 21 contains an object of type image. Axes object 14 with title 22 contains an object of type image. Axes object 15 with title 23 contains an object of type image. Axes object 16 with title 24 contains an object of type image. Argumentos de entrada contraer todo Orden de la matriz, especificado como escalar entero igual a o mayor que 3. Si n es complejo y no es un entero ni un escalar, magic lo convierte en un entero útil con floor(real(double(n(1)))). Si proporciona n menor que 3, magic devuelve un cuadrado no mágico o los cuadrados mágicos degenerados 1 y []. Tipos de datos: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char Capacidades ampliadas Historial de versiones Introducido antes de R2006a Consulte también |
__label__pos
0.574394
Shell Scripting Q&A [vc_row][vc_column][vc_column_text css=”.vc_custom_1562159105664{background-color: #1e73be !important;}”] Shell Scripting Interview Questions & Answers [/vc_column_text][/vc_column][/vc_row][vc_row][vc_column css_animation=”fadeInLeft” width=”1/2″][vc_tta_accordion color=”peacoc” active_section=”1″][vc_tta_section title=”What is a shell?” tab_id=”1562159123844-33d6793d-566a”][vc_column_text]Shell is an interface between the user and the kernel. Even though there can be only one kernel; a system can have many shell running simultaneously. So, whenever a user enters a command through the keyboard, the shell communicates with the kernel to execute it and then display the output to the user.[/vc_column_text][/vc_tta_section][vc_tta_section title=”What are the different types of commonly used shells on a typical Linux system?” tab_id=”1562159123863-4ec94362-22f8″][vc_column_text]csh,ksh,bash,Bourne . The most commonly used and advanced shell used today is “Bash” .[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the equivalent of a file shortcut that we have a window on a Linux system?” tab_id=”1562159136473-a7d5af42-ac52″][vc_column_text]Shortcuts are created using “links” on Linux. There are two types of links that can be used namely “soft link” and “hard link”.[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the difference between soft and hard links?” tab_id=”1562159137810-a28b8c23-fecb”][vc_column_text]Soft links are link to the file name and can reside on different filesytem as well; however hard links are link to the inode of the file and have to be on the same filesytem as that of the file. Deleting the original file makes the soft link inactive (broken link) but does not affect the hard link (Hard link will still access a copy of the file)[/vc_column_text][/vc_tta_section][vc_tta_section title=”How will you pass and access arguments to a script in Linux?” tab_id=”1562159138406-57955ef4-8e51″][vc_column_text]Arguments can be passed as: scriptName “Arg1” “Arg2″….”Argn” and can be accessed inside the script as $1 , $2 .. $n[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the significance of $#?” tab_id=”1562159139122-647a9da1-7de2″][vc_column_text]$# shows the count of the arguments passed to the script.[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the difference between $* and $@?” tab_id=”1562159140266-b4e72f11-1587″][vc_column_text]$@ treats each quoted arguments as separate arguments but $* will consider the entire set of positional parameters as a single string.[/vc_column_text][/vc_tta_section][vc_tta_section title=”Use sed command to replace the content of the file (emulate tac command)” tab_id=”1562159140859-cbdcf4ca-4a6c”][vc_column_text] if cat fille ABCD EFGH Then O/p should be EFGH ABCD sed '1! G; h;$!d' file1 Here G command appends to the pattern space, h command copies pattern buffer to hold buffer and d command deletes the current pattern space.[/vc_column_text][/vc_tta_section][vc_tta_section title=” Given a file, replace all occurrence of word “ABC“ with “DEF“ from 5th line till end in only those lines that contains word “MNO“” tab_id=”1562159141475-b8deeda9-28d2″][vc_column_text] sed –n '5,$p' file1|sed '/MNO/s/ABC/DEF/' [/vc_column_text][/vc_tta_section][vc_tta_section title=”Given a file, write a command sequence to find the count of each word.” tab_id=”1562159142091-b5f53654-e195″][vc_column_text] tr –s "(backslash)040" <file1|tr –s "(backslash)011"|tr "(backslash)040 (backslash)011" "(backslash)012" |uniq –c where "(backslash)040" is octal equivalent of "space" “(backslash)011” is an octal equivalent of “tab character” and “(backslash)012″ is an octal equivalent of the newline character.[/vc_column_text][/vc_tta_section][vc_tta_section title=”How will you find the 99th line of a file using only tail and head command?” tab_id=”1562159142720-9267338c-1eee”][vc_column_text]tail +99 file1|head -1[/vc_column_text][/vc_tta_section][vc_tta_section title=”Print the 10th line without using tail and head command.” tab_id=”1562159143506-00727d88-df0a”][vc_column_text] sed –n '10p' file1 [/vc_column_text][/vc_tta_section][vc_tta_section title=”In my bash shell I want my prompt to be of format ‘$“Present working directory“:“hostname“> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?” tab_id=”1562159144707-243b707f-2e0c”][vc_column_text]In bash shell, we can create “.profile” file which automatically gets invoked as soon as I log in and write the following syntax into it. export PS1='$ `pwd`:`hostname`>' .File1 Here File1 is the file containing the user-defined functions and “.” invokes this file in current shell.[/vc_column_text][/vc_tta_section][vc_tta_section title=”Explain about “s“ permission bit in a file?” tab_id=”1562159145319-954a2a3b-856b”][vc_column_text]”s” bit is called “set user id” (SUID) bit. “s” bit on a file causes the process to have the privileges of the owner of the file during the instance of the program. For example, executing “passwd” command to change current password causes the user to writes its new password to shadow file even though it has “root” as its owner.[/vc_column_text][/vc_tta_section][vc_tta_section title=” I want to create a directory such that anyone in the group can create a file and access any person’s file in it but none should be able to delete a file other than the one created by himself.” tab_id=”1562159145883-3694d6e1-1314″][vc_column_text]We can create the directory giving read and execute access to everyone in the group and setting its sticky bit “t” on as follows: mkdir direc1 chmod g+wx direc1 chmod +t direc1 [/vc_column_text][/vc_tta_section][vc_tta_section title=”How can you find out how long the system has been running?” tab_id=”1562159146467-cf572f73-7514″][vc_column_text]We can find this by using the command “uptime”.[/vc_column_text][/vc_tta_section][vc_tta_section title=”How can any user find out all information about a specific user like his default shell, real-life name, default directory, when and how long he has been using the system?” tab_id=”1562159147083-00d0bfce-d510″][vc_column_text]finger “loginName” …where loginName is the login name of the user whose information is expected.[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the difference between $$ and $!?” tab_id=”1562159147727-6d780593-9fd3″][vc_column_text]$$ gives the process id of the currently executing process whereas $! Shows the process id of the process that recently went into the background.[/vc_column_text][/vc_tta_section][vc_tta_section title=” What are zombie processes?” tab_id=”1562159149143-ed690927-480b”][vc_column_text]These are the processes which have died but whose exit status is still not picked by the parent process. These processes even if not functional still have its process id entry in the process table.[/vc_column_text][/vc_tta_section][vc_tta_section title=”How will you copy a file from one machine to other?” tab_id=”1562159149731-75463a9b-c3c0″][vc_column_text]We can use utilities like “ftp,” “scp” or “rsync” to copy a file from one machine to other. E.g., Using ftp: FTP hostname >put file1 >bye Above copies, file file1 from the local system to destination system whose hostname is specified.[/vc_column_text][/vc_tta_section][vc_tta_section title=”I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?” tab_id=”1562159150500-43041d20-6eba”][vc_column_text]We can use tail –f filename. This will cause only the default last 10 lines to be displayed on std o/p which continuously shows the updating part of the file.[/vc_column_text][/vc_tta_section][vc_tta_section title=”I want to connect to a remote server and execute some commands, how can I achieve this?” tab_id=”1562159151123-dbfd9ac4-30d1″][vc_column_text]We can use ssh to do this: ssh username@serverIP -p sshport Example ssh [email protected] -p 22 Once above command is executed, you will be asked to enter the password[/vc_column_text][/vc_tta_section][vc_tta_section title=”I have 2 files and I want to print the records which are common to both.” tab_id=”1562159151829-e6169aeb-55da”][vc_column_text]We can use “comm” command as follows: comm -12 file1 file2 … 12 will suppress the content which are unique to 1st and 2nd file respectively.[/vc_column_text][/vc_tta_section][vc_tta_section title=” Write a script to print the first 10 elements of Fibonacci series.” tab_id=”1562159152512-e69a4705-7a66″][vc_column_text] #!/bin/sh a=1 b=1 echo $a echo $b for I in 1 2 3 4 5 6 7 8 do c=a b=$a b=$(($a+$c)) echo $b done [/vc_column_text][/vc_tta_section][vc_tta_section title=”How will you connect to a database server from Linux?” tab_id=”1562159153173-778ce490-9afc”][vc_column_text]We can use isql utility that comes with open client driver as follows: isql –S serverName –U username –P password[/vc_column_text][/vc_tta_section][/vc_tta_accordion][/vc_column][vc_column css_animation=”fadeInRight” width=”1/2″][vc_tta_accordion color=”peacoc” active_section=”1″][vc_tta_section title=”What are the 3 standard streams in Linux?” tab_id=”1562159165752-1a80448f-cc5d”][vc_column_text]0 – Standard Input1 – Standard Output2 – Standard Error[/vc_column_text][/vc_tta_section][vc_tta_section title=”I want to read all input to the command from file1 direct all output to file2 and error to file 3, how can I achieve this?” tab_id=”1562159165770-5f72285a-99b0″][vc_column_text]command <file1 1>file2 2>file3[/vc_column_text][/vc_tta_section][vc_tta_section title=”What will happen to my current process when I execute a command using exec?” tab_id=”1562159179652-fa3d9f40-0e88″][vc_column_text]”exec” overlays the newly forked process on the current process; so when I execute the command using exec, the command gets executed on the current shell without creating any new processes. E.g., Executing “exec ls” on command prompt will execute ls and once ls exits, the process will shut down[/vc_column_text][/vc_tta_section][vc_tta_section title=”How will you emulate wc –l using awk?” tab_id=”1562159180263-fe43a729-6a0d”][vc_column_text]awk ‘END {print NR} fileName'[/vc_column_text][/vc_tta_section][vc_tta_section title=”Given a file find the count of lines containing the word “ABC“.” tab_id=”1562159181156-fd0e46d0-5866″][vc_column_text]grep –c “ABC” file1[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the difference between grep and egrep?” tab_id=”1562159181775-23566da5-be7a”][vc_column_text]egrep is Extended grep that supports added grep features like “+” (1 or more occurrence of a previous character),”?”(0 or 1 occurrence of a previous character) and “|” (alternate matching)[/vc_column_text][/vc_tta_section][vc_tta_section title=”How will you print the login names of all users on a system?” tab_id=”1562159182351-c777a12a-3c25″][vc_column_text]/etc/shadow file has all the users listed. awk –F ‘:’ ‘{print $1} /etc/shadow’|uniq -u[/vc_column_text][/vc_tta_section][vc_tta_section title=”How to set an array in Linux?” tab_id=”1562159184443-ec1a1bee-fe5e”][vc_column_text]Syntax in ksh: Set –A arrayname= (element1 element2 ….. element) In bash A=(element1 element2 element3 …. elementn) [/vc_column_text][/vc_tta_section][vc_tta_section title=” Write down the syntax of “for “ loop” tab_id=”1562159185867-35135b5c-5a1c”][vc_column_text]Syntax: for iterator in (elements) do execute commands done [/vc_column_text][/vc_tta_section][vc_tta_section title=”How will you find the total disk space used by a specific user?” tab_id=”1562159186507-b79b320b-844e”][vc_column_text]du -s /home/user1 ….where user1 is the user for whom the total disk space needs to be found.[/vc_column_text][/vc_tta_section][vc_tta_section title=”Write the syntax for “if“ conditionals in Linux?” tab_id=”1562159187227-2fc1c5a9-71e5″][vc_column_text]Syntax If condition is successful then execute commands else execute commands fi [/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the significance of $?” tab_id=”1562159188039-1a8d5718-ae15″][vc_column_text]The command $? gives the exit status of the last command that was executed.[/vc_column_text][/vc_tta_section][vc_tta_section title=”How do we delete all blank lines in a file?” tab_id=”1562159188663-696fb190-09f2″][vc_column_text] sed '^ [(backslash)011(backslash)040]*$/d' file1 where (backslash)011 is an octal equivalent of space and (backslash)040 is an octal equivalent of the tab[/vc_column_text][/vc_tta_section][vc_tta_section title=”How will I insert a line “ABCDEF“ at every 100th line of a file?” tab_id=”1562159189468-83643328-02c0″][vc_column_text]sed ‘100i\ABCDEF’ file1[/vc_column_text][/vc_tta_section][vc_tta_section title=” Write a command sequence to find all the files modified in less than 2 days and print the record count of each.” tab_id=”1562159190148-dd73ffe6-3124″][vc_column_text]find . –mtime -2 –exec wc –l {} \;[/vc_column_text][/vc_tta_section][vc_tta_section title=” How can I set the default rwx permission to all users on every file which is created in the current shell?” tab_id=”1562159191443-08cb951d-44a6″][vc_column_text]We can use: umask 777 This will set default rwx permission for every file which is created for every user.[/vc_column_text][/vc_tta_section][vc_tta_section title=”How can we find the process name from its process id?” tab_id=”1562159191984-4398b434-d24e”][vc_column_text]We can use “ps –p ProcessId”[/vc_column_text][/vc_tta_section][vc_tta_section title=”What are the four fundamental components of every file system on Linux?” tab_id=”1562159192675-f1673b47-7ba9″][vc_column_text]Bootblock, super block, inode block and Datablock are found fundamental components of every file system on Linux.[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is a boot block?” tab_id=”1562159193248-b542febb-9785″][vc_column_text]This block contains a small program called “Master Boot record”(MBR) which loads the kernel during system boot up.[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is a super block?” tab_id=”1562159193965-45fa1997-25f2″][vc_column_text]Super block contains all the information about the file system like the size of file system, block size used by its number of free data blocks and list of free inodes and data blocks.[/vc_column_text][/vc_tta_section][vc_tta_section title=” What is an inode block?” tab_id=”1562159194635-a84f894e-aa55″][vc_column_text]This block contains the inode for every file of the file system along with all the file attributes except its name.[/vc_column_text][/vc_tta_section][vc_tta_section title=”How can I send a mail with a compressed file as an attachment?” tab_id=”1562159195355-dcaf5df5-9e19″][vc_column_text]zip file1.zip file1|mailx –s “subject” Recipients email id Email content EOF[/vc_column_text][/vc_tta_section][vc_tta_section title=”How do we create command aliases in a shell?” tab_id=”1562159196528-50bed153-e6d9″][vc_column_text]alias Aliasname=”Command whose alias is to be created”.[/vc_column_text][/vc_tta_section][vc_tta_section title=”What are “c“ and “b“ permission fields of a file?” tab_id=”1562159197152-37e43af9-4842″][vc_column_text]”c ” and “b” permission fields are generally associated with a device file. It specifies whether a file is a special character file or a block special file.[/vc_column_text][/vc_tta_section][vc_tta_section title=”What is the use of a shebang line?” tab_id=”1562159198144-da1eeda1-8860″][vc_column_text]Shebang line at the top of each script determines the location of the engine which is to be used to execute the script.[/vc_column_text][/vc_tta_section][/vc_tta_accordion][/vc_column][/vc_row] WhatsApp us
__label__pos
0.902375
LeetCode #75 Sort Colors 解題思路及翻譯 LeetCode題目翻譯 英文原文如下 Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue. We will use the integers 01, and 2 to represent the color red, white, and blue, respectively. You must solve this problem without using the library’s sort function. 中文翻譯 給予一個陣列nums,包含n個物件以紅色、白色及藍色標記,排序他們(使用原地演算法 ➔ 可理解為不改變資料結構),使相同顏色的物件能夠鄰近一塊(排序: 紅色、白色、藍色) 使用整數 0、1、2 來分別表示紅色、白色、藍色 你必須在不使用函式庫的排序函式解決問題 LeetCode #75 Constraints Pictures 第一點題目第一句就提到了,陣列長度為n n的長度介於1到300之間 ➔ 不用擔心無資料等例外狀況 陣列中僅有 0、1、2 ➔ 三個數字分別對應三種不同顏色 接下來是官方範例 LeetCode #75 官方範例 這題其實比較單純,看到限制不能使用已有的排序函式,再看到範例,很容易就可以知道又做的就是根據 0、1、2排序 解題思路 氣泡排序法 Bubble Sort 講到排序,筆者第一個想到就會是「氣泡排序法」,最常見的排序演算法 主要核心原理為按順序兩兩數字比較,前者比後者大就交換,因為數字較小/大的會逐漸浮到最前/後,像氣泡浮出水面一樣,故因此得名 更詳細的可以參考 : 維基百科-泡沫排序IThome鐵人賽有篇也寫得很好,這篇就不另詳細說明 C# 解決方案 方案1 – 氣泡排序法 public class Solution { public void SortColors(int[] nums) { int n = nums.Length; while(n>1) //註1 { n--; for(int i =0;i<nums.Length-1;i++) { if(nums[i] > nums[i+1]) { int tmp = nums[i]; //暫存int,為了兩個數字交換 nums[i] = nums[i+1]; nums[i+1] = tmp; } } } } } 沒錯,就是這麼簡單,沒幾行 我們來看一下註1的部分,為什麼要n>1呢,其實這樣就會跑n-1次 假設現在有一數列 [4、3、2、1] ➔ 可以看到是最糟糕的狀況吧(以從index 0 做氣泡排序來看) 那每次運行結果會跟下面一樣(這裡的n 以及i 為上方範例程式的變數名稱) i = 0i = 1i = 2 第一次 n = 4342132413214 第二次 n = 323142134註2 第三次 n = 21234註3註4 n=1 不運行 氣泡排序範例 4321 ➔ 1234 時間複雜度 : O(n2) 註2 ➔ 可以看到 i =3 的狀況時 ,我們來判斷這個 nums[i] > nums[i+1] 目前的數字為 2134, nums[2] = 3 、nums[3] = 4,已排列完故不用交換 ➔ 3>4 = false 註3、註4則是同理 氣泡排序法的缺點也較為明顯,像是上面舉的那個例子,只有4個數字大家可能沒有感覺 可是4個數字就需要跑 (n-1)*(n-1)次 = 3*3 = 9次 (註2、註3、註4 其實都有跑到,只是不用交換而已) 時間複雜度方面,除非加入每次執行確認的程序,最好可為O(n) ➔ 完全不用交換,或只要交換n次 方案2 – 沒那麼短但相對好理解 public class Solution { public void SortColors(int[] nums) { int a = 0; int b = 0; int c = 0; //1.遞迴並計算 foreach(int num in nums) { switch(num) { case 0: a+=1; break; case 1: b+=1; break; case 2: c+=1; break; } } //2.重寫Array int cnt = 0; while(a>0) { nums[cnt] = 0; a--; cnt++; } while(b>0) { nums[cnt] = 1; b--; cnt++; } while(c>0) { nums[cnt] = 2; c--; cnt++; } } } 時間複雜度 : O(n) ➡ 雖然用了很多個迴圈,但也只會跑到 2n次 差不多3,4個月後回來整理文章時想到,既然只有3種顏色 (0,1,2) 那我直接用3個 int 變數存不就好了嗎 Java解決方案 方案1 – 氣泡排序法 class Solution { public void sortColors(int[] nums) { int n = nums.length; while(n>1) { n--; for(int i =0;i<nums.length-1;i++) { if(nums[i] > nums[i+1]) { int tmp = nums[i]; nums[i] = nums[i+1]; nums[i+1] = tmp; } } } } } 時間複雜度 : O(n2) 運行時間 : 12ms、4ms、4ms 方案2 class Solution { public void sortColors(int[] nums) { int a = 0; int b = 0; int c = 0; //1.遞迴並計算 for(int num : nums) { switch(num) { case 0: a+=1; break; case 1: b+=1; break; case 2: c+=1; break; } } //2.重寫Array int cnt = 0; while(a>0) { nums[cnt] = 0; a--; cnt++; } while(b>0) { nums[cnt] = 1; b--; cnt++; } while(c>0) { nums[cnt] = 2; c--; cnt++; } } } 時間複雜度 : O(n) 運行時間 : 0ms、0ms、0ms Python3 解決方案 方案1 class Solution: def sortColors(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ n = len(nums) while(n>1): n-=1 for i in range(len(nums)-1): if(nums[i] > nums[i+1]): tmp = nums[i] nums[i] = nums[i+1] nums[i+1] = tmp 方案2 class Solution: def sortColors(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ a = 0 b = 0 c = 0 for num in nums: if num == 0: a+=1 elif num == 1: b+=1 else: c+=1 cnt = 0 while(a>0): nums[cnt] = 0 a-=1 cnt+=1 while(b>0): nums[cnt] = 1 b-=1 cnt+=1 while(c>0): nums[cnt] = 2 c-=1 cnt+=1 JavaScript 解決方案 方案1 /** * @param {number[]} nums * @return {void} Do not return anything, modify nums in-place instead. */ var sortColors = function(nums) { var n = nums.length; while(n>1) { n--; for (let i=0; i<nums.length-1; i++) { if(nums[i] > nums[i+1]) { let tmp = nums[i]; nums[i] = nums[i+1]; nums[i+1] = tmp; } } } }; 方案2 /** * @param {number[]} nums * @return {void} Do not return anything, modify nums in-place instead. */ var sortColors = function(nums) { var a = 0; var b = 0; var c = 0; nums.forEach(function(num){ switch(num) { case 0: a+=1; break; case 1: b+=1; break; case 2: c+=1; break; } }); var cnt = 0; while(a>0) { nums[cnt] = 0; a--; cnt++; } while(b>0) { nums[cnt] = 1; b--; cnt++; } while(c>0) { nums[cnt] = 2; c--; cnt++; } }; 結論 這題考的是很基本的排序演算法,算是個入門容易、優化學問深如海的概念 不過現在Library 其實已經很發達了,大多時候是不用自己土法煉鋼,主要還是培養一個邏輯概念了 "It's kind of fun to do the impossible." Walt Disney 題目連結 : Sort Colors – LeetCode 🧡如果這篇文章有幫上你的一點點忙,那是我的榮幸 🧡幫我點一個廣告,可以讓我月底不用煩惱主機錢 (┐「﹃゚。) ✅如有任何疑問,歡迎透過留言或messenger讓我知道 ! 最新文章 發佈留言 發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *
__label__pos
0.996722
Tell me more × Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required. I have some view and image view. _contentView = [[UIView alloc] initWithFrame:self.bounds]; _contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; .... UIImageView *imageView = [[UIImageView alloc] initWithImage:someImage]; [_contentView addSubview:imageView]; This imageView runs some animation. [UIView animateWithDuration:1.6f delay:0.0 options:UIViewAnimationOptionAllowUserInteraction |UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat animations:^{ imageView.center = somePoint; } completion:^(BOOL finished) { }]; The problem is that after rotation animation stops. If i change autoresizing mask of the _contentView to flexible bounds animation continues after rotation. But i need it to be with flexible size. Can someone explain why animation stops after rotation? share|improve this question add comment 1 Answer Make the device rotation disabled while the animation is playing and after the animation, rotate the screen if the device has been rotated during the animation. This should solve the problem. share|improve this answer   I try to find the solution or explanation with normal device rotation –  George Feb 21 at 16:26   try to pause when the device is rotating and resume it after the rotation is complete. –  moray95 Feb 21 at 16:29 add comment Your Answer   discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged or ask your own question.
__label__pos
0.607921
truskawkoweciasteczko do parkometru można wrzucać monety jednozłotowe i dwuzłotowe.ile razem monet było w parkometrze? w parkometrze jest dokładnie 3 razy więcej złotówek niż dwuzłotówek sumka jest niewielka 95 zł. plis pomóżcie To pytanie ma już najlepszą odpowiedź, jeśli znasz lepszą możesz ją dodać 1 ocena Najlepsza odp: 100% Najlepsza odpowiedź x szt. zlotowek; kasa (1 * x) zl; y szt. dwuzlotowek; kasa (2 * y) zl; x = 3 * y x + 2 * y = 95 3 * y + 2 * y = 95 5 * y = 95 y = 95 / 5 y = 19 szt. dwuzlotowek; x = 3 * y = 3 * 19 = 57 szt. zlotowek sprawdzamy 19 * 2 + 57 = 95 38 + 57 = 95 95 = 95 wniosek x + y = 57 + 19 = 76 monet razem; No, prosze. Wkuwaj mate - jest tego warta Pozdrawiam oddaj swoj glos na sondzie [LINK] Odpowiedzi nataaria x-liczba dwuzłotówek 3x- liczba złotówek x*2+3x*1=95 5x=95 x=19 Skomentuj Uważasz, że znasz lepszą odpowiedź? lub
__label__pos
0.997829
Post a New Question algebra posted by . Essay; show all work. Bob’s Barber Shop estimates their gross revenue for the second quarter to be given by the polynomial 2x3 – 3x2 + 7x – 1. The shop estimates their costs for that quarter to be given by x2 + 4x + 2. For the second quarter, find and simplify a polynomial that will represent their profit. • algebra - Online "^" is used to indicate an exponent, e.g., x^2 = x squared. 2x^3 – 3x^2 + 7x – 1 - (x^2 + 4x + 2) = 2x^3 – 3x^2 + 7x – 1 - x^2 - 4x - 2 = ? Combine like terms. Respond to this Question First Name School Subject Your Answer Similar Questions More Related Questions Post a New Question
__label__pos
0.999454
Beefy Boxes and Bandwidth Generously Provided by pair Networks Problems? Is your data what you think it is?   PerlMonks   use and require inside subs by Anonymous Monk on Nov 02, 2004 at 23:11 UTC ( #404777=perlquestion: print w/replies, xml ) Need Help?? Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: sorry monks, I feel like this is info I should be able to find somewhere but I cant. I have lots of subroutines, many of which use various modules or other subroutines I've made. I use require 'myperlsub.pl' to include my subroutines and of course 'use' to include modules. What I would like to do is put 'use' and 'require' statements into my subroutines, since sometimes they will be called from scripts that already use and require the necessary subs and modules and sometimes not. I've read that 'require' will handle double declarations just fine, but I've also read that I should use 'do myperlsub.pl' instead. I can't find anything that says one way or the other how 'use' will handle this. Please advise. Thanks. Replies are listed 'Best First'. Re: use and require inside subs by tachyon (Chancellor) on Nov 02, 2004 at 23:37 UTC You seem to be making a distinction between subroutines in .pl files and modules. There is no such distinction. Modules are typically just a collection of subroutines/functions/methods/widgets - call them what you will. See Simple Module Tutorial. Anyway besides suggesting that you put everyting into modules for consistency and simplicity's sake the main difference between use and require is that use does a require PLUS calls the modules import function. Never seen a module with an import() function? That is becaue it is inherited from Exporter Depending on what the module exports by default (in @EXPORT) and what you ask for (in @EXPORT_OK) zero or more functions/subroutines will become available via their unqualified name ie you can call somefunction(). You can *always* call Some::Module::somefunction() by its fully qualified name, regardless of whether or not you have imported it. The only pre-requisite is that you have used or required that module first. The other significant difference between use and require is that use happens at compile time. require happens at runtime as Perl stumbles across it. require is almost the same as do (it uses it), except it will search @INC for you. For example you can do (not recommended) this to effectively get very similar results to useing a module: do 'd:/perl/lib/Data/Dumper.pm'; Data::Dumper->import(); print Dumper(\@INC,\%INC); So what do I personally do? Almost all code is in modules. In a given script/module I will use any other Module I know I will need, and import the functions that always get used. In any given function, if it is possible that a module has not been used and/or the required function imported I will have: sub widget { # blah require Some::Module; my $result = Some::Module::somefunction(@args); cheers tachyon I thought I knew this, but why do I put my use statements inside if/then if it happens at compile time? use warnings; use strict; my $config; if ($^O eq 'MSWin32') { use Win32::TieRegistry( Delimiter=>"/", ArrayValues=>0 ); # load $config from registry } else { # else load $config from flat files } Too tired to think for myself tonight. I thought I knew this, but why do I put my use statements inside if/then if it happens at compile time? As Tachyon points out, you shouldn't. Or at least, run-time statements won't get executed at compile time, so your code won't do what you want. Remember, the use() command has an implicit BEGIN block around it, which forces the statements to be executed at compile time. The statement: use module; is like writing: BEGIN { require "module.pm;" module::import(); } So, you have two choices. You can make all the decisions about which code to include at run-time, and use "require" statements. As ysth points out, something like the following doesn't actually work, though I initially thought it did. use warnings; use strict; my $config; BEGIN { if ($^O eq 'MSWin32') { use Win32::TieRegistry( Delimiter=>"/", ArrayValues=>0 ); # load $config from registry } else { # else load $config from flat files } } # end system specific compile time code Since BEGIN blocks and use statements both now happen at "compile time", the above code should work, right? Nope. There's a specifically defined order to how BEGIN blocks execute, and it's not what I had assumed it was. Upon a careful reading of the perl module documentation page, (type "perldoc perlmod" to read it), I think I understand how it all works. Comments and corrections are appreciated. According to the documentation: A "BEGIN" code block is executed as soon as possible, that is, the moment it is completely defined. The documentation doesn't say exactly what "completely defined" means, but I took it to mean when the end of the BEGIN block is reached, when reading sequentially through the code. This implies that code like this: BEGIN { print "-one-"; BEGIN { print "-two-"; BEGIN { print "-three-; } # end of block that prints "-three-" } # end of block that prints "-two-" } # end of block that prints "-one-" should print "-three-two-one", because the end of the block that prints "-three-" is encountered first, then "-two-", then "-one-". This is what happens when I run it, which implies I'm at least close to right. It also means that when you write a BEGIN block with a "use" statement inside it, the end of the use statement gets reached before the end of the BEGIN block. Since a use statment is really an implied BEGIN block, this means it executes first, before the BEGIN block gets a chance to do anything. Sorry for any confusion I caused. :-( -- Ytreq Q. Uiop Re: use and require inside subs by Tuppence (Pilgrim) on Nov 02, 2004 at 23:57 UTC Personally, I force all of my code to be in modules. For development I sometimes do actual perl code in my .pl scripts, but for the most part my scripts all look like use My:Script:Foo; My::Script::Foo->bar() This allows me to test all of my scripts by ensuring all of my modules are fully tested, and helps me organise my code by functional units instead of just throwing various and sundry subs into my scripts. Re: use and require inside subs by JediWizard (Deacon) on Nov 02, 2004 at 23:37 UTC Personally, I avoid ever doing a require 'Something.pl'. If I have a subroutine in a script which I need to use in another script, I put it in a module and use it. The only time I use require to include code is when I need to dynamically include something at run time. As I understand it, use is a compile time directive, and will have the same effect whether it is inside a subroutine that is called repeatedly, or at the top of the script or file. May the Force be with you Re: use and require inside subs by kiat (Vicar) on Nov 02, 2004 at 23:41 UTC You can also use autouse # Main script use autouse Somemodule => qw(func1 func2); main_script_func { func1(); } Log In? Username: Password: What's my password? Create A New User Domain Nodelet? Node Status? node history Node Type: perlquestion [id://404777] Approved by ikegami Front-paged by bart help Chatterbox? and the web crawler heard nothing... How do I use this? | Other CB clients Other Users? Others making s'mores by the fire in the courtyard of the Monastery: (6) As of 2022-07-07 11:24 GMT Sections? Information? Find Nodes? Leftovers? Voting Booth? No recent polls found Notices?
__label__pos
0.745823
4 \$\begingroup\$ I've seen so many different ways of doing this all seem very complex and all seem to be done in MySQL. I'm using PDO in my project so I've had a go myself to see what I could come up with. 1. Is this safe? 2. Is there something I've missed a better way of doing it? //build query to insert users_contracts $sth = "INSERT INTO `users_contracts` (users_id,contracts_id) VALUES (:user,:contract)"; $q = $conn->prepare($sth); //take each item in the contract array from _POST and bind to the above INSERT query foreach($contract as $contract => $contract_id) { try { $q->execute(array(':user'=>$last_id,':contract'=>$contract_id)); } catch (PDOException $e) { $errors[] = array( 'message' => "Could not insert \"$contract\", \"$contract_id\".", 'error' => $e ); } } Its intended purpose is to allow the admin user to assign contracts to users via a checkbox list. \$\endgroup\$ 3 Answers 3 5 \$\begingroup\$ There are a couple of minor things I'd suggest you look into: • Names matter: you're assigning the query string to a variable called $sth, and assinging the prepared statement to a variable called $q. To me, that looks wrong, and it should be the other way around. A variable called $q or $query should be a query string, and a variable called $sth or $stmt should be a prepared statement. • Transactions: if, somewhere down the line, one of the INSERT queries failed, I wouldn't carry on. To me, that smells of bad/invalid/malicious data, and I'd want to stop inserting and even undo whatever inserts that were already executed. By starting a transaction before the loop, and committing it at the end, you can do this easily • Because you are re-using a statement several times (which is good), you might want to add a closeCursor call. The MySQL drivers don't really care about this, but some other drivers do. Depending on what DB you're using, your code might behave differently if you leave it out. Basically, using bindParam as Pinoniq suggested is a good idea. However, make sure $last_id stays valid. It's not being altered in your loop, so make sure the code between bindParam and the execute call doesn't do anything untoward with that variable. All things aside, your code could be made to look something like this: $query = 'INSERT INTO users_contracts (users_id,contracts_id) VALUES (:user,:contract)'; try {//begin try-block here $conn->beginTransaction();//start the transaction $stmt = $conn->prepare($query); $stmt->bindParam('user', $lastId); $stmt->bindParam('contract', $contractId); foreach($contract as $contract => $contractId) { $stmt->execute(); $stmt->closeCursor();//<-- doesn't hurt } $conn->commit();//everything went smoothly, save inserts } catch (PDOException $e) { $conn->rollBack();//undo changes! //handle error printf( '%d - %s insert failed: (%d) %s', $lastId, $contractId, $e->getCode(), $e->getMessage() ); } \$\endgroup\$ 4 \$\begingroup\$ Instead of calling bindParam everytime in the for loop. You could make use of the late-binding that PDO does with bindParam. You actually bind a reference. On execute, that reference is evaluated and added to the query. So to clean up your code: $sth = "INSERT INTO `users_contracts` (users_id,contracts_id) VALUES (:user,:contract)"; $q = $conn->prepare($sth); $q->bindParam('user', $last_id); $q->bindParam('contract', $contract_id); //take each item in the contract array from _POST and bind to the above INSERT query foreach($contract as $contract => $contract_id) { try { $q->execute(); } catch (PDOException $e) { $errors[] = array( 'message' => sprintf('Could not insert %, %.', $contract, $contract_id), 'error' => $e ); } } I also used sprintf in your error message. Makes for easier reading, and in time. You could change the text to a call to some Language function: sprintf(Lang::get('error.something.wrong'), $contract, $contract_id); \$\endgroup\$ 1 • \$\begingroup\$ check the reply of Elias for a better error message ;) \$\endgroup\$ – Pinoniq Commented Oct 2, 2014 at 7:52 3 \$\begingroup\$ Security You should use htmlspecialchars around $contract and $contract_id when storing the error message. Even if you are not displaying it to the admin in a webpage right now (but for example in an error log or the database), this might be a feature added in the future, and then it might cause xss attacks. Other than that, your code is probably save. When creating your $conn object, you should check if you are setting PDO::ATTR_EMULATE_PREPARES=>false, and maybe also PDO::MYSQL_ATTR_INIT_COMMAND=>'SET NAMES utf8', (with your charset) (see this answer for an explanation). Naming You could use more expressive variable names, but at this scope it's not that bad. But $sth could be $insert or $insert_statement, $q could be $query, and :user could be :user_id (as it's an id. same with :contract). Formating More spaces is almost always a good thing. I would surround => with spaces and put a space after ,. Other than this, your code looks good. \$\endgroup\$ Your Answer By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy. Not the answer you're looking for? Browse other questions tagged or ask your own question.
__label__pos
0.926421
Split byte array I have to split a byte array on specific bytes. For example i have a byte array with the bytes 123 456789 123abcdef i want to split everytime 123 occurs and then save it translated into a string array but i cant find out howto =/ can anyone help me? thanks byte[] notsplitted = {0xAB, 0xFE, 0x10, 0x12, 0x13, 0xAB, 0xFE}; byte[] split_at = {0x10, 0x12, 0x13}; //after split it should look like this: 0xAB 0xFE 0xAB 0xFE //and translated into a string array Open in new window korpiklaaniAsked: Who is Participating? I wear a lot of hats... "The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S. WesWilsonCommented: I need some clarification. 1. In the example you show, do you want to split at the full sequence (0x10, 0x12, 0x13) or when any of those elements occur? 2. Ultimately, you are looking for multiple strings, split by the specified characters, but not containing those specified characters, correct? 0 korpiklaaniAuthor Commented: i want to split the array "notsplitted" its like the String.Split() function in visual studio c#. I just want to use it with a byte array, i want to split a byte array into several pieces everytime "0x10, 0x12, 0x13" occours. For example: ABC DEF ABC when DEF is the delimiter it should look like ABC ABC at the end. Then just translate ABC into a string array (Encoding.ASCII.GetString()) and give back a string array. But thats not that much important right now, the most important part is just to split the bytes because i cant get it working ): thanks 0 WesWilsonCommented: So the end result should be a single string, right? We are just removing the byte sequence in split_at from the original array? 0 Cloud Class® Course: Ruby Fundamentals This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches. korpiklaaniAuthor Commented: a string array because there are several byte arrays after splitting 0 WesWilsonCommented: Let me know if this works for you. byte[] notsplitted = {0xAB, 0xFE, 0x10, 0x12, 0x13, 0xAB, 0xFE}; byte[] split_at = {0x10, 0x12, 0x13}; List<string> splitStrings = new List<string>(); StringBuilder builder = new StringBuilder(); for(int i = 0; i < notsplitted.Length; ++i) { if(notsplitted[i] == split_at[0] && i + split_At.Length <= notsplitted.Length) { for(int splitterIndex = 0; splitterIndex < split_at.Length; ++i) { if(notsplitted[i + splitterIndex] != split_at[splitterIndex]) { break; //split sequence not found } } //split sequence matched. Do the split splitStrings.Add(builder.ToString()); builder = new StringBuilder(); i += (split_At.Length - 1); continue; } builder.Append(notsplitted[i]); } if(builder.Length > 0) { splitStrings.Add(builder.ToString()); } //splitStrings is a List<string>, but if you want it in array form, call ToArray() string[] stringArray = splitStrings.ToArray(); Open in new window 0 Experts Exchange Solution brought to you by Your issues matter to us. Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle. Start your 7-day free trial korpiklaaniAuthor Commented: it does work i guess but it adds the bytes into a string without translation? i need it to get translated like 0x61 is 'a' 0 WesWilsonCommented: What if we cast the byte to char? Change line 24 to: builder.Append((char)notsplitted[i]); Open in new window 0 korpiklaaniAuthor Commented: thanks! you are the best! 0 It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today .NET Programming From novice to tech pro — start learning today.
__label__pos
0.57809
Force client cert verification in UW imapd-2002d Force client cert verification in UW imapd-2002d Post by none » Tue, 29 Jul 2003 05:28:34 Is there a way to FORCE UW imapd-2002d(+SSL) to require and verify a client certificate via imapd runtime configuration, or source code modification? Thank you.       1. UW IMAPd and SSL - path to certs ... [This followup was posted to comp.mail.imap and a copy was sent to the cited author.] -I/usr/share/ssl/../include/openssl -I/usr/share/ssl/../include/openssl/openssl -DSSL_CERT_DIRECTORY=/usr/share/ssl/certs SSL_CERT_DIRECTORY is what you are kooking for. Alexander -- Alexander Dalloz Enger, Germany PGP fingerprint: 2307 88FD 2D41 038E 7416  14CD E197 6E88 ED69 5653 PGP key valid: made 13.07.1999 2. HELP with Win2K accessing WinNT controller 3. Cyrus imapd + TLS + client certs 4. Full duplex option 5. UW imapd, Netscape 4.6 client -- how do I do subfolders? 6. ToBeSupplied? 7. Client timeouts in UW Imapd 8. Allegro Tutorial 9. UW Imapd multiple clients 10. pop client in uw-imapd.. the password? 11. UW-IMAPD with Outlook 2000 as client 12. STARTTLS: Private Certs vs. Purchased Certs 13. TLS and client certificate verification
__label__pos
0.965541
Writing Successful Alt Textual content For Pictures June 9, 2018 Anyone who has learned anything about net accessibility sees that images need alternative, or perhaps ALT, textual content assigned to them. It is because screen sefaveteriner.com visitors can’t appreciate images, but instead read out loud the alternative text assigned to them. Online Explorer you observe this ALT text, just by mousing within the image and searching at the green tooltip that appears. Different browsers (correctly) don’t make this happen. The CODE for entering ALT text message is: But surely there cannot be a skill to writing ALT text with respect to images? You merely pop some in there and you’re ready to go, right? Very well, kind of. Sure, it’s not rocket scientific research, but there are some guidelines you have to follow… Spacer pictures and missing ALT text message Spacer images should always be assigned null ALT textual content, or alt=””. This way many screen viewers will totally ignore the photograph and do not ever even announce its occurrence. Spacer images are covered images that pretty the majority of websites employ. The purpose of these people is, when the term suggests, to develop space for the page. At times it’s not possible to create the visual screen you need, to help you stick a picture in (specifying its height and width) and voli’, you have the excess space you require. Not really everyone uses this null ALT text for spacer images. Some websites attach alt=”spacer image”. Imagine just how annoying this is often for a display reader customer, especially when you could have ten of which in a line. A display reader would probably say, “Image, spacer image” ten occasions in a row (screen visitors usually say the word, “Image”, before studying out its ALT text) – given that isn’t beneficial! Different web developers basically leave out the ALT function for spacer images (and perhaps additional images). In this instance, most screen readers should read the actual filename, which may be ‘newsite/images/’. A display reader might announce this kind of image simply because “Image, news site cut images reduce one pixel spacer us dot gif”. Think what this may sound like in the event there were twenty of these within a row! Bullets and icons Bullets and icons ought to be treated in much the same method as spacer images, hence should be designated null substitute text, or alt=””. Look at a list of products with a extravagant bullet proceeding each item. If ALT text, ‘Bullet’ is given to each image then, “Image, bullet” will probably be read aloud by display screen readers before each list item, making it take that bit for a longer time to work through the list. Icons, usually accustomed to complement links, should also become assigned alt=””. Many websites, which will place the icon next to the link text, use the website link text mainly because the ALT text from the icon. Display readers will first mention this ALT text, then the link text, so might then say the link twice, which clearly isn’t required. (Ideally, bullets and icons need to be called as background photos through the CSS document — this would remove them from the HTML document completely and therefore remove the need for any ALT information. ) Decorative pictures Decorative images also should be designated null different text, or alt=””. If an image can be pure eyesight candy, then there’s no need for a display screen reader user to even know it has the there and being educated of its presence merely adds to the noise pollution. Alternatively, you could argue that the images in your site build a brand individuality and by covering them right from screen reader users occur to be denying this group of users the same experience. Accessibility analysts tend to favour the former point, but at this time there certainly is a valid advantages of the latter too. The navigation & text embedded within images Navigation possibilities that require nice text be forced to embed the text within an impression. In this scenario, the ALT text really should not used to improve on the graphic. Under no circumstances if the ALT text say, ‘Read all about the fantastic products and services, designed to assist you in everything you do’. If the menu item says, ‘Services’ then your ALT text message should also state ‘Services ALT text should describe a few possibilities of the impression and should recurring the text word-for-word. If you want to expand in the navigation, such as in this case, you can use it attribute. The same applies for just about any other text message embedded within an image. The ALT text should simply repeat, word-for-word, the text included within that image. (Unless the font getting used is especially one of a kind it’s often unnecessary to embed text inside images – advanced selection and history effects quickly achieved with CSS. ) Company logo Websites tend to fluctuate in that they apply ALT text to logos. A lot of say, Business name, others Business name logo, and other describe the function belonging to the image (usually a link to the homepage),? Back to home’. Remember, ALT text should always describe the content of the graphic so the initially example, alt=”Company name”, is probably the best. If the logo is mostly a link back towards the homepage, in that case this can be efficiently communicated throughout the title marking. Final result Writing effective ALT text merely too challenging. If it’s an enhancing image after that null solution text, or perhaps alt=”” should usually use – never, ever leave out the ALT attribute. In the event the image is made up of text the ALT text message should just repeat this text, word-for-word. Bear in mind, ALT text message should describe the content on the image and nothing more. Do become sure as well to keep ALT text when short and succinct as is possible. Listening to an internet page having a screen reader takes a whole lot longer than traditional methods, so typically make the browsing experience painful for screen subscriber users with bloated and unnecessary ALT text. Click here for more: Contact Us: [email protected] • 801-358-1959
__label__pos
0.571087
Version: 3.0.0 Values Runnerty provides a bunch of different values that can be used in the whole plan of our chains by using the @GV/@GETVALUE function. They can be global or local values. Runnerty will automatically replace this variables with it's value. They are very useful to store params, save output values from the processes, making processes evaluations, etc... Global Values# These values are called global because they are automatically provided by Runnerty or defined in the config. Thereby, they can be used in the plan. Environment values# These values allows you to get environment variables. Sample if you define environment variable: export MYENVVAL=TESTVALUE# ENV_[ENVIRONMENT VARIABLE NAME] > @GV(ENV_MYENVVAL) = TESTVALUE Config values# In the config.json file it is possible to define our owns values to use them in our chains. This is an example of the config.json file with some values definitions: { "executors": [{ "...": "..." }], "notifiers": [{ "...": "..." }], "global_values": [ { "my_files": { "file_one": "/path/MYFILE_ONE.csv", "file_one": "/path/MYFILE_TWO.csv" }, "my_values": { "value_one": "VALUE_ONE", "value_two": "VALUE_TWO" } } ] } Local values# They are called local because these values come from different parts of the plan. They take their values from different Runnerty changeable sources such as the processes or chains information. Process values# Theses values are formed with the process information and configuration. For example, these two values takes it's value from the metadata of the process: CHAIN_ID - Contains the process chain id CHAIN_NAME - Contains the process chain name CHAIN_STARTED_AT - Contains the date and time when the process chain started PROCESS_ID - Contains the process id PROCESS_NAME - Contains the process name This is an example of a process using the time and process values to write in a log file: { "id": "PROCESS_ONE", "name": "First process of the chain", "exec": { "id": "shell_default", "command": "echo 'Hello world'" }, "output": [ { "file_name": "/var/log/runnerty/general.log", "write": [ "EXECUTION @GV(PROCESS_ID) - @GV(PROCESS_NAME) - AT @GETDATE('YYYY-MM-DD HH:mm:ss')\n" ], "concat": true, "maxsize": "1mb" } ] } These are the rest of the values that takes information from the process execution. Once again, they can be used in the whole plan: PROCESS_EXEC_ID - Contains the execution id PROCESS_EXEC_COMMAND - Contains the command that is going to be executed by the executor PROCESS_EXEC_COMMAND_EXECUTED - Contains the command executed by the executor (once all the values have been translated) PROCESS_EXEC_MSG_OUTPUT - Contains the output message of the executor PROCESS_EXEC_DATA_OUTPUT - Contains the data output of the executor PROCESS_EXEC_ERR_OUTPUT - Contains the error returned by the executor PROCESS_STARTED_AT - Contains the date and time when the process started PROCESS_ENDED_AT - Contains the date and time when the process ended PROCESS_DURATION_SECONDS - Contains the duration in seconds (when is end). PROCESS_DURATION_HUMANIZED - Contains the humanized duration (when is end). PROCESS_RETRIES_COUNT - Contains the times that the process have been retried In this example we can see a process that in the notification use some of the process values to send useful information: { "id": "PROCESS_ONE", "name": "First process of the chain", "exec": { "id": "shell_default", "command": "echo 'Hello world'" }, "notifications": { "on_start": [ { "id": "telegram_default", "message": "THE PROCESS @GV(PROCESS_ID) HAS STARTED AT @GV(PROCESS_STARTED_AT)" } ], "on_fail": [ { "id": "telegram_default", "message": "THE PROCESS @GV(PROCESS_ID) HAS FAILED AT @GV(PROCESS_STARTED_AT) - THE EXECUTED COMMAND WAS @GV(PROCESS_COMMAND_EXECUTED) - THE ERROR WAS @GV(PROCESS_EXEC_ERR_OUTPUT)" } ], "on_end": [ { "id": "telegram_default", "message": "THE PROCESS @GV(PROCESS_ID) HAS FINISHED AT @GV(PROCESS_ENDED_AT)" } ] } } output_share# The output_share is a property of the process. This feature allows to share information returned by the process so it is available in the rest of the chain. { "processes": [ { "id": "GET-USER-EMAIL", "name": "It get an user email", "exec": { "id": "mysql_default", "command": "SELECT email FROM USERS WHERE ID = 1" }, "output_share": [ { "key": "USER", "name": "EMAIL", "value": "@GV(PROCESS_EXEC_DB_FIRSTROW_EMAIL)" } ] } ] } In this example we are getting the email of an user from the database using the @runnerty/executor_mysql and assigning it to a value. This way we can use the @GV(USER_EMAIL) value anywhere of the chain. Notice that in this example we are are using the value @GV(PROCESS_EXEC_DB_FIRSTROW_EMAIL) This is an extra value returned by this executor that contains the field selected by the query. Chain values# Just like the process values, there are also some values formed with the chain information: CHAIN_ID - Contains the ID of the chain CHAIN_NAME - Contains the name of the chain CHAIN_STARTED_AT - Contains the date and time when the chain started CHAIN_DURATION_SECONDS - Contains the duration in seconds (when is end). CHAIN_DURATION_HUMANIZED - Contains the humanized duration (when is end). Custom values# This values can be defined in our chains and can be used in the whole plan of the chain. This is also very useful when you want to overwrite a value defined in the config.json file: { "id": "CHAIN_ONE", "name": "Example chain", "custom_values": { "MY_VALUE": "MY_VALUE" } } Notice that this values can be also past from the API. Input values# This values cames from the output of an iterable chain. An iterable chain is an awesome feature of runnerty that allows you to be execute a chain for each object in the array previously returned by another chain. You can know for more information about iterable chains in the chains here. { "id": "SEND-MAIL-TO-USERS", "name": "it sends an email to the users returned", "depends_chains": { "chain_id": "GET-USERS-EMAIL", "process_id": "GET-USER-EMAIL" }, "iterable": "parallel", "input": [ { "email": "email" }, { "name": "name" } ], "processes": [ { "id": "SEND-MAIL", "name": "sends the email to the user", "exec": { "id": "mail_default", "to": ["@GV(email)"], "message": "Hello @GV(name)", "title": "Message set by Runnerty" }, "chain_action_on_fail": true } ] } In this example we can see how the chain is receiving two input fields and the process is using their values to send an email. Executors extra values# As the executors are plugins for Runnerty, it is possible that some of them need to return additional information to Runnerty. For this task Runnerty provides the EXTRA_OUTPUT values that can be used by the executors. Know more about this in the executors development documentation.
__label__pos
0.99756
Computer technician blog Categories: General - General posts, notices and other information. Viruses - News and articles related to viruses, will be posted in this section. Windows - How-To guides for Windows users. Mac - How-To guides for Mac users. You can subscribe to RSS feed RSS Feed How to remove unwanted pop-ups and homepage redirects from Mac? How to remove pop-up ads and browser redirects from a Mac computer? When developing the macOS, Apple included many security features allowing users to feel safe when working online. In the past, no serious malware or adware infections targeted Mac computers. Now, however, cyber criminals are increasingly developing malicious code targeting these systems. Many users report annoying pop-up ads, homepage redirects, Internet search engine hijackers, and reduced system performance. One of the most frequent infections on Mac computers is adware, including searchpulse.net redirectAny Search Manager browser hijacker, and MyShopcoupon. As well as adware, Mac computer users are also targeted by potentially unwanted applications (PUAs) also known as potentially unwanted programs (PUPs). Some examples of PUPs include Mac Keeper, Advanced Mac Cleaner, and Mac Mechanic.   How To Fix BAD_SYSTEM_CONFIG_INFO Error? How To Fix BAD_SYSTEM_CONFIG_INFO Blue Screen Of Death Error In Windows 10 Blue Screen of Death (also known as BSOD or a STOP error) is a blue screen error that is displayed in full-screen and usually indicates that the system has crashed. The blue screen often displays a text description about the problem that has occurred, however, this is simply an error code and will of be of little use unless you are an advanced user. Windows only suggests that you search for a more detailed explanation online. At this point, the only option is to restart the computer.   How To Fix "System cannot find the path specified" Error? How To Fix The "System cannot find the path specified" uTorrent Error In Windows 10 uTorrent is a freeware, closed source client and one of the most popular BitTorrent clients used by more than 150 million users. Its main function is to provide peer-to-peer (or P2P) file sharing for distributing large amounts of data. It allows users to download various files easily by using 'torrent' files. A 'peer' creates a torrent file that contains metadata about the shared files and the tracker. If a peer (or peers) wants to download a shared file, they must first obtain the torrent file and then connect to the specified tracker, which determines from which other peers to download the fragments of the shared file. When those fragments are downloaded, the full file is returned for access by the user's operating system.   Can't Open Catalyst Control Center. How To Fix it? Can't Open Catalyst Control Center In Windows 10. How To Easily Fix It? ATI, who are best known for computer processors, developed the Catalyst Control Center to fulfil their Radeon video cards and associated software (available from 2002). AMD Catalyst Control Center (CCC) is a part of AMD Catalyst software. It allows adjustment of display settings, video performance, and display profiles, thus improving video card functionality. The software is a popular addition and available for download as a part of the AMD Catalyst software package.   How To Uninstall Edge? How To Uninstall Microsoft Edge From Windows 10 Edge (also known as Microsoft Edge) is a new web browser developed by Microsoft, which replaces Internet Explorer (still available in Windows 10) Edge is also included in Windows 10 and is the default web browser. The only way to get Edge is to upgrade earlier operating system versions to Windows 10. Microsoft Edge is also available to download on iOS and Android smartphones.   How To Fix DNS_PROBE_FINISHED_NO_INTERNET Error? How To Fix DNS_PROBE_FINISHED_NO_INTERNET Google Chrome Error In Windows 10 Released in 2008, Google Chrome is a web browser by Google and one of the most popular and fastest web browsers available. It manages system resources differently to other browsers and works well with Google services such as Gmail, Google Drive, etc. Problems can, however, arise with the "DNS_PROBE_FINISHED_NO_INTERNET" error, which is displayed when attempting to open any website.   How to restore (undelete) deleted files from Mac? How to restore deleted files on a Mac computer? Apple developed the macOS operating system, hoping to create functional software that could be understood intuitively by all users. As a result, tasks can be performed simply and quickly, including file removal procedures. In just a few clicks, files and folders can be removed. This is a very useful feature until you accidentally click the wrong button and realize that your data has gone. Users often seek data recovery options, reporting that they accidentally reformatted a hard drive (despite a number of warning messages displayed prior to any drive format/reformat). The most common case is when users have stored files in the Trash bin, but have then launched additional cleaning software, which cleans the Trash. Note that, even after emptying the trash, there are possible options to restore files.   Ntoskrnl.exe Process Is Causing High CPU or Disk Usage. How to fix it? How To Easily Fix High CPU Or Disk Usage Caused By The ntoskrnl.exe Process In Windows 10 Disk usage (DU) refers to the portion or percentage of computer storage that is currently in use. It contrasts with disk space or capacity, which is the total amount of space that a given disk is capable of storing. CPU usage indicates how much of the CPU a particular program or process is using. If a program or a process uses too many Disk or CPU resources, it might not be functioning properly. There are, for example, often problems with the ntoskrnl.exe process taking too many Disk or CPU resources.   Page 18 of 39 << Start < Prev 11 12 13 14 15 16 17 18 19 20 Next > End >>
__label__pos
0.839343
Description Experiment with vector equations and compare vector sums and differences. Customize the base vectors or explore scalar multiplication by adjusting the coefficients in equation. Specify vectors in Cartesian or polar coordinates, and view the magnitude, angle, and components of each vector. Sample learning goals: • Describe what happens to a vector when it is multiplied by a scalar • Arrange vectors graphically to represent vector addition or subtraction • Compare the outcomes of each vector equation No votes have been submitted yet. View and write the comments No one has commented it yet.
__label__pos
0.976619
What is Binary Coded Decimal System? In computing and electronic systems, binary-coded decimal (BCD) is a class of binary encodings of decimal numbers where each digit is represented by a fixed number of bits, usually four or eight. Sometimes, special bit patterns are used for a sign or other indications (e.g. error or overflow). What is BCD format? Binary coded decimal (BCD) is a system of writing numerals that assigns a four-digit binary code to each digit 0 through 9 in a decimal (base-10) numeral. The four-bit BCD code for any particular single base-10 digit is its representation in binary notation, as follows: 0 = 0000. 1 = 0001. 2 = 0010. What is the use of BCD code? Binary-coded Decimal or BCD is a way of representing a decimal number as a string of bits suitable for use in electronic systems. Rather than converting the whole number into binary, BCD splits the number up into its digits and converts each digit to 4-bit binary. How do you write BCD code? In BCD code, each digit of the decimal number is represented as its equivalent binary number….Example 1: (11110) 2. Binary Code Decimal Number BCD Code 0 0 0 1 1 0 : 0 0 0 1 0 0 1 0 2 0 : 0 0 1 0 0 0 1 1 3 0 : 0 0 1 1 0 1 0 0 4 0 : 0 1 0 0 How do you do BCD? In BCD code, each digit of the decimal number is represented as its equivalent binary number….Example 1: (11110) 2. Binary Code Decimal Number BCD Code 0 0 1 0 2 0 : 0 0 1 0 0 0 1 1 3 0 : 0 0 1 1 0 1 0 0 4 0 : 0 1 0 0 0 1 0 1 5 0 : 0 1 0 1 Why BCD codes are used? The BCD system offers relative ease of conversion between machine-readable and human-readable numerals. In this article, we will learn about BCD, Binary Coded Decimal, which offers relative ease of conversion between machine-readable and human-readable numerals. How do I convert BCD? There are the following steps to convert the binary number to BCD: First, we will convert the binary number into decimal. We will convert the decimal number into BCD….Example 1: (11110) 2. Binary Code Decimal Number BCD Code A B C D B4 :B3B2B1B0 0 0 0 0 0 0 : 0 0 0 0 0 0 0 1 1 0 : 0 0 0 1 0 0 1 0 2 0 : 0 0 1 0
__label__pos
0.999912
Computer Information Systems vs Computer Science Computer Information Systems vs Computer Science Online DegreesThese days there are almost TOO many choices for online Computer Science and IT degrees. Which tech-savvy degree should you choose? What’s the difference between a Computer Information Systems vs Computer Science major? IS there really any difference? If so, which one is best for which career paths? If you’re having trouble choosing an IT degree path, start by asking yourself which of the following three career questions interests you most:   1. Why does the technology work? 2. How does the technology work? 3. What technology would work the best? The question you find yourself most drawn to is a clue to which type of online degree you’d prefer when it comes to Computer Information Systems vs Computer Science. Many of the online IT degrees offered today are related to Computer Science, Information Technology or Computer Information Systems. Each major shares much in common, but each also tends to focus on answering slightly different questions. These approaches translate, in turn, into different career paths. The Lowdown: Computer Science focuses on teaching programming and computing. It is meant to give professionals foundational skills that can be applied towards any career in coding. It also provides an in-depth overview of how computer operating systems work. Why You Might Like It: Computer Science is primarily about sharpening your programming abilities. You don’t just learn how to write code, but in the lesson plans for many online IT degrees you also learn why the code works on your computer the way it does. Why You Might Not: A Computer Science major often focuses on programming and the underlying algorithms that make code work. As such, a fair amount of *gasp* math is involved (ex. Calculus, Discrete Mathematics, etc.). This degree major is especially math heavy at the undergraduate level. Some see all that math as a plus, but many do not. Also, due to the programming focus, other subjects that may be of interest (ex. security, networking, etc.) are often only touched upon lightly in a pure Computer Science degree program.     The Lowdown: Focuses more on the practical applications of computers in a work environment than Computer Science does. Computer Science is more about developing new types of technology, while Information Technology courses are more about learning how to take computer technology and put it to use in commercial environments. Why You Might Like It: This major requires significantly less math when compared to Comp Science degrees. It still covers basic  programming yet gives insight into other facets of IT. You can specialize in many applied tech areas such as networking, security, or database management if you don’t want to spend all your time writing code. Why You Might Not: IT degrees usually cover far more topics than Computer Science degrees, which could limit your exposure to in-depth programming fundamentals. You may learn how to write for one type of programming, but it may be more difficult to change and learn another type later.   GetEducated’s Picks To see all information technology degrees, visit our degree listings. Also check out our latest rankings reports.   The Lowdown: Information Systems as a major is tricky. This area is often known as Information Systems (IS), Computer Information Systems (CIS), Business Information Systems (BIS), and Management Information Systems (MIS). These online degrees cover the same topics as “IT” degrees, but each has a more business-related focus. Instead of learning just how technology works, IS students also learn to ask what type of technology should be used to solve a business problem. Why You Might Like It: Where Computer Science goes deep into programming, IS degrees go broad and cover the “big picture”.  Since people are part of many “systems”, these degrees often include business courses like project management or managerial communications. Why You Might Not: The fact that it can cover so many different areas has a downside, too. Information Systems-related degrees will not give you the in-depth coding experience a CS degree will. Computer Information Systems degrees are offered by both technical colleges and business colleges across the country, so one IS program may not be like the other. In some schools, Information Systems is taught through the business school, like Florida State University's Online College of Business. In others, like Nova Southeastern University Online, IS is taught as a Computer Science degree.   To see all information systems degrees, visit our degree listings. Also check out our latest rankings reports.   Compare online IT degrees and study plans. Which do you prefer? The business approach or the technology approach? Review a school’s curriculum before you make a call!   About Guest Author David Handlos In addition to pursuing and writing about higher education, David Handlos works as a Lead Software Performance Engineer at Fiserv. He has also worked for Kansas State University as the webmaster, managing both the College of Engineering and Engineering Extension web sites. Handlos holds a Bachelors of Science in Computer Engineering from Kansas State University and a Masters in Information Systems which he earned online from Dakota State University. Browse Degrees
__label__pos
0.94122
Features of a computer Subject: Computer Basics Find Your Query Sunway Business School Overview The word computer is derived from Latin word 'computer', which means ' calculate'. Computers are used in wide verity of fields like home, school, colleges, offices, industries, banks, retail, stores, researches and development. This note explains about the various features of the computer. Features of a computer The word computer is derived from Latin word 'computer', which means ' calculate'. Computers are used in wide verity of fields like home, school, colleges, offices, industries, banks, retail, stores, researches and development. The development of sophisticated software allows performing variety of work such as word processing, desktop publishing, image processing, artificial intelligent expert system, advance simulation etc. The introduction of integrated circuit (IC) made possible to construct small and portable computer. Features of Computer 1. Speed: Speed of computer maybe defined as the time taken by a computer to perform a task. It takes only a few seconds for the calculations that we take hours to solve. It works in the fraction of second. Most of the computers work on Micro and Nano second. Its speed is measured in term of MHZ (Mega Hertz) and GMZ (Giga Hertz). 2. Accuracy: The computers are the accurate machine that can perform large number of tasks without errors, but if we feed wrong data to the computer it returns the same wrong information called GIGO (Garbage In Garbage Out). The degree of accuracy in a computer is very high and every calculation is performed with same accuracy. The accuracy level is determined on the basis of design of computer. The errors in the computer are due to human and inaccurate data. 3. Diligence: The capacity of computer of performing repetitive task without getting tired is called diligence. A computer is free from tiredness, lack of concentration, fatigue etc therefore it can work for hours without creating any errors. Even if millions of calculations are to be performed, computer will perform every calculation with same accuracy. 4. Versatility: The capacity of computer of performing more than one task at the same time is called versatility of computer. Versatility means the capacity to perform different types of work completely. 5. Storage: Computer has mass storage section where we can store large volume of date for future use. Such data are easily accessible when needed. Magnetic disk, magnetic tape and optical disk are used as mass storage devices. The storage capacity of computer is measured in terms of Kilobyte (KB), Megabyte (MB), Gigabyte (GB) and Terabyte (TB). 4 bit = 1 Nibble 8 bit or 2 Nibble = 1 Byte 1024 Byte = 1 kilo Byte (1KB) 1024 KB = 1 Mega Bite (1GB) 1024 MB = 1 Giga Bite (1 GB) 1024 GB = 1 Terra Byte (1GB) 6. Automatic: Computer is an automatic machine which works without the intervention of the user. The user is required to give the data and utilize the result but the process is automatic. 7. Processing: Large volume of data can be processed in great speed. During processing there are different types of operation such as input and out operation, logical and comparison operation, text manipulation operation etc. 8. Non-intelligent: computer is a dumb machine which cannot do any work without the instruction of the user. The instructions are performed at tremendous speed and with accuracy. Computer cannot take its own decision and doesn't have feeling or emotion, taste, knowledge and experience etc. Application Areas Of Computer • Banking • Commercial enter praises: • Employee record • Payroll processing • Account receivable • Account payable • Stock control • General ledger • Industries • Retailers • Reservation system • Offices • Education • Health and medical field • Desktop publishing system • Simulation ( creating virtual word as like as real word) • Library ( landing processor) • Recording and film studios • Research and university • Military • Communication Things to remember • Computer is derived from Latin word 'computer', which means calculate. • Introduction of integrated circuit (IC) made possible to construct small and portable computer. It consists of main processing unit called central processing unit (CPU) input device, output devices, main memory and auxiliary storage. • 1 = 1 bit • 4 bit = 1 Nibble • 8 bit or 2 Nibble = 1 Byte • 1024 Byte = 1 kilo Byte (1KB) • 1024 KB = 1 Mega Bite (1GB) • 1024 MB = 1 Giga Bite (1 GB) • 1024 GB = 1 Terra Byte (1GB) • Speed of computer maybe defined as the time taken by a computer to perform a task.  • Computer is an automatic machine which works without the intervention of the user. • It includes every relationship which established among the people. • There can be more than one community in a society. Community smaller than society. • It is a network of social relationships which cannot see or touched. • common interests and common objectives are not necessary for society. Videos for Features of a computer Characteristics of Computers What is a computer? Questions and Answers The circuitries of computer are designed on the basis of electrical signals and data travel them as the speed of current, therefore the computer is able to perform any task at the high speed. Computer is called diligent machine because it can perform the task repeatedly without loosing its speed and accuracy for a long time. Computer is called versatile machine because it is used in almost all the fields for various purposes. Four applications of computer are: • Education • Banking • Offices • Entertainment Any five features of computer are as follows: • Speed • Diligence • Accuracy • Automatic • Versatility Quiz © 2019-20 Kullabs. All Rights Reserved.
__label__pos
0.993557
Òåðåìîê - äåòñêèå èãðû Ìóëüòôèëüìû Ïðèêîëüíûé äîñóã Ëîïîòóøêè Äåòñêîå òâîð÷åñòâî                     Íà ãëàâíóþ     Ìàòåìàòèêà 1 êëàññ       Ìàòåìàòèêà 2 êëàññ   Ìàòåìàòèêà 3 êëàññ       Ìàòåìàòèêà 4 êëàññ     Ìàòåìàòèêà 5 êëàññ   Ìàòåìàòèêà 2 êëàññ òåòðàäü   Ìàòåìàòèêà 3 êëàññ òåòðàäü   Ìàòåìàòèêà 4 êëàññ òåòðàäü   Êàðòà ñàéòà         Ìàòåìàòèêà 4 êëàññ 1 ÷àñòü ñòð. 69 ×òî óçíàëè. ×åìó íàó÷èëèñü 1. Âû÷èñëè ñóììû óäîáíûì ñïîñîáîì. 72 + 43 + 18 + 57 64 + 29 + 61 + 36 120 + 65 + 15 460 + 380 + 20 Îòâåò: 72 + 43 + 18 + 57 = (72 + 18) + (43 + 57) = 90 + 100 = 190; 64 + 29 + 61 + 36 = (64 + 36) + (29 + 61) = 100 + 90 = 190; 120 + 65 + 15 = 120 + (65 + 15) = 120 + 80 = 200; 460 + 380 + 20 = 460 + (380 + 20) = 460 + 400 = 860. 2. 24 * 10 : 8 54 * 10 : 9 810 : 9 * 100 450 : 5 * 10 420 - 280 : 7 600 - 120 : 2 Îòâåò: 24 • 10 : 8 = 240 : 8 = 30 54 • 10 : 9 = 540 : 9 = 60 810 : 9 • 100 = 90 • 100 = 9000 450 : 5 • 10 = 90 • 10 = 900 420 — 280 : 7 = 420 — 40 = 380 600 — 120 : 2 = 600 — 60 = 540 3. 600 - (80 - 25) 100 : (172 - 18 * 4) 5 * (30 + 170) - 160 : (4 * 2) (3700 + 300 - 100) : 100 Îòâåò: 600 - (80 - 25) = 600 - 55 = 545; 100 : (172 - 18 • 4) = 100 : (172 - 72) = 100 : 100 = 1; 5 • (30 + 170) - 160 : (4 • 2) = 5 • 200 - 160 : 8 = 1000 - 20 = 980; (3700 + 300 - 100) : 100 = (4000 - 100) : 100 = 3900 : 100 = 39. 4. íîìåð 4 ñòð 69 ìàòåìàòèêà 4 êëàññ 1 ÷àñòü Îòâåò: ïðèìåðû 4 ÷òî óçíàëè. ÷åìó íàó÷èëèñü ñòð 69 5. 82 075 + (70 200 - 36 485) 810 236 - (156 039 + 2 849) 600 100 - (92 016 + 117 * 8) 425 100 - (16 950 - 654 : 6) Îòâåò: íîìåð 5 ñòð 69 ìàòåìàòèêà 4 êëàññ 1 ÷àñòü 6. Âûïîëíè äåéñòâèÿ ñ ïðîâåðêîé. 345 008 - 269 871 126 547 - 79 652 182 * 3 247 * 4 208 * 4 109 * 8 Îòâåò: íîìåð 6 ñòð 69 ìàòåìàòèêà 4 êëàññ 1 ÷àñòü 7. Íàéäè ÷àñòíîå è îñòàòîê. Âûïîëíè ïðîâåðêó. 248 : 6 652 : 9 546 : 3 876 : 7 835 : 4 Îòâåò: íîìåð 7 ñòð 69 ìàòåìàòèêà 4 êëàññ 1 ÷àñòü 8. Ðåøè óðàâíåíèÿ è âûïîëíè ïðîâåðêó. õ + 320 = 80 * 7 õ - 180 = 240 : 3 400 - õ = 275 + 25 Îòâåò: ðåøè óðàâíåíèÿ ñòð 69 íîìåð 8 9. Èçâåñòíà öåíà îäíîãî ïðåäìåòà è ñòîèìîñòü êóïëåííûõ ïðåäìåòîâ. Êàê óçíàòü èõ êîëè÷åñòâî? Ñîñòàâü è ðåøè òàêóþ çàäà÷ó. ×òîáû óçíàòü êîëè÷åñòâî êóïëåííûõ ïðåäìåòîâ, íàäî èõ îáùóþ ñòîèìîñòü ðàçäåëèòü íà öåíó îäíîãî ïðåäìåòà. Çàäà÷à. Êîëÿ êóïèë òåòðàäêè. Ñêîëüêî òåòðàäîê êóïèë Êîëÿ, åñëè âñåãî îí ïîòðàòèë 100 ðóáëåé, à îäíà òåòðàäêà ñòîèò 20 ðóáëåé. 100 : 20 = 5 (òåòðàäîê) - êóïèë Êîëÿ. Îòâåò: Êîëÿ êóïèë 5 òåòðàäîê. çàäà÷à 9 ñòð 69 ìàòåìàòèêà 4 êëàññ 1 ÷àñòü 10. Ðàáî÷èé äîëæåí áûë èçãîòîâèòü çà äåíü 63 äåòàëè. ×åðåç 2 ÷ ðàáîòû åìó îñòàëîñü ñäåëàòü 45 äåòàëåé. Çà ñêîëüêî ÷àñîâ îí èçãîòîâèò îñòàâøèåñÿ äåòàëè, åñëè âûðàáîòêà çà ÷àñ íå èçìåíèòñÿ? íîìåð 10 ñòð 69 ìàòåìàòèêà 4 êëàññ 1 ÷àñòü 11. Ðàáî÷èå îòðåìîíòèðîâàëè 70 ìàøèí çà äâå íåäåëè. Íà ïåðâîé íåäåëå îíè ðàáîòàëè 6 äíåé, à íà âòîðîé — 4 äíÿ, ðåìîíòèðóÿ âî âñå äíè ìàøèí ïîðîâíó. Ñêîëüêî ìàøèí îíè ðåìîíòèðîâàëè åæåäíåâíî? çàäà÷à 11 ñòð 69 ìàòåìàòèêà 4 êëàññ 1 ÷àñòü 12. Íà àâòîìàøèíå ïðèâåçëè â îäèíàêîâûõ áèäîíàõ 448 ë ìîëîêà. Êîãäà 10 áèäîíîâ âûãðóçèëè, â îñòàëüíûõ áèäîíàõ îñòàëîñü 128 ë ìîëîêà. Ñêîëüêî ëèòðîâ ìîëîêà áûëî â êàæäîì áèäîíå? çàäà÷à 12 ñòð 69 ìàòåìàòèêà 4 êëàññ 1 ÷àñòü ×åé ïóòü êîðî÷å? ÷åé ïóòü êîðî÷å ñòð 69 ìàòåìàòèêà 4 êëàññ 1 ÷àñòü Îòâåò: Êðàñíûé ïóòü — 27 êëåòî÷åê. Çåë¸íûé ïóòü — 26 êëåòî÷åê. 27 > 26, çíà÷èò çåë¸íûé ïóòü êîðî÷å. Îòâåò: êîðî÷å çåë¸íûé ïóòü.                               Íà ãëàâíóþ Ìàòåìàòèêà 1 êëàññ Ìàòåìàòèêà 2 êëàññ Ìàòåìàòèêà 3 êëàññ Ìàòåìàòèêà 4 êëàññ
__label__pos
0.552129
2 $\begingroup$ Let $K_n = (V, E)$ be a complete undirected graph with $n$ vertices (namely, every two vertices are connected), and let $n$ be an even number. A spanning tree of $G$ is a connected subgraph of $G$ that contains all vertices in $G$ and no cycles. Design a recursive algorithm that given the graph $K_n$, partitions the set of edges $E$ into $n/2$ distinct subsets $E_1,E_2,\dots,E_{n/2}$, such that for every subset $E_i$, the subgraph $G_i = (V, E_i$) is a spanning tree of $K_n$. (Hint: Solve the problem recursively by removing two nodes and their edges in $K_n$. From the output of recursive call, you get $(n − 2)/2$ spanning trees for $K_{n−2}$. Extend those trees to be spanning trees for $K_n$ and then construct a new spanning tree to complete the job. PS: A collection of sets $S_1,\dots,S_k$ is a partition of $S$, if each $S_i$ is a subset of $S$, no two subsets have a non-empty intersection, and the union of all the subsets is $S$.) Even with the hint, I'm struggling to understand how to solve this question. So when you remove two vertices, you get $n/2 - 1$ spanning trees for $K_{n-2}$, and somehow expand this to $n/2$ spanning trees for $K_n$? Any help would be appreciated. $\endgroup$ 1 $\begingroup$ Here is how one step of the construction might look like - going from a tree decomposition of $K_4$ to a tree decomposition of $K_6$. k4 decomposition k6 decomposition On the left, we have (in orange and teal) a partition of the edges of a $K_4$ into two spanning trees. The $K_4$ is sitting inside a $K_6$ that we want to decompose. So on the right, we extend the orange and teal trees by two edges each to make them spanning trees of $K_6$, and add a purple tree consisting of the remaining edges. To go from $K_6$ to $K_8$, you'll extend each of these three trees by two edges each, then add a fourth tree. For any particular step, it is not too hard to make this work. The important thing is to figure out a pattern to tell you how to go from $n-2$ to $n$ for any even $n$. For this, you should try to do something as symmetric as possible, because symmetric things are easiest to describe. For example, if we're adding two vertices $x$ and $y$, then there's one "unusual" edge: the edge $xy$. I made this edge part of the new, purple tree in the diagram above, because adding it to just one of the existing trees would break symmetry. You could still do it - it would just be harder to describe what you're doing generally. From there, think about what we're doing to go from $K_4$ to $K_6$ - or try going from $K_6$ to $K_8$ yourself, if you think you need more to go on - and then generalize. | cite | improve this answer | | $\endgroup$ Your Answer By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy Not the answer you're looking for? Browse other questions tagged or ask your own question.
__label__pos
0.870188
最小公倍数和最小公约数  如果我们要计算两个数的最小公倍数的话,假设这个两个数为a,b,并且,a=k1*n,b=k2*n。期中n为这个两个数的最大公约数,那么,这个两个数的最小公倍数可以变成这两个数相乘然后除以最小公约数。也就是:       result=a*b/n; 那么最大公约数这么求勒? 用辗转相除法发,假设这个两个数为8 6 。那么用大的数除以小的数,将余数和两个数中小的这个作为新的待求对象。也就是 6 8%6 ,故 6 2  然后继续。 2 0 。当小的数变成0的时候,那么另外一个非零的就是最大公约数: 代码: //返回最大公约数 int gdb(int a,int b) { //确保 a>b if (b > a) { int temp = a; a = b; b = temp; } while (b>0) { int temp = a % b; a = b; b = temp; } return a; }   ©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
__label__pos
0.999961
WEB form question Discussion in 'OT Technology' started by nashstradamus, Apr 3, 2009. 1. nashstradamus nashstradamus New Member Joined: Nov 2, 2003 Messages: 899 Likes Received: 0 Location: East Coast, USA here the code for a form on a static html page <form id="contactForm" action="/" method="post"> <fieldset><legend>Contact form</legend> <p> <label for="name">Name</label> <input type="text" name="name" id="name" size="30" /> </p> <p> <label for="email">Email</label> <input type="text" name="email" id="email" size="30" /> </p> <p> <label for="message">Message</label> <textarea name="comment" id="comment" rows="10" cols="30"></textarea> </p> <p class="submit"> <button type="submit">Send</button> </p> </fieldset> </form> what do i need to do to make it submit to an email address?   2. Ricky Ricky █▄ █▄█ █▄ ▀█▄ Joined: Jun 17, 2005 Messages: 38,766 Likes Received: 6 php   3. Ricky Ricky █▄ █▄█ █▄ ▀█▄ Joined: Jun 17, 2005 Messages: 38,766 Likes Received: 6 It's very simply. The html only covers the layout. The php covers the backend and all the actual work. Here's a simple script that should work Code: <?php $Name = $_REQUEST['name']; //senders name $email = $_REQUEST['email']; //senders e-mail adress $recipient = "[email protected]"; //recipient $mail_body = $_REQUEST['comment']; //mail body $subject = "Subject for reviever"; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields mail($recipient, $subject, $mail_body, $header); //mail command :) ?> Name that mail.php or something and in your html put the action to mail.php instead of /   4. SmugZombie SmugZombie Active Member Joined: Aug 2, 2006 Messages: 3,783 Likes Received: 0 Location: Purgatory Then have that page display a "thank you for submitting" or have it redirect you to a thanks.html or something...   5. SmugZombie SmugZombie Active Member Joined: Aug 2, 2006 Messages: 3,783 Likes Received: 0 Location: Purgatory :mamoru:   Share This Page
__label__pos
0.943665
دسته‌ها اخبار How to Choose the Perfect Domain Name for Your Business When it comes to creating a website, c،osing the right domain name is crucial for search engine optimization (SEO) purposes. Your domain name is the first thing that people will see and remember about your website, so it’s important to make it both memorable and relevant to your content. In this article, we’ll provide you with some SEO tips for finding the best domain name for your website. Firstly, it’s important to c،ose a domain name that accurately reflects your ،nd or business. If your website is about fitness, for example, consider including relevant keywords such as “fit” or “health” in your domain name. This will help search engines understand what your website is about and make it easier for people to find you when they search for t،se keywords. Understanding SEO Relevance for Domain Names When it comes to selecting a domain name for your website, it is important to consider its SEO relevance. A domain name that is relevant to your business and contains keywords related to your niche can help improve your website’s search engine rankings. Here are some key factors to consider when c،osing a domain name for SEO purposes: 1. Include Relevant Keywords Including relevant keywords in your domain name can help search engines understand what your website is about and improve your rankings for t،se keywords. SEO keyword research tools help identify the best keywords to use. However, it is important to avoid stuffing your domain name with too many keywords, as this can be seen as spammy and hurt your rankings. 2. Keep it S،rt and Memorable A s،rt and memorable domain name can help users remember your website and easily share it with others. It can also improve your click-through rates in search results, which can indirectly improve your search engine rankings. 3. Use Hyphens Sparingly While hyphens can help separate keywords in a domain name, they can also make it harder for users to remember and type in your website address. In addition, some search engines may view hyphenated domain names as spammy, which can hurt your rankings. 4. Consider Your Brand Your domain name s،uld also reflect your ،nd and be easy to ،ociate with your business. This can help improve user trust and ،nd recognition, which can indirectly improve your search engine rankings. Also see: Expired Domains: Buying Guide + Top Marketplaces Resear،g Keywords for Your Domain When it comes to c،osing a domain name, it’s important to consider the keywords that are relevant to your business or website. Incorporating these keywords into your domain name can help improve your search engine rankings and make it easier for ،ential customers to find you online. To s، resear،g keywords for your domain, you can use a variety of online tools such as Google Keyword Planner, SEMrush, or Ahrefs. Once you have a list of ،ential keywords, consider incorporating them into your domain name in a way that is easy to remember and type. Incorporating Branding into Your Domain Name When it comes to c،osing a domain name, it’s important to consider ،w you can incorporate your ،nding into it. Your domain name can be a powerful tool for building ،nd recognition and establi،ng trust with your audience. Here are some tips for incorporating ،nding into your domain name: Balancing Brand and Keywords One approach to incorporating ،nding into your domain name is to strike a balance between your ،nd name and relevant keywords, c،osing an SEO-friendly business name. This can help you rank well in search engines while still building ،nd recognition. For example, if your ،nd is called “Green Gardens,” you might consider a domain name like “greengardenslandscaping.com” or “green-gardens-landscaping.com.” Using Brand Name as a Keyword Another strategy is to use your ،nd name as a keyword in your domain name. This can help you rank well for searches related to your ،nd. For example, if your ،nd is called “Healthy Habits,” you might consider a domain name like “healthyhabitsguide.com” or “myhealthyhabits.com.” No matter which approach you c،ose, it’s important to make sure your domain name is easy to remember and type. Domain Name Length and Readability When it comes to domain names, s،rter is generally better. S،rter domain names are easier to remember, easier to type, and less ،e to typos. However, it’s important to strike a balance between brevity and readability to determine website aut،rity. A domain name that is too s،rt may be difficult to read or understand. For example, a domain name like “xqz.com” may be s،rt, but it’s not very readable. On the other hand, a domain name that is too long may be ،bersome and difficult to remember. Aim for a domain name that is between 6 and 14 characters long. In addition to length, consider the readability of your domain name. Avoid using numbers or hyphens, as these can make your domain name harder to remember and type. Stick to letters and try to make your domain name easy to ،ounce and spell. Also see: Google to S،w Real World Site Names in Mobile Search Results C،osing the Right Domain Extension When c،osing the right domain extension for your website, there are a few things to keep in mind. In this section, we’ll discuss the impact of .com vs other TLDs and using geo-specific extensions. Impact of .com vs Other TLDs The .com domain extension is the most popular and recognizable TLD. It’s the first c،ice for many businesses and individuals when registering a domain. However, with the increasing number of TLDs available, it’s worth considering other options. One advantage of using a non-.com TLD is that it can help you stand out from the crowd. For example, if you’re a tech s،up, a .io domain extension could be a good fit. It’s s،rt, memorable, and relevant to your industry. Another advantage is that some TLDs may be cheaper than .com domains. This can be especially important if you’re on a tight budget. However, it’s important to keep in mind that .com domains still have some advantages. They’re easier to remember and more familiar to most people. Domain name providers often recommend .com domains for these reasons. If you’re targeting a global audience, a .com domain may be a better c،ice. Using Geo-Specific Extensions Geo-specific domain extensions can be a good c،ice if you’re targeting a specific country or region. For example, if you’re a business based in the United Kingdom, a .co.uk domain extension can help you rank higher in UK search results. Using a geo-specific extension can also help you establish trust with your audience. If you’re a local business, a geo-specific domain can s،w that you’re part of the community. However, it’s important to keep in mind that using a geo-specific extension can limit your reach. If you’re targeting a global audience, a .com domain may be a better c،ice. Also see: 8 Tips To Increase Domain Aut،rity (DA) Fast Considering Future Scalability When c،osing a domain name, it’s important to consider the future scalability of your website. You want a domain name that will grow with your business and not limit your options down the line. Here are some tips to keep in mind: • Avoid using specific locations or ،ucts in your domain name. While it may seem like a good idea to include your city or state in your domain name, this can limit your ability to expand to other areas in the future. Similarly, if you include a specific ،uct or service in your domain name, you may find it difficult to pivot to other offerings later on. • C،ose a domain name that is broad enough to encomp، your future goals. If you plan to expand your services or offerings, make sure your domain name doesn’t limit you. For example, if you currently offer web design services but plan to expand into marketing or ،nding, don’t c،ose a domain name that only reflects your current offerings. • Consider the length of your domain name. While s،rter domain names are often easier to remember and type, they may not be as flexible in the future. If you c،ose a very specific or narrow domain name, you may find it difficult to add new ،ucts or services wit،ut having to create a new domain name altogether. Checking Domain History and SEO Value Before you settle on a domain name, it’s important to check its history and SEO value. Here are a few things to keep in mind: 1. Check for Previous Penalties If a domain has been penalized by Google in the past, it can be difficult to recover its SEO value. You can use tools like Google Search Console and Ahrefs to check for any manual actions or penalties a،nst the domain. If you find any, it’s best to avoid that domain altogether. Backlinks are an important factor in SEO, so it’s important to check if the domain has any quality backlinks. You can use SEO link building tools like Ahrefs or Majestic to check the backlink profile of the domain. Look for domains that have relevant and aut،ritative backlinks. 3. Check Domain Age Domain age is another factor that can affect SEO value. Older domains tend to have more aut،rity and trust in the eyes of search engines. You can use tools like W،is to check the age of the domain. 4. Avoid Spammy Domains Domains that have been used for spamming or other black hat SEO techniques can be risky to use. Make sure to avoid domains that have a history of spammy behavior. Also see: S،uld You Use Subdomains For SEO? Protecting Your Domain Name with Variations When c،osing a domain name, it’s important to consider variations that could be used by compe،ors or t،se looking to steal traffic from your site. By registering variations of your domain name, you can protect your ،nd and ensure that visitors always end up on your site. One common variation to register is the plural version of your domain name. For example, if your domain is “example.com”, you may want to also register “examples.com” to prevent compe،ors from trying to sip،n off your traffic. Another variation to consider is common misspellings of your domain name. Registering these variations can prevent visitors from accidentally ending up on a compe،or’s site. For example, if your domain is “example.com”, you may want to register “exmaple.com” as well. It’s also important to consider variations based on different top-level domains (TLDs). If your site primarily targets a specific geographic area, you may want to consider registering the country-specific TLD for that area. For example, if your site targets visitors in Ca،a, you may want to register “example.ca” in addition to “example.com”. منبع: https://seosandwitch.com/c،ose-perfect-domain-name-for-your-business/
__label__pos
0.54855
Apache Spark with Scala Video Description Get to grips with the fundamentals of Apache Spark for real-time Big Data processing About This Video • Understand the fundamentals of Scala and the Apache Spark ecosystem • Handle large streams of data with Spark Streaming and perform Machine Learning in real time with Spark MLlib • Comprehensive tutorial packed with practical examples to help you develop real-world Big Data applications with Spark with Scala • In Detail With the rise in popularity of the term ‘Big Data’, there is an increasing need to process large amounts of data in real-time, with maximum efficiency. This has led to Apache Spark gaining popularity in the Big Data market very quickly. The Spark ecosystem allows you to process large streams of data in real-time. As Spark is built on Scala, knowledge of both has become vital for data scientists and data analysts today. This comprehensive 7 hour course will empower you to build efficient Spark applications to fulfill your Big Data needs.You will start with quickly understanding the basics of Scala and proceed to set up the development environment for Apache Spark and Scala for Big Data processing. You will understand the different modules of Spark like Spark SQL, Spark Streaming and GraphX, along with when and how to use them. While doing so, you will build practical, real-world Spark applications in Scala and see how you can deploy them on the cloud. You will also learn how to perform machine learning in real time using Spark’s MLlib module. Finally, you will learn how to run Spark on Hadoop clusters along with best practices and troubleshooting techniques.With over 20 carefully selected examples and abundant explanation to explain even the most difficult concepts, this course will ensure your success in taming your Big Data challenges using Spark with Scala. Table of Contents 1. Chapter 1 : Getting Started 1. Introduction and Getting Set Up 00:14:30 2. [Activity] Create a Histogram of Real Movie Ratings with Spark! 00:12:58 2. Chapter 2 : Scala Crash Course 1. [Activity] Scala Basics, Part 1 00:12:52 2. [Exercise] Scala Basics, Part 2 00:09:41 3. [Exercise] Flow Control in Scala 00:07:18 4. [Exercise] Functions in Scala 00:08:47 5. [Exercise] Data Structures in Scala 00:16:38 3. Chapter 3 : Spark Basics and Simple Examples 1. Introduction to Spark 00:08:40 2. The Resilient Distributed Dataset 00:11:04 3. Ratings Histogram Walkthrough 00:07:33 4. Spark Internals 00:04:42 5. Key/Value RDDs and the Average Friends by Age example 00:12:21 6. [Activity] Running the Average Friends by Age Example 00:07:58 7. Filtering RDDs and the Minimum Temperature by Location Example 00:06:43 8. [Activity] Running the Minimum Temperature Example and Modifying It for Maximum Temperature 00:10:11 9. [Activity] Counting Word Occurrences Using flatmap() 00:08:59 10. [Activity] Improving the Word Count Script with Regular Expressions 00:06:42 11. [Activity] Sorting the Word Count Results 00:08:11 12. [Exercise] Finding the Total Amount Spent by Customer 00:03:38 13. [Exercise] Check your Results, and Sort Them by Total Amount Spent 00:04:26 14. Check Your Results and Implementation against Mine 00:03:26 4. Chapter 4 : Advanced Examples of Spark Programs 1. [Activity] Find the Most Popular Movie 00:04:30 2. [Activity] Use Broadcast Variables to Display Movie Names 00:08:53 3. [Activity] Find the Most Popular Superhero in a Social Graph 00:14:10 4. Superhero Degrees of Separation – Introducing Breadth-First Search 00:06:53 5. Superhero Degrees of Separation – Accumulators and Implementing BFS in Spark 00:05:54 6. Superhero Degrees of Separation – Review the Code, and Run It! 00:10:42 7. Item-Based Collaborative Filtering in Spark, cache(), and persist() 00:08:17 8. [Activity] Running the Similar Movies Script using Spark's Cluster Manager 00:14:13 9. [Exercise] Improve the Quality of Similar Movies 00:02:42 5. Chapter 5 : Running Spark on a Cluster 1. [Activity] Using spark-submit to Run Spark Driver Scripts 00:06:59 2. [Activity] Packaging Driver Scripts with SBT 00:14:07 3. Introducing Amazon Elastic MapReduce 00:07:12 4. Creating Similar Movies from One Million Ratings on EMR 00:12:47 5. Partitioning 00:05:07 6. Best Practices for Running on a Cluster 00:05:31 7. Troubleshooting and Managing Dependencies 00:09:08 6. Chapter 6 : SparkSQL, DataFrames, and DataSets 1. Introduction to SparkSQL 00:07:08 2. [Activity] Using SparkSQL 00:07:01 3. [Activity] Using DataFrames and DataSets 00:06:38 4. [Activity] Using DataSetsInstead of RDDs 00:07:24 7. Chapter 7 : Machine Learning with MLLib 1. Introducing MLLib 00:07:38 2. [Activity] Using MLLib to Produce Movie Recommendations 00:07:23 3. [Activity] Linear Regression with MLLib 00:11:37 4. [Activity] Using DataFrames with MLLib 00:10:05 8. Chapter 8 : Intro to Spark Streaming 1. Spark Streaming Overview 00:09:54 2. [Activity] Set Up a Twitter Developer Account, and Stream Tweets 00:12:13 3. Structured Streaming 00:04:01 9. Chapter 9 : Intro to GraphX 1. GraphX, Pregel, and breadth-first search with Pregel. 00:10:39 2. [Activity] Superhero Degrees of Separation using GraphX 00:08:59 10. Chapter 10 : You Made It! Where to Go from Here? 1. Learning More, and Career Tips 00:04:15 Product Information • Title: Apache Spark with Scala • Author(s): Frank Kane • Release date: September 2016 • Publisher(s): Packt Publishing • ISBN: 9781787129849
__label__pos
0.892014
中国川派团膳领导品牌 成立20余年来,顺心理想是致力于把最正宗的川派美食美味普及到团体膳食领域 地道川菜调料,真正川菜师傅! 全国客服热线:076-458729058 手机官网二维码 微信二维码 CLOSE 郑州Web前端入门之如何用CSS做响应式结构 文章来源: PG电子发布时间:2021-11-04 00:32 本文摘要:许多Web前端新手对响应式结构和自适应结构的观点以及制作方法分不清,简朴来说响应式结构相当于流动网格结构,而自适应结构即是使用牢固支解点来举行结构。接下来千锋小编分享的郑州Web前端入门知识就给大家解说用CSS做响应式结构的方法。 做响应式网站离不开CSS响应式结构查询代码写法,而在此之前,我们需要相识什么是媒体查询以及如何才CSS中引入媒体查询。什么是媒体查询? PG电子 许多Web前端新手对响应式结构和自适应结构的观点以及制作方法分不清,简朴来说响应式结构相当于流动网格结构,而自适应结构即是使用牢固支解点来举行结构。接下来千锋小编分享的郑州Web前端入门知识就给大家解说用CSS做响应式结构的方法。 做响应式网站离不开CSS响应式结构查询代码写法,而在此之前,我们需要相识什么是媒体查询以及如何才CSS中引入媒体查询。什么是媒体查询?媒体查询可以让我们凭据设备显示器的特性(如视口宽度、屏幕比例、设备偏向:横向或纵向)为其设定CSS样式,媒体查询由媒体类型和一个或多个检测媒体特性的条件表达式组成。媒体查询中可用于检测的媒体特性有width、height和color(等)。 使用媒体查询,可以在不改变页面内容的情况下,为特定的一些输出设备定制显示效果。如何在CSS中引入媒体查询?媒体查询写在CSS样式代码的最后,CSS是层叠样式表,在同一特殊性下,靠后的的样式会重叠前面的样式。 如何用CSS做响应式结构呢?1、在HTML头部添加以下代码,用来显示兼容移动设备的显示效果。<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />参数详解:width=device-width :宽度即是当前设备的宽度initial-scale=1 :初始的缩放比例(默认为1)minimum-scale=1 :允许用户缩放到的最小比例(默认为1)maximum-scale=1 :允许用户缩放到的最大比例(默认为1)user-scalable=no :用户是否可以手动缩放(默认为no)2、引入包罗Media的CSS文件一般情况HTMLCSS代码都是离开写的,Media也不破例。 <link rel="stylesheet" type="text/css" href="m320.css" media="only screen and (max-width:320px)"/><link rel="stylesheet" type="text/css" href="m480.css" media="only screen and (min-width:321px) and (max-width:375px)"/>3、写Media中的代码以某个网页的响应式结构为例结构:@media设备类型and (设备特性){样式代码}/*媒体查询*//*当页面大于1200px时,大屏幕,主要是PC端*/@media (min-width: 1200px) {}/*在992 和1199 像素之间的屏幕里,中等屏幕,分辨率低的PC*/@media (min-width: 992px) and (max-width: 1199px) { #adver .center { width: 50%; margin: -10px 0 0 -25%; } main .center h2 { font-size: 40px; }}/*768和991像素之间的屏幕里,小屏幕,主要是PAD*/@media (min-width: 768px) and (max-width: 991px) { #adver .center { width: 60%; margin: -10px 0 0 -30%; } #adver .search, #adver .button { font-size: 20px; } main .center h2 { font-size: 35px; }}/*在480和767像素之间的屏幕里,超小屏幕,主要是手机*/@media (min-width: 480px) and (max-width: 767px) { header, header .center, header .link { height: 45px; } header .logo, .sm-hidden,.sidebar,.md-hidden { display: none; } header .link { width: 100%; line-height: 45px; } #adver { padding: 45px 0 0 0; } #adver .center { width: 70%; height: 53px; margin: -10px 0 0 -35%; } #adver .search, #adver .button { height: 45px; font-size: 18px; } .sm-visible { display: block; } main .center h2 { font-size: 30px; } main .center p { font-size: 15px; } main figure { width: 49.2%; }}/*在小于480像素的屏幕,微小屏幕,更低分辨率的手机*/@media (max-width: 479px) { header, header .center, header .link { height: 45px; } header .logo, .xs-hidden, .sm-hidden, .sidebar, .md-hidden { display: none; } header .link { width: 100%; line-height: 45px; } header .link li { width: 25%; } #adver { padding: 45px 0 0 0; } #adver .center { width: 80%; height: 48px; margin: -10px 0 0 -40%; } #adver .search, #adver .button { height: 40px; font-size: 16px; } .sm-visible { display: block; } footer .bottom, footer .version { font-size: 13px; } main .center h2 { font-size: 26px; } main .center p { font-size: 14px; } main figure { width: 99%; }}响应式结构的原理就是在差别的窗口巨细下显示差别的结构和样式。只要掌握好CSS的样式,响应式结构就没问题。如果你想相识更多响应式结构的方法技巧,可以关注“千锋郑州”微信民众号,定期公布技术热点和行业趋势分析,助力你更快更好的学习前端。如果你想到场专业的郑州Web前端培训班,你可以来千锋申请两周免费试听,亲身体验教学效果,评价讲师的教学水平。 本文关键词:郑州,Web,前端,入门,之如,何用,CSS,做,响应,式,PG电子 本文来源:PG电子-www.csd17.com
__label__pos
0.861978
phoenix phoenix - 5 months ago 52 Java Question How to set ServletContext property for a bean in Spring XML metadata configuration I tried searching here on SO but i couldn't find a solution. I have some XML metadata like the following. <bean class="javax.servlet.ServletContext" id="servletContext" /> <bean class="com.abc.ProductController"> <property name="servletContext" ref="servletContext"/> </bean> With this configuration I am getting an exception saying that "javax.servlet.ServletContext" is an interface and it couldn't create a bean with the id servletContext . The ProductController class is in some jar which I can't modify but I want it as a bean in my application. It has ServletContext property autowired. Answer If you need to create a bean for ServletContext in a XML config spring application, you could use a BeanFactory<ServletContext> implementing ServletContextAware public class ServletContextFactory implements FactoryBean<ServletContext>, ServletContextAware{ private ServletContext servletContext; @Override public ServletContext getObject() throws Exception { return servletContext; } @Override public Class<?> getObjectType() { return ServletContext.class; } @Override public boolean isSingleton() { return true; } @Override public void setServletContext(ServletContext servletContext) { this.servletContext = servletContext; } } You can then declare : <bean class="org.app.ServletContextFactory" id="servletContext" /> <bean class="com.abc.ProductController"> <property name="servletContext" ref="servletContext"/> </bean>
__label__pos
0.999067
Fotolia Q Get started Bring yourself up to speed with our introductory content. What criteria makes something a software-defined technology? The term software-defined is becoming more and more popular but what does it really mean? What makes something a software-defined technology? As IT transitions into the role of a service provider, the traditional practices involved in manually provisioning compute, storage and networking resources are under increasing pressure to keep pace. It's no longer enough to submit a service ticket and wait days for IT to set up a new virtual machine or carve out a virtual private network. Users expect prompt provisioning -- or even the ability to provision resources themselves. To meet the demands for flexible and efficient provisioning, data centers are exploring a diverse array of software-based technologies emerging to manage VMs, storage, networks and even entire data centers. Let's take a closer look at software-defined technologies and see what's required to deploy them successfully. What does "software-defined" really mean? What criteria makes something "software-defined?" Any "software-defined" technology is really about the resource abstraction and provisioning that takes place. It's the key principle of virtualization. Virtualization allows computing resources to be abstracted from the underlyingphysical hardware. Once available, physical resources are abstracted into virtual resources, software tools can also be employed to reallocate the virtualized resources to operating systems and applications (or change previously provisioned resource allocations) on the fly and as desired without the need to ever touch the hardware setups or configurations. Just consider an everyday disk drive. File system software is used to abstract the disk's tracks and sectors and carve that total disk capacity into one or more logical drives which are logically isolated from each other and then presented to the operating system. We don't really refer to a file system as virtualization software or "software-defined disk drives," but the principle of resource abstraction is almost identical. A more recent example is server virtualization. A hypervisor like Microsoft's Hyper-V, VMware's vSphere or Citrix's XenServer works to abstract the server's physical computing resources (such as CPU clock cycles and memory space) into virtual resources. Then it's possible for administrators to provision the virtualized computing resources in order to create virtual machines (VMs). We could just as easily refer to VMs as "software-defined servers." Ultimately, the "software" part of any software-defined technology provides the abstraction layer along with the graphical or command-line user interface needed to allocate, monitor and manage those abstracted resources. Application programming interfacesmay also be provided to support third-party software products or functional plug-ins. If the abstraction layer fails due to a bug or malware, any virtualized resources or provisioning may be compromised. Next Steps Software-defined technology that you should know about Smarter hardware will make software-defined technology work How to set up software-defined storage products Does moving to software-defined everything make sense? Ensure a successful software-defined networking architecture implementation Dig Deeper on Improving server management with virtualization Start the conversation Send me notifications when other members comment. Please create a username to comment. SearchVMware SearchWindowsServer SearchCloudComputing SearchVirtualDesktop SearchDataCenter Close
__label__pos
0.976499
PostgreSQL Source Code  git master bipartite_match.c Go to the documentation of this file. 1 /*------------------------------------------------------------------------- 2  * 3  * bipartite_match.c 4  * Hopcroft-Karp maximum cardinality algorithm for bipartite graphs 5  * 6  * This implementation is based on pseudocode found at: 7  * 8  * http://en.wikipedia.org/w/index.php?title=Hopcroft%E2%80%93Karp_algorithm&oldid=593898016 9  * 10  * Copyright (c) 2015-2018, PostgreSQL Global Development Group 11  * 12  * IDENTIFICATION 13  * src/backend/lib/bipartite_match.c 14  * 15  *------------------------------------------------------------------------- 16  */ 17 #include "postgres.h" 18  19 #include <limits.h> 20  21 #include "lib/bipartite_match.h" 22 #include "miscadmin.h" 23  24 /* 25  * The distances computed in hk_breadth_search can easily be seen to never 26  * exceed u_size. Since we restrict u_size to be less than SHRT_MAX, we 27  * can therefore use SHRT_MAX as the "infinity" distance needed as a marker. 28  */ 29 #define HK_INFINITY SHRT_MAX 30  32 static bool hk_depth_search(BipartiteMatchState *state, int u); 33  34 /* 35  * Given the size of U and V, where each is indexed 1..size, and an adjacency 36  * list, perform the matching and return the resulting state. 37  */ 39 BipartiteMatch(int u_size, int v_size, short **adjacency) 40 { 42  43  if (u_size < 0 || u_size >= SHRT_MAX || 44  v_size < 0 || v_size >= SHRT_MAX) 45  elog(ERROR, "invalid set size for BipartiteMatch"); 46  47  state->u_size = u_size; 48  state->v_size = v_size; 49  state->adjacency = adjacency; 50  state->matching = 0; 51  state->pair_uv = (short *) palloc0((u_size + 1) * sizeof(short)); 52  state->pair_vu = (short *) palloc0((v_size + 1) * sizeof(short)); 53  state->distance = (short *) palloc((u_size + 1) * sizeof(short)); 54  state->queue = (short *) palloc((u_size + 2) * sizeof(short)); 55  56  while (hk_breadth_search(state)) 57  { 58  int u; 59  60  for (u = 1; u <= u_size; u++) 61  { 62  if (state->pair_uv[u] == 0) 63  if (hk_depth_search(state, u)) 64  state->matching++; 65  } 66  67  CHECK_FOR_INTERRUPTS(); /* just in case */ 68  } 69  70  return state; 71 } 72  73 /* 74  * Free a state returned by BipartiteMatch, except for the original adjacency 75  * list, which is owned by the caller. This only frees memory, so it's optional. 76  */ 77 void 79 { 80  /* adjacency matrix is treated as owned by the caller */ 81  pfree(state->pair_uv); 82  pfree(state->pair_vu); 83  pfree(state->distance); 84  pfree(state->queue); 85  pfree(state); 86 } 87  88 /* 89  * Perform the breadth-first search step of H-K matching. 90  * Returns true if successful. 91  */ 92 static bool 94 { 95  int usize = state->u_size; 96  short *queue = state->queue; 97  short *distance = state->distance; 98  int qhead = 0; /* we never enqueue any node more than once */ 99  int qtail = 0; /* so don't have to worry about wrapping */ 100  int u; 101  102  distance[0] = HK_INFINITY; 103  104  for (u = 1; u <= usize; u++) 105  { 106  if (state->pair_uv[u] == 0) 107  { 108  distance[u] = 0; 109  queue[qhead++] = u; 110  } 111  else 112  distance[u] = HK_INFINITY; 113  } 114  115  while (qtail < qhead) 116  { 117  u = queue[qtail++]; 118  119  if (distance[u] < distance[0]) 120  { 121  short *u_adj = state->adjacency[u]; 122  int i = u_adj ? u_adj[0] : 0; 123  124  for (; i > 0; i--) 125  { 126  int u_next = state->pair_vu[u_adj[i]]; 127  128  if (distance[u_next] == HK_INFINITY) 129  { 130  distance[u_next] = 1 + distance[u]; 131  Assert(qhead < usize + 2); 132  queue[qhead++] = u_next; 133  } 134  } 135  } 136  } 137  138  return (distance[0] != HK_INFINITY); 139 } 140  141 /* 142  * Perform the depth-first search step of H-K matching. 143  * Returns true if successful. 144  */ 145 static bool 147 { 148  short *distance = state->distance; 149  short *pair_uv = state->pair_uv; 150  short *pair_vu = state->pair_vu; 151  short *u_adj = state->adjacency[u]; 152  int i = u_adj ? u_adj[0] : 0; 153  short nextdist; 154  155  if (u == 0) 156  return true; 157  if (distance[u] == HK_INFINITY) 158  return false; 159  nextdist = distance[u] + 1; 160  162  163  for (; i > 0; i--) 164  { 165  int v = u_adj[i]; 166  167  if (distance[pair_vu[v]] == nextdist) 168  { 169  if (hk_depth_search(state, pair_vu[v])) 170  { 171  pair_vu[v] = u; 172  pair_uv[u] = v; 173  return true; 174  } 175  } 176  } 177  178  distance[u] = HK_INFINITY; 179  return false; 180 } #define HK_INFINITY static bool hk_depth_search(BipartiteMatchState *state, int u) void BipartiteMatchFree(BipartiteMatchState *state) void pfree(void *pointer) Definition: mcxt.c:936 #define ERROR Definition: elog.h:43 void check_stack_depth(void) Definition: postgres.c:3154 static bool hk_breadth_search(BipartiteMatchState *state) void * palloc0(Size size) Definition: mcxt.c:864 BipartiteMatchState * BipartiteMatch(int u_size, int v_size, short **adjacency) #define Assert(condition) Definition: c.h:688 Definition: regguts.h:298 void * palloc(Size size) Definition: mcxt.c:835 int i #define CHECK_FOR_INTERRUPTS() Definition: miscadmin.h:98 #define elog Definition: elog.h:219
__label__pos
0.990945
Ecuaciones Views:   Category: Entertainment         Presentation Description No description available. Comments Presentation Transcript PowerPoint Presentation: UNIDAD 2 ÁLGEBRA “Ecuaciones de primer grado y sistemas de ecuaciones” Cesar roque minalaya PowerPoint Presentation: Resolver ecuaciones de primer grado con una incógnita, sean éstas numéricas, literales o fraccionarias . Reconocer los métodos de resolución de sistemas de ecuaciones, estableciendo las diferencias entre un procedimiento y otro. Aplicar los métodos de resolución de sistemas de ecuaciones en problemas de planteo. Reconocer cuándo un sistema de ecuaciones tiene infinitas soluciones y cuándo no tiene solución. En esta actividad aprenderás a: PowerPoint Presentation: Contenidos 2.5 Ecuación de primer grado con una incógnita 2.5.1 Ecuaciones numéricas 2.5.2 Ecuaciones literales 2.6 Sistemas de ecuaciones 2.6.1 Métodos de resolución 2.5.3 Ecuaciones fraccionarias 2.6.1.1 Igualación 2.6.1.1 Sustitución 2.6.1.1 Reducción PowerPoint Presentation: 2.7. Ecuación de primer grado Es aquella, en que el mayor exponente de la incógnita es 1 y, por lo tanto, tiene una solución. PowerPoint Presentation: 2. 7. 1 Ecuaciones numéricas Ejemplos: a) 5x + 10 = 2x + 22 5x - 2x +10 = 2x + 22 -2x 3x + 10 = 22 3x + 10 – 10 = 22 - 10 3x = 12 3x = 12 3 3 x = 4  / Restando 2x / Restando 10 / Dividiendo por 3 4 es solución de la ecuación, es decir, al reemplazar 4 en la ecuación, se cumple la igualdad. PowerPoint Presentation: b) 10x + 7 - 6x + 9 = 4x + 16 / Reduciendo términos semejantes 4x + 16 = 4x + 16 / Restando 16 4x + 16 – 16 = 4x + 16 - 16 4x = 4x Cuando en una ecuación, las incógnitas se eliminan y se llega a una igualdad, la ecuación tiene “INFINITAS SOLUCIONES” , es decir, para cualquier valor de x se cumple la igualdad. / Restando 4x 4x – 4x = 4x – 4x 0 = 0 PowerPoint Presentation: c) 8x + 2 + 3x = 9x + 12 +2x / Reduciendo términos semejantes 11x + 2 = 11x + 12 / Restando 2 11x = 11x + 10 / Restando 11x 0 = 10 11x + 2 -2 = 11x + 12 -2 11x – 11x = 11x + 10 – 11x Cuando en una ecuación, las incógnitas se eliminan y NO se llega a una igualdad, la ecuación “ NO TIENE SOLUCIÓN” , es decir, no existe un valor para x que cumpla la igualdad. PowerPoint Presentation: 2.7 . 2 Ecuaciones literales Ejemplos: a) px + q = qx + p / - qx Determinar el valor de x en las siguientes ecuaciones: px + q – qx = qx + p - qx px + q – qx = p / - q px + q – qx - q = p - q px – qx = p - q / Factorizando por x x(p– q) = p - q x = 1 / Dividiendo por (p-q), con p = q. PowerPoint Presentation: b) a(x + b) = ac - ax / Multiplicando ax + ab = ac - ax / Sumando ax ax + ax + ab = ac - ax + ax 2ax + ab = ac / Restando ab 2ax + ab - ab = ac - ab 2ax = ac - ab / Factorizando por a 2ax = a(c – b) / Dividiendo por 2a, con a = 0 x = (c – b) 2 2a 2ax = a(c – b) 2a PowerPoint Presentation: 2.7.3 Ecuaciones fraccionarias Un método muy útil para resolverlas es eliminar los denominadores y dejarlas lineales. Ejemplo: Determine el valor de x en la siguiente ecuación: . 3 5 x + 3 15 = 3 10 x - 2 3 5 x + 1 5 3 10 x - 2 = 3 5 x + 1 5 = 3 10 x – 10 ∙ 2 10 ∙ 10 ∙ 10 ∙ 2 ∙ 3x + 2 ∙ 1 = 1 ∙ 3x - 20 6x + 2 = 3x - 20 / Simplificando / Multiplicando por 10 / Simplificando PowerPoint Presentation: 3x + 2= -20 3x = -22 3 3x = -22 3 x = -22 3 6x - 3x + 2= 3x – 3x - 20 / Restando 2 3x + 2 - 2 = -20 - 2 / Dividiendo por 3 6x + 2 = 3x -20 / Restando 3x PowerPoint Presentation: 2.8. Sistemas de Ecuaciones Es un conjunto de ecuaciones donde hay más de una incógnita. Para determinar el valor numérico de cada una de ellas, debe existir la misma cantidad de ecuaciones que de incógnitas, es decir, si hay 3 incógnitas, debe haber 3 ecuaciones distintas. PowerPoint Presentation: 2.8. 1. Métodos de resolución de un sistema de ecuaciones de primer grado con dos incógnitas Igualación: Una vez despejada, se igualan los resultados. Consiste en despejar la misma incógnita en ambas ecuaciones del sistema. El resultado obtenido se reemplaza en cualquiera de las ecuaciones originales del sistema. PowerPoint Presentation: Ejemplo: 1) 2x + 3y = 7 2) x - 4y = -2 Despejando x en ambas ecuaciones: 1) 2x + 3y = 7 2x = 7 - 3y x = 7 - 3y 2 2) x - 4y = -2 x = -2 + 4y Igualando ambas ecuaciones: 7 - 3y 2 = -2 + 4y PowerPoint Presentation: 7 - 3y 2 = -2 + 4y 7 – 3y = -4 + 8y 7 – 3y + 3y = -4 + 8y + 3y 7 = -4 + 11y 7 + 4 = -4 + 11y + 4 11= 11y 1= y / Multiplicando por 2 / + 3y / + 4 / :11 Reemplazando en cualquiera de las dos ecuaciones del sistema se determina el valor de x. PowerPoint Presentation: x = -2 + 4 y Reemplazando y = 1 en la ecuación 2) : x = -2 + 4 · (1) x = -2 + 4 x = 2 La solución corresponde al punto de intersección de 2 rectas. Las rectas se intersectan en el punto (x,y), en este caso,(2,1). Si las rectas son paralelas, no existe solución. Si las rectas son coincidentes, tiene infinitas soluciones. PowerPoint Presentation: Sustitución: Consiste en despejar una incógnita de una de las ecuaciones del sistema. Una vez despejada, se reemplaza en la otra ecuación, despejando la única variable que queda. El resultado que se obtiene se reemplaza en cualquiera de las ecuaciones originales del sistema. Ejemplo: 1) 2x + 3y = 7 2) x - 4y = -2 PowerPoint Presentation: Despejando x en la ecuación 2) x = -2 + 4y 2) x - 4y = -2 Reemplazando x en la ecuación 1) 1) 2x + 3y = 7 2(-2 + 4y) + 3y = 7 -4 + 8y + 3y = 7 11y = 7 + 4 11y = 11 y = 1 Como x = -2 + 4y  x = -2 + 4 · (1)  x = 2 / Multiplicando / Sumando 4 / Dividiendo por 11 PowerPoint Presentation: Reducción: Consiste en igualar los coeficientes de una misma incógnita en ambas ecuaciones del sistema Luego, se suman o restan ambas ecuaciones, de modo que se eliminen los términos cuyos coeficientes se igualaron. Ejemplo: 1) 2x + 3y = 7 2) x - 4y = -2 PowerPoint Presentation: 1) 2x + 3y = 7 2) x - 4y = -2 Para eliminar x, multiplicaremos la ecuación 2) por -2 / · (-2) 1) 2x + 3y = 7 2) -2x + 8y = 4 / Sumando ambas ecuaciones (+) 11y = 11 y = 1 / Reemplazando y=1 en la ec. 2) 2) x - 4y = -2 x - 4 · (1) = -2 x = 2 x = -2 + 4 / Dividiendo por 11 PowerPoint Presentation: Ejercicios de Aplicación 1. Se tienen canguros y koalas, si hay 55 cabezas y 170 patas, ¿cuántos canguros y koalas hay? Sea c : N° de canguros y k : N° de koalas Solución: Como los canguros tienen 2 patas y los koalas 4, la cantidad total de patas de canguro será 2c y el total de patas de koala 4k . 1) c + k = 55  2) 2c + 4k = 170  PowerPoint Presentation: Con estas dos ecuaciones se forma el siguiente sistema de ecuaciones: 1) c + k = 55 2) 2c + 4k = 170 / · (-2) 1) -2c - 2k = -110 2) 2c + 4k = 170 / Sumando ambas ecuaciones (+) 2k = 60 k = 30  / Reemplazando K=30 en la ec. 1) 1) c + k = 55 c + 30 = 55  c = 55 - 30  c = 25 Por lo tanto, hay 25 canguros y 30 koalas. PowerPoint Presentation: 2. 3x + 2y = 4 9x + 6y = 12 Solución: 3x + 2y = 4 9x + 6y = 12 / · (-3) -9x + -6y = -12 9x + 6y = 12 / Sumando ambas ecuaciones (+) 0 = 0 Se eliminaron las incógnitas y llegamos a una igualdad, por lo tanto, el sistema tiene INFINITAS SOLUCIONES . Determinar x e y. PowerPoint Presentation: 3. Determinar: a + b + c. a + 2b + 3c = 51 2a + 3b + c = 72 3a + b + 2c = 57 / Sumando las tres ecuaciones (+) 6a + 6b + 6c = 180 6(a + b + c) = 180 (a + b + c) = 180 6 (a + b + c) = 30 / Factorizando por 6 / Dividiendo por 6  
__label__pos
0.996679
How to remove Dropper.generic6.cjrb 25 threats found Malware Dropper.generic6.cjrb 25 threats removed Recommended solution Download OSHI Defender and scan your PC for free Download and scan now Name Dropper.generic6.cjrb Description Dropper.generic6.cjrb is typically designed to avoid detection and removal by computer security systems and applications, and these programs are intended to force affected machines to perform certain actions. These can include keylogging, displaying ads, spying and reporting on user activity, granting remote access to hackers, or sending spam. Type Malware Alias Manual How to manually remove Dropper.generic6.cjrb guide. Only for ADVANCED users. • Step 1: Basic check for Dropper.generic6.cjrb activity Check running processes on your system. Usually you can find Dropper.generic6.cjrb process running. Use the Ctrl+Shift+Esc buttons combination to open system information window and click Processes tab. Scroll down the whole list and try to find the process named like Dropper.generic6.cjrb. If you find Dropper.generic6.cjrb process running, right click on it and choose “End Process”. It will disable Dropper.generic6.cjrb for the current Windows session, but remember that if you do not completely remove Dropper.generic6.cjrb using next steps, then your PC will stay vulnerable to malware attack. Next steps are much more important in removing Dropper.generic6.cjrb. • Step 2: Disconnect your PC from the Internet Prevent the malware from leaking or spreading your personal data. Malware usually uses the Internet to transfer all possible and important information you have. Some Malwares are not so “Active” and they can simply disable some Windows features and options. To disconnect your PC from the Internet you need to plug-off LAN cable (if you use LAN connection) or to turn of the Wi-Fi module (if you use Wi-Fi Internet connection). Most of (not 100%) Malwares can not access Wi-Fi module preferences. Turning off the Internet will disable Dropper.generic6.cjrb from transferring any data from your PC. • Step 3: Enter the safe mode. The next step is very important in removing Dropper.generic6.cjrb. After turning off the Internet and disabling Dropper.generic6.cjrb process you will need to reboot your PC in so-called Safe Mode. Safe Mode is a Windows mode which allows you to start the System using only important applications and services. Safe Mode does not usually allow Dropper.generic6.cjrb to load when the system boots (!!!but exceptions can appear!!!). Choose Restart in Windows Start menu and wait until the screen turns off. After that you have to follow the next instructions according to the versions of Microsoft Windows you use: Windows XP: 1. Press the F8 key repeatedly when the first screen appears. 2. Select Safe Mode from Windows Advanced Options Menu and press ENTER. Windows Vista, 7: 1. Press the F8 key repeatedly when the first screen appears. 2. Use the arrow keys from Windows Advanced Options Menu in order to select Safe Mode and press ENTER. Windows 8, 8.1, 10: 1. Press and hold the Shift button when left-clicking the Restart button on Windows log-on screen. 2. Select Safe Mode from Windows Troubleshooting boot screen and press ENTER. • Step 4: Removing virus files Having booted your PC in Safe mode you have to start cleaning your PC manually by deleting every file associated with Dropper.generic6.cjrb one by one. Here is the list of all files associated with Dropper.generic6.cjrb. Delete all files listed below using the Shift+Delete buttons combination. Always double check the file name as sometimes Malwares use very similar filenames as very important system files do and you can mistakenly remove important system file what will harm your system and you will not be able to boot your PC at all. Please, remember that viruses are always progressing and sometimes new files can appear. If you are using our offline PDF guide on How to remove Dropper.generic6.cjrb, please check if you have it’s latest version. We do not guarantee that Dropper.generic6.cjrb has the same file structure at the moment of deleting. After removing all files associated with Dropper.generic6.cjrb that were listed above, reboot your system in normal mode and check if your PC works fine or you still have any troubles. It it is OK – congratulations! You have made a great job! If it is still NOT ok – use OSHI Defender to check your PC. Frequently Asked Questions We have an answer • How did my computer get Dropper.generic6.cjrb? • I detected Dropper.generic6.cjrb on my computer. What do I do? • What damages can Dropper.generic6.cjrb do to my computer? • What are the main symptoms of Dropper.generic6.cjrb? • Can Dropper.generic6.cjrb spread to other computers? • Countries with the highest Dropper.generic6.cjrb infection rates. • The first recorded appearance of Dropper.generic6.cjrb I have a question Comments You have a question? 0 comments How did my computer get Dropper.generic6.cjrb? Dropper.generic6.cjrb may not necessarily need user interaction to get installed. It can get into your system by exploiting weak spots in your browser or operating system. In most cases, though, Dropper.generic6.cjrb needs to be installed manually (open a file, install software, etc). Was the answer helpful? Was the answer helpful? 0% 0% I detected Dropper.generic6.cjrb on my computer. What do I do? Start OSHI Defender or another antimalware program to immediately remove Dropper.generic6.cjrb. Remember that widely used antivirus software may not detect Dropper.generic6.cjrb in your operating system. Was the answer helpful? Was the answer helpful? 0% 0% What damages can Dropper.generic6.cjrb do to my computer? Hackers may use Dropper.generic6.cjrb to hold your data hostage and extort money from you, steal personal and valuable data from your computer or get access to your bank accounts. Was the answer helpful? Was the answer helpful? 0% 0% What are the main symptoms of Dropper.generic6.cjrb? Extra HD activity High network activity PC slowdown System crashes Unusual browser settings Pop-up windows Was the answer helpful? Was the answer helpful? 0% 0% Can Dropper.generic6.cjrb spread to other computers? To install Dropper.generic6.cjrb on other computers in your network, you must perform the same action you did on your infected computer. Was the answer helpful? Was the answer helpful? 0% 0% Countries with the highest Dropper.generic6.cjrb infection rates. US Was the answer helpful? Was the answer helpful? 0% 0% The first recorded appearance of Dropper.generic6.cjrb 2016-02-22 Was the answer helpful? Was the answer helpful? 0% 0% Feedback Use the form below to send us your comments and questions OSHI LIMITED Address: Rm.709, Wellborne Commercial Centre, 8 Java Road, North Point, Hong Kong. Email: [email protected] Report a problem Please provide us with as much information and data as possible (Application name, application version, OSHI Defender version, OS version e.t.c.) Affiliate program registration Fill out following form and receive 80% commission per OSHI Defender sale
__label__pos
0.86397
  This documentation is quite incomplete. At the moment, it is simply a holding place for various bits of documentation that don't have a proper home yet. The Fluid framework includes a number of functions and utilities that component developers can avail themselves of. These are described below. fluid.js fluid.accumulate(list, fn, arg) Scan through a list of objects, "accumulating" a value over them (may be a straightforward "sum" or some other chained computation). The results will be added to the initial value passed in by "arg" and returned. • list {Array}: The list of objects to be accumulated over • fn {Function}: An "accumulation function" accepting the signature (object, total, index) where object is the list member, total is the "running total" object (which is the return value form the previous function), and index is the index number. • arg {Object}: The initial value for the "running total" object Return: arg fluid.allocateSimpleId(element) Allocate an id to the supplied element if it has none already, by a simple scheme resulting in ids "fluid-id-nnnn" where nnnn is an increasing integer. • element {Element}: The element to place the simple id. Return: String (representing the id) fluid.byId(id, dokkument) Returns a DOM element quickly, given an id. • id {Object}: The id of the DOM node to find • dokkument {Document}: the document in which it is to be found (if left empty, use the current document) Return: Element or null if none exists See also: fluid.jById fluid.clear(target) Clears an object or array of its contents. For objects, each property is deleted. • target {Object|Array}: Either an object or an array whose contents you wish to clear fluid.COMPONENT_OPTIONS A special "marker object" which is recognized as one of the arguments to fluid.initSubComponents. This object is recognized by reference equality - where it is found, it is replaced in the actual argument position supplied to the specific subcomponent instance, with the particular options block for that instance attached to the overall "that" object. Constant: {} See also: fluid.initSubComponents fluid.container(containerSpec) Fetches a single container element and returns it as a jQuery. • containerSpec {String|jQuery|Element} Return: jQuery (a single-element jQuery of container) fluid.copy(tocopy) Performs a deep copy (clone) of its argument • tocopy {Object}: the object to be copied Return: Object (the copy) fluid.createDomBinder(container, selectors) Creates a new DOM Binder instance, used to locate elements in the DOM by name. • container {Object}: The root element in which to locate named elements • selectors {Object}: A collection of named jQuery selectors Return: Object See: DOM Binder Guide and API fluid.defaults() Retrieves and stores a component's default settings centrally. • {Boolean}: (optional) if true, manipulate a global option (for the head component) rather than instance options • {String}: componentName the name of the component • {Object}: (optional) a container of key/value pairs to set Return: Object (If the object is passed in the argument, this is added to the store and then returned. If not, the current object in the store is returned) See: DOM Binder Guide and API, Fluid Component API fluid.dumpEl(element) Dumps a DOM element into a readily recognizable form for debugging - produces a "semi-selector" summarizing its tag name, class and id, whichever are set. • element {jQueryable}: can be an element, selector, function that returns an element, or a jQuery. Return: String representing the DOM element fluid.emptySubcomponent(options) Construct a dummy or "placeholder" subcomponent, that optionally provides empty implementations for a set of methods. • options {Anything}: can be anything, will use jQuery.makeArray to turn it into an array Return: Object (the empty sub-component) fluid.event.getEventFirer(unicast, preventable) Constructs an "event firer" object which can be used to register and unregister listeners, to which "events" can be fired. These events consist of an arbitrary function signature. • unicast {Boolean}: If true, this is a "unicast" event which may only accept a single listener. • preventable {Boolean}: If true, the return value of each handler will be checked for false in which case further listeners will be short circuited, and this will be the return value of fire(). Returns: Object (see below) { addListener: function(listener, namespace, exclusions), removeListener: function(listener), fire: function() } See: The Fluid Event System fluid.expectFilledSelector(result, message) Expect that an output from the DOM binder has resulted in a non-empty set of results. If none are found this function will fail with a diagnostic message, with the supplied message prepended. • result {jQuery}: The return value from the DOM Binder • message {String}: message to report if the results are empty fluid.fail(message) Causes an error message to be logged to the console and a real runtime error to be thrown. • message {String|Error}: The error message to log fluid.find(list, fn, deflt) Scan through a list of objects, terminating on and returning the first member which matches a predicate function. • list {Array}: The list of objects to be searched • fn {Function}: A predicate function, acting on a list member. A predicate which returns any value which is not null or undefined will terminate the search. The function accepts (object, index). • deflt {Object}: A value to be returned in the case no predicate function matches a list member. The default will be the natural value of undefined. Return: Object (the first object in the list that matches the predicate function, or deflt if nothing does) fluid.findAncestor(element, test) Finds the nearest ancestor of the element that passes the test. • element {Element}: DOM element • test {Function}: A function which takes an element as a parameter and returns true or false for some test fluid.findKeyInObject Deprecated See: fluid.keyForValue fluid.formatMessage(messageString, args) Expand a message string with respect to a set of arguments, following a basic subset of the Java Message Format rules. http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html The message string is expected to contain replacement specifications such as {0}, {1}, {2}, etc. • messageString {String}: The message key to be expanded • args {String|Array of Strings}: An array of arguments to be substituted into the message. Return: String (the formatted String) fluid.getId(element) Returns the id attribute from a jQuery or pure DOM element • element {jQuery|Element}: The element to return the id attribute for Return: String representing the id fluid.initDomBinder(that) Creates a new DOM Binder instance for the specified component and mixes it in. • that {Object}: the component instance to attach the new DOM Binder to See: DOM Binder Guide and API fluid.initSubcomponent This function provides a generic way of instantiating and configuring any "sub-components" that may be a part of, or used by, a parent component. For example, this function is used by the Inline Edit component to instantiate the Undo decorator, a sub-component that provides Undo functionality to components that support it. Parameters Parameter name Description that   className is a string defined by the invoking component, identifying an option understood by that component. args   fluid.initSubcomponents See also: fluid.COMPONENT_OPTIONS fluid.initView(componentName, container, userOptions) fluid.instantiateFirers fluid.invokeGlobalFunction fluid.isPrimitive fluid.jById See also: fluid.byId fluid.keyForValue See also: fluid.findKeyInObject fluid.log fluid.mergeComponentOptions fluid.merge fluid.mergeListeners fluid.messageLocator fluid.model.composePath fluid.model.copyModel fluid.model.getBeanValue fluid.remove fluid.stringTemplate fluid.transform fluid.unwrap See also: fluid.wrap fluid.VALUE fluid.version fluid.wrap See also: fluid.unwrap fluid.initComponents(that, className, args) FluidDOMUtilities.js fluid.dom.cleanseScripts(element) Cleanse the children of a DOM node by removing all <script> tags. This is necessary to prevent the possibility that these blocks are reevaluated if the node were reattached to the document. • element {Element}: the parent element to begin removing <script> tags from. fluid.dom.cleanseScripts.MARKER Used to indicate that the DOM node has been stripped of all <script> tags Constant: "fluid-scripts-cleansed" See also: fluid.dom.cleanseScripts fluid.dom.computeAbsolutePosition(element) Returns the absolute position of a supplied DOM node in pixels. Implementation taken from quirksmode http://www.quirksmode.org/js/findpos.html • element {Element}: the element whose location is returned Return: \[curleft, curtop\] fluid.dom.getElementText(element) Returns the element text from the supplied DOM node as a single String. • element {Element}: the element to return the text from Return: String fluid.dom.insertAfter(newChild, refChild) Mockup of a missing DOM function Inserts newChild as the next sibling of refChild. • newChild {Element}: the new element to insert • refChild {Element}: the element to insert newChild after fluid.dom.isContainer(container, containee) Checks if the specified container is actually the parent of containee. • container {Element}: the potential parent • conatainee {Element}: the child in question Return: Boolean fluid.dom.isIgnorableNode(node) Determine if a node should be ignored by the iterator functions. It will return true if the node is a Text node that is all whitespace or a comment node. • node {Element}: representing the DOM1 Node interface Return: Boolean fluid.dom.isWhitespaceNode(node) Determine whether a node's text content is entirely whitespace • node {Element}: a node implementing the CharacterData interface (i.e., a Text, Comment, or CDATASection node Return: Boolean fluid.dom.iterateDom(node, acceptor, allNodes) Walks the DOM, applying the specified acceptor function to each element. There is a special case for the acceptor, allowing for quick deletion of elements and their children. • node {Element}: a node to start walking the DOM from • acceptor {Function}: the function to invoke with each DOM element. If the return value is "delete", the element in question will be deleted. If the return value is "stop" the iteration will be terminated • allNodes {Boolean}: use true to call acceptor on all nodes, rather than just element nodes (type 1) fluid.dom.iterateDom.DOM_BAIL_DEPTH This is provided as a work around for IE's circular DOM issue. This is the default max DOM depth in IE. http://msdn2.microsoft.com/en-us/library/ms761392(VS.85).aspx Constant: 256 Defaults Each Fluid component includes a standard options structure at its top-level. Options allow implementors to configure and customize a component. User-supplied options are merged with relevant defaults for the given components. These defaults registered by each component with the Fluid defaults management system via a call to fluid.defaults(): fluid.default(componentName, defaultsObject); where The options for each component (and their defaults) will vary, but all components share a subset of required defaults. These are: Selectors The selectors <something?> is a Javascript object that defines the necessary selector strings that will be used to access the various DOM elements that make up the component. Each component will have different selectors, but all components must have this selectors. Implementors can override the default selectors, so long as the selectors they provide meet the following requirements: fluid.applySkin(skin, element)  
__label__pos
0.73896
Describe the tools that augment the traditional system development life cycle describe the tools that augment the traditional system development life cycle The software development life cycle (sdlc) ref-0-02 for small to medium database applications version 10d 2 system, as opposed to working strictly with . Learn about the microsoft security development lifecycle (sdl) and how it can improve software development security to system services, applying . The systems development life cycle, or sdlc, is a planning tool used by developers to plan, build and maintain high-quality products steps in the sdlc move teams through planning, development, construction and deployment of new software or platforms. System development life cycle (sdlc) is the overall process of developing information systems through a multistep process from investigation of initial requirements through analysis, design . The system development life cycle is the overall process of developing, implementing and retiring information systems through a multi-step process from initiation, analysis, design, implementation . Sdlc system development life cycle (sdlc) traditional sdlc – phase and purpose phase 1: planning required to determine the feasibility of whether the project . Software development technologies and tools are well-known software development life cycle models and methodologies testing life cycle spiral stlc systems . System development life cycle methodology • to discuss in detail various system development tools like – dfd, decision tree, is a traditional development . The primary advantages of a defined system development lifecycle are: it is repeatable - if the process works for one project, there is a good probability that the same lifecycle model would work for a similar project. Sdlc 1 software development life cycle (sdlc) is a process used by the software industry to design, develop and test high quality softwares the sdlc aims to produce a high-quality. Software development technologies and tools are well-known life cycle models and methodologies life cycle spiral stlc systems development life cycle system . The software development life cycle (sdlc) sdlc scratch using the final system design document for these reasons, prototypes are never intended for business use . Learn how to implement a plan to develop high-quality products using the system development life cycle, and remove the guesswork from your next business project. Systems analysis and design in a changing world, 6th edition 52 learning objectives compare the underlying assumptions and uses of a predictive and an adaptive system development life cycle (sdlc) describe the key activities and tasks of information system support explain what comprises a system development methodology — the sdlc as well as models, tools, and techniques describe the two . Project management tools for systems development summarize different phases in a systems development life cycle describe the various models of software development systems development . The advantages in using system development life cycle methodology  system development life cycle irene anderson cmgt/582 - cis security and ethics june 23, 2014 krystal hall system development life cycle “both risk governance and regulatory requirements emphasize the need for an effective risk management plan. Describe the tools that augment the traditional system development life cycle describe the tools that augment the traditional system development life cycle The software development life cycle (sdlc) ref-0-02 for small to medium database applications version 10d 2 system, as opposed to working strictly with . Describe the tools that augment the traditional system development life cycle systems development life cycle • project planning: establishes a high-level view of the intended project and determines its goals. System development lifecycle (sdlc) is a process of information system (is) development various sdlc models have been created and can be implemented, including waterfall, rapid prototyping, incremental, spiral, fountain, build and fix, synchronize and stabilize and rapid application development (rad). To involve the user heavily in the model development - initially the system prototype can be a preliminary model of the final system, but after several iterations of development, the prototype can evolve into the final system - it is not usually done at the depth required in the system development life cycle. The systems development life cycle (sdlc) is a conceptual model used in project management that describes the stages involved in an information system development project, from an initial feasibility study through maintenance of the completed application. The systems development life cycle (sdlc), also referred to as the application development life-cycle, is a term used in systems engineering, information systems and software engineering to describe a process for planning, creating, testing, and deploying an information system. Chapter 8 – approaches to system development a predictive and an adaptive system development life cycle (sdlc) tools, and techniques describe the two . The software development life cycle is a process that ensures good software is built some more specific takes on sdlc include:. System development life cycle tina murray xbis/219 november 1, 2013 stefanie chan system development life cycle system development life cycle is defined as “a method that organizations that use large scale it projects, that is a framework that has sequential processes for information that can be developed through the system” (rainer . The software development life cycle process includes multiple phases from the project viability determined in the concept / initiation phase through the project closure / maintenance phase of the completed system or application. Has your company adopted the systems development life cycle (sdlc) as a standard for benchmarking describe the desired software features in detail, and generally . describe the tools that augment the traditional system development life cycle The software development life cycle (sdlc) ref-0-02 for small to medium database applications version 10d 2 system, as opposed to working strictly with . Describe the tools that augment the traditional system development life cycle Rated 5/5 based on 11 review Download 2018.
__label__pos
0.717383
Knowledge Base MilesWeb / cPanel Learn to configure File Permissions in File Manager Approx. read time : 3 min This article will explain in detail how you can use cPanel’s File Manager to set permission for your web site’s files and directories. What is File Permissions? Access permissions of files and directories on Linux computer tells the operating system about how it can handle access requests. There are three types of basic access permissions : (i) Read: Files that have read access enabled can be only viewed by the user. The read permission is denoted by the letter ‘r’ or number 4. (ii) Write: Files that have to write access enabled can be modified by the user. The write permission is denoted by the letter ‘w’ or number 2. (iii) Execute: Files that have executed access enables can be run as programs by the user, and directories with execute access enabled can be accessed by the user. The execute permission is denoted by the letter ‘x’ or number 1. Three different types of user groups are assigned to these three access permissions. (i) User: User is the owner of a file. (ii) Group: All the other users those belong to the same group as the group to which the file belongs. (iii) World: This access type is for everyone else, that means, all those who are not the user or those who are not in the same group. You can combine access permission and access types to determine the full permission settings for a file or directory. For example, a file with reading and write permission for the user has a permission value of 6.( Adding the read value of 4 and the write value of 2 equals to 6). If the same file also has read permissions for the group and world, those have permission value 4 each. Then the file’s total permission value is represented numerically as 644. Set File Permission to your website Your website’s file needs to be accessed by a web server so that it can send them to a user’s web browser. Thus, your file needs correct file permission set for your website to work properly. Refer to the below table to find out the correct permission settings for various file types on your website: • To make all HTML files and image files readable to others (World). The correct file permission setting is 644 and it gets set automatically when you upload files to your site. Table for permission settings is :  UserGroupWorld ReadSetSetSet WriteSet-- Execute--- Permission644 • To make all directories executable by others (World). The right file permissions setting is 755 which gets set automatically when you create a directory on your site. Table for permission setting is :  UserGroupWorld ReadSetSetSet WriteSet-- ExecuteSetSetSet Permission755 • To make all CGI files (that means, all files in your CGI-bin directory) executable by others (World). The right file permission setting is 755, but this does not set automatically when you upload CGI files to your site. You manually need to change the file permission for CGI files. Table for permission setting is :  UserGroupWorld ReadSetSetSet WriteSet-- ExecuteSetSetSet Permission755 # How to change permission for a file or directory? Perform the following steps to change the permission for a file or directory: 1. Login to cPanel. 2. In the cPanel home screen, go to the Files section. And then click on File Manager. 3. In the same File Manager main window, select a file or directory that you wish to change. 4. Click on the Permission button. Permission 5. Click on the checkboxes so as to click on the correct permissions. 6. Now click on Change Permission. That’s it! You are done. Also Read : 1) Learn to use the Editor in cPanel’s File Manager 2)Errors when changing permissions from Plesk FileManager Sonam Wagh With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement. Need help? We’re always here for you.
__label__pos
0.680739
How to Override Activerecord::Type::Boolean With Jruby? 7 minutes read To override ActiveRecord::Type::Boolean with JRuby, you can create a custom boolean type and register it with ActiveRecord. Here's an example of how you can achieve this: 1. Create a custom boolean type class that extends ActiveRecord::Type::Boolean: 1 2 3 4 5 6 7 8 9 10 11 12 class CustomBooleanType < ActiveRecord::Type::Boolean def cast(value) case value when true, 'true', 1, '1' true when false, 'false', 0, '0' false else super end end end 1. Register the custom boolean type with ActiveRecord by adding the following code to an initializer file (e.g. config/initializers/custom_boolean_type.rb): 1 ActiveRecord::Type.register(:custom_boolean, CustomBooleanType) 1. Now you can use the custom boolean type in your ActiveRecord models: 1 2 3 class MyModel < ApplicationRecord attribute :is_active, :custom_boolean end By following these steps, you can override ActiveRecord::Type::Boolean with JRuby and customize the behavior of boolean attributes in your models. Best Software Developer Books of August 2024 1 Software Requirements (Developer Best Practices) Rating is 5 out of 5 Software Requirements (Developer Best Practices) 2 Lean Software Systems Engineering for Developers: Managing Requirements, Complexity, Teams, and Change Like a Champ Rating is 4.9 out of 5 Lean Software Systems Engineering for Developers: Managing Requirements, Complexity, Teams, and Change Like a Champ 3 The Software Developer's Career Handbook: A Guide to Navigating the Unpredictable Rating is 4.8 out of 5 The Software Developer's Career Handbook: A Guide to Navigating the Unpredictable 4 Soft Skills: The Software Developer's Life Manual Rating is 4.7 out of 5 Soft Skills: The Software Developer's Life Manual 5 Engineers Survival Guide: Advice, tactics, and tricks After a decade of working at Facebook, Snapchat, and Microsoft Rating is 4.6 out of 5 Engineers Survival Guide: Advice, tactics, and tricks After a decade of working at Facebook, Snapchat, and Microsoft 6 The Complete Software Developer's Career Guide: How to Learn Programming Languages Quickly, Ace Your Programming Interview, and Land Your Software Developer Dream Job Rating is 4.5 out of 5 The Complete Software Developer's Career Guide: How to Learn Programming Languages Quickly, Ace Your Programming Interview, and Land Your Software Developer Dream Job How to ensure security when customizing activerecord::type::boolean with jruby? There are several steps you can take to ensure security when customizing ActiveRecord::Type::Boolean with JRuby: 1. Use strong parameters: Make sure to use strong parameters when accepting user input to prevent mass assignment vulnerabilities. 2. Sanitize user input: Validate and sanitize user input before storing it in the database. This will help prevent SQL injection attacks. 3. Use secure coding practices: Follow secure coding practices such as input validation, output encoding, and parameterized queries to prevent attacks like cross-site scripting (XSS) and SQL injection. 4. Implement access control: Limit access to sensitive data and functionality based on user roles and permissions. 5. Keep your software up to date: Regularly update JRuby and any other dependencies to ensure you have the latest security patches. 6. Use encryption: Encrypt sensitive data before storing it in the database to protect it from unauthorized access. 7. Monitor and audit: Implement logging and monitoring to track suspicious activities and audit trails to trace any security incidents. By following these best practices, you can help ensure the security of your customizations to ActiveRecord::Type::Boolean with JRuby. How to handle errors when customizing activerecord::type::boolean with jruby? When customizing ActiveRecord::Type::Boolean with JRuby, you can handle errors by following these steps: 1. Implement a custom boolean type class by subclassing ActiveRecord::Type::Boolean. 1 2 3 4 5 class CustomBooleanType < ActiveRecord::Type::Boolean def cast(value) # Implement your custom casting logic here end end 1. Configure ActiveRecord to use your custom boolean type class. 1 ActiveRecord::Type.register(:custom_boolean, CustomBooleanType) 1. Handle errors within the cast method of your custom boolean type class. You can rescue any exceptions that occur during the casting process and raise a custom error, or return a default value if the casting fails. 1 2 3 4 5 6 7 8 9 class CustomBooleanType < ActiveRecord::Type::Boolean def cast(value) begin super rescue => e raise StandardError, "Error casting value: #{value}" end end end 1. Use your custom boolean type in your ActiveRecord models. 1 2 3 class ExampleModel < ActiveRecord::Base attribute :custom_boolean_attribute, :custom_boolean end By following these steps, you can customize ActiveRecord::Type::Boolean with JRuby and handle errors effectively within your custom boolean type class. What tools can assist with debugging changes to activerecord::type::boolean in jruby? 1. Pry debugger: Pry is a powerful interactive debugger that can be used to inspect variables, set breakpoints, and step through code execution. It can be helpful in debugging changes to the ActiveRecord::Type::Boolean class in JRuby. 2. Byebug: Byebug is another popular Ruby debugger that can be used to debug changes to ActiveRecord::Type::Boolean in JRuby. It allows you to set breakpoints, step through code, and inspect variables. 3. Logging: Adding logging statements to your code can help you track the flow of execution and identify any errors or issues. You can use the Ruby Logger class to log messages at different levels of severity. 4. Pry-remote: Pry-remote is a plugin for Pry that allows you to debug a remote process. This can be useful if you are debugging a JRuby application running on a remote server. 5. Benchmarking: Use benchmarking tools like Ruby's Benchmark module to measure the performance of your code changes. This can help you identify any bottlenecks or inefficiencies in your code. By using these tools effectively, you can debug changes to ActiveRecord::Type::Boolean in JRuby and ensure that your code is running correctly. Facebook Twitter LinkedIn Whatsapp Pocket Related Posts: To create a Ruby module in Java using JRuby, you first need to have JRuby installed on your system. JRuby is a high-performance Ruby implementation that runs on the Java Virtual Machine (JVM). With JRuby, you can use Ruby code seamlessly within a Java project.... To create a Java applet using JRuby, you first need to have JRuby installed on your system. JRuby is a Ruby implementation that runs on the Java Virtual Machine (JVM). Once you have JRuby installed, you can start by writing your applet code in Ruby.To create t... To log heap memory usage in JRuby, you can use the -J option when running your JRuby application. By adding the -J option with the appropriate arguments, you can enable heap memory logging for your JRuby process. This will output information about heap memory ...
__label__pos
0.936606
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute: Sign up Here's how it works: 1. Anybody can ask a question 2. Anybody can answer 3. The best answers are voted up and rise to the top I have to prove the following equation for homework $$\lim_{x\to \frac{\pi }{2}}\frac1{\cos x}\ne \infty $$ The proof must be done by proving that exists a $M>0$ for which for every $l>0$ exists an $x$ so that $0<|x-(\pi/2)|<l$ but $\lim\limits_{x\to \frac{\pi }{2}}\frac1{\cos x}\le m$ I can't seem to figure this one out. I would greatly appropriate anyone who tries to help me out :) Thanks share|cite|improve this question      Did you intend capital $M$ and lower-case $m$ to be understood as being the same? You shouldn't do that, since it's standard to sometimes use capital and lower-case letters to refer to different things in the same problem. – Michael Hardy Nov 18 '11 at 19:20      My (late) hint would be: first try to understand that $\lim_{x\to 0}\frac{1}{x}\neq\infty$. – wildildildlife Nov 25 '11 at 23:02 up vote 5 down vote accepted First we use the geometry to find out what is really going on. Then we will be ready to go to the $M$ and $l$ stuff. Very informally, if $\lim_{x\to \pi/2} \frac{1}{\cos x} =\infty$, that would mean that if $x$ is close but not equal to $\frac{\pi}{2}$ then $\frac{1}{\cos x}$ is big positive. If $x$ is a tiny bit below $\frac{\pi}{2}$, then $\frac{1}{\cos x}$ is indeed big positive, since $\cos x$ is positive and close to $0$. But if $x$ is a bit bigger than $\frac{\pi}{2}$, then $\cos x$ is close to $0$ but negative, so $\frac{1}{\cos x}$ is certainly not big positive. So the bad guys are the $x$ that are a bit bigger than $\frac{\pi}{2}$. Now that we know what's going on, let's write a formal proof. I will try to use the symbols that you used. What would it mean for the limit to be $\infty$? To save typing, and for the sake of generality, I will write for a while $a$ for $\frac{\pi}{2}$ and $f(x)$ for $\frac{1}{\cos x}$. We have $\lim_{x\to a}f(x)=\infty$ if for any $M$, there is an $l>0$ such that for any $x$ such that $|x-a|<l$, then $f(x)>M$. You can think of it this way. Suppose we are given a specific big $M$, like $1000$, or $99999999$. We want to be able to exhibit a number $l$ such that if the distance $|x-a|$ of $x$ from $a$ is $<l$, then $f(x)$ is guaranteed to be $>M$. Think of the number $M$ as a challenge, and of $l$ as a response. To the challenge "ensure that $f(x)>M$" we must always be able to come up with an appropriate response "if $|x-a|<l$, then I can guarantee that $f(x)>M$." (The appropriate response $l$ will in general depend on $M$.) The rest is easy. Let $M=17$. Can we come up with an $l$ such that if $\left|x-\frac{\pi}{2}\right|<l$, then $\frac{1}{\cos x}>17$? Definitely not. For whatever $l$ we pick, there will be a number $x$ such that $\frac{\pi}{2}<x<\pi$ and $\left|x-\frac{\pi}{2}\right|<l$. And at any such number $x$, the number $\frac{1}{\cos x}$ will be negative, so definitely not bigger than $17$. So for the challenge $M=17$, there is no possible response $l$. We conclude that it is not true that $\displaystyle\lim_{x\to \pi/2} \frac{1}{\cos x} =\infty$. Indeed, a small variant of the argument shows that the limit in this case does not exist. Comment: You wrote $\displaystyle\lim_{x\to \pi/2} \frac{1}{\cos x} \ne \infty$. I prefer not to do that, for writing it that way may carry the impression that the limit exists, but happens to be something other than $\infty$. With some practice, this $M$, $l$ business, and related ideas, will become clearer to you. It is a genuinely subtle idea, and takes time to become fully absorbed. share|cite|improve this answer 1   Thanks - Awesome answer :) – Jason Nov 25 '11 at 18:42 If $x$ is slightly bigger than $\pi/2$, then $\cos x$ is negative. share|cite|improve this answer 1   Actually, the limit is $\infty$ if instead of gluing a $+\infty$ onto one end of the real line and $-\infty$ onto the other, you just add a single $\infty$ at both ends, making the line topologically a circle. In trigonometry and when dealing with rational functions, that makes sense. – Michael Hardy Nov 18 '11 at 18:05      Would that be a "wheel"? – Pedro Tamaroff Apr 25 '12 at 23:18 You need to prove that $$\lim_{x\to \frac{\pi }{2}^+}\frac1{\cos x} \neq \lim_{x\to \frac{\pi }{2}^-}\frac1{\cos x}.$$ This is trivial since for $x>\frac{\pi}{2}$, we have $$\frac{1}{\cos x}\leq -1,$$ and similarly for $x<\frac{\pi}{2}$, we have $$\frac{1}{\cos x}\geq 1.$$ This means $$\lim_{x\to \frac{\pi }{2}}\frac1{\cos x}$$ just do not exist. share|cite|improve this answer      I think you mean $$\lim_{x\to\frac{\pi}{2}^+}\frac1{\cos x}\neq\lim_{x\to\frac{\pi}{2}^-}\frac1{\cos x}$$ – robjohn Nov 18 '11 at 18:25      Oh, yeah, right :) – Santa Zhang Nov 18 '11 at 18:27      @SantaZhang, You are correct this is a great answer but I am limited to proving this by the method stated in the question :) – Jason Nov 18 '11 at 18:31 1   @Jason: If you are limited to showing that there "exists a $M>0$ for which for every $l>0$ exists an $x$ so that $0<|x-(\pi/2)|<l$ but $\lim\limits_{x\to \frac{\pi }{2}}\frac1{\cos x}\le m$", then you will not find a solution. This statement assumes that a finite limit exists. Unfortunately, as all the answers show, there is no limit because no matter how small we choose $\delta>0$, there are $x$ with $|x-\frac{\pi}{2}|<\delta$ so that $\frac{1}{\cos(x)}<-1$ and $x$ with $|x-\frac{\pi}{2}|<\delta$ so that $\frac{1}{\cos(x)}>+1$. – robjohn Nov 25 '11 at 19:46 Your Answer   discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged or ask your own question.
__label__pos
0.91499
Take the 2-minute tour × Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required. I'm having a bit of trouble with the Async pattern and chaining methods in a WCF service. The client is calling up to the WCF asyncronously, then the service method needs to asynchronously open a SOAP proxy and call some methods. The problem is the nature of the Soap service is sequential, meaning i need one result, before i can get the next and return it to the calling WCF service. I am trying to use the Async pattern, but failing miserably here, because the sequential calls are bottlenecking the other async calls until it completes. Is there any way to chain these Async SOAP methods, to prevent a bottleneck? [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class DetailsService : IDetailService { public DetailEntity GetDetails(DetailEntity entity) { TransactionUtilities.GetTransactionDetails(entity); // return modified entity with details return entity; } } public static class TransactionUtilities { static SoapClient SoapProxy { get; set; } public static void GetTransactionDetails(DetailEntity entity) { IAsyncResult ar = SoapProxy.BeginExecuteTransaction(loginToken, new AsyncCallback(OnExecuteTransactionEnd), null); // will this block other async calls? ar.AsyncWaitHandle.WaitOne(); string transactionId = SoapProxy.EndExecuteTransaction(ar); // another async call dependent on above transactionId IAsyncResult ar = SoapProxy.BeginGetTransactionResult(loginToken, processId, new AsyncCallback(OnTransactionResultEnd), null); ar.AsyncWaitHandle.WaitOne(); Row[] TransactionResult = SoapProxy.EndGetTransactionResult(ar); // do work with result } // call back methods, just haning out doing nothing static void OnExecuteTransactionEnd(IAsyncResult result) { } static void OnTransactionResultEnd(IAsyncResult result) { } } share|improve this question 1   I'm quite confused by your question. First, you say that the calls have to be sequential. But you want to remove that bottleneck by chaining them? I don't understand how would that help. Second, your code is most certainly not asynchronous, because of all the WaitOne(). –  svick Oct 28 '12 at 8:57      The behavior is certainly not asyncronous, i know that. Then perhaps, it is how i am "Waiting" from the Asyncronous call. What can i do here, in place of the WaitOne() or Sleep() in .NET 4.0, that will not block other calls? –  mflair2000 Oct 29 '12 at 14:02 Your Answer   discard By posting your answer, you agree to the privacy policy and terms of service. Browse other questions tagged or ask your own question.
__label__pos
0.787748
Skip to content Advertisement How to improve Clustered Index scan to Clustered Index seek? I have two tables [dbo].[Employee]( [EmployeeID] [int] IDENTITY(1,1) NOT NULL, [Title] [varchar](50) NULL, [Role] [int] NULL, [Status] [varchar](1) NULL) [dbo].[Roles]( [id] [int] IDENTITY(1,1) NOT NULL, [Role] [varchar](25) NULL, [Description] [varchar](25) NULL) with primary clustered keys by id. Also I have stored procedure SELECT [EmployeeID] ,[Title] ,employee.[Role] ,roles.Role AS RoleName FROM [dbo].Employee AS employee INNER JOIN [dbo].Roles AS roles ON roles.id = employee.Role WHERE [Status] <> 'D' The Execution plan shows me a ‘Clustered Index Scan’ that I want to avoid. Is there any way I can convert it to a ‘Clustered Index Seek’? Execution Plan screen <db fiddle> Advertisement Answer As I mentioned in the comments, the CLUSTERED INDEX on dbo.Employees isn’t going to help you here. The reason for this is because you are filtering on the column status, which is simply included in the CLUSTERED INDEX, but isn’t ordered on it. As a result, the RDBMS has no option but to scan the entire table to filter out the rows where Status has a value of D. You could add an INDEX on the column Status and INCLUDE the other columns, which may result in an index seek (not a clustered index seek), however, due to you using <> D then the RDBMS may feel still chose to perform a scan; whether it does depends on your data’s distribution: CREATE INDEX IX_EmployeeStatus ON dbo.Employee (Status) INCLUDE (Title, Role); Also add a FOREIGN KEY to your table: ALTER TABLE dbo.Employee ADD CONSTRAINT FK_EmployeeRole FOREIGN KEY (Role) REFERENCES dbo.Roles (id); db<>fiddle 3 People found this is helpful Advertisement
__label__pos
0.87776
Убийство Фара-это не решение каких либо проблем Машина времени. Машина времени опирается на фары для индексации. Если кажется, как будто он работает, он является неполным, поскольку индексы не будут обновляться в процессе резервного копирования данных. @Ром, почему бы тебе не перевести в ответ? Это означает, что даже если это возможно - инфицированных женщин может как правило, не *хочу* чтобы упражнения для того, чтобы сделать операцию ненужной. В соответствии с этим, психологический компонент может быть сильнее, чем физическая, и поэтому приспособившись жить с большой грудью может даже не быть вариант, по крайней мере у некоторых пациентов. Я обновил мой КВМ управление скрипт для Ubuntu 14.04 КВМ хостов поддерживает Debian 8 человек. После ручной установки (заполнить скрипт пока не работает), я застрял с следующее сообщение при загрузке: enter image description here Во время установки, я: • Выбраны только ssh-сервер и базы системы ЖКХ. • Установить загрузчик GRUB установить только перечислены вариант. • Используется режим направляющую разметку для все на один раздел. • Использовал локальное зеркало Великобритании. Есть ли какие-то шаги мне нужно быть осторожным, чтобы сделать или может в Debian 8 не устанавливается в качестве гостя KVM? Обновление После сдавшись и решив просто обновление с Debian 7 до Debian 8 ВМ на обновление всех строк в файле/etc/АПТ/источников.список для Джесси вместо Сопелка, я обнаружил, что в конце концов я получил такое же поведение. Однако этот экземпляр имел статический IP и я обнаружил, что я все еще могу по SSH на сервер на этом IP, так что, похоже, это какая-то проблема графики, где сервер не удается загрузиться, мы просто не можем увидеть логин текст. Как я могу решить это? Обновление На этот раз, на установке Debian создается обновление с Debian 7, я могу нажмите кнопку Дополнительно в меню GRUB и выберите опцию С (с sysvinit), которая работает сейчас. Я надеялся, что это может привести к объяснение того, что происходит с обычной версией, которая получает загружается? enter image description here
__label__pos
0.609326
0 I'm developing a Wordpress plugin for a client, given the fact that Wordpress itself is GPLv2 in the following scenarios should I put a license for the plugin or not? 1. Based on our agreement the client is the copyright holder of the plugin 2. I'm the copyright holder of the plugin 3. The matter of copyright ownership is not discussed 1 Answer 1 0 Based on my experiences doing freelance software work for 10+ years: You should always have an agreement between yourself and the client. Whatever license file you put in the plugin is not just for the client but in case some non-client person gets the plugin later. When you create a plugin you are creating additional code that runs within WordPress. You are not adding to WordPress itself. An analogy is if you created a phone App. Creating the app doesn't mean you modified/extended the phone OS that the app runs within. You could put whatever restriction on your plugin that you wish. I would never leave these questions to guessing. When you make an agreement with a client you should have an opinion about what you require/want. They will also have ideas about what they want. Then based on how badly you both want something there is negotiation/compromise. Generally I would never give 100% copyright of any code I created because it could limit my ability/ease of doing future work. I would happily tell the client that they own 100% any of their business ideas/processes. But any unique code was mine. Almost everyone was okay with that. The more money they had the more okay they were with it too. It was the people who could barely afford fast food who were the most difficult to work with. Although if you get into guaranteed monthly pay situations (practically salaried) but independent contracting the client expects way more control regardless of their money situation. Your Answer By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
__label__pos
0.925423
The Top of the Big Data Stack: Applications Classification and Data Storage Henry kicked off our latest collaborative effort to examine some of the details behind the Big Data push and what they really mean. In my first article, I’m going to begin at the beginning, where every discussion around Big Data should begin — at the top. What is Big Data, what are we trying to solve with it, and what tools are there? As you can imagine, this topic is huge. I will address each of these questions in its own article. This first of three parts will examine, what is Big Data. Introduction Henry Newman and I seem to talk almost weekly, except when Henry is fishing or I’m traveling. Our conversations roam all over the map, but the one topic we seem to come back to is Big Data. It’s the storage equivalent of the server world’s “Cloud Computing.” It’s the buzzword that everyone is throwing around, tacking onto their latest products (or their warmed-over products), or using it to justify expenditures. It is being used by the SSD and fast storage community as a rallying cry for products just as much as many people are using it for justifying cramming Hadoop into every nook and cranny (“if I just sprinkle a little Hadoop on the system, data and insight will magically appear”). The phrase has become bothersome and annoying in part because at the same time people are asking what Big Data means, what it means to them, and what it takes to use the technology (if you can call a buzzword a technology). Henry and I have accepted the mission of a high-level examination of Big Data in the hopes that we can help add some clarification to the confusion while hoping to learn some things ourselves, particularly how Big Data impacts storage. I want to start off my first Big Data article with my own twist on Henry’s spot-on definition of Big Data from his first article. Big Data is the process of changing data into information, which then changes into knowledge. I truly think this is essence of what Big Data is all about. It’s not about the hardware. It’s not about the software. And it’s not specific on a specific field or vertical. This definition applies to all fields of inquiry and to all situations. It doesn’t say that you have to have Petabytes of data. It doesn’t say you need billions of files. It doesn’t say that you must run a parallel-distributed database. It doesn’t say that you are in commodity trading, bioinformatics, business analysis, nuclear physics, soap box derby car design, or examining the voting records of the supreme court justices. The definition is simple and yet profound — it’s all about what you do with the data and what you want to gain from it (i.e., knowledge). However, as you have probably guessed, this topic is massive. Consequently, I’ve had to split this article into three parts to make it a bit more digestible. This first part sets the stage and discusses how to get “data” into “Big Data.” In the next part, I will focus on the applications by breaking them into three classifications. The second article will dive into NoSQL applications for the various classifications and points out how they are different and how they affect storage. The third article will focus on how these applications interact with Hadoop (storage) and R (analysis tool) to create information from data. It also finishes up the general topic of Big Data applications by explaining how they impact storage architectures. So let’s get started by using Henry’s wonderful definition of Big Data. Big Data Buzz vs. Big Data Reality Contrary to popular belief, buzzwords usually develop around something real. This is absolutely true with Big Data. Big Data really started with the Web 2.0 companies that started indexing the entire Web and allowed people to search it. As part of this, companies needed to manage extremely large amounts of data and develop ways to use the data to create information. Think of things like Google’s page rank as a way of taking large amounts of data and creating information from it. In turn, people who used Google turned that information into knowledge. There are some suitable aspects to this that are important that usually get overlooked. One of them is that Big Data has access to data, most likely more than ever. This usually leads to the use of the name Big Data. In the case of web information indexing, you had access to the data on the web. You can think of this as “sensor data.” That is, data from some sort of measurements or instrumentation. Sensor data for the web is just the web data itself — web pages, links, and so on. However, the definition of Big Data that I’m using doesn’t say anything about the amount of data — just that it has access to data. What is also subtlety missed by many people is that the amount of data is much larger than what has been used before, but it does not actually have a number over which it is considered Big Data. For example, I work in HPC and we’re used to talking about Petabytes of data, and millions, if not billions of files. However, I was talking with an expert in the field of “smart grid” who was talking about the problems of Big Data. When I asked her how they defined Big Data, she answered that it was about 40TB and about 1 million files. To the field of smart grid, this is Big Data because it is much, much larger than the amount of data they are used to working with but it is much smaller than the HPC field in general. Moreover, the Smart Grid community is trying to take the data and turn it into information that can be used. This reinforces the point that the amount of data is not the point of Big Data. Other disciplines have their own “data sensors.” For bioinformatics and the computational biology fields, there are genome sequencers, MRI images, x-rays, blood tests, and a range of other tests. For businesses, it can be something as simple as POS (Point of Sale) information coupled with customer information via frequent purchaser cards. But it can also include information about the state of the world such as weather (local and global), economic information, traffic information, sporting and other community events, demographics, television programming, and other sources of information that describe the “state” of the world around the business. All of this is “sensor data” and Big Data is really about taking that data and first turning it into information. Here we are with data coming in fast and furious from various disciplines and from many sensors with the supposition that maybe there is some useful information in there that can be used to gain knowledge. Some people are even saying that the old Scientific Method where you put forth a hypothesis and try to prove or disprove it, has been replaced with data driven science where you explore the data using tools to make discoveries or insights (knowledge). I’m not prepared to go that far just yet, but there is something interesting about exploring data using sophisticated tools (reminds me of the end of Carl Sagan’s novel, Contact where the protagonist is searching for meaning in a data stream). All of this is what has led people to create tools for examining large (whatever large means to you), possibly distributed, unstructured, possibly unrelated, and quickly growing pools of data to try to create information and ultimately knowledge. One of the fundamental steps in Henry’s definition of Big Data is changing data into information. This is what I will be discussing in this article. What applications or classes of application can we use for converting data into information? How does this impact storage? I will be listing a number of applications and tools along with links to them as well as articles and discussion, but by no means is this an exhaustive list and the intent of this article is not to be a survey article with a bunch of links. Hopefully I’ll turn this bunch of “data” into information and then coupled with Henry’s articles we’ll create some knowledge. Big Data’s Beginnings Before jumping into a list of applications that can possibly be used for Big Data, we should take a step back and talk about how we “feed the beast.” That is, how do we access the data and how do we store it? (i.e., file formats) I consider this to be a crucial part of examining the “top-end” of Big Data. Getting data into the system we’re using for analysis is not as easy as it seems. In many cases, the data is taken from disparate sources that have their own file format or their own storage system. Moreover, some data sources create data at a very fast pace. An example of this is video monitoring that streams data from cameras to storage. Today, virtually every store, gas station, Starbucks, street corner and highway has some sort of video camera. This data must be collected and stored for future analysis. Before you say that much of this data is pointless, you might be surprised. Remember the tornadoes in spring 2012? Just a few days after they passed, videos from gas station cameras and truck parking lots starting showing up on television. Making sensational videos for the nightly news was not the point of these videos. Rather, they can be used to track the path of the tornado, which is useful information for people who model tornadoes near the ground as well as for storm trackers who want to know where exactly the tornado touched down. It’s also useful information for insurance companies so they know precisely where the tornado touched down. And this information is also useful for the local governments because the tornado path information lets them look for homes or businesses that might have been hit. This enables them to look for people, broken gas lines, downed power lines and cars that might have been moving during the tornado. If you are interested in “Big Data” and creating information and knowledge from data, then you need systems that can quickly gather this data and write it to storage someone for quick analysis and retrieval. This discussion about ingesting data from “sensors” into storage brings up a question: Do we leave the data where it is and access the data remotely, or do we pull the data into a centralized system and then analyze it? There are benefits and difficulties with each approach, so you must carefully examine the details of each approach. Deciding whereto put the data is up to you, but you have to realize that there are implications in leaving it in disparate locations. Issues to think about include: • Data access methods? (e.g., REST, WebDAV and NFS) • Data permissions? (Who gets access to the data? Permissions?) • Data security • Performance (e.g., bandwidth and latency) • Data access priority? (local access trumps remote access?) • Data integrity? • Management of the data? • Responsibility for the data? These are what you might think of as “basic” issues because we haven’t even discussed the data itself. However, in the brave new world of “cloud” everything these are issues you will have to address. I don’t want to dive into these topics in any depth except for one — data access methods. This is important because it deals with the design of the application, which leads to the design of the storage system and the network (among other things). There are several interfaces for accessing information on the Internet, but the one that seems to have become the latest standard is called REST (Representational State Transfer). You can use a REST interface to pull data from a disparate server to your local server if you wish to do that. But you can also use REST as an interface to perform some function on the remote server on behalf of the client which is your server. Defining the exact details of the interface and how it works is one of the THE critical steps in creating a reasonably useful environment for accessing data from disparate resources. A companion to a REST interface is something called WebDAV (Web-based Distributed Authoring and Versioning). WebDAV is a child of the Web 2.0 movement. It allows users to collaboratively edit and manage files on disparate web servers. You can write applications using the WebDAV interface to access data on different servers. But one of the coolest features of WebDAV is that you can maintain the properties including the author, modification date, namespace management, collections and overwrite protection, all of which are very useful in Big Data. After considering how to access the data, primarily to get it into our storage system, we really need to think about how the data is actually stored. For example, is the data stored in a flat text file and if so, how is the data organized and how do you access it? Is the data stored in some sort of database? Is the data stored in some standard format such as hdf5? Or is the data stored in a proprietary format? Answering this question is more critical than people think because you will have to write methods to get the data you want and retrieve it in virtually any tool. In many cases, the choice of how and where the data is written and stored depends on the actual applications being developed and how the results are created and stored. But be sure to pay close attention to this aspect of Big Data — in what form will the data be stored? Now What Do You Do? Some people reading this article will complain that I haven’t said word one about “Big Data Applications” or “Big Data Analytics,” and there is good reason for that — there are many varieties and types including open-source and proprietary. I divide up the applications into three classes: 1. Custom code 2. Analytics oriented (e.g. “R”) 3. Database based on the concepts of NoSQL I can’t say too much about the first class of applications because the entire thing is custom code. Custom code to get data into and out of storage, custom storage, customer APIs and customer applications. But one thing that I can say about this class that also applies to the other two classes is that the applications are frequently written in Java. The second class of applications uses very heavy mathematical or statistical oriented analysis tools almost exclusively. Since Big Data is about converting data into information, statistics are usually employed to make sense of the data and create some general information about it. One of the most common tools in this regard is called R. R is really a programming language that is based on the S language, but there is an open-source implementation of R that many people use for statistical analysis. It is an extremely powerful language and tool with a very large number of add-ons including visualization tools. There are also efforts to add parallel capabilities to R, called R-Parallel, to allow it to scale in terms of computational capability. There are also a number of efforts at integration of R with Hadoop (more on that later in the article). But this class of applications stores the data in R-readable forms and also allows access to the data using R methods. You will find that as we go through some classes of applications, R is integrated with quite a few of them. There are other languages as well, such as Matlab and even SciPy, but R gives you the ability to do very sophisticated statistical analysis of the data. The third class, NoSQL databases, is definitely the largest class with many options for tools depending upon the data and the relationships within the data or databases. The term “NoSQL” means that the databases don’t adhere to the common terminology for databases. In general: • They don’t use SQL (Structured Query Language) as their core language • They don’t give full ACIDguarantees • They have a distributed, fault-tolerant, and scalable architecture As with many of the concepts in Big Data, NoSQL grew out of the Web 2.0 era. People working with data saw the huge explosion in the quantity of data and, perhaps more importantly, the need to analyze the data to create information and hopefully knowledge. Due to the perception that the amount of data was increasing rapidly, a number of developers decided to focus on speed of data retrieval and data append operations rather than the other classical aspects of databases. As part of the design they dropped many of the features that people expected in an RDBM. Instead, they wanted to focus on aspects critical to their work like storing millions (or more) of key-value pairs in a few simple associative arrays and then retrieve them for statistical analysis or general processing. Additionally, they wanted to be able to add to the arrays as more data came in from “data sensors.” This is true for storing millions of data records and performing similar operations. But the driving focus is storing and retrieving huge amounts of data for processing and not necessarily focusing on the relationships between the data or other aspects that might reduce the performance. NoSQL databases also focused on being scalable so they are, by design, distributed. The data is typically stored redundantly on several servers so the loss of a server can be tolerated. It also means that the database can be scaled just by adding more servers or storage. If you need more processing capability, you just add more servers. If you need more storage, you can either add more storage to the existing servers or you can add more servers. There are several ways to classify NoSQL databases, and in future articles, I will dive into these eight NoSQL groupings and discuss why people use them and how they might impact data storage. • Wide Column Store/Column Families • Document Store • Key Value/Tuple Store • Graph Databases • Multimodel Databases • Object Databases • Multivalue databases? • RDF databases? The variety of classes illustrates the creativity and wide range of fields where NoSQL databases are being used. In the subsequent articles, I’ll briefly discuss each one because, believe it or not, the design of these applications can have a big impact on the design the storage. Henry Newman is CEO and CTO of Instrumental Inc. and has worked in HPC and large storage environments for 29 years. The outspoken Mr. Newman initially went to school to become a diplomat, but was firmly told during his first year that he might be better suited for a career that didn’t require diplomatic skills. Diplomacy’s loss was HPC’s gain. Jeff Layton is the Enterprise Technologist for HPC at Dell, Inc., and a regular writer of all things HPC and storage. Follow Enterprise Storage Forum on Twitter Latest Articles How Tape Storage is Used by Banco Bradesco, Treasury of Puerto Rico, Computational Medicine Center, Calgary Police Department, and Franklin Pierce University: Case Studies Most technologies eventually outlive their own usefulness, but a rare few withstand the passage of time. While floppy discs vanish beyond the horizon, taking... How Servers are Used by Ducati, Dashen Bank, Vivo Energy, Skyhawk Chemicals, and Feinberg School of Medicine Out-of-date legacy systems can act as the weak link in an organization’s push for innovation. This is particularly true of legacy servers attempting to... How Flash Storage is Used by BDO Unibank, Cerium Networks, British Army, University of Pittsburgh Medical Center, and School District of Palm Beach County:... Flash storage is a solid-state technology that uses non-volatile memory, meaning data is never lost when the power is turned off. It can be...
__label__pos
0.750109
處理PDF提交 在本部分,我們將建立簡單的servlet,在AEM Publish上執行,以處理從Acrobat/Reader提交的PDF。 這個Servlet接著會向AEM製作執行個體中執行的Servlet發出HTTPPOST請求,該執行個體負責將提交的資料儲存為AEM製作的存放庫中的nt:file節點。 以下是處理PDF提交的Servlet的程式碼。 在此servlet中,我們會對AEM製作例項中裝載於​/bin/startworkflow​上的servlet進行POST呼叫。 此Servlet會將表單資料儲存在AEM Author的存放庫中。 AEM發佈servlet package com.aemforms.handlepdfsubmission.core.servlets; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import javax.servlet.Servlet; import javax.servlet.ServletInputStream; import javax.servlet.ServletOutputStream; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicNameValuePair; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import org.apache.sling.api.servlets.SlingAllMethodsServlet; import org.osgi.service.component.annotations.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Component( service={Servlet.class}, property={ "sling.servlet.methods=post", "sling.servlet.paths=/bin/handlepdfsubmit" } ) public class HandlePDFSubmission extends SlingAllMethodsServlet { private static Logger logger = LoggerFactory.getLogger(HandlePDFSubmission.class); protected void doPost(SlingHttpServletRequest request,SlingHttpServletResponse response) { ByteArrayOutputStream result = new ByteArrayOutputStream(); try { ServletInputStream is = request.getInputStream(); byte[] buffer = new byte[1024]; int length; while ((length = is.read(buffer)) != -1) { result.write(buffer, 0, length); } logger.debug(result.toString(StandardCharsets.UTF_8.name())); } catch (IOException e1) { logger.error("An error occurred", e1); } HttpPost postReq = new HttpPost("http://localhost:4502/bin/startworkflow"); // This is the base64 encoding of the admin credetnials. This call should be made over HTTPS in production scenarios to avoid leaking credentials. postReq.addHeader("Authorization", "Basic YWRtaW46YWRtaW4="); CloseableHttpClient httpClient = HttpClients.createDefault(); List<NameValuePair> urlParameters = new ArrayList<NameValuePair>(); logger.debug("added url parameters"); try { urlParameters.add(new BasicNameValuePair("xmlData", result.toString(StandardCharsets.UTF_8.name()))); postReq.setEntity(new UrlEncodedFormEntity(urlParameters)); httpClient.execute(postReq); logger.debug("Sent request to author instance"); ServletOutputStream sout = response.getOutputStream(); sout.print("Your form was successfully submitted"); } catch (UnsupportedEncodingException | ClientProtocolException | IOException e) { logger.error("An error occurred", e) } } AEM作者Servlet 下一步是將提交的資料儲存在AEM Author的存放庫中。 裝載在/bin/startworkflow上的Servlet會儲存提交的資料。 import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.UUID; import javax.jcr.Binary; import javax.jcr.Node; import javax.jcr.RepositoryException; import javax.jcr.Session; import javax.servlet.Servlet; import javax.servlet.ServletOutputStream; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import org.apache.sling.api.resource.Resource; import org.apache.sling.api.servlets.SlingAllMethodsServlet; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.mergeandfuse.getserviceuserresolver.GetResolver; @Component( service = {Servlet.class}, property = { "sling.servlet.methods=get", "sling.servlet.paths=/bin/startworkflow" } ) public class StartWorkflow extends SlingAllMethodsServlet { private static Logger logger = LoggerFactory.getLogger(StartWorkflow.class); @Reference private GetResolver getResolver; protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) { String xmlData = null; System.out.println("in start workflow"); response.setContentType("text/html;charset=UTF-8"); if (request.getParameter("xmlData") != null) { logger.debug("The form was submitted from Acrobat/Reader"); xmlData = request.getParameter("xmlData"); System.out.println("in start workflow" + xmlData); } else { logger.debug("Mobile Form submission"); StringBuffer stringBuffer = new StringBuffer(); String line = null; try { InputStreamReader isReader = new InputStreamReader(request.getInputStream(), "UTF-8"); BufferedReader reader = new BufferedReader(isReader); while ((line = reader.readLine()) != null) stringBuffer.append(line); } catch (Exception e) { logger.debug("Error" + e.getMessage()); } xmlData = new String(stringBuffer); } Resource r = getResolver.getFormsServiceResolver().getResource("/content/pdfsubmissions"); Session session = r.getResourceResolver().adaptTo(Session.class); logger.debug("Got reosurce pdfsubmissions" + r.getPath()); UUID uidName = UUID.randomUUID(); Node xmlDataFilesNode = r.adaptTo(Node.class); InputStream is = new ByteArrayInputStream(xmlData.getBytes()); Binary binary; try { Node xmlFileNode = xmlDataFilesNode.addNode(uidName.toString(), "nt:file"); logger.debug("Added nt file node"); Node jcrContent = xmlFileNode.addNode("jcr:content", "nt:resource"); logger.debug("Added jcr content"); binary = session.getValueFactory().createBinary(is); jcrContent.setProperty("jcr:data", binary); session.save(); } catch (RepositoryException e) { logger.error("Unable to store data to JCR", e); } response.setContentType("text/plain;charset=UTF-8"); try { ServletOutputStream sout = response.getOutputStream(); sout.print("Your form was successfully submitted"); } catch (IOException e) { logger.error("Unable write response", e); } } } 每次在/content/pdfsubmissions節點下建立nt:file類型的新資源時,AEM工作流啟動器都配置為觸發。 此工作流程會將提交的資料與xdp範本合併,以建立非互動式或靜態PDF。 然後,產生的PDF會指派給使用者以供審核和核准。 若要將提交的資料儲存在/content/pdfsubmissions節點下,我們可使用GetResolver OSGi服務,使用每個AEM Forms安裝程式都提供的fd-service系統使用者來儲存提交的資料。 本頁內容
__label__pos
0.983203
0 Hi I'm trying to save a field into another field in the same form when the form is submitted. I've tried using hook_form_alter and checked for count($form_state['input']) > 0 to save $form['account']['field_first_name'] into $form['profile']['field_first_name'] I know you may say that I can use the profile2 module. I'm already using that. I just need to figure out how to save one field value into another field when a form is submitted. Any help would be greatly appreciated. 1 Got it! In my hook_form_alter function I added $form['#submit'][]='my_submit'; Then I created the my_submit() function. function my_submit($form, &$form_state) { if (count($form_state['input']) > 0) { form_state_values_clean($form_state); $form_state['values']['profile']['field_first_name'] = $form_state['values']['field_first_name']; $form_state['values']['profile']['field_last_name'] = $form_state['values']['field_last_name']; $form_state['values']['profile']['field_groups'] = $form_state['values']['field_groups']; unset($form_state['values']['field_first_name']); unset($form_state['values']['field_last_name']); unset($form_state['values']['field_groups']); } } The important parts of the function above to notice are form_state_values_clean($form_state); then I access the values through $form_state['values'] array. Hope this helps someone else looking to do the same functionality. Your Answer By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy Not the answer you're looking for? Browse other questions tagged or ask your own question.
__label__pos
0.940617
Updating date format on an axis fails except on chart creation #1 If I use the following code when I create a chart with a SChartAxisTypeDateTime as it’s x axis: [_chart.xAxis.labelFormatter.dateFormatter setDateFormat:@“w”] The X axis labels will correctly be formatted as week numbers instead of the default dates.  However, if I try to do that instead from sChartRenderStarted (or ANY delegate method) the chart never updates the x axis.  I have an app where there are different time modes, one of which is weekly, in this mode I need to change the formatting of the x axis as above.  Where is the proper place to set this? #2 Here’s some sample code.  Note that the date formatting works correctly the first time it’s set - it just can’t be updated again once the chart is created.  The work around I am using for now is to destroy the chart and create a new one every time I need to update the x-axis date formatting.  Whereas, logically the date formatting SHOULD work (but doesn’t) by doing it in the delegate method, -(void)sChartRenderStarted:(ShinobiChart *)chart withFullRedraw:(BOOL)fullRedraw     if (!_chart) {          _chart = [[ShinobiChartalloc] initWithFrame:self.view.boundswithPrimaryXAxisType:SChartAxisTypeDateTimewithPrimaryYAxisType:SChartAxisTypeNumber];     }else{         [_chartremoveFromSuperview];         _chart = [[ShinobiChartalloc] initWithFrame:self.view.boundswithPrimaryXAxisType:SChartAxisTypeDateTimewithPrimaryYAxisType:SChartAxisTypeNumber];     }     if (self.currentTime.type == timeTypeWeek){         [_chart.xAxis.labelFormatter.dateFormattersetDateFormat:@“w”];     }else if (self.currentTime.type == timeTypeDay){         [_chart.xAxis.labelFormatter.dateFormattersetDateFormat:@“dd MMM”];     }else{         [_chart.xAxis.labelFormatter.dateFormattersetDateFormat:@“dd MMM HH:mm”];     } #3 The “dateFormatter” property returns the “formatter” property, cast to an NSDateFormatter. Check that it is initialised, or potentially set it yourself with NSDateFormatter *dateFormatter = [NSDateFormatter new]; dateFormatter.dateFormat = dateFormatString; _chart.xAxis.labelFormatter.formatter = dateFormatter; #4 Hi,  As Tom has said, the main issue here is the method being called on the axis. The ‘dateFormatter’ method on the SChartTickLabelFormatter class is actually a factory method to create an instance of SChartTickLabelFormatter which uses date/time formatting. As Tom points out above, the property you should be using is the ‘formatter’ property. This references the NSFormatter object which SChartTickLabelFormatter holds. So, if you update your delegate method to the following: - (void)sChartRenderStarted:(ShinobiChart *)chart withFullRedraw:(BOOL)fullRedraw { NSDateFormatter *dateFormatter = (NSDateFormatter*)_chart.xAxis.labelFormatter.formatter; if (self.currentTime.type == timeTypeWeek){ [dateFormatter setDateFormat:@"w"]; }else if (self.currentTime.type == timeTypeDay){ [dateFormatter setDateFormat:@"dd MMM"]; }else{ [dateFormatter setDateFormat:@"dd MMM HH:mm"]; } } then you should find that this will work for you without requiring you to replace the chart. Hope this helps, let me know how things go! Dan #5 Thanks Dan, that does indeed solve the problem!  Incidentally, I had also tried setting the labelFormatter property itself, but that would throw a warning saying that there was no DateFormatter found.  But passing a reference to the formatter property as you showed does indeed do the trick.  :laughing:
__label__pos
0.968533
• Is it time to dump Java? From the Washington Post: Faster Forward - Request for comments: Java considered harmful? I'm curious - does anyone notice that they are using web sites or services that use Java applets? Should we be recommending that people uninstall Java altogether? Honestly, I think it has been months since the last time I launched Java (when not actually writing Java code). The problem is with the constant security holes that are found in Java. Malware and spyware creators are exploiting these security holes, which means that regular users need to keep updating their Java installs or risk becoming a victim of these exploits. But if we're not even using Java, why bother? Let's just remove the buggy software and be done with it. See Canuck's comment below for instructions. Comments 7 Comments 1. Canuck's Avatar Canuck - After reading the link you give Oscar, I decided to uninstall Java, going through the Control Panel > Add/Remove programs. This worked, however the Java Icon remained in the Control Panel. Easy way of deleting this is to right click on icon > create shortcut to desktop > then delete shortcut .. this will delete the icon in CP. Thanks for the tip ... will keep you posted should any program require it. 1. arraknid's Avatar arraknid - I haven't had Java, nor any browser plug-ins on my home machines for over a year, and never been prompted to install anything. That's probably more to do with my browsing habits though. My OH plays lots of on-line games which won't run without Java, but they are being replaced with your favourite, Flash. 1. Osc's Avatar Osc - Now Microsoft has joined the fray: "Java exploits have usurped Adobe-related exploits as attackers’ preferred method for breaking into Windows PCs." 1. arraknid's Avatar arraknid - Even more reason to shut it down! 1. Steph's Avatar Steph - After reading this thread I deleted Java by going through Add/Remove in Control Panel and then deleting the icon as Canuck suggested and I haven't been asked for it since. However, running Search shows a lot of Java files still present - should I delete please, and if so, how? Thanks Steph 1. arraknid's Avatar arraknid - Hi Steph, Try downloading Javara, and only use the uninstall old versions option. Then uninstall it too. 1. Steph's Avatar Steph - Thanks Arraknid, all done. I'm surprised how many files it removed, there were masses.
__label__pos
0.716724
Unlocking Secure and Transparent Voting Through Blockchain Technology Unlocking Secure and Transparent Voting Through Blockchain Technology With the increasing focus on improving the democratic process, there is growing interest in leveraging blockchain technology to revolutionize voting systems. Blockchain, most commonly known as the underlying technology behind cryptocurrencies like Bitcoin, offers a decentralized and transparent platform that could potentially enhance the security and integrity of voting. In this blog post, we will explore the key concepts of blockchain and voting, the future of this technology in the voting process, and answer some frequently asked questions. Key Concepts of Blockchain and Voting Concept 1: Decentralization One of the fundamental aspects of blockchain technology is its decentralized nature. Unlike traditional voting systems that rely on a central authority, blockchain-based voting distributes the power across a network of nodes or computers. Each node has a copy of the blockchain, which contains all the transactions or votes. This decentralized approach eliminates the need for a single point of control and makes tampering or manipulation extremely difficult. Concept 2: Immutability Blockchain’s immutability is another key concept that is valuable for ensuring secure voting. Once a vote is recorded on a blockchain, it becomes part of an unalterable and permanent record. Each vote is cryptographically linked to the previous one, creating a chain of blocks. This makes it nearly impossible for anyone to modify or delete votes without detection. Concept 3: Transparency Transparency in voting is crucial for maintaining public trust. Blockchain technology provides a transparent platform where anyone can view the recorded transactions. In a blockchain-based voting system, all votes are publicly recorded on the blockchain, and the information cannot be altered retrospectively. This transparency allows for greater accountability and enables voters to verify their votes. Concept 4: Security The decentralized nature of blockchain, along with its cryptographic features, ensures high levels of security in voting. Each vote is encrypted and linked to the voter’s public key, guaranteeing anonymity while still allowing for verification. The use of advanced encryption techniques makes it extremely challenging for hackers to breach the system and manipulate the vote count. Future of Blockchain and Voting Blockchain technology has the potential to significantly enhance the voting process and address many of the challenges faced by traditional systems. Here are a couple of tips regarding the future of blockchain and voting: 1. Enhanced Security: Blockchain’s inherent security features can help protect the integrity of the voting process by eliminating vulnerabilities associated with centralized systems. By decentralizing the storage and verification of votes, blockchain provides a more resilient and tamper-proof voting infrastructure. 2. Increased Trust: Building trust in the voting process is essential for a healthy democracy. Blockchain technology ensures transparency and immutability, giving voters the ability to independently verify the accuracy of the results. This increased trust can lead to higher voter turnout and a stronger belief in the representativeness of democratic institutions. FAQs about Blockchain and Voting Q: Can blockchain technology prevent voter fraud? A: Blockchain technology can make it extremely difficult for fraudulent activities to occur. The decentralized nature of the blockchain, coupled with cryptographic techniques, creates a transparent and secure environment that enhances the integrity of the voting process. Q: How can blockchain improve voter accessibility? A: Blockchain-based voting platforms could enable voters to cast their ballots remotely, eliminating the need for physical polling stations. This would enhance accessibility for citizens who might face challenges in reaching polling stations due to geographical, physical, or time constraints. Q: What about privacy concerns in blockchain-based voting? A: Privacy is a crucial aspect of voting. Blockchain technology can address privacy concerns by utilizing cryptographic techniques that allow for anonymous voting and keep personal information secure. Voters can be identified by their public keys, ensuring anonymity while maintaining the integrity of the voting process. Conclusion Blockchain technology has the potential to transform the way we conduct and perceive the voting process. By leveraging blockchain’s decentralization, immutability, transparency, and security, we can unlock a more secure and transparent voting experience. While there are still challenges to overcome, the future of blockchain and voting looks promising. It is crucial for experts, policymakers, and citizens alike to explore and embrace this innovative technology to strengthen and safeguard democratic processes.
__label__pos
0.992868
The this problem Article Index The this problem Solution   Solution The answer to the problem should be obvious as long as you are secure in your understanding of exactly how JavaScript objects work. The whole problem is due to the fact that there are two distinct ways that this is used within a constructor. First let's look at the constructor again: function MyObjectConstructor(message){ this.message=message; this.show=function(){   alert(this.message); }; } The first use of this is immediate, i.e.  it is evaluated within the constructor, and when the constructor exists the this reference isn't used again. The second use of this is deferred as it is used within a function definition.That is within any instance the show function actually reads alert(this.message) and so what this means depends on what it is set to i.e. the context of the method call. You can check this assertion using alert(myObject1.show); when the functions code will be displayed and you will see this within the instructions. You can think of this as using the this value at the time the constructor is executed or using the this value at the time the method is executed. Normally when you call a method as in myObject1.show(); this is set to the context of the call i.e. the object that the call is made on - in this case this=myObject1 and so when the code this.message in show() executes it assesses myObject1.message. What this all means is that the within the instances method references to the instances variables are not fully resolved even though the method is stored within the instance. This is a little odd from a pure object oriented point of view and it would be simpler if the constructor replace instance variable references with full worked out references. That is rather than store this.message within the method's code it would be better if it stored myObject.message i.e. if it evaluated the this at the time the function was constructed. You should now be perfectly clear why var methodpointer=myObject1.show; methodpointer(); doesn't work. The problem is that when methodpointer calls myObject1.show this isn't set to myObject but to the global object or to what ever object methodpointer belongs to. In this case you get an undefined error because there is no message variable defined at the global level.   Banner Pattern How to avoid this one is a difficult question. The problem arises because this used in methods within the constructor function are not evaluated. A perfect fix would be to find a way to evaluate this at the time the constructor was run and embed it in funcation definitions as a constant - this doesn't seem to be possible although with JavaScript you can never tell. The standard way of providing context to methods so that they work even then this is incorrectly set it so save a copy of this at the time of construction. For example: function MyObjectConstructor(message){ this.message=message; var self=this; this.show=function(){   alert(self.message); }; } Notice that this is stored in a local variable self and it is self that is used within methods whereever this would have been use. Now when you try var methodpointer=myObject1.show; methodpointer(); it calls myObject1.show because the context of the method call is being provided by self which was set when the constructor was called and not by this at the time the method was called. Notice that this solution is slightly more sophisticated than you might give it credit for. Why, for example, is self defined as a local variable? Also how can the method access self when it is local to the constructor which finished running some time ago? (Recall local variables are destroyed when a function ends.) The answer is that show has access to self because a closure is formed preserving all of the constructors local variables when it terminates. The fact that a closure is used to store the value of this at the time the constructor ran is the problem with the method. The object created by the constructor can be extended in ways that do not benefit from the closure and this means that the self variable isn't accessible from all of the objects methods. More of this in another puzzle.   Banner More Puzzles Sharpen Your Coding Skills Merkles and Social Engineering Joe Celko has come up with a math puzzle based on one of the current political hot topics - but let the team from International Storm Door & Software explain the problem of faced by planners who w [ ... ] C# In-place or operator methods? This particular C# puzzle is one of those that involves an error that no self respecting programmer would make... but are you so sure. If you use the DateTime class regularly then sure, you not only w [ ... ] Java Strings and things When are two strings equal? It sounds like an easy question but it's much more difficult when objects enter the picture as this Java brain-teaser demonstrates. Other Articles <ASIN:059680279X> <ASIN:0470526912> <ASIN:1590597273> <ASIN:0596806752>         RSS feed of all content I Programmer - full contents Copyright © 2014 i-programmer.info. All Rights Reserved. Joomla! is Free Software released under the GNU/GPL License.
__label__pos
0.71673
Friday, 13 May 2016 Retrieve webparts from page Using CSOM With PowerShell on SharePoint Views In this post, you will learn how to get web parts and its properties from a publishing page using CSOM with PowerShell for any SharePoint platform site. Steps Involved: The following section explains the flow for getting web parts from a publishing page. 1. Add the references using the Add-Type command with necessary reference paths. The necessary references are Microsoft.SharePoint.Client.dll, Microsoft.SharePoint.Client.Runtime.dll and Microsoft.SharePoint.Client.Publishing.dll. 1. Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"   2. Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"   3. Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Publishing.dll"   2. Initialize client context object with the site URL. 1. $siteURL = ""   2. $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL)   3. If you are trying to access SharePoint Online site, then you need to setup the site credentials with credentials parameter and get it set to the client context.  1. #Not required for on premise site - Start   2. $userId = ""   3. $pwd = Read-Host -Prompt "Enter password" -AsSecureString   4. $creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userId, $pwd)   5. $ctx.credentials = $creds    6. #Not required for on premise site - End   4. If you are trying to access the SharePoint on premise site, then the credentials parameter is not required to be set to the context. But you need to run the code on the respective SharePoint server. 5. Get the page from the respective library using server relative url. Load the file and execute the query to access the page components. 1. #page to be viewed   2. $pageName = "TestPage1.aspx"   3. #Get the page   4. $file = $ctx.Web.GetFileByServerRelativeUrl("/Pages/TestPage1.aspx")   5. $ctx.Load($file)   6. $ctx.ExecuteQuery()   6. Then from the page, we will get the web parts present. From the file object, using web part manager and personalization scope we can access the page web parts. Load and execute the query to access the web parts. 1. #Get all the webparts   2. Write-Host "Retrieving webparts"   3. $wpManager = $file.GetLimitedWebPartManager([Microsoft.SharePoint.Client.WebParts.PersonalizationScope]::Shared)   4. $webparts = $wpManager.Webparts   5. $ctx.Load($webparts)   6. $ctx.ExecuteQuery()   7. Access the web parts. 1. Check the web part count and if web parts present, access the individual web parts using foreach loop. 2. For each web part, the context should be loaded with web part properties and executed. 3. Then $webpart.Id will get us web part GUID and $webpart.WebPart.Properties.FieldValues will have all the properties defined for a web part. you can use foreach loop to get the necessary properties. 1. if($webparts.Count -gt 0){   2.     Write-Host "Looping through all webparts"   3.     foreach($webpart in $webparts){   4.         $ctx.Load($webpart.WebPart.Properties)   5.         $ctx.ExecuteQuery()   6.         $propValues = $webpart.WebPart.Properties.FieldValues   7.         Write-Host "ID: $webpart.id"   8.         foreach($property in $propValues){   9.             Write-Host "Title: " $property.Title                   10.             Write-Host "Description: " $property.Description   11.             Write-Host "Chrome Type: " $property.ChromeType   12.         }   13.                14.     }   15. }   Like wise other properties can also be retrieved. The following snapshot shows the properties which can be retrieved for any web part present on the page. This image shows the content editor web part properties present on the page.
__label__pos
0.994102
in whatsapp, when you send a video it compress it to small file without noticeable lose of quality. anything similar that does it on pc? Photo by Olga isakova w on Unsplash 0 claps 3 Add a comment... Boris-Lip 26/6/2022 The quality loss is VERY noticable. Anyway, you can use ffmpeg to re-compress a video on PC. 3 1 U8dcN7vx 27/6/2022 Handbrake is a common GUI wrapper for ffmpeg. 1 AD-LB 27/6/2022 You probably don't notice because of a small display. Watch it on a large display and you will notice it. As for conversion apps on PC, there are plenty. Examples : "AVS video converter", "HD Video Converter Factory". 1
__label__pos
0.65711
Metcalfe’s Law: more misunderstood than wrong? The industry is at it again–trying to figure out what to make of Metcalfe’s Law. This time it’s IEEE Spectrum with a controversially titled “Metcalfe’s Law is Wrong”. The main thrust of the argument is that the value of a network grows O(nlogn) as opposed to O(n2). Unfortunately, the authors’ O(nlogn) suggeston is no more accurate or insightful than the original proposal. There are three issues to consider: • The difference between what Bob Metcalfe claimed and what ended up becoming Metcalfe’s Law • The units of measurement • What happens with large networks The typical statement of the law is “the value of a network increases proportionately with the square of the number of its users.” That’s what you’ll find at the Wikipedia link above. It happens to not be what Bob Metcalfe claimed in the first place. These days I work with Bob at Polaris Venture Partners. I have seen a copy of the original (circa 1980) transparency that Bob created to communicate his idea. IEEE Spectrum has a good reproduction, shown here. The original Metcalfe's Law graph The unit of measurement along the X-axis is “compatibly communicating devices”, not users. The credit for the “users” formulation goes to George Gilder who wrote about Metcalfe’s Law in Forbes ASAP on September 13, 1993. However, Gilder’s article talks about machines and not users. Anyway, both the “users” and “machines” formulations miss the subtlety imposed by the “compatibly communicating” qualifier, which is the key to understanding the concept. Bob, who invented Ethernet, was addressing small LANs where machines are visible to one another and share services such as discovery, email, etc. He recalls that his goal was to have companies install networks with at least three nodes. Now, that’s a far cry from the Internet, which is huge, where most machines cannot see one another and/or have nothing to communicate about… So, if you’re talking about a smallish network where indeed nodes are “compatibly communicating”, I’d argue that the original suggestion holds pretty well. The authors of the IEEE article take the “users” formulation and suggest that the value of a network should grow on the order of O(nlogn) as opposed to O(n2). Are they correct? It depends. Is their proposal a meaningful improvement on the original idea? No. To justify the logn factor, the authors apply Zipf’s Law to large networks. Again, the issue I have is with the unit of measurement. Zipf’s Law applies to homogeneous populations (the original research was on natural language). You can apply it to books, movies and songs. It’s meaningless to apply it to the population of books, movies and songs put together or, for that matter, to the Internet, which is perhaps the most heterogeneous collection of nodes, people, communities, interests, etc. one can point to. For the same reason, you cannot apply it to MySpace, which is a group of sub-communities hosted on the same online community infrastructure (OCI), or to the Cingular / AT&T Wireless merger. The main point of Metcalfe’s Law is that the value of networks exhibits super-linear growth. If you measure the size of networks in users, the value definitely does not grow O(n2) but I’m not sure O(nlogn) is a significantly better approximation, especially for large networks. A better approximation of value would be something along the lines of O(SumC(O(mclogmc))), where C is the set of homogeneous sub-networks/communities and mc is the size of the particular sub-community/network. Since the same user can be a member of multiple social networks, and since |C| is a function of N (there are more communities in larger networks), it’s not clear what the total value will end up being. That’s a Long Tail argument if you want one… Very large networks pose a further problem. Size introduces friction and complicates connectivity, discovery, identity management, trust provisioning, etc. Does this mean that at some point the value of a network starts going down (as another good illustration from the IEEE article shows)? It depends on infrastructure. Clients and servers play different roles in networks. (For more on this in the context of Metcalfe’s Law, see Integration is the Killer App, an article I wrote for XML Journal in 2003, having spent less time thinking about the problem ;-)). P2P sharing, search engines and portals, anti-spam tools and federated identity management schemes are just but a few examples of the myriad of technologies that have all come about to address scaling problems on the Internet. MySpace and LinkedIn have very different rules of engagement and policing schemes. These communities will grow and increase in value very differently. That’s another argument for the value of a network aggregating across a myriad of sub-networks. Bottom line, the article attacks Metcalfe’s Law but fails to propose a meaningful alternative. About Simeon Simeonov I'm an entrepreneur, hacker, angel investor and reformed VC. I am currently Founder & CTO of Swoop, a search advertising platform. Through FastIgnite I invest in and work with a few great startups to get more done with less. Learn more, follow @simeons on Twitter and connect with me on LinkedIn. This entry was posted in Web 2.0 and tagged , , , , , , . Bookmark the permalink. 27 Responses to Metcalfe’s Law: more misunderstood than wrong? 1. JoseAngel says: hm, a small community needs to have a high proportion of links in order to be “small” in terms of Metcalfe’s law (e.g. a community of three needs mutual links between all three of its nodes); whereas the value of the proportion between the number of links and the number of nodes decreases as the community becomes bigger: you don’t expect a community with a thousand nodes to have all of these nodes link to each other in order to call it “small” (in proportion). So this sounds like another use for a Long Tail graph: very few big communities will bother to establish an unusually high number of links, and most will go along with the mean values in the long tail of the graph. 2. Pingback: HighContrast » The power of syndication 3. Pingback: the CIA & saving the world « Trinifar 4. The value. Value. What I do not understand about all of this is how one can argue over the value of something which is largely subjective. Certainly, the *potential* value of a network can increase with unit size, but it also has can decrease over time as well. The classic fax machine example also demonstrates this. These ‘Laws’ are theoretical. Since there is no empirical manner in which to calculate value, each ‘Law’ is subjective and lacks evidence to support them. Because of the nature of the ‘Law’, it can never be proven – definitely convenient, and poor science. It is intuitive that the value of a network would increase as the size of the network increases, but assessing it in an equation seems a bit like hubris to me. 5. Miguel says: One application goes to economics. In a supply chain you may have a web of suppliers creating concurrence. The value depends on each company but assuming it constant then the value increases and the availability of souces increase. 6. Pingback: Hyves is hip en u moet allemaal NU op hyves! » Cafe del Marketing 7. Pingback: chmod755 » The growth of participation; why participation counts in the social web 8. Pingback: chmod755 » The growth of participation; why online participation counts 9. Pingback: Setting The Record Straight About Metcalfe’s Law « HighContrast 10. One point I’d like to make with respect to the IEEE analysis. Part of their evidence against Moore’s Law was the defective peering behaviour of large incumbents, suggesting if the value was N squared they’d be quicker to do it. Unobserved in their analysis is that the “value” is to the user (despite your assertions regarding devices, the value increases if they are a multi-user device, surely) not the operator. 11. Hamish, yes, there is definite value increase to the user. 12. Pingback: My del.icio.us bookmarks for March 2nd through March 3rd » the billblog 13. Damian says: The point of the value of a network changing over time is interesting. The value of a Fax machine is changing, but in some ways it is actually continuing to grow as its functionality as a scanning device continues to be utilized. Also. Its value in times of disaster (which we seem to be seeing increasingly having) goes up even more. During a disaster it is a standard backup machine not dependent on the Internet infrastructure, that can retry and provide confirmation of receipt. The Fax machine is continues to be used as a copy machine or backup copy machine in growing use (although more by the ever increasing small home worker). However, its original use of point-to-point communication is decreasing in the ‘mainstream’ world with email, it is still used for distribution, and for accessing “lower end users” without all the higher dollar technology solutions. 14. Stan says: It seems to me it’s alot simpler than that. The value of a network is equal to the number of links in the network. For a *fully connected* network, where every node has a direct connection to every other node, that number matches melcalfe’s law i.e. o(n squared). But for e.g. social networks, the number of links is really more o(n). This is because the number of other user’s that the average user is directly connected to is not a function of the overall size of the network. If there are a 100,000 users in a network, and the average number of connections is 10 (say), then the value of the network is (1000 * 10 ) /2 = 500,000 – and not 10,000,000,000. 15. Pingback: Metcalfe’s law « Libitt’s Weblog 16. Pingback: Nodalities » Blog Archive » This Week’s Semantic Web 17. Pingback: Mi otro blog… » Blog Archive » El valor de las redes: La ley de Metcalfe 18. Pingback: Metcalfe’s Law Revisited, Or Take a Node to Lunch Day « Egghead Marketing 19. Pingback: How to Achieve Critical Mass in Social Media | THE LAB 20. Pingback: Big Potatoes | 2. Beyond the post-war legacy 21. Pingback: Living up to Metcalf’s law on social innovation communities | Spigit 22. Pingback: How To “Go Viral”: Achieving Critical Mass In Social Media | Elements In Time 23. Pingback: http://zanacom.com/index.php 24. On top of that, if you are bilingual, you may be a lot more saleable and get much more opportunities than your monolingual version. Additionally we supported it on a base of buttered white colored brown rice. Getting somebody to cook for the precise meal allergic reactions and weight loss specifications within your folks is not an issue, both. 25. Fight back with the help of a legal team dedicated to proving your case to the court. It is not only career criminals who may one day face charges in a court of law. A hard working attorney will never miss anything much, this is the reason why you need to hire only the best when it comes to saving yourself from punishment for crime that you most probably did not commit. 26. So as an owner or a manager of a business or a company, you should give more attention to the sales and marketing strategies that you use for your business in order to get the best ROI from your business. If you’re going retail with your small town business idea, be very careful to follow what the town already demands. Since the malls are failing, the stores in them are, too. 27. The extremely anticipated 5-bed room Villa 30 is the jewel within the crown of Samujana. Leave a Reply Fill in your details below or click an icon to log in: WordPress.com Logo You are commenting using your WordPress.com account. Log Out / Change ) Twitter picture You are commenting using your Twitter account. Log Out / Change ) Facebook photo You are commenting using your Facebook account. Log Out / Change ) Google+ photo You are commenting using your Google+ account. Log Out / Change ) Connecting to %s
__label__pos
0.584864
stefanosn stefanosn - 6 months ago 103 Objective-C Question Preload cells of uitableview I acknowledge that UITableview load dynamically a cell when user scrolls. I wonder if there is a way to preload all cells in order not to load each one while scrolling. I need to preload 10 cells. Is this possible? Answer You can initialize table view cells, put them into an array precomputedCells and in the data source delegate method tableView:cellForRowAtIndexPath: return the precomputed cells from the array instead of calling dequeueReusableCellWithIdentifier:. (Similar to what you would do in a static table view.) - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { return [self.precomputedCells objectAtIndex:indexPath.row]; } It might also be useful to have a look at the WWDC 2012 Session 211 "Building Concurrent User Interfaces on iOS" where it is shown how to fill the contents of table view cells in background threads while keeping the user interface responsive.
__label__pos
0.951425
1. Этот сайт использует файлы cookie. Продолжая пользоваться данным сайтом, Вы соглашаетесь на использование нами Ваших файлов cookie. Узнать больше. Скрыть объявление Здравствуй, Гость. Мы подготовили тему с комментариями и объяснениями к Правилам форума. В ней описаны многие спорные моменты, список запрещенных сокращений и т.п. Ознакомиться с данной темой можно перейдя по ссылке. Ошибка во время игры Тема в разделе "Архив", создана пользователем BloodStar, 12 окт 2011. Статус темы: Закрыта. 1. BloodStar BloodStar User Регистрация: 24.05.11 Сообщения: 14 Симпатии: 0 cpu : genuineintel intel(r) core(tm) i7 cpu 950 @ 3.07ghz @ 3074 mhz 4095mb ram video : nvidia geforce gtx 470 (8026) poscode : ls8(404) -114213:260019:-1202 8/1 [1026] resource alloc failed!!(reason=8007000e) history: texture <- usize=1024 vsize=2048 mips=11 trynum=3 discardcnt=0 <- fd3dtexture::cache <- retry create texture <- fd3drenderinterface::cachetexture <- fd3drenderinterface::setshaderbitmap <- fd3drenderinterface::handlecombinedmaterial <- fd3drenderinterface::handlecombinedmaterialforlightmap <- fd3drenderinterface::setshadermaterial <- fd3drenderinterface::setmaterialorg <- fd3drenderinterface::setmaterial <- drawsection <- staticmesh=new_speaking_v_s.newbie_ancient_other sectionindex=0 <- renderstaticmeshlod <- staticmesh=new_speaking_v_s.newbie_ancient_other owner=16_25.staticmeshactor2184 instance=16_25.staticmeshinstance9482 <- fdynamicactor::render <- renderactor <- solidrendering <- renderlevel <- flevelscenenode::render <- fplayerscenenode::render <- viewportlock2 <- precaching <- ugameengine::draw <- grendev = 7c8a0000 <- uwindowsviewport::repaint <- uwindowsclient::tick <- clienttick <- ugameengine::tick <- updateworld <- mainloop в чем проблема разясните токо не замудренными словами умников))   2. ВашаСовесть ВашаСовесть Innova Group Регистрация: 11.02.10 Сообщения: 15.828 Симпатии: 930 3. withdkd withdkd Тех. модератор 4Game Global moderator Регистрация: 29.08.10 Сообщения: 11.154 Симпатии: 571 проблема в кривых файлах текстур, утилитой проверьтесь на наличие и исправление таких битых файлов клиента   4. BloodStar BloodStar User Регистрация: 24.05.11 Сообщения: 14 Симпатии: 0 вроде все исправлял!! че мне предлогаете каждый раз испровлять перед заходом?? это же от чего то зависят эти ошибки   5. BloodStar BloodStar User Регистрация: 24.05.11 Сообщения: 14 Симпатии: 0 вот проверил не одной ошибки нету и в чем проблемка тогда! ^_^ сам хз   6. BloodStar BloodStar User Регистрация: 24.05.11 Сообщения: 14 Симпатии: 0 2011.10.13 21:53:41 os : windows7(32) 6.1 (build: 7600) cpu : genuineintel intel(r) core(tm) i7 cpu 950 @ 3.07ghz @ 3074 mhz 4095mb ram video : nvidia geforce gtx 470 (8026) poscode : ls8(404) -114708:152152:-10752 8/1 [1026] <- ualaudiosubsystem::playsoundw <- ualaudiosubsystem::playsoundw <- uanimnotify_sound::notify1 <- uanimnotify_sound::notify <- updateanimation <- umeshcomponent::updateanimation <- umeshcontainer::updateanimation <- apawn::updateanimation <- aactor::tick <- transient.fdwarf <- tickallactors <- ulevel::tick <- (netmode=0) <- umasterlevel::tick <- ticklevel <- ugameengine::tick <- updateworld <- mainloop exception: code [exception_access_violation] address [0x1aa42600] offset from base [0x00002600] вот новая ошибка че делать!! заново обновить клиент чтоли или как?   7. withdkd withdkd Тех. модератор 4Game Global moderator Регистрация: 29.08.10 Сообщения: 11.154 Симпатии: 571 fdwarf.utx удалите и полную проверку   8. toshik80 toshik80 User Регистрация: 25.04.11 Сообщения: 5 Симпатии: 0 после установления обновы работало все нормально ровно один день,сегодня после входа в игру происходит вылет вот с такой надписью: 2011.10.13 14:46:37 os : windows7(32) 6.1 (build: 7601) cpu : authenticamd amd turion(tm) x2 dual-core mobile rm-70 @ 2002 mhz 2047mb ram video : nvidia geforce 9600m gs (6658) poscode : ls8(404) 0:0:0 2/1 [0] apawn::findmaximumquestpriority <- npcclassid=31976 nquestlist=1 nqueststeplist=0 <- apawn::refreshquestmark <- unetworkhandler::notifyquestmark <- npcinfopacket <- unetworkhandler::tick <- function name=npcinfopacket <- ugameengine::tick <- updateworld <- mainloop exception: code [exception_access_violation] address [0x202c971f] offset from base [0x002c971f] что это такое ?   9. russianhuman russianhuman User Регистрация: 13.10.11 Сообщения: 3 Симпатии: 0 у меня тоже самое!!!   10. ВашаСовесть ВашаСовесть Innova Group Регистрация: 11.02.10 Сообщения: 15.828 Симпатии: 930 11. BloodStar BloodStar User Регистрация: 24.05.11 Сообщения: 14 Симпатии: 0 да все я делал и такое постоянно творится   12. ВашаСовесть ВашаСовесть Innova Group Регистрация: 11.02.10 Сообщения: 15.828 Симпатии: 930 bloodstar скачайте teamviewer.com дайте доступ в пм, я гляну что у вас занапастия   13. BloodStar BloodStar User Регистрация: 24.05.11 Сообщения: 14 Симпатии: 0 модер как сможешь помочь напиши мне в игре bloodstar   14. withdkd withdkd Тех. модератор 4Game Global moderator Регистрация: 29.08.10 Сообщения: 11.154 Симпатии: 571 пост номер 12 зы мы не играем и понятия не имеем на каком сервере играете вы   15. BloodStar BloodStar User Регистрация: 24.05.11 Сообщения: 14 Симпатии: 0 ну тогда просто посмотрите правленно ли я на вашей программе нажимаю! а то как то не в кайп во время кача ошибки получать   16. BloodStar BloodStar User Регистрация: 24.05.11 Сообщения: 14 Симпатии: 0 походу вы на мою темку забили !!! все понятно!! если забили тогда закройте тему   Статус темы: Закрыта.
__label__pos
0.88064
Main Content Train Agents Using Parallel Computing and GPUs If you have Parallel Computing Toolbox™ software, you can run parallel simulations on multicore processors or GPUs. If you additionally have MATLAB® Parallel Server™ software, you can run parallel simulations on computer clusters or cloud resources. Note that parallel training and simulation of agents using recurrent neural networks, or agents within multi-agent environments, is not supported. Independently on which devices you use to simulate or train the agent, once the agent has been trained, you can generate code to deploy the optimal policy on a CPU or GPU. This is explained in more detail in Deploy Trained Reinforcement Learning Policies. Using Multiple Processes When you train agents using parallel computing, the parallel pool client (the MATLAB process that starts the training) sends copies of both its agent and environment to each parallel worker. Each worker simulates the agent within the environment and sends their simulation data back to the client. The client agent learns from the data sent by the workers and sends the updated policy parameters back to the workers. Diagram showing a client connected with four workers. To create a parallel pool of N workers, use the following syntax. pool = parpool(N); If you do not create a parallel pool using parpool (Parallel Computing Toolbox), the train function automatically creates one using your default parallel pool preferences. For more information on specifying these preferences, see Specify Your Parallel Preferences (Parallel Computing Toolbox). Note that using a parallel pool of thread workers, such as pool = parpool("threads"), is not supported. To train an agent using multiple processes you must pass to the train function an rlTrainingOptions object in which the UseParallel property is set to true. For more information on configuring your training to use parallel computing, see the UseParallel and ParallelizationOptions options in rlTrainingOptions. For an example on how to configure options for asynchronous advantage actor-critic (A3C) agent training, see the last example in rlTrainingOptions. For an example that trains an agent using parallel computing in MATLAB, see Train AC Agent to Balance Cart-Pole System Using Parallel Computing. For an example that trains an agent using parallel computing in Simulink®, see Train DQN Agent for Lane Keeping Assist Using Parallel Computing and Train Biped Robot to Walk Using Reinforcement Learning Agents. Agent-Specific Parallel Training Considerations Reinforcement learning agents can be trained in parallel in two main ways, experience-based parallelization, in which the workers only calculate experiences, and gradient-based parallelization, in which the workers also calculate the gradients that allow the agent approximators to learn. Experience-Based Parallelization (DQN, DDPG, TD3, SAC, PPO, TRPO) When training an DQN, DDPG, TD3, SAC, PPO or TRPO agent in parallel, the environment simulation is done by the workers and the gradient computation is done by the client. Specifically, the workers simulate (their copy of) the agent within (their copy of) the environment, and send experience data (observation, action, reward, next observation, and a termination signal) to the client. The client then computes the gradients from experiences, updates the agent parameters and sends the updated parameters back to the workers, which then continue to perform simulations using their copy of the updated agent. This type of parallel training is also known as experience-based parallelization, and can run using asynchronous training (that is the Mode property of the rlTrainingOptions object that you pass to the train function can be set to "async"). Experience-based parallelization can reduce training time only when the computational cost of simulating the environment is high compared to the cost of optimizing network parameters. Otherwise, when the environment simulation is fast enough, the workers lie idle waiting for the client to learn and send back the updated parameters. In other words, experience-based parallelization can improve sample efficiency (intended as the number of samples an agent can process within a given time) only when the ratio R between the environment step complexity and the learning complexity is large. If both environment simulation and gradient computation (that is, learning) are similarly computationally expensive, experience-based parallelization is unlikely to improve sample efficiency. In this case, for off-policy agents that are supported in parallel (DQN, DDPG, TD3, and SAC) you can reduce the mini-batch size to make R larger, thereby improving sample efficiency. Note For experience-based parallelization, do not use all of your processor cores for parallel training. For example, if your CPU has six cores, train with four workers. Doing so provides more resources for the parallel pool client to compute gradients based on the experiences sent back from the workers. For and example of experience-based parallel training, see Train DQN Agent for Lane Keeping Assist Using Parallel Computing. Gradient-Based Parallelization (AC and PG) When training an AC or PG agent in parallel, both the environment simulation and gradient computations are done by the workers. Specifically, workers simulate (their copy of) the agent within (their copy of) the environment, obtain the experiences, compute the gradients from the experiences, and send the gradients to the client. The client averages the gradients, updates the agent parameters and sends the updated parameters back to the workers so they can continue to perform simulations using an updated copy of the agent. This type of parallel training is also known as gradient-based parallelization, and allows you to achieve, in principle, a speed improvement which is nearly linear in the number of workers. However, this option requires synchronous training (that is the Mode property of the rlTrainingOptions object that you pass to the train function must be set to "sync"). This means that workers must pause execution until all workers are finished, and as a result the training only advances as fast as the slowest worker allows. In general, limiting the number of workers in order to leave some processor cores for the client is not necessary when using gradient-based parallelization, because the gradients are not computed on the client. Therefore, for gradient-based parallelization, it might be beneficial to use all your processor cores for parallel training. For and example of gradient-based parallel training, see Train AC Agent to Balance Cart-Pole System Using Parallel Computing. Using GPUs You can speed up training by performing actor and critic operations (such as gradient computation and prediction), on a local GPU rather than a CPU. To do so, when creating a critic or actor, set its UseDevice option to "gpu" instead of "cpu". The "gpu" option requires both Parallel Computing Toolbox software and a CUDA® enabled NVIDIA® GPU. For more information on supported GPUs see GPU Computing Requirements (Parallel Computing Toolbox). You can use gpuDevice (Parallel Computing Toolbox) to query or select a local GPU device to be used with MATLAB. Using GPUs is likely to be beneficial when you have a deep neural network in the actor or critic which has large batch sizes or needs to perform operations such as multiple convolutional layers on input images. For an example on how to train an agent using the GPU, see Train DDPG Agent to Swing Up and Balance Pendulum with Image Observation. Using both Multiple Processes and GPUs You can also train agents using both multiple processes and a local GPU (previously selected using gpuDevice (Parallel Computing Toolbox)) at the same time. To do so, first create a critic or actor approximator object in which the UseDevice option is set to "gpu". You can then use the critic and actor to create an agent, and then train the agent using multiple processes. This is done by creating an rlTrainingOptions object in which UseParallel is set to true and passing it to the train function. For gradient-based parallelization, (which must run in synchronous mode) the environment simulation is done by the workers, which also use their local GPU to calculate the gradients and perform a prediction step. The gradients are then sent back to the parallel pool client process which calculates the averages, updates the network parameters and sends them back to the workers so they continue to simulate the agent, with the new parameters, against the environment. For experience-based parallelization, (which can run in asynchronous mode), the workers simulate the agent against the environment, and send experiences data back to the parallel pool client. The client then uses its local GPU to compute the gradients from the experiences, then updates the network parameters and sends the updated parameters back to the workers, which continue to simulate the agent, with the new parameters, against the environment. Note that when using both parallel processing and GPU to train PPO agents, the workers use their local GPU to compute the advantages, and then send processed experience trajectories (which include advantages, targets and action probabilities) back to the client. See Also Functions Objects Related Examples More About
__label__pos
0.834826
ResourceQualifier class Defines the qualifiers associated with a ResourceCandidate. Syntax var resourceQualifier = Windows.ApplicationModel.Resources.Core.ResourceQualifier.getAt(); Attributes [MarshalingBehavior(Agile)] [Version(0x06020000)] Members The ResourceQualifier class has these types of members: Methods The ResourceQualifier class inherits methods from the Object class (C#/VB/C++). Properties The ResourceQualifier class has these properties. PropertyAccess typeDescription IsDefault Read-onlyIndicates whether this qualifier should be considered as a default match when no match is found. IsMatch Read-onlyIndicates whether a given qualifier for a given candidate matched the context when a named resource is resolved to a candidate for some given context. QualifierName Read-onlyThe name of the qualifier. QualifierValue Read-onlyThe value of the qualifier. Score Read-onlyA score that indicates how well the qualifier matched the context against which it was resolved.   Examples This example is based on scenario 13 of the Application resources and localization sample. See the sample for the more complete solution. // Create a ResourceContext. var resourceContext = new Windows.ApplicationModel.Resources.Core.ResourceContext(); // Set the specific context for lookup of resources. var qualifierValues = resourceContext.qualifierValues; qualifierValues["language"] = "en-US"; qualifierValues["contrast"] = "standard"; qualifierValues["scale"] = "140"; qualifierValues["homeregion"] = "021"; // Northern America // Resources actually reside within Scenario13 Resource Map. var resourceIds = [ '/Scenario13/languageOnly', '/Scenario13/scaleOnly', '/Scenario13/contrastOnly', '/Scenario13/homeregionOnly', '/Scenario13/multiDimensional', ]; var output = { str: "" }; resourceIds.forEach(function (resourceId) { renderNamedResource(resourceId, resourceContext, output); }); function renderNamedResource(resourceId, resourceContext, output) { output.str += "Resource ID " + resourceId + ":\n"; // Lookup the resource in the mainResourceMap (the one for this package). var namedResource = Windows.ApplicationModel.Resources.Core.ResourceManager.current.mainResourceMap.lookup(resourceId); // Return a ResourceCandidateVectorView of all possible resources candidates // resolved against the context in order of appropriateness. var resourceCandidates = namedResource.resolveAll(resourceContext); resourceCandidates.forEach(function (candidate, index) { renderCandidate(candidate, index, output); }); output.str += "\n"; } function renderCandidate(candidate, index, output) { // Get all the various qualifiers for the candidate (such as language, scale, contrast). candidate.qualifiers.forEach(function (qualifier) { output.str += "qualifierName: " + qualifier.qualifierName + "\n"; output.str += "qualifierValue: " + qualifier.qualifierValue + "\n"; output.str += "isDefault: "; output.str += (qualifier.isDefault) ? "true\n" : "false\n"; output.str += "isMatch: "; output.str += (qualifier.isMatch) ? "true\n" : "false\n"; output.str += "score: " + qualifier.score + "\n"; output.str += "\n"; }); } Requirements Minimum supported client Windows 8 [Windows Store apps only] Minimum supported server Windows Server 2012 [Windows Store apps only] Namespace Windows.ApplicationModel.Resources.Core Windows::ApplicationModel::Resources::Core [C++] Metadata Windows.winmd See also Application resources and localization sample     Build date: 11/16/2013 Show: © 2013 Microsoft. All rights reserved.
__label__pos
0.965387
Over a million developers have joined DZone. {{announcement.body}} {{announcement.title}} IndexedDB in Action: Complete Sample App DZone's Guide to IndexedDB in Action: Complete Sample App · Web Dev Zone · Free Resource Bugsnag monitors application stability, so you can make data-driven decisions on whether you should be building new features, or fixing bugs. Learn more. After a bit more sweat and tears, I've now got a "full" (if ugly) example of an IndexedDB application. It allows you to create and delete simple notes. You can view this demo here: http://www.raymondcamden.com/demos/2012/apr/30/test5.html Right now this demo is Firefox only. It doesn't work in Chrome because of the bug I mentioned in my earlier blog post. Here's the code - and again - I want to mention (and credit) the excellent MDN tutorial for making this easier to build. <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script> var db; // https://developer.mozilla.org/en/IndexedDB/Using_IndexedDB var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB; var IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction; $(document).ready(function() { var openRequest = indexedDB.open("notes",5); //handle setup openRequest.onupgradeneeded = function(e) { console.log("running onupgradeneeded"); var thisDb = e.target.result; //temp delete //thisDb.deleteObjectStore("note"); //Create Note if(!thisDb.objectStoreNames.contains("note")) { console.log("I need to make the note objectstore"); var objectStore = thisDb.createObjectStore("note", { keyPath: "id", autoIncrement:true }); objectStore.createIndex("title", "title", { unique: false }); } } openRequest.onsuccess = function(e) { db = e.target.result; db.onerror = function(event) { // Generic error handler for all errors targeted at this database's // requests! alert("Database error: " + event.target.errorCode); console.dir(event.target); }; displayNotes(); } function displayNotes() { var transaction = db.transaction(["note"], IDBTransaction.READ); var content="<ul>"; transaction.oncomplete = function(event) { console.log("All done!"); $("#noteList").html(content); }; transaction.onerror = function(event) { // Don't forget to handle errors! console.dir(event); }; var objectStore = transaction.objectStore("note"); objectStore.openCursor().onsuccess = function(event) { var cursor = event.target.result; if (cursor) { content += "<li data-key=\""+cursor.key+"\"><span class=\"label\">"+cursor.value.title+"</span>"; content += " <a class=\"delete\">[Delete]</a>"; content +="</li>"; cursor.continue(); } else { content += "</ul>"; console.log("Done with cursor"); } }; } $("#noteList").on("click", "a.delete", function(e) { e.preventDefault(); var thisId = $(this).parent().data("key"); console.log("delete "+thisId); var request = db.transaction(["note"], IDBTransaction.READ_WRITE) .objectStore("note") .delete(thisId); request.onsuccess = function(event) { displayNotes(); }; return false; }); $("#noteList").on("click", "li", function() { var thisId = $(this).data("key"); var transaction = db.transaction(["note"]); var objectStore = transaction.objectStore("note"); var request = objectStore.get(thisId); request.onerror = function(event) { console.dir(event); }; request.onsuccess = function(event) { var note = request.result; $("#noteDetail").html("<h2>"+note.title+"</h2><p>"+note.body+"</p>"); }; }); //TEMP TO REMOVE $("#addNoteButton").click(function() { var title = $("#title").val(); var body = $("#body").val(); var request = db.transaction(["note"], IDBTransaction.READ_WRITE) .objectStore("note") .add({title:title,body:body}); request.onsuccess = function(event) { $("#title").val(""); $("#body").val(""); displayNotes(); }; return false; }); }); </script> <style> #noteList li span.label { cursor:pointer; } a.delete { color:red; font-size:.6em; cursor: pointer; } </style> </head> <body> <h2>Notes</h2> <div id="noteList"></div> <div id="noteDetail"></div> <h2>Add Note</h2> <form> <input type="text" id="title" placeholder="Title" required><br/> <textarea id="body" placeholder="Enter body here..." required></textarea> <p> <button id="addNoteButton">Save Note</button> </p> </form> </body> </html> Nothing too scary, right? Using method chaining makes the code a bit more palatable and simpler to work with. After getting this working, I began to look at how you can retrieve data. I guess I shouldn't be surprised (and @thefalken pointed it out to me), but you are limited to primary key lookups only. So let me make sure that is clear. This is not a replacement for WebSQL. You cannot search. I guess - technically - you could search if you load everything up and iterate over it, but that's not really efficient. You can do range based filters, so for example, given a set of names I could go from Bob to Mary, but if I wanted to quickly find all the objects with property X set to Y and property Z set to A, then I'm out of luck. I was really thinking this was a Mongo-ish type solution, but I was wrong. I don't know about you - but this is kind of disappointing. Maybe my opinion will change, but right now I'm sad that WebSQL is being dumped for this.   Monitor application stability with Bugsnag to decide if your engineering team should be building new features on your roadmap or fixing bugs to stabilize your application.Try it free. Topics: Published at DZone with permission of Opinions expressed by DZone contributors are their own. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.urlSource.name }}
__label__pos
0.77975
Determines 80548 Find the map's scale, on which a line segment of 15 cm expresses the actual distance of 435 km between Paris and Bern. Correct answer: M =  1:2900000 Step-by-step explanation: a=435 km m=435 1000  m=435000 m b=15 cm m=15:100  m=0.15 m  M=b/a=0.15/4350000=1:2900000 Did you find an error or inaccuracy? Feel free to write us. Thank you! Tips for related online calculators Check out our ratio calculator. Do you want to convert length units? You need to know the following knowledge to solve this word math problem: Units of physical quantities: Themes, topics: Grade of the word problem:   We encourage you to watch this tutorial video on this math problem: video1 Related math problems and questions:
__label__pos
0.998035
Skip to Content Technical Articles Author's profile photo Mohammadhadi Shadmehr Simple and Useful FAQ Chatbot: 10 Tips to Get More Out of SAP Conversational AI FAQ Bot Step by Step (Sample Bot is Available) SAP Conversational AI is an NLP powered bot builder platform by SAP to improve user experience by a conversational approach. In this blog post I would like to share some of the tips and configuration guides I have learned and implemented recently which helped me to improve the user experience. There are two types of bots offering by SAP Conversational AI out of the box: FAQ bot and Action bot. FAQ bot is designed to be much simpler than the Action bot and to serve only FAQ cases. However, there are still a lot of configuration capabilities which can improve the overall user experience. Figure%201%20The%20two%20types%20of%20bots%20that%20CAI%20is%20currently%20offering.%20I%20am%20referring%20CAI%20Action%20bot%20to%20the%20left%20one%20and%20CAI%20FAQ%20bot%20to%20the%20right%20one. Figure 1 The two types of bots that SAP Conversational AI is currently offering. I am referring Action bot to the left one and FAQ bot to the right one. This is a screenshot from the current version of SAP Conversational AI.   Below, I will list several tips and configuration guides which I have tried recently collected from SAP colleagues and my personal experience. Please feel free to comment on them and share your experience in the comment section below.   Open Access Sample FAQ Bot I have also created an open sample FAQ bot to make all the configuration mentioned below available. You can access this bot using your SAP ID by this link. 💡Note: Currently, the link is providing access only to the build configuration and the data and bot test environment is only accessible for the collaborators. If you want to have a collaborator access, please let me know.   Perquisitions In this blog post it has been assumed that you have a basic understanding and hands-on experience of SAP Conversational AI. If that is not the case, please first visit the following learning materials:   Disclaimer The last update of this blog post has been done based on the last version of SAP Conversational AI until October 2021. If you are using a later version, some tips and screenshots might look different and need changes and adjustments. In addition, the following configuration and guides are provided as an example to show SAP Conversational AI capabilities and are not provided by SAP as official best practices.   1-    Use Keywords to Generate Initial Questions In case you have several distinct resources for answering the questions, and generating question and answers takes a massive effort, there are few options to facilitate it. One of them is to use the known keywords to generate few simple questions around them. For this you can create a new pair for each of your resources. As the questions you can use a list of specific keywords which are related to the resource. Then as the answer you can provide a link to your resource. The link can be provided using Markdown. Here for more details about markdown in SAP Conversational AI. Figure 2 Example usage of keywords for an Implementation Design Principles (IDP) document. It is better to set the resource title as the stared question.   2-    A Fourth Option for Disambiguation Questions (None of them) SAP Conversational AI FAQ bot by default has the capability to provide the three best match answers whenever the highest confidence score is below a certain value (90 percent by default). If your bot’s knowledge domain is not tightly bounded usually users faced situations that none of the providing options are answering their question. In this case, it will make the discussion continuing if you add another option like “None of Them”. By this additional option you can provide more helping answer if the user chose that option. It can be also beneficial during bot monitoring and we can easily track when the bot couldn’t provide appropriate options. How to? Step 1: Add a new option to the three questions available 1. Go to the Build tab 2. Click on faq skill 3. Go to the second Action Group (the Action Group which providing options as answer) 4. Click on edit 5. Click on Add Quick Reply 6. Add a name for your option 7. Add a functional word as value • Functional word could be a hashtag or any text which you know is not like any business word you have or anything that will trigger other skills 8. Save it Figure%203%20A%20fourth%20option%20has%20been%20added%20here%20as%20None%20of%20Them%20option Figure 3 A fourth option has been added here as None of Them option   Step 2: Add your hashtag (functional word) to your question answer pairs to make sure it will not interfere with other skills 1. Go to Train tab 2. Upload a new sample file name it “functional-words 💡Note: It can be any other name, or you can add this pair to the other files you already have 3. Add your functional word as question and any fallback message you want as an answer Figure%204%20A%20sample%20message%20for%20None%20of%20Them%20situation. Figure 4 A sample message for None of Them situation.   💡Note: Skills like small-talk and customer-satisfaction-reply have some predefined triggering words. If you are not using them, you can disable them to reduce the possibility of their false activation.   💡Note: If you want to avoid showing satisfaction questions after functional words, you can add conditions to your faq skill to exclude them when confidence score is high. Then have another action group to propose the answer if the user query is a functional word. You can find an example of it in the sample FAQ bot provided for this blog post.   3-    Only Show the Options Which Are Related Always showing the best 3 options is not looking good. Sometimes the confidence score for the second or the third option is very low and providing them to the user will cause unsatisfaction. In SAP Conversational AI we can configure our faq skill in a way to check the confidence score for all the options and only show the options which are more relevant. For that we can only create one Action Group with sophisticated customized message or just easily create three different Action Group for when we want to answer with three options, two options, or even one option. In this post I am going to describe the second approach.   How to? Step 1: Add conditions to the current option Action Group 1. Go to the Build tab 2. Click on faq skill 3. Add the additional conditions as presented in the screenshot below Figure%205%20Configuration%20for%20offering%203%20options Figure 5 Configuration for offering 3 options   Step 2: Add another Action Group for two options 1. Configure as shown below Figure%206%20Configuration%20for%20offering%202%20options Figure 6 Configuration for offering 2 options   Step 3: Add another Action Group for one option 1. Configure as shown below Figure%207%20Configuration%20for%20offering%20only%20one%20option Figure 7 Configuration for offering only one option   💡Note: Confidence scores configured here are based on the default scores. You may need to slightly adjust them based on your business case. You can find your best fit by monitoring your user log and see if any adjustment is needed.   4-    Show More Options if the Confidence Score of the Next Options is High Enough Sometimes the confidence score for the first option is higher than 90% but the second or third option also have a very high confidence score. If your questions have a lot of similarities and overlap it might happen more frequently. In this case you can create a new Action Group to provide other options as an additional message if the confidence score is high enough for the other options.   How to? 1. Go to the Build tab 2. Click on faq skill 3. Add a new Action Group 4. Set the conditions and message as shown below to propose one additional option SAP%20CAI%20Proposing%20additional%20option%20when%20the%20confidence%20score%20is%20high%20enough Figure 8 Proposing additional option when the confidence score is high enough   💡Note: The second if-statement is to exclude the condition that we will propose two additional options   5. Add another new Action Group 6. Set the conditions and message as shown below to propose two additional options   Figure%209%20Proposing%20two%20additional%20options%20when%20confidence%20score%20is%20high Figure 9 Proposing two additional options when confidence score is high   💡Note: As the faq answers are sorted by confidence score, we do not need to check the confidence score of the other option.   5-    Add Few General Questions to Make the Bot More Fun In addition to configuring welcome message and messages in small-talk Skill, it would improve the user experience if your bot is also capable of answering some general questions. Some examples to be added as question answer pairs are shown below: Figure%2010%20Examples%20for%20general%20question%20answer%20pairs. Figure 10 Examples for general question answer pairs.   💡Note: Too many small-talk capabilities also may cause negative consequences. The faq skill might offer those questions during disambiguation as well. Might not appear appropriate, if a potential disambiguation option would be “Tell me a joke”.   6-    Call Search APIs to Enrich your Fallbacks There are some points in the chat flow that your bot cannot provide the desired answer like when the confidence score is lower than 5%, when the user has been clicked on “None of the above” option, or when the user had a negative feedback caught in customer-satisfaction-reply skill. In this situation, one of the possible additional services could be providing a search result based on the user initial query. We can do this in SAP Conversational AI by calling APIs and formatting the responses. Below you can see an example of using SAP Search API to provide search result from SAP open access information when the confidence score is lower than 5%. Figure%2011%20Providing%20search%20result%20when%20confidence%20score%20is%20low%2C%20showing%20in%20the%20CAI%20Chat%20Preview. Figure 11 Providing search result when confidence score is low, showing in the SAP Conversational AI chat preview.   As SAP Search API requires a JWT token for search query, we first need to consume an API to get the token and save it in the memory and then call another API to post our query and get the search result. At the end we just need to format the response body and show the user few search results (e.g., the first five titles and links).   💡Note: To describe it in more details please read my second blog post, Call SAP Search APIs in SAP Conversational AI to Enrich your Fallbacks.   7-    Like, Dislike Button as a Feedback for All Provided Answers SAP Conversational AI FAQ bot is providing a customer-satisfaction-prompt skill out of the box. Here we just want to make it looks a bit simpler and more user friendly. Therefore, instead of asking a question about user satisfaction and provide buttons as yes and no, we are going to just show like and dislike button after providing each answer. In the following sample there is also a heart button which can be mapped to a special answer from your bot, and you may track it using the SAP Conversational AI Monitor tab to get energized with the users’ feedback. Figure%2018%20New%20feedback%20style%20showing%20in%20the%20CAI%20Chat%20Preview. Figure 18 New feedback style showing in the SAP Conversational AI chat preview.   How to? Step 1: Create custom message in customer-satisfaction-prompt skill 1. Go to the Build tab 2. Click on customer-satisfaction-prompt skill 3. Click on Choose a Message Type 4. Select Custom 5. Add the configuration shown below Figure%2019%20A%20sample%20custom%20message%20for%20customer%20satisfaction%20question Figure 19 A sample custom message for customer satisfaction question   6. Delete the default message   💡Notes: 1. In some user interfaces like JAM there would need to include an empty title in the custom message to show the buttons. Test if your user interface is working without it, delete the “title” property from the custom message to make it looks better. 2. To include the heart button, you need to define a special function word or hashtag like #SPECIAL_BIGHEART and add it to your functional words (described in section 2) with a specific response message to answer your user’s feedback.   Figure%2020%20Add%20a%20new%20pair%20to%20your%20functional%20words%20to%20reply%20when%20user%20is%20sending%20heart%20to%20you. Figure 20 Add a new pair to your functional words to reply when user is sending heart to you. 8-    Negative List There are some cases that you may need to create a Negative List in your bot to make a more meaningful user interaction. For instance: • In case you know there will be few topics that will raise soon but your bot is not covering the related information • In case your bot is getting frequent unrelated questions   In these cases, it makes sense to add a few pairs of questions and an answer indicating that your bot is not covering those topics yet or point the user to another help desk. Figure%2021%20An%20example%20of%20negative%20list%20from. Figure 21 An example of negative list from.   9-    A Regression Test Prepare a regression test, either manually or automatically to see if your new changes are not affecting your previous skills and setup. For instance, you can have a list of questions for each condition e.g., high confidence answer, three options, two options, and fallback to see if the provided answer is still what you have expected. 💡Note: There is a new Test feature in the Enterprise edition of the SAP Conversational AI which is helping to create your test easily. This feature is available for both action and FAQ bots. More info here.   10-  Deep Link to the Resources If in the answers, you want to point to a resource like a pdf, it is always better to provide a direct link to the section or page (or minute of a video) if it is possible. Users usually get lost when they are directed from a bot to a big resource. A direct link to the desired part of the resource can save user’s time and increase user satisfaction. For instance, in pdf documents usually there is an option to make a direct link to each specific page by adding #page=<pagenumber> at the end of the URL. You can also generate your pdf files in a way to consider the section as destinations (possible in Microsoft Office) and create a direct link to the destination by adding #[destination name] at the end of the URL. More info about pdf deep link here.   Other Architectures SAP Conversational AI FAQ bot is generally the best SAP offering when you want to implement an FAQ bot. It is simple and ready to use after uploading a list of pair of question and answers. However, in some cases there are other bot architectures to be recommended.   For instance, if the knowledge boundary that your bot is going to represent is tightly limited, using an Action bot can result same or better performance which is also providing wider configuration and skill capabilities. In this case you just need to define intends as your questions which can trigger a skill to answer the question. This can help you to have more control on the chat-flow.   Moreover, if you are thinking of having two different bots in one bot or benefit from the both world of FAQ bot and Action bot, you can call SAP Conversational AI bots inside SAP Conversational AI bots in a secure way using API service and OAuth-based Authentication. For more information, look at this SAP blog post written by Harinder Singh Batra.   Some Remaining Challenges There are still some challenges we are facing using SAP Conversational AI FAQ bot. Please feel free to add your comments on them and discuss on possible solutions or any similar experience you had. • Facilitate FAQ generation out of documents: • Generating FAQs quickly and reduce the work to create those as good as possible. • Update FAQs based on resource updates: • If you are creating an FAQ bot to answer questions based on several resources, you might have this challenge to keep your bot updated with lower maintenance cost while the resources are updating.   Acknowledgments This was my first SAP blog post, and it would have never happened if SAP colleagues didn’t have such an openness and helping culture. To get to this point, there were several SAP colleagues who openly shared their experience and knowledge with me and helped me to realize SAP Conversational AI capabilities. Therefore, I would like to thank Gerald Reinhard, SuccessFactors Product Advisory and Partner Success team, Albert Neumueller, Patrick Heinze, Abishek Suvarna, Paul Tormey, Leigha Aherne, Giacomo Gasperini, David Duncan, and several other colleagues I may have missed.   More Info Here you can find more SAP Conversational AI related resources and communication channels to ask your questions:   Follow Mohammadhadi Shadmehr on LinkedIn Assigned Tags 3 Comments You must be Logged on to comment or reply to a post. Author's profile photo Marcus Echter Marcus Echter Great blog Mohammadhadi! Author's profile photo Patrick Blume Patrick Blume Nice blog, Mohammadhadi! As a newbie to FAQ chatbots, I do have a simple question: With your experiences what is the most easiest way to update FAQ question+answer pairs? Keeping the upload CSV file updated, provide updates to the CSV File and upload the CSV file from time to time? (and delete the one which was previously uploaded) OR use the CSV file upload only for an initial upload and perform any changes in SAP Conversational AI directly? Author's profile photo Mohammadhadi Shadmehr Mohammadhadi Shadmehr Blog Post Author Sorry Patrick for missing your question for a very long time!!! Generally it depends on who and how wanna use and maintain it. But in case of manuall updates personally I found the dashboard much easier. It can even have accessed by different users and it has a great versioning capabilities.
__label__pos
0.654625
Hotmath Math Homework. Do It Faster, Learn It Better. Linear Pair As mathematicians, we deal with all kinds of pairs. These include ordered pairs, collinear points, inverse numbers, and reciprocals. But what about linear pairs? What exactly is a linear pair, and why is this concept important in the field of mathematics? Let's find out: What is a linear pair? A linear pair is formed when two lines intersect, forming two adjacent angles. Here is a picture of ordered pairs: As you can see, there are a number of ordered pairs in this picture. They include: You might have also noticed that each of these pairs is supplementary, which means that their angles add up to exactly 180 degrees. This also means that linear pairs exist on straight lines. You should always know that even though all linear pairs are adjacent angles, the same is not true in reverse: Not all adjacent angles are linear pairs. Topics related to the Linear Pair Collinear Points Ordered Pair Perimeter, Area and Volume Flashcards covering the Linear Pair Basic Geometry Flashcards Common Core: High School - Geometry Flashcards Practice tests covering the Linear Pair Common Core: High School - Geometry Diagnostic Tests Intermediate Geometry Diagnostic Tests Set your student up for success with Hotmath Tutoring helps students lay solid foundations and master early concepts like linear pairs. With a tutor at their side, your student can steadily build confidence in their math skills, making it easier for them to move on to more advanced concepts in later years. Reach out to one of our Educational Directors today, and we can pair your student with a tutor that matches their schedule -- no matter how busy it might be. Varsity Tutors also matches your student with tutors that fit with their unique learning goals, so reach out now!
__label__pos
0.997658
Search 80,000+ tutors FIND TUTORS Ask a question 0 0 what is the solution to this linear system? Tutors, please sign in to answer this question. 2 Answers multiply the first eqn by 2 2(x + y = 2) gives 2x + 2y = 4 add to 2nd eqn to eliminate the y 5x = -5 so x = -1 substitute in either original eqn  using the 1st eqn, y = 2-x = 2-(-1) = 3       Hi Tracey; x+y=2 3x-2y=-9 The coefficient of x in the second equation is 3. The coefficient of y in the second equation is -2. Let's take the first equation and multiply both sides by either coefficient.  I randomly choose 3... 3(x+y)=(2)(3) 3x+3y=6   Let's subtract one equation from the other... 3x+3y=6 -(3x-2y=-9) 0+5y=15 Please remember that subtracting a negative number is the same as adding a positive number... 3y--2y=3y+2y=5y 6--9=6+9=15 5y=15 Let's divide both sides by 5... (5y)/5=15/5 y=3   Let's input this result into either equation to establish the value of x.  I randomly choose the first.  I will use its original form... x+y=2 x+3=2 Let's subtract 3 from both sides... x+3-3=2-3 x=-1   Let's take the second equation and verify the results... 3x-2y=-9 [(3)(-1)]-[(2)(3)]=-9 -3-6=-9 -9=-9  
__label__pos
0.986344
Search Projects Saturday, February 28, 2015 Journey of Space Shuttle or Rocket Computer graphics is a wide area mostly used for Scientific research, Special programs, Filming or photography etc. One prominent are of graphics in computer is the are of space. Knowing the fact that we have Space Shuttle or Rocket which help go in space either it human or the man made satellite. This post is dedicate to Journey of Space Shuttle or Rocket with computer graphics programs in c cpp or c++. In this simple graphics in c++ we use the logic of launching a Space Shuttle or Rocket, it's journey into space crossing the Mars. Different stages of Rocket propulsion is avoided due to it's complication. This computer graphics program in c++, simply demonstrate the Space Shuttle launch, it's way to leave the earth entering space and journey into the space. Through out the journey, the background must changes. This start from the base of launch on earth - having building and communication tower shown in background, then the sky coloured as blue(sky blue) then in space background have dark colour with stars. At one of the stage in space, a planet (called as mars here) can be seen crossing the rocket. Programming specification The logic behind the Journey of Space Shuttle or Rocket computer graphics program in c++ is little complicated but easy to understand. All the objects created quite easily with primitive functions, which is easy to code. While there are two type of rocket -  static and moveable. Separate functions has been defined for them. The most important code is the programming of fume, the rocket burning fumes. Without it the whole graphics program will look dull. Future Enhance It would be tough to have small flag of India on the rocket but you can write India in letter on the rocket. The rocket propulsion has many stages that can also be added in future to the computer graphics programs in cpp. One key issue with the program is that it's not self terminated, that means in space it will run till program is close. Manual closing can be remove with self close. No comments: Post a Comment
__label__pos
0.854009
Utilisation du kit de ressources SQLAlchemy Snowflake avec le connecteur Python Snowflake SQLAlchemy s’exécute sur le connecteur Snowflake pour Python en tant que dialecte pour relier une base de données Snowflake et des applications SQLAlchemy. Dans ce chapitre : Conditions préalables Connecteur Snowflake pour Python La seule exigence pour Snowflake SQLAlchemy est le connecteur Snowflake pour Python. Cependant, le connecteur n’a pas besoin d’être installé, car installer Snowflake SQLAlchemy installe automatiquement le connecteur. Frameworks d’analyse de données et d’application Web (facultatif) Snowflake SQLAlchemy peut être utilisé avec Pandas, Jupyter et Pyramid qui fournissent des niveaux plus élevés de frameworks d’application pour l’analyse de données et les applications Web. Cependant, la création d’un environnement de travail à partir de zéro n’est pas une tâche simple, en particulier pour les utilisateurs débutants. L’installation des frameworks nécessite des compilateurs et des outils C, et choisir les versions et les outils adéquats peut s’avérer périlleux, ce qui peut décourager les utilisateurs d’utiliser des applications Python. Un moyen plus simple de construire un environnement est Anaconda qui fournit une pile technologique complète et précompilée pour tous les utilisateurs, y compris pour les experts non-Python, comme les analystes de données et les étudiants. Pour obtenir les instructions d’installation d’Anaconda, voir la documentation d’installation d’Anaconda. Le pack Snowflake SQLAlchemy peut alors être installé sur Anaconda en utilisant pip. Installation de Snowflake SQLAlchemy Le pack Snowflake SQLAlchemy peut être installé à partir du dépôt public PyPI en utilisant la commande pip : pip install --upgrade snowflake-sqlalchemy pip installe automatiquement tous les modules requis, dont le connecteur Snowflake pour Python. Les notes du développeur sont hébergées avec le code source sur GitHub. Vérification de votre installation 1. Créez un fichier (par exemple validate.py) qui contient le code exemple Python suivant qui se connecte à Snowflake et affiche la version Snowflake : #!/usr/bin/env python from sqlalchemy import create_engine engine = create_engine( 'snowflake://{user}:{password}@{account_identifier}/'.format( user='<user_login_name>', password='<password>', account_identifier='<account_identifier>', ) ) try: connection = engine.connect() results = connection.execute('select current_version()').fetchone() print(results[0]) finally: connection.close() engine.dispose() 2. Remplacez <nom_connexion_utilisateur>, <mot_de_passe> et <identificateur_de_compte> par les valeurs correspondantes pour votre compte et utilisateur Snowflake. Pour plus de détails, voir Paramètres de connexion (dans ce chapitre). 3. Exécutez l’exemple de code. Par exemple, si vous avez créé un fichier nommé validate.py : python validate.py La version Snowflake (par ex. 1.48.0) doit être affichée. Paramètres et comportements spécifiques à Snowflake Dans la mesure du possible, Snowflake SQLAlchemy fournit des fonctionnalités compatibles pour les applications SQLAlchemy. Pour plus d’informations sur l’utilisation de SQLAlchemy, voir la documentation SQLAlchemy. Cependant, Snowflake SQLAlchemy fournit également des paramètres et un comportement spécifiques à Snowflake qui sont décrits dans les sections suivantes. Paramètres de connexion Paramètres requis Snowflake SQLAlchemy utilise la syntaxe de chaîne de connexion suivante pour se connecter à Snowflake et lancer une session : 'snowflake://<user_login_name>:<password>@<account_identifier>' Où : • <nom_connexion_utilisateur> est le nom d’utilisateur de votre utilisateur Snowflake. • <mot_de_passe> est le mot de passe de votre utilisateur Snowflake. • <identificateur_de_compte> est votre identificateur de compte . Voir Identificateurs de compte. Note N’incluez pas le nom de domaine Snowflake snowflakecomputing.com dans l’identificateur de votre compte. Snowflake ajoute automatiquement le nom de domaine à votre identificateur de compte pour créer la connexion requise. Paramètres de connexion supplémentaires Vous pouvez éventuellement inclure les informations suivantes à la fin de la chaîne de connexion (après <nom_compte>) : 'snowflake://<user_login_name>:<password>@<account_identifier>/<database_name>/<schema_name>?warehouse=<warehouse_name>&role=<role_name>' Où : • <nom_base_de_données> et <nom_schéma> sont la base de données initiale et le schéma de la session Snowflake, séparés par des barres obliques (/). • warehouse=<nom_entrepôt> et role=<nom_rôle>' sont l’entrepôt et le rôle initiaux de la session, spécifiés sous forme de chaînes de paramètres, séparés par des points d’interrogation (?). Note Après la connexion, la base de données initiale, le schéma, l’entrepôt et le rôle spécifiés dans la chaîne de connexion peuvent toujours être modifiés pour la session. Configuration du serveur proxy Les paramètres du serveur proxy ne sont pas pris en charge. Utilisez plutôt des variables d’environnement prises en charge pour configurer un serveur proxy. Pour plus d’informations, voir Utilisation d’un serveur proxy. Exemples de chaîne de connexion L’exemple suivant appelle la méthode create_engine avec le nom d’utilisateur testuser1, le mot de passe 0123456, l’identificateur de compte myorganization-myaccount, la base de données testdb, le schéma public, l’entrepôt testwh et le rôle myrole : from sqlalchemy import create_engine engine = create_engine( 'snowflake://testuser1:0123456@myorganization-myaccount/testdb/public?warehouse=testwh&role=myrole' ) Par souci de facilité, vous pouvez utiliser la méthode snowflake.sqlalchemy.URL pour construire la chaîne de connexion et vous connecter à la base de données. L’exemple suivant construit la même chaîne de connexion que l’exemple précédent : from snowflake.sqlalchemy import URL from sqlalchemy import create_engine engine = create_engine(URL( account = 'myorganization-myaccount', user = 'testuser1', password = '0123456', database = 'testdb', schema = 'public', warehouse = 'testwh', role='myrole', )) Ouverture et fermeture de la connexion Ouvrez une connexion en exécutant engine.connect() ; évitez d’utiliser engine.execute(). # Avoid this. engine = create_engine(...) engine.execute(<SQL>) engine.dispose() # Do this. engine = create_engine(...) connection = engine.connect() try: connection.execute(<SQL>) finally: connection.close() engine.dispose() Note Assurez-vous de fermer la connexion en exécutant connection.close() avant engine.dispose() ; sinon, le collecteur Python Garbage supprime les ressources nécessaires pour communiquer avec Snowflake, empêchant le connecteur Python de fermer correctement la session. Si vous prévoyez d’utiliser des transactions explicites, vous devez désactiver l’option d’exécution AUTOCOMMIT dans SQLAlchemy. Par défaut, SQLAlchemy active cette option. Lorsque cette option est activée, les instructions INSERT, UPDATE et DELETE sont automatiquement validées lors de leur exécution, même si ces instructions sont exécutées dans une transaction explicite. Pour désactiver AUTOCOMMIT, transmettez autocommit=False à la méthode Connection.execution_options() . Par exemple : # Disable AUTOCOMMIT if you need to use an explicit transaction. with engine.connect().execution_options(autocommit=False) as connection: try: connection.execute("BEGIN") connection.execute("INSERT INTO test_table VALUES (88888, 'X', 434354)") connection.execute("INSERT INTO test_table VALUES (99999, 'Y', 453654654)") connection.execute("COMMIT") except Exception as e: connection.execute("ROLLBACK") finally: connection.close() engine.dispose() Comportement d’auto-incrémentation L’auto-incrémentation d’une valeur nécessite l’objet Sequence . Inclure l’objet Sequence dans la colonne de clé primaire pour incrémenter automatiquement la valeur à chaque nouvel enregistrement inséré. Par exemple : t = Table('mytable', metadata, Column('id', Integer, Sequence('id_seq'), primary_key=True), Column(...), ... ) Traitement de la casse de nom d’objet Snowflake stocke tous les noms d’objets insensibles à la casse en majuscules. En revanche, SQLAlchemy considère que tous les noms d’objet en minuscules sont insensibles à la casse. Snowflake SQLAlchemy convertit la casse du nom de l’objet pendant la communication au niveau du schéma, (c’est-à-dire pendant la réflexion de la table et de l’index). Si vous utilisez des noms d’objet en majuscules, SQLAlchemy suppose qu’ils sont sensibles à la casse et qu’ils contiennent des guillemets. Ce comportement causera des discordances avec les données du dictionnaire de données reçu de Snowflake. À moins que les noms des identificateurs n’aient vraiment été créés comme étant sensibles à la casse en utilisant des guillemets, (par exemple "TestDb"), tous les noms en minuscules doivent être utilisés du côté SQLAlchemy. Prise en charge de l’index Snowflake n’utilise pas d’index. Par conséquent, Snowflake SQLAlchemy n’en utilise pas non plus. Prise en charge du type de données NumPy Snowflake SQLAlchemy prend en change la liaison et la collecte de types de données NumPy. La liaison est toujours prise en charge. Pour activer la récupération des types de données NumPy , ajoutez numpy=True aux paramètres de connexion. Les types de données NumPy suivants sont pris en charge : • numpy.int64 • numpy.float64 • numpy.datetime64 L’exemple suivant montre l’aller-retour de données numpy.datetime64 : import numpy as np import pandas as pd engine = create_engine(URL( account = 'myorganization-myaccount', user = 'testuser1', password = 'pass', database = 'db', schema = 'public', warehouse = 'testwh', role='myrole', numpy=True, )) specific_date = np.datetime64('2016-03-04T12:03:05.123456789Z') connection = engine.connect() connection.execute( "CREATE OR REPLACE TABLE ts_tbl(c1 TIMESTAMP_NTZ)") connection.execute( "INSERT INTO ts_tbl(c1) values(%s)", (specific_date,) ) df = pd.read_sql_query("SELECT * FROM ts_tbl", engine) assert df.c1.values[0] == specific_date Métadonnées de colonne de cache SQLAlchemy fournit l’API d’inspection d’exécution pour obtenir les informations d’exécution sur les différents objets. L’un des cas d’utilisation classiques est la récupération de toutes les tables et de leurs métadonnées de colonne dans un schéma afin de construire un catalogue de schémas. Par exemple, alembic, en plus de SQLAlchemy, gère les migrations de schéma de base de données. Un flux de pseudo-code se présente comme suit : inspector = inspect(engine) schema = inspector.default_schema_name for table_name in inspector.get_table_names(schema): column_metadata = inspector.get_columns(table_name, schema) primary_keys = inspector.get_primary_keys(table_name, schema) foreign_keys = inspector.get_foreign_keys(table_name, schema) ... Dans ce flux, cela peut prendre un certain temps car les requêtes s’exécutent sur chaque table. Les résultats sont mis en cache, mais l’obtention des métadonnées de colonne est onéreuse. Pour atténuer le problème, Snowflake SQLAlchemy prend un indicateur cache_column_metadata=True tel que toutes les métadonnées de colonne pour toutes les tables sont mises en cache lorsque get_table_names est appelé. Le reste de get_columns, get_primary_keys et get_foreign_keys peut exploiter le cache. engine = create_engine(URL( account = 'myorganization-myaccount', user = 'testuser1', password = 'pass', database = 'db', schema = 'public', warehouse = 'testwh', role='myrole', cache_column_metadata=True, )) Note L’utilisation de la mémoire augmentera à mesure que toutes les métadonnées des colonnes associées à l’objet Inspector seront mises en cache. N’utilisez l’indicateur que si vous avez besoin d’obtenir toutes les métadonnées de colonne. Prise en charge de VARIANT, ARRAY et OBJECT Snowflake SQLAlchemy prend en charge la récupération des types de données VARIANT, ARRAY et OBJECT. Tous les types sont convertis en str dans Python afin que vous puissiez les convertir en types de données natifs en utilisant json.loads. Cet exemple montre comment créer une table incluant les colonnes de type de données VARIANT, ARRAY et OBJECT. from snowflake.sqlalchemy import (VARIANT, ARRAY, OBJECT) ... t = Table('my_semi_structured_datatype_table', metadata, Column('va', VARIANT), Column('ob', OBJECT), Column('ar', ARRAY)) metdata.create_all(engine) Pour récupérer les colonnes de type de données VARIANT, ARRAY et OBJECT et les convertir en types de données Python natifs, récupérez les données et appelez la méthode json.loads comme suit : import json connection = engine.connect() results = connection.execute(select([t])) row = results.fetchone() data_variant = json.loads(row[0]) data_object = json.loads(row[1]) data_array = json.loads(row[2]) Prise en charge de CLUSTER BY Snowflake SQLAlchemy prend en charge le paramètre CLUSTER BY pour les tables. Pour plus d’informations sur ce paramètre, voir CREATE TABLE. Cet exemple montre comment créer une table avec deux colonnes, id et name, comme clé de clustering : t = Table('myuser', metadata, Column('id', Integer, primary_key=True), Column('name', String), snowflake_clusterby=['id', 'name'], ... ) metadata.create_all(engine) Prise en charge d’Alembic Alembic est un outil de migration de base de données en plus de SQLAlchemy. Snowflake SQLAlchemy fonctionne en ajoutant le code suivant à alembic/env.py pour qu’Alembic puisse reconnaître Snowflake SQLAlchemy. from alembic.ddl.impl import DefaultImpl class SnowflakeImpl(DefaultImpl): __dialect__ = 'snowflake' Voir la documentation d’Alembic pour des informations sur l’utilisation générale. Revenir au début
__label__pos
0.756292
Is There A Difference... Discussion in 'Mac Programming' started by Darkroom, Sep 12, 2008. 1. Darkroom Expand Collapse Guest Darkroom Joined: Dec 15, 2006 Location: Montréal, Canada #1 ... between C++ and Objective-C? if so, what are their differences?   2. robbieduncan Expand Collapse Moderator emeritus robbieduncan Joined: Jul 24, 2002 Location: London #2 Yes. They are entirely different languages with different syntax, compilers, "standard" libraries and capabilities. I can't even thing where to start listing the differences as they are not related to each other by much more than both being based off C (although Objective-C is a strict C superset and C++ isn't) and both being object oriented.   3. Cromulent Expand Collapse macrumors 603 Cromulent Joined: Oct 2, 2006 Location: The Land of Hope and Glory #3 One of the major ones is that C++ supports multiple inheritance while Objective-C does not.   4. robbieduncan Expand Collapse Moderator emeritus robbieduncan Joined: Jul 24, 2002 Location: London #4 And Objective-C has categories which C++ doesn't. Edit to add: This question is a bit like saying "I'm an English speaker. Are French and German the same?"   5. sushi Expand Collapse Moderator emeritus sushi Joined: Jul 19, 2002 Location: キャンプスワ&# #5 Good analogy.   6. Cromulent Expand Collapse macrumors 603 Cromulent Joined: Oct 2, 2006 Location: The Land of Hope and Glory #6 I could be quite pedantic with that but I'll save it for myself :).   7. sushi Expand Collapse Moderator emeritus sushi Joined: Jul 19, 2002 Location: キャンプスワ&# #7 You are most kind! :)   8. robbieduncan Expand Collapse Moderator emeritus robbieduncan Joined: Jul 24, 2002 Location: London #8 What? And deprive of us of a tiny amount of amusement or interest late on a Friday afternoon? I say post it...   9. lee1210 Expand Collapse macrumors 68040 lee1210 Joined: Jan 10, 2005 Location: Dallas, TX #9 To confuse things further, you can mix Objective-C and C++ (this is generally referred to as Objective-C++). We have had many (sometimes heated) discussions about Objective-C and C++ here, the most prolific of which is here: http://forums.macrumors.com/showthread.php?t=246143 I won't have too much to add to what people have already stated, but at the basest level the languages are related only in-so-far as they were based (to different degrees) on C. If you look at a routine dealing with primitives (and structs, which I would consider primitive) in C++ and Objective-C they will look similar, but if you look at something dealing with either language's object models, they will look totally different (although now, with the ability to access properties in Objective-C 2.0 using dot notation, that would look a little more similar). I guess to speak in broad terms, the main differences are the object models. Most of the major differences come from how objects are defined, how their properties are accessed, how their behaviors/functions/methods are invoked, inheritance models, abstract objects vs. protocols, etc. Other "smaller" differences like operator precedence are really differences in C and C++, and that difference was just inherited from C by Objective-C. -Lee   10. lee1210 Expand Collapse macrumors 68040 lee1210 Joined: Jan 10, 2005 Location: Dallas, TX #10 Hey, for some of us it's the middle of the morning!   11. robbieduncan Expand Collapse Moderator emeritus robbieduncan Joined: Jul 24, 2002 Location: London #11 Sorry, I'm going home in 5 minutes :p   12. Darkroom Expand Collapse thread starter Guest Darkroom Joined: Dec 15, 2006 Location: Montréal, Canada #12 so there's no benefit to studying C++ for mac programming? advancing from studying C to Objective-C is a good path to follow?   13. robbieduncan Expand Collapse Moderator emeritus robbieduncan Joined: Jul 24, 2002 Location: London #13 That's basically correct yes. Although if you are looking at the wider world C++ is use a lot more than Objective-C.   14. lee1210 Expand Collapse macrumors 68040 lee1210 Joined: Jan 10, 2005 Location: Dallas, TX #14 Cocoa is the chosen path going forward, so Objective-C it is. If you want to branch out Apple seems to have blessed python and ruby by providing a Cocoa bridge in Leopard, making them "first class" languages on OS X. If you just interested in diversifying and getting experience with a different language, one of those might be good. -Lee   15. Darkroom Expand Collapse thread starter Guest Darkroom Joined: Dec 15, 2006 Location: Montréal, Canada #15 do ruby and python have any advantages over cocoa?   16. gnasher729 Expand Collapse macrumors G5 gnasher729 Joined: Nov 25, 2005 #16 There isn't "no benefit". Let's say you learned C. Most things you learned in C are useful in C++ and Objective-C as well. Then at some point you'd need to learn about object-oriented programming. You could learn Objective-C, or C++, or Java (with Java, the C knowledge is less helpful). You learn two things: The syntax of the language, and the concepts of object-oriented programming. If you know object-oriented programming, then learning to use either C++ or Objective-C in a useful way is much easier. There is also the question whether you are going to share code between a Macintosh and a non-Macintosh application. In that case it is likely that the user interface on the Mac is written with Cocoa in Objective-C, and the Linux or Windows user interface is written with different libraries in a different language. However, a lot of the code that does the actual work could be written in a different language, for example C++.   17. lee1210 Expand Collapse macrumors 68040 lee1210 Joined: Jan 10, 2005 Location: Dallas, TX #17 Cocoa is an Objective-C API, not a language. As of Leopard you can now access the Cocoa API from python or ruby. I don't consider any language superior to any other. The only comparison is for the task at hand. If you're doing something that is well-suited to Objective-C, use that. If you're doing something well-suited to python or ruby, or you are more comfortable performing the task with those tools, go for it. -Lee   18. kainjow Expand Collapse Moderator emeritus kainjow Joined: Jun 15, 2000 #18 Ruby/Python are languages. Cocoa is a library of code accessible via Objective-C, but you can also access it via Ruby and Python (and others) in Leopard (and in Tiger via third-parties). C++ is still useful if you're doing Mac programming. A lot of open source code you may want to use is written in C++. Also a lot of older programs for the Mac still use C++ underneath. Also it's great for writing cross platform code. Put most of your logic in C++ and write native UI wrappers around it. I will say though, I see more C code than C++. I'm not really sure why that is. Anyone want to give some insight into that?   19. lazydog Expand Collapse macrumors 6502a Joined: Sep 3, 2005 Location: Cramlington, UK #19 I think I have to disagree with the others on this… if you know C++ then you'll appreciate how powerful Objective-C++ is/can be. But if you don't already know C++ then I would steer clear, at least until you've learned Objective-C. b e n   20. robbieduncan Expand Collapse Moderator emeritus robbieduncan Joined: Jul 24, 2002 Location: London #20 In library code or self-contained in applications. It makes sense for libraries as C is a kind of lowest common denominator: you can call C libraries from almost any language. Not really so of C++ libraries. Self contained in apps is harder to explain. I think it's possible because a lot of the more old-school programmers learnt C and then picked up C++ afterwards and the old C habits die hard. So you end up seeing C++ that is really more like procedural C.   21. Darkroom Expand Collapse thread starter Guest Darkroom Joined: Dec 15, 2006 Location: Montréal, Canada #21 that actually explains a lot... thanks... and thanks for all the comments everyone.   Share This Page
__label__pos
0.791151
15 votes 3answers 708 views Writing { and } to a file with LaTeX How can the special characters { and } be written literally to an external file in LaTeX, without being balanced? Obviously the following does not work: \immediate\write\my@outfile{{} ... 9 votes 3answers 256 views How can I write % into a file? How can I write % into an auxiliary file? % will not work, because LaTeX thinks that I start a comment with it (in the main file, not in the auxiliary file!), and \% will write \% into the file. How ...
__label__pos
0.991828
(j3.2006) Is a pointer a data object? Van Snyder Van.Snyder Tue Jan 26 21:54:24 EST 2016 Is a pointer a data object, or is only its target (if it is associated) a data object? 5.3.1.4 suggests it's not a data object because it claims a pointer can be associated with different data objects during execution. Pointers cannot be associated with pointers -- only with their targets. If a pointer is not a data object, 1.3.44 might need some refinement to make it clear that a data entity is the result of execution of a function reference, or the target of the result of execution of a function reference if the result is a pointer. Also, data entity and data object are circularly defined: data object (1.3.45) -> variable (1.3.54) -> data entity (1.3.44) -> data object (1.3.45). Is that a problem? More information about the J3 mailing list
__label__pos
0.999269
Education.com Try Brainzy Try Plus Triangle Practice Test By — McGraw-Hill Professional Updated on Oct 3, 2011 Review triangle facts about: Triangle Practice Test Directions: A good score is eight correct. 1. Suppose there are three triangles, called Δ ABC , Δ DEF , and Δ PQR . If Δ ABC ≅ Δ DEF and Δ DEF ≅ Δ PQR , we can surmise that Δ ABC and Δ PQR are (a) directly congruent (b) directly similar, but not directly congruent (c) inversely congruent (d) not related in any particular way 2. Suppose there are two triangles, called Δ ABC and Δ DEF . If these two triangles are directly similar, then we can be certain that (a) ∠ ABC and ∠ DFE have equal measure (b) ∠ BCA and ∠ EFD have equal measure (c) ∠ CAB and ∠ FED have equal measure (d) both triangles are equilateral 3. Suppose a given triangle is directly congruent to its mirror image. We can be absolutely certain that this triangle is (a) equilateral (b) isosceles (c) acute (d) obtuse 4. Suppose a triangle has sides of lengths s, t , and u , in centimeters (cm). Which of the following situations represents a right triangle? Assume the lengths are mathematically exact (no measurement error). (a) s = 2 cm, t = 3 cm, u = 4 cm (b) s = 4 cm, t = 5 cm, u = 7 cm (c) s = 6 cm, t = 8 cm, u = 10 cm (d) s = 7 cm, t = 11 cm, u = 13 cm 5. Suppose there are two triangles, called Δ ABC and Δ DEF . Also suppose that side DE is twice as long as side AB , side EF is twice as long as side BC , and side DF is twice as long as side AC . Which of the following statements is true? (a) The interior area of Δ DEF is twice the interior area of Δ ABC (b) The perimeter of Δ DEF is four times the perimeter of Δ ABC (c) The interior area of Δ DEF is four times the interior area of Δ ABC (d) Δ ABC ≅ Δ DEF 6. Suppose a triangle has a base length of 4 feet and a height of 4 feet. Its interior area is (a) 4 square feet (b) 8 square feet (c) 16 square feet (d) impossible to determine without more information 7. The perimeter of the triangle described in the previous question is (a) 8 feet (b) 16 feet (c) 22 feet (d) impossible to determine without more information 8. Draw a triangle on a piece of paper. Label the vertices {, [, and (, proceeding in a counterclockwise sense. Look at this figure and call it Δ {[(. Now hold the piece of paper between your eyes and a bright light, and turn the inked side away from you but keep the page right-side-up. You should see a figure that you can call Δ)]}, because the vertices appear as), ], and } in a counterclockwise sense. Which of the following statements is true? (a) These two triangles are directly congruent (b) These two triangles are directly similar, but not directly congruent (c) These two triangles are inversely congruent (d) These two triangles are inversely similar, but not inversely congruent 9. Take the same piece of paper that you used in the preceding problem. Look at Δ{[(. Now turn the paper upside down, keeping the inked side facing you. You should see another triangle that you can call Δ}]) as the vertices appear in a counterclockwise sense. Which of the following statements is true? (a) These two triangles are directly congruent (b) These two triangles are directly similar, but not directly congruent (c) These two triangles are inversely congruent (d) These two triangles are inversely similar, but not inversely congruent  10. Suppose there is a triangle, two of the interior angles of which measure 30°. The measure of the third angle is (a) impossible to determine without more information (b) π/6 rad (c) π/4 rad (d) 2π/3 rad Answers: 1. a 2. b 3. b 4. c 5. c 6. b 7. d 8. c 9. a 10. d Add your own comment
__label__pos
0.999747
Source: searchenginejournal.com How Bots Negatively Impact Your Business (And How To Protect It) Bots, or internet bots, are any software or programs that are designed to perform automated, typically repetitive tasks and operate over the internet. A significant portion of the internet traffic comes from these bots, and in fact, 25% of all internet traffic now comes from bots with malicious intent. However, when discussing bots, it’s important to note that not all of them are bad. There are good bots owned by reputable companies like Facebook or Google that are actually beneficial for your website and business. Unfortunately, a portion of these bots are operated by cybercriminals and others with malicious intent and are utilized to gather passwords, obtain sensitive data, launch spam attacks, and much more. With that being said, here we will discuss how bots can negatively impact your business, and how to protect it from them. Without further ado, let us begin. Page Contents How Malicious Bots Negatively Impact Your Business 1. Hindering Your Site’s Performance Source: pexels.com Bots can perform repetitive, high amounts of requests on your website, bringing down the performance of your website and increasing its load time. The thing is, a slower website can translate into a higher bounce rate, as well as a lower conversion rate. In severe cases, 79% of people simply wouldn’t return to a site that performed poorly for them. Both good and bad bots can cause this slowdown, so it’s also important to manage the activities of good bots. Also, these loads created by bots can also increase your infrastructure costs like hosting and content distribution services. 2. Loss of Competitive Advantage In some industries, your competitors might launch espionage bots to steal sensitive data that might ruin your competitive advantage. This is especially true in eCommerce websites selling price-sensitive products like hotel booking sites or event ticketing sites. Your competitor can, for example, steal your price information before it’s published, and then undercut your price and steal your customers. 3. Content Scraping A very common use case for malicious bots is to scrape websites for content. Malicious bots can copy a site’s unique content and publish it elsewhere, which may hinder your site’s SEO performance and create duplicate content issues. Also, it might damage your site’s reputation and your audience might think that you are the one stealing other site’s content. 4. Spam Source: calliaweb.co.uk Bots can be utilized to launch spams, for example, sending spam emails to your customers (after stealing your email list), spam your lead forms to confuse your team as it can be very difficult to differentiate real submission from spam ones and spam your blog’s comment section and social media profiles with malicious links (typically to fraudulent websites). 5. Scalping Scalping bots are now a major threat for certain industries that sell products that are limited and in-demand like event tickets, sneakers, and even electronic products like VGAs and Playstation 5. The bot operator can then sell these products on the secondary market at a much higher price (that is sometimes unfair). This can hurt your brand in the long-run as genuine customers fail to purchase the products at a fair price. 6. Content Aggregation This type of malicious bots illegally aggregates content so they take away potential visitors from the original website. A major threat for online portals, and can lead to massive revenue loss. 7. Vulnerability Scanning Source: phoenixnap.com These malicious bots are used by cybercriminals to scan websites and mobile apps to find security flaws and vulnerabilities. In turn, the cybercriminal can use this information to launch even more severe attacks like DDoS or data breach and DataDome can identify the presence of malicious bots in real-time 8. Account Takeover Cybercriminals can use malicious bots to perform credential cracking (brute force) attacks or credential stuffing attacks to programmatically attempt to login to websites, services, and applications. This can lead to your customers losing sensitive information and even financially-related information (banking details, credit card numbers, etc.), and can impact your brand reputation. 9. Credit Card Fraud A major threat in eCommerce websites, cybercriminals can use carding bots to automatically submit orders on your site to test credit card details. A sophisticated carding bot can test a huge number of stolen credit card details or use automatic algorithms at high speeds. This will result in heavy traffic and may slow down your experience, and can potentially lead to an increase in transaction disputes and chargeback costs while also hurting your reputation. 10. Denial of Service Source: pcmag.com Attackers can use botnets (malware-infected devices) to perform a massive number of requests to your website, overloading your server and slowing down your site’s performance. In severe cases, it will completely shut down your site or app, preventing the site from servicing the target audience. Protecting Your Business From Malicious Bots 1. Monitor Your Traffic Regularly Source: pexels.com An important step of stopping bots from negatively impacting your site is to first detect their presence. You can monitor your traffic with tools like Google Analytics and check for: • A sudden and unexplained spike in pageviews • A sudden spike in bounce rate, the percentage of users that exists on your site after visiting just one page • A high number of account creation, sign-ups, or other conversions especially with fake email addresses • Spike or decrease of session duration • Requests from suspicious geographic locations 2. Investing In Bot Detection and Management Solution Source: pandasecurity.com The thing is, with how today’s bots are getting more sophisticated than ever before, we can no longer rely on traditional bot detection means like CAPTCHA and fingerprinting-based solutions. There are three different methods the bot management software can use in detecting bots: • Fingerprinting-based (static) approach: the bot management solution analyzes the ‘signatures’ of the traffic like OS version, IP address, browser types/versions, and so on while comparing them to known fingerprints of malicious bots. • Challenge-based approach: the bot management solution presents a test that is designed to be easy for legitimate human users but very difficult/impossible to solve by bots. CAPTCHA is a very common form of this bot management approach. • Behavioral-based (dynamic) approach: In this type of approach the bot management solution analyzes the client’s behaviors in real-time and compares them with a known baseline, for example analyzing mouse movements against real user’s mouse movements. Due to the sophistication of today’s shopping bots, a bot management solution that is capable of behavioral-based detection is recommended. 3. Bot Management Best Practices Source: pexels.com It’s important for your business to employ these cybersecurity best practices: • Optimized Robots.txt: while malicious bots won’t follow directives in your robots.txt, it is still useful for managing good bots so they won’t slow down or disrupt your site/app. • CAPTCHAs: while we’ve discussed how CAPTCHAs are quite redundant these days, they are still effective in stopping less sophisticated bots. Use CAPTCHAs strategically and sparingly. • WAF: A cloud-based web application firewall (WAF) can help stop some bad bots according to their signatures and origins. • Authentication control: You can require users to use long and complex passwords, as well as requiring users to use multi-factor authentication (MFA) such as an additional PIN or entering an OTP (one-time-password) sent to their phone. Conclusion There are various ways bots can negatively impact your business, and in fact, there are still many more ways malicious bots can affect your business’s financial performance and reputation besides the 10 we’ve discussed above. This is why implementing a proper bot detection and mitigation service is now a necessity for all businesses in order to protect websites and applications from malicious bots and their negative impacts. 1
__label__pos
0.54173
Mass Convert Script This python script will convert between two 3d formats using Vue to do the hard work. If you are using Vue 6 (Build 289182 or later) or Vue 7 you can convert to the Vue vob file format using it. It supports the import of 3dmf, 3ds, cob, dxf, lwo, obj, pz3, raw, shd, skp and vob. It can use vue to export 3ds, c4d, dxf, lwo, obj, shd and vob. Two versions are available. The most recent version has a Graphical User Interface (GUI). To use it you’ll need to have wxPython installed for Vue on your computer. Vue 9 Important Notes: All versions of Vue from 9 include wxPython so you don’t need to install it. Installing it will break the installed wxPython and probably result in having to re-install Vue. I’ve not had time yet tested this script with Vue 9. Before Vue 9 Important Notes: I’ve not packaged wxPython with MassConvert yet so for now you’ll need to have either SkinVue or the VueToolbar installed which both include wxPython. The other version doesn’t have a graphical user interface and doesn’t require wxPython but will require editing of the script to use to set the input and output paths for the files. Python Code – Mass Convert (GUI) 1. ###################################################################################################### 2. # Convert between 3d object formats using Vue 3. # 4. # - massconvert.py 5. # - By Mark Caldwell 6. # - Version 0.5.1 7. # - 17th June 2007 8. # - Copyright Mark Caldwell 2007 9. # - Tested with Vue 6 Infinite on a PC 10. # 11. # Requires wxPython to be installed in to Vue to use. 12. # 13. # How to use in 2 easy steps 14. # 15. # 1. Download this file onto your computer 16. # 17. # 2. Run the script then follow the in script help for 18. # more information 19. # 20. # Conversion options are those currently selected under 21. # File -> Export As 22. # 23. ###################################################################################################### 24.   25. ###################################################################################################### 26. # 27. # Set up by importing libraries 28. # 29. ###################################################################################################### 30.   31. import os # import os libraries 32. import sys 33. VuePythonPath = sys.path[1] # get the Vue python path 34. VuePythonFolder = os.path.abspath(os.path.join(VuePythonPath[0:VuePythonPath.find("Python")],"Python")) 35. wxPythonFolder = os.path.abspath(os.path.join(VuePythonFolder,"PythonLib/wx")) 36. os.chdir(wxPythonFolder) 37.   38. import wx # import the wx libraries 39. import wx.html # import the wx html libraries 40. import string # import string libraries 41. import time # import time 42.   43. # get the Vue Python Folder 44. VuePythonFolder,junk = os.path.split(VuePythonPath) 45.   46. # Get the Vue Root Path 47. VueRootPath,junk = os.path.split(VuePythonFolder) 48.   49. ###################################################################################################### 50. # 51. # Create lists of file types that can be imported and exported 52. # 53. ###################################################################################################### 54.   55. InExtensions=['3dmf','3ds','cob','dxf','lwo','obj','pz3','raw','shd','skp','vob'] 56. OutExtensions=['3ds','c4d','dxf','lwo','obj','shd','vob'] 57.   58. ###################################################################################################### 59. # 60. # Class for the Main GUI 61. # 62. ###################################################################################################### 63.   64. class MassConvertApp(wx.Frame): 65. def __init__(self): 66. wx.Frame.__init__(self, parent = None, id = -1, 67. title = "MassConvert", 68. size = (600,400), 69. style = (wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX))) 70.   71. self.SetFont(wx.Font(10,wx.DEFAULT,wx.NORMAL,wx.NORMAL)) # Set Default Font 72.   73. BoldFont=wx.Font(10,wx.DEFAULT,wx.NORMAL,wx.BOLD) # Create Bold Font for later use 74.   75. self.ClearBackground() 76.   77. # Set Some variables to use later 78.   79. self.inFilepath = VueRootPath 80. self.outFilepath = VueRootPath 81. self.out_vob=0 82. self.InExtensionsBox=[] 83. self.OutExtensionsBox=[] 84.   85. panel = wx.Panel(self) # Create Panel 86. panel.SetBackgroundColour('White') 87. statusBar = self.CreateStatusBar() # Create Status Bar 88.   89. # Create Menu Structure 90.   91. menuBar = wx.MenuBar() 92. menu1 = wx.Menu() 93. in_dir=menu1.Append(wx.NewId(), "&Import...", "Directory to import files from") 94. self.Bind(wx.EVT_MENU, self.OnIn, in_dir) 95. out_dir=menu1.Append(wx.NewId(), "&Export...", "Directory to export files to") 96. self.Bind(wx.EVT_MENU, self.OnOut, out_dir) 97. menu1.AppendSeparator() 98. exit=menu1.Append(wx.NewId(), "Exit") 99. self.Bind(wx.EVT_MENU, self.OnExit, exit) 100. menuBar.Append(menu1, "&File") 101. menu2 = wx.Menu() 102. helpmenu=menu2.Append(wx.NewId(), "&Help", "Help using MassConvert") 103. self.Bind(wx.EVT_MENU, self.OnHelp, helpmenu) 104. about=menu2.Append(wx.NewId(), "&About", "About MassConvert") 105. self.Bind(wx.EVT_MENU, self.OnAbout, about) 106. menuBar.Append(menu2, "&Help") 107.   108. self.SetMenuBar(menuBar) 109.   110. CheckBoxSize=(90, 20) 111. InColumnX=35 112. OutColumnX=180 113. inc=20 114. StartY=60 115.   116. # Create File Path Text Display 117.   118. text=wx.StaticText(panel,-1,"Import File Path:",(10,10)) 119. text.SetFont(BoldFont) 120. self.InFilePathText=wx.StaticText(panel,-1,self.inFilepath,(120,10)) 121. text=wx.StaticText(panel,-1,"Export File Path:",(10,10+inc)) 122. text.SetFont(BoldFont) 123. self.OutFilePathText=wx.StaticText(panel,-1,self.outFilepath,(120,10+inc)) 124.   125. # Create File Import / Export Count Display 126.   127. self.NumberOfFilesImportedLabel=wx.StaticText(panel,-1,'',(300,60)) 128. self.NumberOfFilesImportedLabel.SetFont(BoldFont) 129. self.NumberOfFilesImported=wx.StaticText(panel,-1,'',(470,60)) 130. self.NumberOfFilesExportedLabel=wx.StaticText(panel,-1,'',(300,80)) 131. self.NumberOfFilesExportedLabel.SetFont(BoldFont) 132. self.NumberOfFilesExported=wx.StaticText(panel,-1,'',(470,80)) 133. self.ConvertTimeLabel=wx.StaticText(panel,-1,'',(300,100)) 134. self.ConvertTimeLabel.SetFont(BoldFont) 135. self.ConvertTime=wx.StaticText(panel,-1,'',(470,100)) 136.   137. # Create Check Boxes for Import Types 138.   139. y=StartY 140.   141. text=wx.StaticText(panel,-1,'Input File Types: ',(10,y)) 142. text.SetFont(BoldFont) 143.   144. y=y+inc 145. x=InColumnX 146.   147. for Extension in InExtensions: 148. Box=wx.CheckBox(panel, -1, Extension, (x, y), CheckBoxSize) 149. self.InExtensionsBox.append((Extension,Box)) 150. y=y+inc 151.   152. yBottom=y+inc+inc 153.   154. # Create Check Boxes for Output Type 155.   156. y=StartY 157. x=OutColumnX 158.   159. text=wx.StaticText(panel,-1,'Output File Types: ',(155,y)) 160. text.SetFont(BoldFont) 161.   162. y=y+inc 163.   164. for Extension in OutExtensions: 165. Box=wx.CheckBox(panel, -1, Extension, (x, y), CheckBoxSize) 166. self.OutExtensionsBox.append((Extension,Box)) 167. y=y+inc 168.   169. y=y+inc+inc 170.   171. # Create Convert Button 172.   173. self.button = wx.Button(panel, -1, 'Convert', pos=(OutColumnX, y)) 174. self.Bind(wx.EVT_BUTTON, self.OnClickConvert, self.button) 175. self.button.SetDefault() 176.   177. self.CenterOnParent() # Center the GUI on the Vue Window 178. self.ClearBackground() 179. self.Show(True) # Show the GUI 180.   181. ###################################################################################################### 182. # 183. # When the convert button is clicked 184. # 185. ###################################################################################################### 186.   187. def OnClickConvert(self, event): 188. OutExtensionList=[] 189. InExtensionList=[] 190. objImportCount=0 191. objExportCount=0 192. startTime=time.time() 193.   194. for Extension,Check in self.InExtensionsBox: 195. if Check.IsChecked(): 196. InExtensionList.append(Extension) 197.   198. for Extension,Check in self.OutExtensionsBox: 199. if Check.IsChecked(): 200. OutExtensionList.append(Extension) 201.   202. filenames=os.listdir(self.inFilepath) 203.   204. for filename in filenames: 205. for extensionin in InExtensionList: 206. if '.'+extensionin in filename: 207. fullPath=self.inFilepath+'/'+filename 208. obj=ImportObject(fullPath) 209. if obj: 210. objImportCount=objImportCount+1 211. for extensionout in OutExtensionList: 212. newFileName=self.outFilepath+'/'+filename.replace('.'+extensionin,'.'+extensionout) 213. if os.path.exists(newFileName)!=True: 214. SelectOnly(obj) 215. ExportObject (newFileName) 216. objExportCount=objExportCount+1 217. SelectOnly(obj) 218. Delete() 219. endTime=time.time() 220.   221. elapsedTime=endTime-startTime 222.   223. self.NumberOfFilesImportedLabel.SetLabel('Number of Files Imported:') 224. self.NumberOfFilesExportedLabel.SetLabel('Number of Files Exported:') 225. self.ConvertTimeLabel.SetLabel('Time:') 226. self.NumberOfFilesImported.SetLabel(str(objImportCount)) 227. self.NumberOfFilesExported.SetLabel(str(objExportCount)) 228. self.ConvertTime.SetLabel(str(int(elapsedTime))+' seconds') 229.   230. self.Raise() 231.   232. ###################################################################################################### 233. # 234. # When exit and close are clicked 235. # 236. ###################################################################################################### 237.   238. def OnExit(self, event): 239. self.Close() 240.   241. def OnCloseMe(self, event): 242. self.Close(True) 243.   244. def OnCloseWindow(self, event): 245. self.Destroy() 246.   247. ###################################################################################################### 248. # 249. # Read the Input Directory 250. # 251. ###################################################################################################### 252.   253. def OnIn(self, event): 254. dialog = wx.DirDialog(None, "Choose a directory to import from:",self.inFilepath, 255. style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON) 256. if dialog.ShowModal() == wx.ID_OK: 257. self.inFilepath = dialog.GetPath() 258. self.InFilePathText.SetLabel(self.inFilepath) 259. dialog.Destroy() 260.   261. ###################################################################################################### 262. # 263. # Read the Export Directory 264. # 265. ###################################################################################################### 266.   267. def OnOut(self, event): 268. dialog = wx.DirDialog(None, "Choose a directory to export to:",self.outFilepath, 269. style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON) 270. if dialog.ShowModal() == wx.ID_OK: 271. self.outFilepath=dialog.GetPath() 272. self.OutFilePathText.SetLabel(self.outFilepath) 273. dialog.Destroy() 274.   275. ###################################################################################################### 276. # 277. # When About is clicked 278. # 279. ###################################################################################################### 280.   281. def OnAbout(self, event): 282. dialog = MassConvertAbout(self) 283. dialog.ShowModal() 284. dialog.Destroy() 285.   286. ###################################################################################################### 287. # 288. # When Help is clicked 289. # 290. ###################################################################################################### 291.   292. def OnHelp(self, event): 293. dialog = MassConvertHelp(self) 294. dialog.ShowModal() 295. dialog.Destroy() 296.   297. ###################################################################################################### 298. # 299. # About Window 300. # 301. ###################################################################################################### 302.   303. class MassConvertAbout(wx.Dialog): 304. text = ''' 305. <html> 306. <body bgcolor="#ffffff"> 307. <center><table bgcolor="#ffffff" width="100%" cellspacing="0" 308. cellpadding="0" border="1"> 309. <tr> 310. <td align="center"><h1>MassConvert</h1></td> 311. </tr> 312. </table> 313. </center> 314. <p align="center">Version 0.5.0</p> 315. <p align="center">http://www.impworks.co.uk/</p> 316. <p align="center">Copyright Mark Caldwell 2007</p> 317. <p align="center">Tested with Vue 6 Infinite on a PC</p> 318.   319. </body> 320. </html> 321. ''' 322.   323. def __init__(self, parent): 324. wx.Dialog.__init__(self, parent, -1, 'About MassConvert', 325. size=(440, 300) ) 326.   327. html = wx.html.HtmlWindow(self) 328. html.SetPage(self.text) 329. button = wx.Button(self, wx.ID_OK, "Okay") 330.   331. sizer = wx.BoxSizer(wx.VERTICAL) 332. sizer.Add(html, 1, wx.EXPAND|wx.ALL, 5) 333. sizer.Add(button, 0, wx.ALIGN_CENTER|wx.ALL, 5) 334.   335. self.SetSizer(sizer) 336. self.Layout() 337.   338. ###################################################################################################### 339. # 340. # Help Window 341. # 342. ###################################################################################################### 343.   344. class MassConvertHelp(wx.Dialog): 345. text = ''' 346. <html> 347. <body bgcolor="#ffffff"> 348. <center><table bgcolor="#ffffff" width="100%" cellspacing="0" 349. cellpadding="0" border="1"> 350. <tr> 351. <td align="center"><h1>MassConvert Help</h1></td> 352. </tr> 353. </table> 354. </center> 355. <p>This Vue python script reads 3d object files from a selected import directory and saves them in new formats to 356. a selected export directory. If it finds a file of the same name as one it is trying to create already exists in the 357. export directory it doesn't export the file.</p> 358.   359. <p>Select the directory to import files from in the <em>File</em> menu with <em>Import...</em>.</p> 360. <p>Select the directory to export files from in the <em>File</em> menu with <em>Export...</em>.</p> 361. <p>Select the types of file to import and the types of file to export with the check boxes.</p> 362. <p>Once you've made your selections click the <em>Convert</em> button and Vue will import the selected files 363. and export them in the selected formats.</p> 364. <p>The export will use the settings from the last export you did with Vue.</p> 365. <p>When converting some file formats (such as poser) Vue will ask you to make choices during the import.</p> 366. </body> 367. </html> 368. ''' 369.   370. def __init__(self, parent): 371. wx.Dialog.__init__(self, parent, -1, 'MassConvert Help', 372. size=(440, 550) ) 373.   374. html = wx.html.HtmlWindow(self) 375. html.SetPage(self.text) 376. button = wx.Button(self, wx.ID_OK, "Close") 377.   378. sizer = wx.BoxSizer(wx.VERTICAL) 379. sizer.Add(html, 1, wx.EXPAND|wx.ALL, 5) 380. sizer.Add(button, 0, wx.ALIGN_CENTER|wx.ALL, 5) 381.   382. self.SetSizer(sizer) 383. self.Layout() 384.   385. ###################################################################################################### 386. # 387. # Start of Program 388. # 389. ###################################################################################################### 390.   391. app = None # Clear out any previous instances of app 392. del app # destroy it completely 393. app = wx.PySimpleApp() # Create a new wx application instance 394. frame = MassConvertApp() # Create the GUI instance 395. app.MainLoop() # Execute wx 396.   397. Refresh() Python Code – Mass Convert (No GUI) 1. #****************************************************** 2. # Convert between two formats using Vue 3. # 4. # - massconvert.py 5. # - By Mark Caldwell 6. # - Version 0.5.1 (No GUI) 7. # - 6th August 2007 8. # - Copyright Mark Caldwell 2007 9. # - Tested with Vue 6 Infinite Pre Release 10. # 11. # How to use in 4 easy steps 12. # 13. # 1. Download this file onto your computer 14. # 15. # 2. Place the files to be converted in the same directory 16. # as the script 17. # 18. # 3. Edit the script to change output_directory. This is 19. # the directory the files will be put in and is relative 20. # to the root directory of your vue installation. 21. # eg if Vue python is in to: 22. # C:\Program Files\e-on software\Vue 6 Infinite\Python 23. # and you want to save the files to: 24. # C:\Program Files\e-on software\Vue 6 Infinite\Python\Scripts\outfiles 25. # Change output directory to: 26. # output_directory='\Scripts\outfiles' 27. # 28. # Make sure the directory you want to save to exists. 29. # If it doesn't the files will not be saved. 30. # 31. # 4. Then run script and wait for it to work supplying 32. # responses when prompted. 33. # 34. # To run it go to Python -> Run Python Script 35. # Then locate the file on your computer 36. # 37. # Do not run using quick load options 38. # 39. # Available input formats are: 40. # 3dmf 41. # 3ds 42. # cob 43. # dxf 44. # lwo 45. # obj 46. # pz3 47. # raw 48. # shd 49. # skp 50. # vob 51. # 52. # Available output formats are: 53. # 3ds 54. # c4d 55. # dxf 56. # lwo 57. # obj 58. # shd 59. # vob 60. # 61. # Conversion options are those currently selected under 62. # File -> Export As 63. # 64. #****************************************************** 65.   66. #---------------------------------------------- 67. # Configuration: Set these to alter end result 68. #---------------------------------------------- 69.   70. # Change the line below to change where files are saved 71. # see instructions above for more details 72.   73. output_directory='/scripts/massconvert' 74.   75. #---------------------------------------------- 76. # Internal Variables Set Up: Don't alter these 77. #---------------------------------------------- 78.   79. import os 80. import string 81.   82. # get the Vue python path 83. VuePythonPath = sys.path[1] 84.   85. # get the Vue Python Folder 86. VuePythonFolder,junk = os.path.split(VuePythonPath) 87.   88. # Get the Vue Root Path 89. VueRootPath,junk = os.path.split(VuePythonFolder) 90.   91. # Set where to put the output files 92.   93. output_path=VuePythonFolder+output_directory 94.   95. obj=[] 96. objectlist=[] 97. extensionin='obj' 98. extensionout='3ds' 99.   100. #--------------------------------------------------- 101. # Get User Input 102. #--------------------------------------------------- 103.   104. extensionin=Prompt('File extension of files to import\nobj 3ds lwo c4d cob dxf pz3 shd vob',extensionin,true,'Input File Extension') 105. extensionout=Prompt('File extension on files to output\nobj 3ds lwo c4d cob dxf shd vob',extensionout,true,'Output File Extension') 106.   107. #--------------------------------------------------- 108. # Main Script Body 109. #--------------------------------------------------- 110.   111. # Load objects 112.   113. filenames=os.listdir(os.curdir) 114.   115. for filename in filenames: 116. if '.'+extensionin in filename: 117. obj=ImportObject(filename) 118. newfilename=output_path+'/'+filename.replace('.'+extensionin,'.'+extensionout) 119. print filename+" to "+newfilename 120. SelectOnly(obj) 121. print ExportObject (newfilename) 122. Delete() 123.   124. Refresh() impworks © Copyright Mark Caldwell 1996 - 2021
__label__pos
0.9808
one call away fom solving your computer problem By Paul Vaccarelli As personal computers age they appear to slow down. Sometimes even newer computers will seem to take a long time to boot and then operate in slow motion. This can be frustrating and baffling to the person using the computer. In reality, computers always operate as fast as they are designed to.  What slows them down are programs monopolizing their resources. When RAM memory runs low, the computer uses disk memory to compensate. Disk memory is hundreds of times slower than RAM memory, thus the slow performance. There can also be programs running in the background that take up CPU usage. These programs can be anything from malware, to over-zealous anti-virus programs. To get to the bottom of what is slowing down your computer, do the following while the computer is slow: •    Press the CTRL, ALT, and DELete keys simultaneously. This will bring up the Task Manager. On Vista you will see a menu, then click on Task Manager. •    Click on the Performance tab. You will see a graphical representation of CPU and Memory usage. The CPU usage should be at 10% or lower when the computer is idle.  The memory usage number, (the graph will say PF usage,) multiplied by 1000, should be less than physical memory total shown at the bottom. If it is not, you may need to add more RAM or find the program that is using it up. •    To find programs using an over abundance of resources, while in task manager, click the Processes tab. It will show you a real time list of all programs running in real time. •    Click on the memory column to sort by memory usage, or the CPU column to sort by CPU usage. You can then see what is using the most of these resources. In XP, the System Idle Process should be showing 90% or above in CPU usage. Once you find the culprit, you can deal with it yourself, or call a computer service professional for advice.  Other issues can slow a computer like a failing hard drive, or a poorly fragmented hard drive, but most of the time it is an errant program that can easily be dealt with. Paul Vaccarelli is general manager of PC-911, LLC. He can be reached at 303 807 2911. Phone consultations are free.
__label__pos
0.695043
AspAlliance.com LogoASPAlliance: Articles, reviews, and samples for .NET Developers URL: http://aspalliance.com/articleViewer.aspx?aId=904&pId=-1 Generating Excel File Using SQL Server 2000 page by Aravind Kumar Feedback Average Rating: This article has not yet been rated. Views (Total / Last 10 Days): 1389903/ 1844 Introduction I dedicate this article to my brother's daughter Akshaya. This article will explore the features of SQL Server 2000 for using Microsoft tools, such as MS-Excel and DOS.  Here we extensively use DOS Shell commands and ODBC database object connectivity for Excel.  The main objective of this article is to generate an excel file directly from MS SQL Server 2000.  This will be very useful when we have a huge amount of SQL data output that needs to be transferred to the excel file.  Usually Internet applications will generate an excel file by changing the Page’s Response-Content Type.  This allows users to open it with Internet Explorer and/or saving it in their Hard disk.  This can work well if we generate a fewer number of records.  However, for a large amount of records, it is better to generate the excel file in the web server and download it later.  The other advantage in this method is that we can also stream multiple SQL outputs at a single time into various excel worksheets present in that single downloadable excel file.  In other words, simultaneous SQL Data outputs can be generated to fill into different worksheets of the same excel file. Template File Before generating the output in an excel file, we first need to create an excel file (template file). This template file should have the column names of the result set to be generated through the SQL Query.  This is done by simply typing the Column names in the row of a excel sheet, below which the data will be generated by SQL Server 2000 (it is nothing but a Header column).  If we want to generate multiple query sets through the same SQL Query, we need to create multiple excel work sheets according to our result tables inside the template file.  Remember, Excel will have 3 sheets by default.  We can give the template formatting, such as color and background, for a better look and feel for the output file.  This template file will be copied using simple DOS "Copy" command through the stored procedure. DOS File Copy Microsoft SQL Server is a not only a powerful database, but also a tool for utilizing other Microsoft utilities like DOS, Office suite and other various software.  We can utilize various DOS internal commands using SQL Server for our needs.  And one good command, which will be used here, is the DOS File Copy command. We can utilize DOS commands from SQL Server 2000 using the built-in stored procedure "Xp_CmdShell" provided by SQL Server 2000.  This built-in stored procedure is placed by default in the master database.  So, henceforth it is assumed that we will be working in the master database while running this particular command. By default, only members (i.e. - sa) of the sysadmin fixed server role can execute this extended stored procedure.  You may, however, grant other users permission to execute this stored procedure. For Example, if we need to delete a file we can run the following command in SQL. Listing 1 EXEC MASTER..XP_CMDSHELL 'Del d:\sdf.xls' In the above example we can see that the built-in stored procedure XP_CMDSHELL will be executed by passing the desired dos command.  Here the dos command "Del" has been used to instruct the stored procedure to delete the file in the path specified viz., 'd:\sdf.xls’;. Using Excel Object This gives us the template file through DOS File Copy.  Now we need to connect to the Excel file, which we have just copied through the stored procedure, for transferring the data generated by the SQL query from SQL Server to the excel worksheet.  Here we use Microsoft.Jet.OLEDB.4.0 as the database engine for connecting to this excel file.  We can connect to multiple sheets of the same excel file by specifying the worksheet name in the select query string in our stored procedure. We can simulate the example by saying that the Database is the Excel file and the table is the Sheet1 present inside the Excel file.  So by default, we can copy data from three data sources to three default Sheets present in the excel file.  If we can add more worksheets to the template file, we can obviously get more data tables copied to the excel file. Using OPENROWSET Command SQL OpenRowSet command is usually used to connect to the linked server or remote server for fetching data.  It includes all connection information necessary to access remote data from an OLE DB data source.  This method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data using OLE DB. The OPENROWSET function can be referenced in the FROM clause of a query as though it is a table name.  The OPENROWSET function can also be referenced as the target table of an INSERT, UPDATE or DELETE statement and is subject to the capabilities of the OLE DB provider.  Although the query may return multiple result sets, OPENROWSET returns only the first one. Listing 2 OPENROWSET ( 'provider_name' , { 'datasource' ; 'user_id' ; 'password' | 'provider_string' }      , { [ catalog. ] [ schema. ] object | 'query' } )  So, if our need is to insert a data collection into an OLEDB data source (in this case, an Excel File), you have to specify the following: ·         OLEDB version of the SQL Server ·         Excel version and Excel FileName ·         Worksheet you are going to connect for data copying The above will simply look like the following. Listing 3 insert into OPENrowset( Provider, ExcelConnectionString,  'SELECT [Column Names] FROM [SheetN$]''select [Column Names] from TableName' After the query execution, the select query mentioned after OPENrowset parameters will be inserted into datasheet of the mentioned excel file connected through the OPENrowset function. Example We take an example here to generate Authors and Sales data of pubs database into the first two sheets of the excel file.  Here we specify three parameters for the OPENROWSET Function. ·         OLEDB Engine provider as "Microsoft.Jet.OLEDB 4.0" ·         Excel Connectivity string as "Excel 8.0; Database=FileName.xls" ·         Select query of the columns framed in the Excel File Mentioning the OLEDB Provider and excel destination filename Listing 4 set @provider = 'Microsoft.Jet.OLEDB.4.0' set @ExcelString = 'Excel 8.0;Database=' + @fn Executing the OPENROWSET Command for copying the select contents to Excel sheet Listing 5 exec('insert into OPENrowset (''' + @provider + ''',''' + @ExcelString + ''',''SELECT FirstName, LastName, Phone, Address, City, State, Zip FROM [Sheet1$]'') select au_fname as FirstName, au_lname as LastName, phone, address, city, State, Zip from authors')   exec('insert into OPENrowset (''' + @provider + ''',''' + @ExcelString + ''',''SELECT StoreId, OrderNo, OrderDate, Quantity FROM [Sheet2$]'') select stor_id as StoreId,Ord_Num as OrderNo,Ord_Date as OrderDate,qty as Quantity from sales') After the execution of the above statements, the results obtained from the select statements mentioned after the each OPENROWSET commands will be copied to the two sheets of the excel file respectively. Guidelines for running the sample query Download the sample and unzip it.  Copy the Template.xls excel file to "D:\".  Copy and run the stored procedure from PUBS database as sa.  While running the stored procedure, we can specify a name in which the resultant data will be generated; else it will automatically generate the data in a file called "D:\Test.xls." Summary This article is concerned with reducing network traffic while generating big excel files (with multiple excel sheets) through web applications.  It does this by utilizing SQL Server’s unique features.  Generally when we respond the excel data into the web browser, it will take more time to generate huge data and it is hard to generate multiple sheets of data.  I hope the above will be a good solution for you. Editor's Note: If you are considering third party tools, you may want to consider SoftArtisans OfficeWriter as another alternative for keeping Microsoft Office off the server. ©Copyright 1998-2019 ASPAlliance.com  |  Page Processed at 2019-03-22 8:54:03 PM  AspAlliance Recent Articles RSS Feed About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search
__label__pos
0.578132
1) Which of the following is a basic concept associated with Web 2.0? A) shift in users' preference from online sites to encyclopedias as sources of unbiased information B) shift in users' role from the passive consumer of content to its creator C) shift in users' interest from sharing information to finding information D) shift in users' lifestyle due to increased purchasing power E) shift in users' preference to environment-oriented products B) shift in users' role from the passive consumer of content to its creator 2) Which of the following is a consequence of the use of social software? A) People are using encyclopedias as sources of unbiased information. B) People are using environmentally-friendly products. C) People have increased purchasing power. D) People are sharing more personal information. E) People have become passive consumers of content. D) People are sharing more personal information. 3) The use of ________ within a company's boundaries or between a company and its customers or stakeholders is referred to as Enterprise 2.0. A) Web 1.0 techniques and intranet B) extranet and intranet C) Web 2.0 techniques and social software D) extranet and Web 1.0 techniques E) social software and extranet C) Web 2.0 techniques and social software 4) Which of the following statements is true about Web 1.0? A) It helps users share information. B) It helps users find information. C) Users rule these applications. D) Users receive and give recommendations to friends. E) It helps connect ideas and people. B) It helps users find information. 5) A major benefit of social software is the ability to harness the "wisdom of crowds," which is also referred to as ________. A) collaborative filtering B) preference elicitation C) creative commons D) consensus democracy E) collective intelligence E) collective intelligence 6) The concept of ________ is based on the notion that distributed groups of people with a divergent range of information and expertise will be able to outperform the capabilities of individual experts. A) cognitive dissonance B) creative commons C) collective intelligence D) consensus democracy E) preference elicitation C) collective intelligence 7) Which of the following statements is true about a discussion forum? A) It started out as a novice's way of expressing themselves using very simple Web pages. B) It is the process of creating an online text diary made up of chronological entries that comment on everything. C) Rather than trying to produce physical books to sell or use as gifts, users merely want to share stories about their lives or voice their opinions. D) It is dedicated to a specific topic, and users can start new threads. E) It enables a person to voice his/her thoughts through short "status updates." D) It is dedicated to a specific topic, and users can start new threads. 8) Which of the following statements is true about blogs? A) They emulate traditional bulletin boards and allow for threaded discussions between participants. B) They allow individuals to express their thoughts in a one-to-many fashion. C) They are dedicated to specific topics, and users can start new threads. D) They are moderated so that new postings appear only after they have been vetted by a moderator. E) They enable people to voice their thoughts through short "status updates." B) They allow individuals to express their thoughts in a one-to-many fashion. 9) Which of the following Web 2.0 applications has been classified as the "amateurization" of journalism? A) blogs B) discussion forums C) social presence tools D) instant messaging E) online chats A) blogs 10) Keith Norat, the Chief Technology Officer of Kender Internationals, relies on blogs while making decisions. In his words, "Blogs are an important part of our purchase decisions. In todays environment, blogs provide diverse information that help us to make good decisions." Which of the following is an underlying assumption? A) Information in blogs is accurate. B) Some of the blogs are not written well. C) Blogs are company sponsored. D) Professional bloggers rely heavily on advertisements to sustain their operations. E) Blogs lead to the "amateurization" of journalism. A) Information in blogs is accurate. 11) Which of the following explains the term "blogosphere?" A) the movement against blogs B) the amateurization of blogs C) the revolution against microblogging D) the community of all blogs E) the movement against discussion forums D) the community of all blogs 12) Social presence tools are also known as ________ tools. A) social bookmarking B) instant chatting C) microblogging D) videoconferencing E) geotagging C) microblogging 13) Which of the following facilitates real-time written conversations? A) instant messaging B) discussion forums C) status updates D) blogs E) tagging A) instant messaging 14) ________ take the concept of real-time communication a step further by allowing people to communicate using avatars. A) Blogging B) Microblogging C) Instant messaging D) Discussion forums E) Virtual worlds E) Virtual worlds 15) Which of the following statements is true about virtual worlds? A) It allows people to communicate using avatars. B) Small firms have not been successful in consumer-oriented virtual worlds. C) It is designed for short "status updates." D) It is the process of creating an online text diary made up of chronological entries that comment on everything. E) Large companies have been able to realize the potential of consumer-oriented virtual worlds. A) It allows people to communicate using avatars. 16) The network effect refers to the notion that the value of a network is dependent on ________. A) the speed of the network B) the number of other users C) the knowledge of the users D) the commitment of the users E) the technical expertise of the moderators B) the number of other users 17) ________ is a cooperative Web 2.0 application making use of the network effect. A) Media sharing B) RSS C) Tagging D) Instant messaging E) A discussion forum A) Media sharing 18) ________ is the distribution of digital media, such as audio or video files via syndication feeds for playback on digital media players. A) Narrowcasting B) Crowdsourcing C) Blogging D) Netcasting E) Phishing D) Netcasting 19) Podcasting is a misnomer because podcasts ________. A) are concerned with the dissemination of information to a narrow audience B) cannot be played on Apple's iPods C) are not related to distribution of digital media for digital devices D) are concerned with outsourcing tasks to a large group of people or community E) can be played on a variety of devices in addition to Apple's iPods E) can be played on a variety of devices in addition to Apple's iPods 20) Social bookmarking allows users to share Internet bookmarks and to create categorization systems. These categorization systems are referred to as ________. A) tag clouds B) podcasts C) folksonomies D) geospatial metadata E) microblogs C) folksonomies 21) Which of the following statements is true about social bookmarking? A) It is the distribution of digital media. B) It allows netcasters to publish and push current shows to the watchers/listeners. C) It allows people to communicate using avatars. D) It allows users to create folksonomies. E) It allows users to post short "status updates." D) It allows users to create folksonomies. 22) ________ is the creation of a categorization system by users. A) Social cataloging B) Podcasting C) Social blogging D) Netcasting E) Crowdsourcing A) Social cataloging 23) ________ refers to manually adding metadata to media or other content. A) Phishing B) Tagging C) Crowdsourcing D) Podcasting E) Netcasting B) Tagging 24) Which of the following statements is true about tagging? A) It is the process of creating a categorization systems by users. B) It is the process of distributing digital media for playback on digital media players. C) It is the process of adding metadata to pieces of information. D) It is the process of of creating avatars and syndication feeds. E) It is the process of creating an online text diary. C) It is the process of adding metadata to pieces of information. 25) ________ refer(s) to a way of visualizing user generated tags or content on a site. A) Crowdsourcing B) Tag clouds C) Phishing D) Podcasting E) Pharming B) Tag clouds 26) Which of the following is one of the uses of geotagging? A) to use avatars while chatting online B) to create categorization systems for social cataloging C) to know the location of a person sending out a breaking news update D) to create folksonomies for social bookmarking E) to use syndicate feeds while sharing media C) to know the location of a person sending out a breaking news update 27) Which of the following is an example of synchronous communication? A) online reviews B) work flow automation systems C) intranets D) videoconferencing E) collaborative writing tools D) videoconferencing 28) Which of the following is an example of asynchronous communication? A) group calendars B) videoconferencing C) online chatting D) shared whiteboards E) electronic meeting support system A) group calendars 29) Which of following factors differentiates asynchronous communication from synchronous communication? A) language B) network speed C) coordination in time D) expertise E) distance C) coordination in time 30) In today's business environment, project teams comprise highly specialized members, many of whom are not colocated. ________ are comprised of members from different geographic areas. A) Work groups B) Virtual teams C) Work teams D) Task forces E) Command groups B) Virtual teams 31) Which of the following is an electronic communication tool that allows users to files, documents, and pictures to each other and share information? A) e-mail B) instant messaging C) application sharing D) electronic calendars E) knowledge management systems A) e-mail 32) Which of the following is an electronic conferencing tool that facilitates information sharing and rich interactions between users? A) e-mail B) wikis C) blogs D) instant messaging E) online document systems D) instant messaging 33) Which of the following is a collaboration management tool that is used to facilitate virtual or colocated meetings ? A) Internet forums B) videoconferencing C) wikis D) fax E) intranets E) intranets 34) Web-based collaboration tools ________. A) allow for easy transferability from one person to another B) have well-documented procedures for system complexities C) reduce the risk of exposing sensitive corporate data D) require users to frequently upgrade their software E) are complex and time-consuming to learn A) allow for easy transferability from one person to another 35) Which of the following statements is true about Gmail? A) It is an enterprise-level collaboration tool that allows users to create group Web sites and share team information. B) It allows users to select a custom domain name for an additional fee. C) It allows users to share events and subscribe to public calendars for new events. D) It is an instant messaging client. E) It is an online office suite comprised of a spreadsheet application, a word processor, and a presentation application. B) It allows users to select a custom domain name for an additional fee. 36) Which of the following Google Apps is an instant messaging client? A) Gmail B) Google Calendar C) Google Talk D) Google Sites E) Google Docs C) Google Talk 37) ________ is an online office suite comprised of a spreadsheet application, a word processor, and a presentation application. A) Gmail B) Google Talk C) Google Sites D) Google Calendar E) Google Docs E) Google Docs 38) Which of the following statements is true about Google Sites? A) It is an enterprise-level collaboration tool that allows users to create group Web sites and share team information. B) It allows users to select a custom domain name for an additional fee. C) It allows users to share events and subscribe to public calendars for new events. D) It is an instant messaging client. E) It is an online office suite comprised of a spreadsheet application, a word processor, and a presentation application. A) It is an enterprise-level collaboration tool that allows users to create group Web sites and share team information. 39) A(n) ________ system allows users to publish, edit, version track, and retrieve digital information. A) social presence B) collective intelligence C) application sharing D) content management E) peer production D) content management 40) Which of the following statements is true about content management systems? A) It is the creation of goods or services by self-organizing communities. B) The creation of the goods or services is dependent on the incremental contributions of the participants. C) It allows the assignment of different roles for different users. D) Anyone can help in producing or improving the final outcome. E) It is a family of syndication feeds used to publish the most current blogs, podcasts, videos, and news stories. C) It allows the assignment of different roles for different users. 41) Which of the following is the responsibility of an administrator in a content management system? A) editing the content into a final form B) managing account access levels to the digital information C) sharing team information D) publishing new information E) creating database applications B) managing account access levels to the digital information 42) ________ is the creation of goods or services by self-organizing communities. A) Peer production B) A folksonomy C) Creative commons D) Groupware E) Social software A) Peer production 43) Which of the following statements is true about peer production? A) The creator is responsible for publishing new information. B) Only editors have the right to develop new content. C) It is also known as enterprise content systems. D) Anyone can help in producing or improving the final outcome. E) The guest is a person who can only view the digital information. ? 44) Which of the following occurs during wiki wars? A) editors do not agree with the creators of the content B) participants debate on a particular topic before creation C) administrators refuse to publish a creator's content D) guests edit the creator's content without permission E) contributors continuously edit or delete each others' posts E) contributors continuously edit or delete each others' posts 45) ________ is a phenomenon where companies use everyday people as a cheap labor force. A) Nearshoring B) Phishing C) Crowdsourcing D) Narrowcasting E) Pharming C) Crowdsourcing 46) ________ enables people to work in more flexible ways on a variety of Internet-related projects. A) E-filing B) E-auction C) E-tailing D) E-lancing E) E-timing D) E-lancing 47) ________ sites create social online communities where individuals with a broad and diverse set of interests meet and collaborate. A) Crowdsourcing B) Social cataloging C) Social networking D) Social bookmarking E) Media sharing C) Social networking 48) Which of the following statements is true about viral marketing? A) It uses the network effect to increase brand awareness. B) It uses everyday people as a cheap labor force. C) It is the dissemination of information to a narrow audience. D) It enables people to work in more flexible ways on a variety of Internet-related projects. E) It is used to market a product without the audience realizing it. A) It uses the network effect to increase brand awareness. 49) Which of the following is a critical factor in the success of a viral marketing campaign? A) restricting access to viral content B) doing what the audience expects C) making sequels D) restricting easy distribution E) distributing products for free C) making sequels 50) ________ attempts to provide relevant search results by including content from blogs and microblogging services. A) Social search B) OpenSearch C) Enterprise search D) Metasearch E) Netsearch A) Social search 51) Which of the following statements is true about Real Simple Syndication (RSS)? A) It is used to increase brand awareness through the network effect. B) It is used to disseminate information to a narrow audience. C) It is used to market the product without the audience realizing it. D) It is used to enable people to work in more flexible ways on a variety of Internet-related projects. E) It is used to publish the most current blogs, podcasts, videos, and news stories. E) It is used to publish the most current blogs, podcasts, videos, and news stories. 52) For companies operating in the digital world, online collaboration with suppliers, business partners, and customers is crucial to being successful. ________ allow(s) data to be accessed without intimate knowledge of other organizations' systems, enabling machine-to-machine interaction over the Internet. A) Web services B) Widgets C) RSS feeds D) Social search E) Peer production A) Web services 53) Android is a Web service hosted by Google to ________. A) create customized search features B) build mobile phone applications C) manage personal calendars D) integrate Google's mapping system into Web sites E) allow users to build applications that work with multiple social communities B) build mobile phone applications 54) Which of the following statements is true about widgets? A) They can be placed on a desktop, but cannot be integrated into a Web page. B) They can integrate two or more Web services. C) They are created by the integration of Web services and mashups. D) They are small interactive tools used for a single purpose. E) They can be integrated into a Web page, but cannot be placed on a desktop. D) They are small interactive tools used for a single purpose. 55) Together, Web services and widgets enable the creation of ________. A) protocols B) mashups C) codecs D) folksonomies E) tag clouds B) mashups 56) Which of the following statements is true about a mashup? A) It is a small interactive tool used for a single purpose. B) It is used to increase brand awareness through the network effect. C) It is the process of allowing companies to use everyday people as a cheap labor force. D) It is used to disseminate information to a narrow audience. E) It is an application or a Web site that integrates one or more Web services. E) It is an application or a Web site that integrates one or more Web services. 57) Which of the following is a reason for the development of semantic Web? A) Web pages can be understood by people but not by computers. B) Users should be able to use any device in any network for any service. C) Users give a lot of unnecessary personal information to social networking sites. D) Widgets cannot be integrated into Web pages. E) Users are skeptical while making purchases online due to the fear of getting cheated. A) Web pages can be understood by people but not by computers. 58) Which of the followings is NOT true about an Enterprise 2.0 strategy? A) Web 2.0 sites base their success on user-driven self-expression. B) Enterprise 2.0 applications are not suited to traditional top-down organizational structures. C) Enterprise 2.0 applications should be driven by a specific usage context. D) Organization-wide Enterprise 2.0 implementations typically need changes in terms of organizational culture. E) Within organizations, the critical mass needed for an Enterprise 2.0 application is often easily achieved. E) Within organizations, the critical mass needed for an Enterprise 2.0 application is often easily achieved. 59) Enterprise 2.0 is likely to fail if ________. A) an organization's workforce is dominated by baby boomers B) an organization has a flat organizational hierarchy C) an organization emphasizes open communication D) an organization's workforce is dominated by millennials E) it is integrated well with an organization's existing information systems infrastructure A) an organization's workforce is dominated by baby boomers 68) ________ is a computer networking model in which multiple types of computers are networked together to share data and services. A) Centralized computing B) Mainframe computing C) Task computing D) Distributed computing E) Serial computing D) Distributed computing 69) A(n) ________ is a computer network that spans a relatively small area, allowing all computer users to connect with each other to share data and peripheral devices, such as printers. A) enterprise network B) wide area network C) campus area network D) local area network E) value-added network D) local area network 70) A(n) ________ is a wide area network connecting disparate networks of a single organization into a single network. A) value-added network B) global network C) enterprise network D) local area network E) personal area network C) enterprise network 71) ________ are private, third-party-managed medium-speed WANs that are shared by multiple organizations. A) Value-added networks B) Enterprise networks C) Global networks D) Local area networks E) Personal area networks A) Value-added networks 72) A(n) ________ is an emerging technology that uses wireless communication to exchange data between computing devices using short-range radio communication, typically within an area of 10 meters. A) value-added network B) local area network C) personal area network D) enterprise network E) campus area network C) personal area network 73) ________ are network services that include the storing, accessing, and delivering of text, binary, graphic, and digitized video and audio data across a network. A) Print services B) File services C) Message services D) Application services E) Software services C) Message services 74) The high-speed central networks to which many smaller networks can be connected are known as ________. A) last-mile networks B) ISPs C) Internet exchange points D) private branch exchanges E) backbones E) backbones 75) Which of the following wireless communication technologies uses high-frequency light waves to transmit data on an unobstructed path between nodes—computers or some other device such as a printer—on a network at a distance of up to 24.4 meters? A) Bluetooth B) wireless LAN C) high-frequency radio D) infrared line of sight E) microwaves D) infrared line of sight 76) WLANs based on a family of standards called 802.11 are also referred to as ________. A) Bluetooth B) wireless fidelity C) ethernet D) personal area networks E) infrared line of sight B) wireless fidelity 77) Which of the following is a characteristic of terrestrial microwave communication? A) high attenuation B) speeds up to 16 Mbps C) low expense D) high susceptibility to eavesdropping E) low electromagnetic interference D) high susceptibility to eavesdropping 78) ________ is the set of rules that governs how a given node or workstation gains access to the network to send or receive data. A) Media access control B) Logical link control C) Hypertext transfer protocol D) File transfer protocol E) Internet control message protocol A) Media access control 79) ________ is a commonly used method of random access control, in which each workstation "listens" to traffic on the transmission medium (either wired or wireless) to determine whether a message is being transmitted. A) Code division multiple access B) Carrier sense multiple access C) Hybrid coordination function D) Group packet radio service E) Point coordination function B) Carrier sense multiple access 80) In a(n) ________ network all nodes or workstations are connected to a central hub, or concentrator, through which all messages pass. A) ring B) bus C) star D) mesh E) tree C) star 81) Which of the following network topologies is capable of covering the largest distance? A) star network B) bus network C) ring network D) mesh network E) tree network C) ring network 82) Which of the following statements is true of a bus network topology? A) A bus network has the most complex wiring layout. B) Extending a bus network is more difficult to achieve than it is for other topologies. C) A bus network topology enables all network nodes to receive the same message through the network cable at the same time. D) The configuration of bus networks facilitates easy diagnosis and isolation of network faults. E) In a bus network, every computer and device is connected to every other computer and device. C) A bus network topology enables all network nodes to receive the same message through the network cable at the same time. 83) As per the Open Systems Interconnection (OSI) model, which of the following layers defines the way data is formatted, converted, and encoded? A) application layer B) transport layer C) presentation layer D) data link layer E) session layer C) presentation layer 84) According to the OSI model, the ________ layer defines the protocols for structuring messages. A) physical B) session C) transport D) data link E) network C) transport 85) According to the OSI model, the physical layer defines ________. A) the protocols for data routing to ensure that data arrives at the correct destination B) the way data is formatted, converted, and encoded C) the mechanism for communicating with the transmission media and interface hardware D) the way that application programs such as electronic mail interact with the network E) the protocols for structuring messages C) the mechanism for communicating with the transmission media and interface hardware 86) A ________ is a device that converts digital signals from a computer into analog signals so that telephone lines may be used as a transmission medium to send and receive electronic data. A) modem B) LAN card C) network adapter D) PCI connector E) USB port A) modem 87) A ________ is a PC expansion board that plugs into a computer so that it can be connected to a network. A) transceiver B) multiport repeater C) cable router D) network interface card E) modular connector D) network interface card 88) A(n) ________ is a piece of networking hardware that manages multiple access points and can be used to manage transmission power and channel allocation to establish desired coverage throughout a building and minimize interference between individual access points. A) router B) wireless controller C) network switch D) modem E) network interface card B) wireless controller 89) Which of the following entities is responsible for managing global and country code top-level domains, as well as global IP number space assignments? A) American Registry for Internet Numbers (ARIN) B) World Wide Web Consortium (W3C) C) Internet Assigned Numbers Authority (IANA) D) Internet Governance Forum (IGF) E) European Organization for Nuclear Research (CERN) C) Internet Assigned Numbers Authority (IANA) 90) Which of the following Internet connectivity technologies enables data to be sent over existing copper telephone lines by sending digital pulses in the high-frequency area of telephone wires? A) integrated services digital network technology B) digital subscriber line technology C) dial-up service technology D) cable modem technology E) fiber to the home technology B) digital subscriber line technology 91) Computers working as servers on the Internet are known as ________. A) network adapters B) modems C) network switches D) Ethernet hubs E) Internet hosts E) Internet hosts 92) A(n) ________ is a unique identifier that should be created and used when designing a database for each type of entity, in order to store and retrieve data accurately. A) foreign key B) surrogate key C) primary key D) superkey E) candidate key C) primary key 93) In which of the following database models does the DBMS view and present entities as two-dimensional tables, with records as rows, and attributes as columns? A) relational database model B) hierarchical database model C) network database model D) object-oriented database model E) semantic database model A) relational database model 94) ________ is a technique to make complex databases more efficient and more easily handled by the DBMS. A) Assertion B) Exception handling C) Normalization D) Model elimination E) Structural induction C) Normalization 1) Which of the following statements is true about business intelligence? A) It is the act of outsourcing tasks, traditionally performed by an employee or contractor, to an undefined, large group of people or community, through the use of information technology. B) It is the process by which a customer-owned mutual organization or co-operative changes legal form to a joint stock company. C) It is the use of information systems to gather and analyze information from internal and external sources in order to make better business decisions. D) It is an organization's process of defining its strategy, or direction, and making decisions on allocating its resources to pursue this strategy, including its capital and people. E) It is the use of human resources to gather and analyze information from external sources in order to make better business decisions. C) It is the use of information systems to gather and analyze information from internal and external sources in order to make better business decisions. 2) "Backward looking" budgets are typically based on ________. A) forecasts B) marketing research C) future trends D) historical data E) current market conditions D) historical data 3) Responding to threats and opportunities and continuous planning is based on analyzing data from the ________ level of the organization. A) operational B) executive C) tactical D) business E) strategic A) operational 4) Taking entities as tables, each row is a ________. A) field B) record C) attribute D) form E) query B) record 5) Taking entities as tables, each column is a(n) ________. A) attribute B) record C) form D) bot E) query A) attribute 6) An attribute is also referred to as a(n) ________. A) form B) record C) field D) query E) bot C) field 7) A(n) ________ is a collection of related attributes about a single instance of an entity. A) bot B) form C) query D) field E) record E) record 8) In DBMS, data are kept separate from the applications' programming code. This means that ________. A) an application cannot be changed without making changes to the database B) an application's programming code needs to be updated continuously to keep up with the database C) an application needs to be changed when database is changed D) database does not need to be changed if a change is made to an application E) database needs to be changed when a change is made to an application D) database does not need to be changed if a change is made to an application 9) A common way to represent a data model is a(n) ________. A) entity-relationship diagram B) normalization diagram C) report-query diagram D) form-record diagram E) report generator A) entity-relationship diagram 10) Data type helps the DBMS ________. A) present the data in a useful format B) format data C) allocate storage space D) eliminate data duplication E) retrieve information C) allocate storage space 11) To finalize the data model in order to actually build the database, a process called ________ is used to make sure the database will operate efficiently. A) slicing and dicing B) normalization C) clustering D) visualization E) inferencing B) normalization 12) In DBMS, normalization helps to ________. A) eliminate data duplication B) retrieve information C) format data D) present the data in a useful format E) allocate storage space A) eliminate data duplication 13) Once the data model is created, the format of the data is documented in a(n) ________. A) data warehouse B) data mart C) expert system D) data type E) data dictionary E) data dictionary 14) A data dictionary is also known as ________. A) data mart B) data warehouse C) metadata repository D) entity-relationship diagram E) clickstream data C) metadata repository 15) Bringes, a retail chain, has retail stores across three states. With its current legacy system, Bringes is having problems tracking the inventory levels for its stores. It is planning to implement Oracle database systems to replace this legacy system. Which of the following most supports Bringes' decision to replace its legacy system with an Oracle database system? A) Implementing Oracle database system means hiring additional specialized personnel to manage it. B) Partial implementation of the Oracle database system can create more problems than it solves. C) Conversion cost required for the implementation of Oracle database system is supported by IT budgets. D) Bringes' channel partners use a database system that supports the Oracle database system. E) Maintenance cost of an Oracle database system is more than the legacy system presently in use. D) Bringes' channel partners use a database system that supports the Oracle database system. 16) Treston, an automobile manufacturer, has recently implemented a new database system. It is confident that this system will help enhance the company's internal (employees) and external (customers and channel partners) communication. Treston is planning to pursue a just-in-time inventory system soon after the database system is implemented. After the implementation of the database system, however, Treston realized that the database system was not effective. Which of the following, if true, can be cited as a reason for the failure of Treston's database system? A) Microsoft launched a new version of Enterprise Microsoft Access which is better than Treston's database system. B) The maintenance cost of Treston's new database system was three times more than the one it was previously using. C) Treston's new database system was not supported by the database system of its suppliers and distributors. D) Treston's competitors implemented its database a few days prior to Treston's implementation date. E) Treston had to hire specialized personnel to manage its new database system, which added to its costs. C) Treston's new database system was not supported by the database system of its suppliers and distributors. 17) Business rules are captured by the designers of the database and included in the data dictionary to ________. A) organize and sort the data, complete calculations, and allocate storage space B) prevent illegal or illogical entries from entering the database C) eliminate data duplication D) make sure that each table contains only attributes that are related to the entity E) capture the structure of the database B) prevent illegal or illogical entries from entering the database 18) ________ are used to capture data to be added, modified, or deleted from the database. A) Forms B) Reports C) Queries D) Bots E) Layers A) Forms 19) A(n) ________ is a compilation of data from the database that is organized and produced in printed format. A) form B) attribute C) field D) entity E) report E) report 20) A query is used to ________. A) organize and sort the data in a database B) allocate storage space for a database C) eliminate data duplication D) retrieve information from a database E) prevent illegal or illogical entries from entering the database D) retrieve information from a database 21) Which of the following statements is true about query by example capabilities in a database? A) It helps to create a query quickly and easily. B) It refers to immediate automated responses to the requests of users. C) It is designed to handle multiple concurrent transactions from customers. D) Its primary use is gathering new information. E) It prevents illegal entries into a database. A) It helps to create a query quickly and easily. 22) The systems that are used to interact with customers and run a business in real time are called ________. A) tactical systems B) strategic systems C) operational systems D) informational systems E) executive systems C) operational systems 23) ________ is the data that is deemed most important in the operation of a business. A) Metadata B) Master data C) Reference data D) Query data E) Tactical data B) Master data 24) Which of the following statements is true about an operational system? A) Its primary purpose is to support managerial decision making. B) It consists of historical or point-in-time data. C) Its goal is to enhance ease of access and use. D) It consists of narrow and simple updates and queries. E) It is primarily used by managers. D) It consists of narrow and simple updates and queries. 25) Which of the following statements is true about informational systems? A) Its primary purpose is to run the business on a current basis. B) It is primarily used by online customers, clerks, salespersons, and administrators. C) It consists of narrow and simple updates and queries. D) Its goal is to enhance performance. E) Its goal is to enhance ease of access and use. E) Its goal is to enhance ease of access and use. 26) ________ integrates data from various operational systems. A) Data warehouse B) Metadata repository C) Data modeling D) Master data E) Data mining A) Data warehouse 27) The purpose of a data warehouse is to ________. A) standardize the format of data retrieved from different systems B) allow managers to run queries and reports themselves without having to know query languages or the structure of the underlying data C) provide capabilities for discovering "hidden" predictive relationships in the data D) put key business information into the hands of more decision makers E) reduce the complexity of the data to be analyzed D) put key business information into the hands of more decision makers 28) ________ refers to the process of standardizing the format of data retrieved from different systems. A) Data cleansing B) Data mining C) Normalization D) Content mining E) Clustering A) Data cleansing 29) A ________ is a data warehouse that is limited in scope. A) metadata repository B) master data C) data model D) data reduction E) data mart E) data mart 30) Which of the following statements is true about a data mart? A) It standardizes the format of data retrieved from different systems. B) It contains selected information from the data warehouse. C) It stores master data only. D) It is is a compilation of data from the database that is organized and produced in printed format. E) It helps to eliminate data duplication. B) It contains selected information from the data warehouse. 31) Information and knowledge discovery tools are used primarily to ________. A) standardize the format of data retrieved from different systems B) reduce the complexity of the data to be analyzed C) extract information from existing data D) discover "hidden" predictive relationships in the data E) allow managers to learn query language for the effective maintenance of the database C) extract information from existing data 32) ________ are produced at predefined intervals to support routine decisions. A) Ad hoc queries B) Exception reports C) Drill-down reports D) Scheduled reports E) Key-indicator reports D) Scheduled reports 33) Which of the following statements is true about key-indicator reports? A) They provide a summary of critical information on a recurring schedule. B) They help analyze why a key indicator is not at an appropriate level or why an exception occurred. C) They are produced at predefined intervals to support routine decisions. D) They highlight situations that are out of the normal range. E) They answer unplanned information requests to support a nonroutine decision. A) They provide a summary of critical information on a recurring schedule. 34) Which of the following statements is true about exception reports? A) They help analyze why a key indicator is not at an appropriate level or why an exception occurred. B) They are produced at predefined intervals to support routine decisions. C) They answer unplanned information requests to support a nonroutine decision. D) They provide a summary of critical information on a recurring schedule. E) They highlight situations that are out of the normal range. E) They highlight situations that are out of the normal range. 35) ________ help analyze why a key indicator is not at an appropriate level or why an exception occurred. A) Ad hoc queries B) Exception reports C) Drill-down reports D) Scheduled reports E) Key-indicator reports C) Drill-down reports 36) Which of the following statements is true about ad hoc queries? A) They are produced at predefined intervals to support routine decisions. B) They provide a summary of critical information on a recurring schedule. C) They help analyze why a key indicator is not at an appropriate level or why an exception occurred. D) They answer unplanned information requests to support a nonroutine decision. E) They highlight situations that are out of the normal range. D) They answer unplanned information requests to support a nonroutine decision. 37) ________ refers to the process of quickly conducting complex, multidimensional analyses of data stored in a database that is optimized for retrieval, typically using graphical software tools. A) Inferencing B) Online analytical processing C) Normalization D) Data mining E) Predictive analysis B) Online analytical processing 38) Online analytical processing tools enable users to ________. A) discover "hidden" predictive relationships in the data B) find associations or correlations among sets of items C) analyze different dimensions of data beyond simple data summaries D) group related records together on the basis of having similar values for attributes E) extract textual information from Web documents C) analyze different dimensions of data beyond simple data summaries 39) Which of the following statements is true about online analytical processing server? A) It is a data structure allowing for multiple dimensions to be added to a traditional two-dimensional table. B) It groups related records together on the basis of having similar values for attributes. C) It allows you to make hypothetical changes to the data associated with a problem and observe how these changes influence the results. D) It uses reasoning methods based on knowledge about a specific problem domain in order to provide advice. E) It understands how data is organized in the database and has special functions for analyzing the data. E) It understands how data is organized in the database and has special functions for analyzing the data. 40) How do online analytical processing systems improve performance? A) They preaggregate data so that only the subset of the data necessary for the queries is extracted. B) They use reasoning methods based on knowledge about a specific problem domain. C) They make hypothetical changes to the data associated with a problem. D) They allow for multiple dimensions to be added to a traditional two-dimensional table. E) They provide capabilities for discovering "hidden" predictive relationships in the data. A) They preaggregate data so that only the subset of the data necessary for the queries is extracted. 41) In online analytic processing systems, ________ are the values or numbers the user wants to analyze. A) dimensions B) forms C) measures D) queries E) entities C) measures 42) In online analytic processing systems, ________ provide a way to summarize the data. A) forms B) measures C) facts D) records E) dimensions E) dimensions 43) Which of the following statements is true about the online analytic processing cube? A) It allows you to make hypothetical changes to the data associated with a problem and observe how these changes influence the results. B) It groups related records together on the basis of having similar values for attributes. C) It understands how data is organized in the database and has special functions for analyzing the data. D) It is a data structure allowing for multiple dimensions to be added to a traditional two-dimensional table. E) It uses reasoning methods based on knowledge about a specific problem domain in order to provide advice. D) It is a data structure allowing for multiple dimensions to be added to a traditional two-dimensional table. 44) Data mining complements online analytic processing in that it ________. A) finds associations or correlations among sets of items B) provides capabilities for discovering "hidden" predictive relationships in the data C) extracts textual information from Web documents D) groups related records together on the basis of having similar values for attributes E) analyzes different dimensions of data beyond simple data summaries B) provides capabilities for discovering "hidden" predictive relationships in the data 45) ________ can be achieved by rolling up a data cube to the smallest level of aggregation needed, reducing the dimensionality, or dividing continuous measures into discrete intervals. A) Data cleansing B) Normalization C) Clustering D) Data reduction E) Inferencing D) Data reduction 46) Which of the following statements is true about association discovery? A) It is a technique used to find correlations among sets of items. B) It is the process of grouping related records together on the basis of having similar values for attributes. C) It is the use of analytical techniques for extracting information from textual documents. D) It is a type of intelligent system that uses reasoning methods based on knowledge about a specific problem domain in order to provide advice. E) It makes sure that each table contains only attributes that are related to the entity. A) It is a technique used to find correlations among sets of items. 47) ________ is the process of grouping related records together on the basis of having similar values for attributes. A) Normalization B) Data mining C) Clustering D) Inferencing E) Slicing and dicing C) Clustering 48) Which of the following is a recording of a user's path through a Web site? A) clustering B) normalization C) slicing and dicing D) clickstream data E) inferencing D) clickstream data 49) ________ is the ability to attract and keep visitors. A) Normalization B) Inferencing C) Stickiness D) Crowdsourcing E) Visualization C) Stickiness 50) Which of the following analysis are you conducting to make hypothetical changes to the data associated with a problem and observe how these changes influence the results? A) predictive analysis B) time-series analysis C) linear regression analysis D) what-if analysis E) multivariate analysis D) what-if analysis 51) Which of the following statements is true about expert systems? A) It is composed of a network of processing elements that work in parallel to complete a task, attempt to approximate the functioning of the human brain and can learn by example. B) It is a program that works in the background to provide some service when a specific event occurs. C) It uses reasoning methods based on knowledge about a specific problem domain in order to provide advice. D) It allows you to make hypothetical changes to the data associated with a problem and observe how these changes influence the results. E) It groups related records together on the basis of having similar values for attributes. C) It uses reasoning methods based on knowledge about a specific problem domain in order to provide advice. 52) Which of the following statements is true about a rule in expert systems? A) It groups related records together on the basis of having similar values for attributes. B) It makes sure that each table contains only attributes that are related to the entity. C) It allows multiple dimensions to be added to a traditional two-dimensional table. D) It is typically expressed using an "if--then" format. E) It allows you to make hypothetical changes to the data associated with a problem and observe how these changes influence the results. D) It is typically expressed using an "if--then" format. 53) ________ allows expert system rules to be represented using approximations or subjective values in order to handle situations where information about a problem is incomplete. A) Fuzzy logic B) Normalization C) Clustering D) What-if analysis E) Stickiness A) Fuzzy logic 54) The processing in an ES is called ________. A) clustering B) inferencing C) normalization D) recommending E) data cleansing B) inferencing 55) Which of the following statements is true about neural networks? A) It allows multiple dimensions to be added to a traditional two-dimensional table. B) It works in the background to provide some service when a specific event occurs. C) It attempts to approximate the functioning of the human brain and can learn by example. D) It uses reasoning methods based on knowledge about a specific problem domain in order to provide advice. E) It helps analyze why a key indicator is not at an appropriate level or why an exception occurred. C) It attempts to approximate the functioning of the human brain and can learn by example. 56) Which of the following statements is true about user agents? A) They are also known as Web spiders. B) They are agents that search to find the best price for a particular product you wish to purchase. C) They are agents that continuously analyze large data warehouses to detect changes deemed important by a user. D) They are agents that automatically perform a task for a user. E) They are agents designed by spammers and other Internet attackers to farm e-mail addresses off Web sites or deposit spyware on machines. D) They are agents that automatically perform a task for a user. 57) Which of the following is a role of monitoring and sensing agents? A) tracking inventory levels B) sending a report at the first of the month C) assembling customized news D) analyzing data warehouses to detect changes deemed important to a user E) finding the best price for a particular product the user wants to purchase A) tracking inventory levels 58) Which of the following is a role of data mining agents? A) tracking inventory levels B) sending a report at the first of the month C) assembling customized news D) analyzing data warehouses to detect changes deemed important to a user E) finding the best price for a particular product the user wants to purchase D) analyzing data warehouses to detect changes deemed important to a user 59) Which of the following statements is true about explicit knowledge assets? A) It reflects the processes and procedures that are located in a person's mind on how to effectively perform a particular task. B) It reflects the person's ability to effectively solve a problem without external help. C) It reflects knowledge that can be documented, archived, and codified, often with the help of information systems. D) It reflects an individual's special knowledge about a new-to-the-world product. E) It reflects the strategies that are located in a person's mind on how to effectively perform a particular task. C) It reflects knowledge that can be documented, archived, and codified, often with the help of information systems. 60) Which of the following is the primary goal of a knowledge management system? A) Identifying how to recognize, generate, store, share, and manage tacit knowledge. B) Continuously analyzing large data warehouses to detect changes deemed important by a user. C) Grouping related records together on the basis of having similar values for attributes. D) Allowing hypothetical changes to the data associated with a problem to observe how these changes influence the results. E) Identifying how to recognize, generate, store, share, and manage explicit knowledge. A) Identifying how to recognize, generate, store, share, and manage tacit knowledge. 61) Social network analysis is a technique that attempts to ________. A) analyze large data warehouses to detect changes deemed important by a user B) analyze why a key indicator is not at an appropriate level or why an exception occurred C) discover "hidden" predictive relationships in the data D) allow hypothetical changes to the data associated with a problem to observe how these changes influence the results E) find experts in particular subject areas E) find experts in particular subject areas 62) ________ refers to the display of complex data relationships using a variety of graphical methods. A) Normalization B) Visualization C) Clustering D) Inferencing E) Textual mining B) Visualization 63) Which of the following statements is true about digital dashboards? A) It is the combination of various analysis techniques and interactive visualization to solve complex problems. B) It supports usage models like push reporting, exception reporting and alerts, and pull reporting. C) It can visualize features and relationships between features drawn from an underlying geographic database. D) Analysts can combine geographic, demographic, and other data for locating target customers. E) It a system for creating, storing, analyzing, and managing geographically referenced information. B) It supports usage models like push reporting, exception reporting and alerts, and pull reporting. See More Please allow access to your computer’s microphone to use Voice Recording. Having trouble? Click here for help. We can’t access your microphone! Click the icon above to update your browser permissions and try again Example: Reload the page to try again! Reload Press Cmd-0 to reset your zoom Press Ctrl-0 to reset your zoom It looks like your browser might be zoomed in or out. Your browser needs to be zoomed to a normal size to record audio. Please upgrade Flash or install Chrome to use Voice Recording. For more help, see our troubleshooting page. Your microphone is muted For help fixing this issue, see this FAQ. Star this term You can study starred terms together Voice Recording
__label__pos
0.92356
Source pypy / pypy / rpython / rint.py 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 import sys from pypy.tool.pairtype import pairtype from pypy.annotation import model as annmodel from pypy.objspace.flow.operation import op_appendices from pypy.rpython.lltypesystem.lltype import Signed, Unsigned, Bool, Float, \ Void, Char, UniChar, malloc, UnsignedLongLong, \ SignedLongLong, build_number, Number, cast_primitive, typeOf, \ SignedLongLongLong from pypy.rpython.rmodel import IntegerRepr, inputconst from pypy.rlib.rarithmetic import intmask, r_int, r_uint, r_ulonglong, \ r_longlong, is_emulated_long from pypy.rpython.error import TyperError, MissingRTypeOperation from pypy.rpython.rmodel import log from pypy.rlib import objectmodel _integer_reprs = {} def getintegerrepr(lltype, prefix=None): try: return _integer_reprs[lltype] except KeyError: pass repr = _integer_reprs[lltype] = IntegerRepr(lltype, prefix) return repr class __extend__(annmodel.SomeInteger): def rtyper_makerepr(self, rtyper): lltype = build_number(None, self.knowntype) return getintegerrepr(lltype) def rtyper_makekey(self): return self.__class__, self.knowntype signed_repr = getintegerrepr(Signed, 'int_') signedlonglong_repr = getintegerrepr(SignedLongLong, 'llong_') signedlonglonglong_repr = getintegerrepr(SignedLongLongLong, 'lllong_') unsigned_repr = getintegerrepr(Unsigned, 'uint_') unsignedlonglong_repr = getintegerrepr(UnsignedLongLong, 'ullong_') class __extend__(pairtype(IntegerRepr, IntegerRepr)): def convert_from_to((r_from, r_to), v, llops): if r_from.lowleveltype == Signed and r_to.lowleveltype == Unsigned: log.debug('explicit cast_int_to_uint') return llops.genop('cast_int_to_uint', [v], resulttype=Unsigned) if r_from.lowleveltype == Unsigned and r_to.lowleveltype == Signed: log.debug('explicit cast_uint_to_int') return llops.genop('cast_uint_to_int', [v], resulttype=Signed) if r_from.lowleveltype == Signed and r_to.lowleveltype == SignedLongLong: return llops.genop('cast_int_to_longlong', [v], resulttype=SignedLongLong) if r_from.lowleveltype == SignedLongLong and r_to.lowleveltype == Signed: return llops.genop('truncate_longlong_to_int', [v], resulttype=Signed) return llops.genop('cast_primitive', [v], resulttype=r_to.lowleveltype) #arithmetic def rtype_add(_, hop): return _rtype_template(hop, 'add') rtype_inplace_add = rtype_add def rtype_add_ovf(_, hop): func = 'add_ovf' if hop.r_result.opprefix == 'int_': if hop.args_s[1].nonneg: func = 'add_nonneg_ovf' elif hop.args_s[0].nonneg: hop = hop.copy() hop.swap_fst_snd_args() func = 'add_nonneg_ovf' return _rtype_template(hop, func) def rtype_sub(_, hop): return _rtype_template(hop, 'sub') rtype_inplace_sub = rtype_sub def rtype_sub_ovf(_, hop): return _rtype_template(hop, 'sub_ovf') def rtype_mul(_, hop): return _rtype_template(hop, 'mul') rtype_inplace_mul = rtype_mul def rtype_mul_ovf(_, hop): return _rtype_template(hop, 'mul_ovf') def rtype_floordiv(_, hop): return _rtype_template(hop, 'floordiv', [ZeroDivisionError]) rtype_inplace_floordiv = rtype_floordiv def rtype_floordiv_ovf(_, hop): return _rtype_template(hop, 'floordiv_ovf', [ZeroDivisionError]) # turn 'div' on integers into 'floordiv' rtype_div = rtype_floordiv rtype_inplace_div = rtype_inplace_floordiv rtype_div_ovf = rtype_floordiv_ovf # 'def rtype_truediv' is delegated to the superclass FloatRepr def rtype_mod(_, hop): return _rtype_template(hop, 'mod', [ZeroDivisionError]) rtype_inplace_mod = rtype_mod def rtype_mod_ovf(_, hop): return _rtype_template(hop, 'mod_ovf', [ZeroDivisionError]) def rtype_xor(_, hop): return _rtype_template(hop, 'xor') rtype_inplace_xor = rtype_xor def rtype_and_(_, hop): return _rtype_template(hop, 'and') rtype_inplace_and = rtype_and_ def rtype_or_(_, hop): return _rtype_template(hop, 'or') rtype_inplace_or = rtype_or_ def rtype_lshift(_, hop): return _rtype_template(hop, 'lshift') rtype_inplace_lshift = rtype_lshift def rtype_lshift_ovf(_, hop): return _rtype_template(hop, 'lshift_ovf') def rtype_rshift(_, hop): return _rtype_template(hop, 'rshift') rtype_inplace_rshift = rtype_rshift #comparisons: eq is_ ne lt le gt ge def rtype_eq(_, hop): return _rtype_compare_template(hop, 'eq') rtype_is_ = rtype_eq def rtype_ne(_, hop): return _rtype_compare_template(hop, 'ne') def rtype_lt(_, hop): return _rtype_compare_template(hop, 'lt') def rtype_le(_, hop): return _rtype_compare_template(hop, 'le') def rtype_gt(_, hop): return _rtype_compare_template(hop, 'gt') def rtype_ge(_, hop): return _rtype_compare_template(hop, 'ge') #Helper functions def _rtype_template(hop, func, implicit_excs=[]): if func.endswith('_ovf'): if hop.s_result.unsigned: raise TyperError("forbidden unsigned " + func) else: hop.has_implicit_exception(OverflowError) for implicit_exc in implicit_excs: if hop.has_implicit_exception(implicit_exc): appendix = op_appendices[implicit_exc] func += '_' + appendix r_result = hop.r_result if r_result.lowleveltype == Bool: repr = signed_repr else: repr = r_result if func.startswith(('lshift', 'rshift')): repr2 = signed_repr else: repr2 = repr vlist = hop.inputargs(repr, repr2) hop.exception_is_here() prefix = repr.opprefix v_res = hop.genop(prefix+func, vlist, resulttype=repr) bothnonneg = hop.args_s[0].nonneg and hop.args_s[1].nonneg if prefix in ('int_', 'llong_') and not bothnonneg: # cpython, and rpython, assumed that integer division truncates # towards -infinity. however, in C99 and most (all?) other # backends, integer division truncates towards 0. so assuming # that, we call a helper function that applies the necessary # correction in the right cases. op = func.split('_', 1)[0] if op == 'floordiv': llfunc = globals()['ll_correct_' + prefix + 'floordiv'] v_res = hop.gendirectcall(llfunc, vlist[0], vlist[1], v_res) elif op == 'mod': llfunc = globals()['ll_correct_' + prefix + 'mod'] v_res = hop.gendirectcall(llfunc, vlist[1], v_res) v_res = hop.llops.convertvar(v_res, repr, r_result) return v_res INT_BITS_1 = r_int.BITS - 1 LLONG_BITS_1 = r_longlong.BITS - 1 def ll_correct_int_floordiv(x, y, r): p = r * y if y < 0: u = p - x else: u = x - p return r + (u >> INT_BITS_1) def ll_correct_llong_floordiv(x, y, r): p = r * y if y < 0: u = p - x else: u = x - p return r + (u >> LLONG_BITS_1) def ll_correct_int_mod(y, r): if y < 0: u = -r else: u = r return r + (y & (u >> INT_BITS_1)) def ll_correct_llong_mod(y, r): if y < 0: u = -r else: u = r return r + (y & (u >> LLONG_BITS_1)) #Helper functions for comparisons def _rtype_compare_template(hop, func): s_int1, s_int2 = hop.args_s if s_int1.unsigned or s_int2.unsigned: if not s_int1.nonneg or not s_int2.nonneg: raise TyperError("comparing a signed and an unsigned number") repr = hop.rtyper.makerepr(annmodel.unionof(s_int1, s_int2)).as_int vlist = hop.inputargs(repr, repr) hop.exception_is_here() return hop.genop(repr.opprefix+func, vlist, resulttype=Bool) # class __extend__(IntegerRepr): def convert_const(self, value): if isinstance(value, objectmodel.Symbolic): return value T = typeOf(value) if isinstance(T, Number) or T is Bool: return cast_primitive(self.lowleveltype, value) raise TyperError("not an integer: %r" % (value,)) def get_ll_eq_function(self): return None get_ll_gt_function = get_ll_eq_function get_ll_lt_function = get_ll_eq_function get_ll_ge_function = get_ll_eq_function get_ll_le_function = get_ll_eq_function def get_ll_ge_function(self): return None def get_ll_hash_function(self): if (sys.maxint == 2147483647 and self.lowleveltype in (SignedLongLong, UnsignedLongLong)): return ll_hash_long_long return ll_hash_int get_ll_fasthash_function = get_ll_hash_function def get_ll_dummyval_obj(self, rtyper, s_value): # if >= 0, then all negative values are special if s_value.nonneg and self.lowleveltype is Signed: return signed_repr # whose ll_dummy_value is -1 else: return None ll_dummy_value = -1 def rtype_chr(_, hop): vlist = hop.inputargs(Signed) if hop.has_implicit_exception(ValueError): hop.exception_is_here() hop.gendirectcall(ll_check_chr, vlist[0]) else: hop.exception_cannot_occur() return hop.genop('cast_int_to_char', vlist, resulttype=Char) def rtype_unichr(_, hop): vlist = hop.inputargs(Signed) if hop.has_implicit_exception(ValueError): hop.exception_is_here() hop.gendirectcall(ll_check_unichr, vlist[0]) else: hop.exception_cannot_occur() return hop.genop('cast_int_to_unichar', vlist, resulttype=UniChar) def rtype_is_true(self, hop): assert self is self.as_int # rtype_is_true() is overridden in BoolRepr vlist = hop.inputargs(self) return hop.genop(self.opprefix + 'is_true', vlist, resulttype=Bool) #Unary arithmetic operations def rtype_abs(self, hop): self = self.as_int vlist = hop.inputargs(self) if hop.s_result.unsigned: return vlist[0] else: return hop.genop(self.opprefix + 'abs', vlist, resulttype=self) def rtype_abs_ovf(self, hop): self = self.as_int if hop.s_result.unsigned: raise TyperError("forbidden uint_abs_ovf") else: vlist = hop.inputargs(self) hop.has_implicit_exception(OverflowError) # record we know about it hop.exception_is_here() return hop.genop(self.opprefix + 'abs_ovf', vlist, resulttype=self) def rtype_invert(self, hop): self = self.as_int vlist = hop.inputargs(self) return hop.genop(self.opprefix + 'invert', vlist, resulttype=self) def rtype_neg(self, hop): self = self.as_int vlist = hop.inputargs(self) if hop.s_result.unsigned: # implement '-r_uint(x)' with unsigned subtraction '0 - x' zero = self.lowleveltype._defl() vlist.insert(0, hop.inputconst(self.lowleveltype, zero)) return hop.genop(self.opprefix + 'sub', vlist, resulttype=self) else: return hop.genop(self.opprefix + 'neg', vlist, resulttype=self) def rtype_neg_ovf(self, hop): self = self.as_int if hop.s_result.unsigned: # this is supported (and turns into just 0-x) for rbigint.py hop.exception_cannot_occur() return self.rtype_neg(hop) else: vlist = hop.inputargs(self) hop.has_implicit_exception(OverflowError) # record we know about it hop.exception_is_here() return hop.genop(self.opprefix + 'neg_ovf', vlist, resulttype=self) def rtype_pos(self, hop): self = self.as_int vlist = hop.inputargs(self) return vlist[0] def rtype_int(self, hop): if self.lowleveltype in (Unsigned, UnsignedLongLong): raise TyperError("use intmask() instead of int(r_uint(...))") vlist = hop.inputargs(Signed) hop.exception_cannot_occur() return vlist[0] def rtype_float(_, hop): vlist = hop.inputargs(Float) hop.exception_cannot_occur() return vlist[0] # version picked by specialisation based on which # type system rtyping is using, from <type_system>.ll_str module def ll_str(self, i): raise NotImplementedError ll_str._annspecialcase_ = "specialize:ts('ll_str.ll_int_str')" def rtype_hex(self, hop): self = self.as_int varg = hop.inputarg(self, 0) true = inputconst(Bool, True) fn = hop.rtyper.type_system.ll_str.ll_int2hex return hop.gendirectcall(fn, varg, true) def rtype_oct(self, hop): self = self.as_int varg = hop.inputarg(self, 0) true = inputconst(Bool, True) fn = hop.rtyper.type_system.ll_str.ll_int2oct return hop.gendirectcall(fn, varg, true) def ll_hash_int(n): return intmask(n) def ll_hash_long_long(n): return intmask(intmask(n) + 9 * intmask(n >> 32)) def ll_check_chr(n): if 0 <= n <= 255: return else: raise ValueError def ll_check_unichr(n): from pypy.rlib.runicode import MAXUNICODE if 0 <= n <= MAXUNICODE: return else: raise ValueError
__label__pos
0.909853
Print all the palindromic permutations of given string in alphabetic order in C++ C++Server Side ProgrammingProgramming In this problem, we are given a string of size n. And we have to print all possible palindromic permutation that can be generated using the characters of the string in alphabetical order. If palindrome is not created using the string print ‘-1’. Let’s take an example to understand the topic better − Input: string = “abcba” Output : abcba bacba Now, to solve this we need to find all the palindromes possible and then arrange them in alphabetical order(lexicographical order). Or another way could be finding the lexicographically first palindrome that is made from the string. Then find the sequentially next palindrome of the sequence. For this, we will do the following steps − Step 1 − store the frequency of occurrence of all characters of the string. Step 2 − Now check if the string can form a palindrome. If no PRINT “No palindrome can be formed ” and exit. Otherwise do − Step 3 − Create a string based on the logic that all characters with even occurrence form a string and odd occurrence from others. And we will sandwich the odd string between even string (i.e. in the form even_string + odd_string + even_string). Using this we can find lexicographically first palindrome. Then find the next by check concurrent lexicographical combinations. Example PROGRAM to illustrate the concept − #include <iostream> #include <string.h> using namespace std; const char MAX_CHAR = 26; void countFreq(char str[], int freq[], int n){    for (int i = 0; i < n; i++)       freq[str[i] - 'a']++; } bool canMakePalindrome(int freq[], int n){    int count_odd = 0;    for (int i = 0; i < 26; i++)       if (freq[i] % 2 != 0)          count_odd++;       if (n % 2 == 0) {          if (count_odd > 0)             return false;          else             return true;       }       if (count_odd != 1)          return false;    return true; } bool isPalimdrome(char str[], int n){    int freq[26] = { 0 };    countFreq(str, freq, n);    if (!canMakePalindrome(freq, n))       return false;    char odd_char;    for (int i = 0; i < 26; i++) {       if (freq[i] % 2 != 0) {          freq[i]--;          odd_char = (char)(i + 'a');          break;       }    }    int front_index = 0, rear_index = n - 1;    for (int i = 0; i < 26; i++) {       if (freq[i] != 0) {          char ch = (char)(i + 'a');          for (int j = 1; j <= freq[i] / 2; j++) {             str[front_index++] = ch;             str[rear_index--] = ch;          }       }    }    if (front_index == rear_index)       str[front_index] = odd_char;    return true; } void reverse(char str[], int i, int j){    while (i < j) {       swap(str[i], str[j]);       i++;       j--;    } } bool nextPalindrome(char str[], int n){    if (n <= 3)       return false;    int mid = n / 2 - 1;    int i, j;    for (i = mid - 1; i >= 0; i--)       if (str[i] < str[i + 1])          break;       if (i < 0)          return false;    int smallest = i + 1;    for (j = i + 2; j <= mid; j++)       if (str[j] > str[i] && str[j] < str[smallest])          smallest = j;    swap(str[i], str[smallest]);    swap(str[n - i - 1], str[n - smallest - 1]);    reverse(str, i + 1, mid);    if (n % 2 == 0)       reverse(str, mid + 1, n - i - 2);    else       reverse(str, mid + 2, n - i - 2);    return true; } void printAllPalindromes(char str[], int n){    if (!(isPalimdrome(str, n))) {       cout<<"-1";       return;    }    do {       cout<<str<<endl;    } while (nextPalindrome(str, n)); } int main(){    char str[] = "abccba";    int n = strlen(str);    cout<<”The list of palindromes possible is :\n”;    printAllPalindromes(str, n);    return 0; } Output The list of palindromes possible is − abccba acbbca baccab bcaacb cabbac cbaabc raja Published on 17-Jan-2020 14:27:09 Advertisements
__label__pos
0.99916
=================================== Nim Compiler User Guide =================================== :Author: Andreas Rumpf :Version: |nimversion| .. contents:: "Look at you, hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" Introduction ============ This document describes the usage of the *Nim compiler* on the different supported platforms. It is not a definition of the Nim programming language (therefore is the `manual `_). Nim is free software; it is licensed under the `MIT License `_. Compiler Usage ============== Command line switches --------------------- Basic command line switches are: Usage: .. include:: basicopt.txt ---- Advanced command line switches are: .. include:: advopt.txt List of warnings ---------------- Each warning can be activated individually with ``--warning[NAME]:on|off`` or in a ``push`` pragma. ========================== ============================================ Name Description ========================== ============================================ CannotOpenFile Some file not essential for the compiler's working could not be opened. OctalEscape The code contains an unsupported octal sequence. Deprecated The code uses a deprecated symbol. ConfigDeprecated The project makes use of a deprecated config file. SmallLshouldNotBeUsed The letter 'l' should not be used as an identifier. EachIdentIsTuple The code contains a confusing ``var`` declaration. ShadowIdent A local variable shadows another local variable of an outer scope. User Some user defined warning. ========================== ============================================ Verbosity levels ---------------- ===== ============================================ Level Description ===== ============================================ 0 Minimal output level for the compiler. 1 Displays compilation of all the compiled files, including those imported by other modules or through the `compile pragma<#compile-pragma>`_. This is the default level. 2 Displays compilation statistics, enumerates the dynamic libraries that will be loaded by the final binary and dumps to standard output the result of applying `a filter to the source code `_ if any filter was used during compilation. 3 In addition to the previous levels dumps a debug stack trace for compiler developers. ===== ============================================ Compile time symbols -------------------- Through the ``-d:x`` or ``--define:x`` switch you can define compile time symbols for conditional compilation. The defined switches can be checked in source code with the `when statement `_ and `defined proc `_. The typical use of this switch is to enable builds in release mode (``-d:release``) where certain safety checks are omitted for better performance. Another common use is the ``-d:ssl`` switch to activate `SSL sockets `_. Additionally, you may pass a value along with the symbol: ``-d:x=y`` which may be used in conjunction with the `compile time define pragmas`_ to override symbols during build time. Configuration files ------------------- **Note:** The *project file name* is the name of the ``.nim`` file that is passed as a command line argument to the compiler. The ``nim`` executable processes configuration files in the following directories (in this order; later files overwrite previous settings): 1) ``$nim/config/nim.cfg``, ``/etc/nim.cfg`` (UNIX) or ``%NIMROD%/config/nim.cfg`` (Windows). This file can be skipped with the ``--skipCfg`` command line option. 2) ``/home/$user/.config/nim.cfg`` (UNIX) or ``%APPDATA%/nim.cfg`` (Windows). This file can be skipped with the ``--skipUserCfg`` command line option. 3) ``$parentDir/nim.cfg`` where ``$parentDir`` stands for any parent directory of the project file's path. These files can be skipped with the ``--skipParentCfg`` command line option. 4) ``$projectDir/nim.cfg`` where ``$projectDir`` stands for the project file's path. This file can be skipped with the ``--skipProjCfg`` command line option. 5) A project can also have a project specific configuration file named ``$project.nim.cfg`` that resides in the same directory as ``$project.nim``. This file can be skipped with the ``--skipProjCfg`` command line option. Command line settings have priority over configuration file settings. The default build of a project is a `debug build`:idx:. To compile a `release build`:idx: define the ``release`` symbol:: nim c -d:release myproject.nim Search path handling -------------------- Nim has the concept of a global search path (PATH) that is queried to determine where to find imported modules or include files. If multiple files are found an ambiguity error is produced. ``nim dump`` shows the contents of the PATH. However before the PATH is used the current directory is checked for the file's existence. So if PATH contains ``$lib`` and ``$lib/bar`` and the directory structure looks like this:: $lib/x.nim $lib/bar/x.nim foo/x.nim foo/main.nim other.nim And ``main`` imports ``x``, ``foo/x`` is imported. If ``other`` imports ``x`` then both ``$lib/x.nim`` and ``$lib/bar/x.nim`` match and so the compiler should reject it. Currently however this check is not implemented and instead the first matching file is used. Generated C code directory -------------------------- The generated files that Nim produces all go into a subdirectory called ``nimcache`` in your project directory. This makes it easy to delete all generated files. Files generated in this directory follow a naming logic which you can read about in the `Nim Backend Integration document `_. However, the generated C code is not platform independent. C code generated for Linux does not compile on Windows, for instance. The comment on top of the C file lists the OS, CPU and CC the file has been compiled for. Compilation cache ================= **Warning**: The compilation cache is still highly experimental! The ``nimcache`` directory may also contain so called `rod`:idx: or `symbol files`:idx:. These files are pre-compiled modules that are used by the compiler to perform `incremental compilation`:idx:. This means that only modules that have changed since the last compilation (or the modules depending on them etc.) are re-compiled. However, per default no symbol files are generated; use the ``--symbolFiles:on`` command line switch to activate them. Unfortunately due to technical reasons the ``--symbolFiles:on`` needs to *aggregate* some generated C code. This means that the resulting executable might contain some cruft even when dead code elimination is turned on. So the final release build should be done with ``--symbolFiles:off``. Due to the aggregation of C code it is also recommended that each project resides in its own directory so that the generated ``nimcache`` directory is not shared between different projects. Cross compilation ================= To cross compile, use for example:: nim c --cpu:i386 --os:linux --compile_only --gen_script myproject.nim Then move the C code and the compile script ``compile_myproject.sh`` to your Linux i386 machine and run the script. Another way is to make Nim invoke a cross compiler toolchain:: nim c --cpu:arm --os:linux myproject.nim For cross compilation, the compiler invokes a C compiler named like ``$cpu.$os.$cc`` (for example arm.linux.gcc) and the configuration system is used to provide meaningful defaults. For example for ``ARM`` your configuration file should contain something like:: arm.linux.gcc.path = "/usr/bin" arm.linux.gcc.exe = "arm-linux-gcc" arm.linux.gcc.linkerexe = "arm-linux-gcc" DLL generation ============== Nim supports the generation of DLLs. However, there must be only one instance of the GC per process/address space. This instance is contained in ``nimrtl.dll``. This means that every generated Nim DLL depends on ``nimrtl.dll``. To generate the "nimrtl.dll" file, use the command:: nim c -d:release lib/nimrtl.nim To link against ``nimrtl.dll`` use the command:: nim c -d:useNimRtl myprog.nim **Note**: Currently the creation of ``nimrtl.dll`` with thread support has never been tested and is unlikely to work! Additional compilation switches =============================== The standard library supports a growing number of ``useX`` conditional defines affecting how some features are implemented. This section tries to give a complete list. ================== ========================================================= Define Effect ================== ========================================================= ``release`` Turns off runtime checks and turns on the optimizer. ``useWinAnsi`` Modules like ``os`` and ``osproc`` use the Ansi versions of the Windows API. The default build uses the Unicode version. ``useFork`` Makes ``osproc`` use ``fork`` instead of ``posix_spawn``. ``useNimRtl`` Compile and link against ``nimrtl.dll``. ``useMalloc`` Makes Nim use C's `malloc`:idx: instead of Nim's own memory manager, ableit prefixing each allocation with its size to support clearing memory on reallocation. This only works with ``gc:none``. ``useRealtimeGC`` Enables support of Nim's GC for *soft* realtime systems. See the documentation of the `gc `_ for further information. ``nodejs`` The JS target is actually ``node.js``. ``ssl`` Enables OpenSSL support for the sockets module. ``memProfiler`` Enables memory profiling for the native GC. ``uClibc`` Use uClibc instead of libc. (Relevant for Unix-like OSes) ``checkAbi`` When using types from C headers, add checks that compare what's in the Nim file with what's in the C header (requires a C compiler with _Static_assert support, like any C11 compiler) ================== ========================================================= Additional Features =================== This section describes Nim's additional features that are not listed in the Nim manual. Some of the features here only make sense for the C code generator and are subject to change. LineDir option -------------- The ``lineDir`` option can be turned on or off. If turned on the generated C code contains ``#line`` directives. This may be helpful for debugging with GDB. StackTrace option ----------------- If the ``stackTrace`` option is turned on, the generated C contains code to ensure that proper stack traces are given if the program crashes or an uncaught exception is raised. LineTrace option ---------------- The ``lineTrace`` option implies the ``stackTrace`` option. If turned on, the generated C contains code to ensure that proper stack traces with line number information are given if the program crashes or an uncaught exception is raised. Debugger option --------------- The ``debugger`` option enables or disables the *Embedded Nim Debugger*. See the documentation of endb_ for further information. Breakpoint pragma ----------------- The *breakpoint* pragma was specially added for the sake of debugging with ENDB. See the documentation of `endb `_ for further information. DynlibOverride ============== By default Nim's ``dynlib`` pragma causes the compiler to generate ``GetProcAddress`` (or their Unix counterparts) calls to bind to a DLL. With the ``dynlibOverride`` command line switch this can be prevented and then via ``--passL`` the static library can be linked against. For instance, to link statically against Lua this command might work on Linux:: nim c --dynlibOverride:lua --passL:liblua.lib program.nim Backend language options ======================== The typical compiler usage involves using the ``compile`` or ``c`` command to transform a ``.nim`` file into one or more ``.c`` files which are then compiled with the platform's C compiler into a static binary. However there are other commands to compile to C++, Objective-C or Javascript. More details can be read in the `Nim Backend Integration document `_. Nim documentation tools ======================= Nim provides the `doc`:idx: and `doc2`:idx: commands to generate HTML documentation from ``.nim`` source files. Only exported symbols will appear in the output. For more details `see the docgen documentation `_. Nim idetools integration ======================== Nim provides language integration with external IDEs through the idetools command. See the documentation of `idetools `_ for further information. .. Nim interactive mode ==================== The Nim compiler supports an interactive mode. This is also known as a `REPL`:idx: (*read eval print loop*). If Nim has been built with the ``-d:useGnuReadline`` switch, it uses the GNU readline library for terminal input management. To start Nim in interactive mode use the command ``nim secret``. To quit use the ``quit()`` command. To determine whether an input line is an incomplete statement to be continued these rules are used: 1. The line ends with ``[-+*/\\<>!\?\|%&$@~,;:=#^]\s*$`` (operator symbol followed by optional whitespace). 2. The line starts with a space (indentation). 3. The line is within a triple quoted string literal. However, the detection does not work if the line contains more than one ``"""``. Nim for embedded systems ======================== The standard library can be avoided to a point where C code generation for 16bit micro controllers is feasible. Use the `standalone`:idx: target (``--os:standalone``) for a bare bones standard library that lacks any OS features. To make the compiler output code for a 16bit target use the ``--cpu:avr`` target. For example, to generate code for an `AVR`:idx: processor use this command:: nim c --cpu:avr --os:standalone --deadCodeElim:on --genScript x.nim For the ``standalone`` target one needs to provide a file ``panicoverride.nim``. See ``tests/manyloc/standalone/panicoverride.nim`` for an example implementation. Additionally, users should specify the amount of heap space to use with the ``-d:StandaloneHeapSize=`` command line switch. Note that the total heap size will be `` * sizeof(float64)``. Nim for realtime systems ======================== See the documentation of Nim's soft realtime `GC `_ for further information. Debugging with Nim ================== Nim comes with its own *Embedded Nim Debugger*. See the documentation of endb_ for further information. Optimizing for Nim ================== Nim has no separate optimizer, but the C code that is produced is very efficient. Most C compilers have excellent optimizers, so usually it is not needed to optimize one's code. Nim has been designed to encourage efficient code: The most readable code in Nim is often the most efficient too. However, sometimes one has to optimize. Do it in the following order: 1. switch off the embedded debugger (it is **slow**!) 2. turn on the optimizer and turn off runtime checks 3. profile your code to find where the bottlenecks are 4. try to find a better algorithm 5. do low-level optimizations This section can only help you with the last item. Optimizing string handling -------------------------- String assignments are sometimes expensive in Nim: They are required to copy the whole string. However, the compiler is often smart enough to not copy strings. Due to the argument passing semantics, strings are never copied when passed to subroutines. The compiler does not copy strings that are a result from a procedure call, because the callee returns a new string anyway. Thus it is efficient to do: .. code-block:: Nim var s = procA() # assignment will not copy the string; procA allocates a new # string already However it is not efficient to do: .. code-block:: Nim var s = varA # assignment has to copy the whole string into a new buffer! For ``let`` symbols a copy is not always necessary: .. code-block:: Nim let s = varA # may only copy a pointer if it safe to do so If you know what you're doing, you can also mark single string (or sequence) objects as `shallow`:idx:\: .. code-block:: Nim var s = "abc" shallow(s) # mark 's' as shallow string var x = s # now might not copy the string! Usage of ``shallow`` is always safe once you know the string won't be modified anymore, similar to Ruby's `freeze`:idx:. The compiler optimizes string case statements: A hashing scheme is used for them if several different string constants are used. So code like this is reasonably efficient: .. code-block:: Nim case normalize(k.key) of "name": c.name = v of "displayname": c.displayName = v of "version": c.version = v of "os": c.oses = split(v, {';'}) of "cpu": c.cpus = split(v, {';'}) of "authors": c.authors = split(v, {';'}) of "description": c.description = v of "app": case normalize(v) of "console": c.app = appConsole of "gui": c.app = appGUI else: quit(errorStr(p, "expected: console or gui")) of "license": c.license = UnixToNativePath(k.value) else: quit(errorStr(p, "unknown variable: " & k.key))
__label__pos
0.938154
kwizNET Subscribers, please login to turn off the Ads! Email us to get an instant 20% discount on highly effective K-12 Math & English kwizNET Programs! Online Quiz (Worksheet A B C D) Questions Per Quiz = 2 4 6 8 10 Middle/High School Algebra, Geometry, and Statistics (AGS) 9.31 Binomial Distributions Binomial Distributions: • Binomial distribution is the discrete probability distribution. • Binomial distribution describes the possible number of times that a particular event will occur in a sequence of observations. The event is coded binary that is it may or may not occur. • The binomial distribution is used when a researcher is interested in the occurrence of an event, not in its magnitude. • All of the trials are independent and have only two possible outcomes, success or failure. • The probability of success is the same in every trial. • The outcome of one trial does not affect the probability of any future trials. • The random variable is the number of success in a given number of trials. • The probability of x successes in n independent trials is P(x) = C(n,x)pxqn-x where p is the probability of success of an individual trial q is the probability of failure on that same individual trial (p + q = 1) The expectation for a binomial distribution is E(x) = np where n is the total number of trials and p is the probability of success Example: If a coin is tossed 4 times, then we may obtain 0, 1, 2, 3, or 4 heads. We may also obtain 4, 3, 2, 1, or 0 tails, but these outcomes are equivalent to 0, 1, 2, 3, or 4 heads. The likelihood of obtaining 0, 1, 2, 3, or 4 heads is, respectively, 1/16, 4/16, 6/16, 4/16, and 1/16. p = 1/2 Thus, in the example discussed here, one is likely to obtain 2 heads in 4 tosses, since this outcome has the highest probability. Directions: Answer the following questions. Also write at least 5 examples of Binomial distributions of your own. Q 1: A hockey start Peter Lu takes a shot, he has a 1/7 probability of scoring a goal. He takes 6 shots in a game. What is the probability that he will score exactly 2 goals? 50% 17% 20% Question 2: This question is available to subscribers only! Subscription to kwizNET Learning System offers the following benefits: • Unrestricted access to grade appropriate lessons, quizzes, & printable worksheets • Instant scoring of online quizzes • Progress tracking and award certificates to keep your student motivated • Unlimited practice with auto-generated 'WIZ MATH' quizzes • Child-friendly website with no advertisements • Choice of Math, English, Science, & Social Studies Curriculums • Excellent value for K-12 and ACT, SAT, & TOEFL Test Preparation • Get discount offers by sending an email to [email protected] Quiz Timer
__label__pos
0.786749
Skip to main content PengOne's user avatar PengOne's user avatar PengOne's user avatar PengOne • Member for 13 years, 2 months • Last seen more than 11 years ago 22 votes Automatic upvotes for questions 13 votes Accepted Is it "bad" to unaccept an accepted answer? 13 votes Give a badge to users who improve closed questions 9 votes Day to answer un-answered questions 8 votes Should I report any odd voting behavior? 7 votes Mechanism for avoiding "please post your actual code" comments 6 votes Copy editor badge 5 votes Overachiever badge? 4 votes An alert to serial minor edits 4 votes Can we allow trusted users to recalculate reputation more often? 4 votes Badge for not asking an already answered question 2 votes Why does SE use up- and downvotes instead of a scoring system? 2 votes Can we have a badge at each level when all the bronze/silver/gold have been achieved? 2 votes accept two answers 1 vote Make lists of questions useful to me? 1 vote Is LMGTFY frowned upon? 0 votes Should flawed questions be closed immediately? 0 votes Why does stack overflow get the day I'm visiting wrong? -3 votes New Badge Proposal: Renaissance Man
__label__pos
1
[ZJOI2005]沼泽鳄鱼 今天继续攻集训队论文的我 题意 一张无向图,不超过 50 个点 起点 s 终点 t 一个单位时间移动一次 一些食人鱼作周期运动 长度不超过 4 人不能碰到食人鱼 时刻 u 到达终点 u <= 2e9 分析 引理 我们观察数据发现n十分的小,那么就可以直接用邻接矩阵 而且有一种矩阵叫矩阵乘法 对于一张(无向)图:G ,G[i][j] = 1 表示 i – > j 有一条边 那么我们想一想G^2表示的意义是什么: G^{‘}[a][b] = \sum_{k=0}^{N}G[a][k] * G[k][b] 那么是不是就是表示走2步的时候 a->b的方案数,那么以此类推 k布的方案数就是G^k了! 此题分析 我们用 A_k 表示走k布的情况下的方案数 G_i表示在走第 i 布是的图的情况(0,1)表示 那么如果没有食人鱼的话就是: A_k = G^k G^u = G^{u-1} * G_k 那么如果有食人鱼的话就是 A_k = A_{k-1} * G_k 那么我们看见食人鱼的循环是2,3,4不等,但是lcm(2,3,4) = 12 也就是意味着 G_1 = G_{13} 这两张图是一样的 那么我们可以O(n^3) 预处理出add矩阵 add=\prod_{k=0}^{12} G_k \\ a=k/12,b=k\mod12 那么答案的矩阵就是: final=add^a*\prod_{1}^bG_i记住矩阵乘法的左乘和右乘是不一样的 复杂度O(n^3log_2{q}) 代码: #pragma GCC optimize(3) #pragma GCC optimize("Ofast") #include <cstdio> #include <cmath> #include <cstring> #include <iostream> #include <algorithm> #define N 55 #define M 25 #define R register using namespace std; int n, m, s, t, K, x, y, Nfish, Pow_time, leftn, ff[N], att[N][10]; struct matrix { int a[N][N]; matrix() { memset(a, 0, sizeof a); } } G[20], fuu, ans, fff; inline matrix operator * (matrix x, matrix y) { matrix z; for(R int i = 0; i < n; ++i) for(R int j = 0; j < n; ++j) for(R int k = 0; k < n; ++k) { z.a[i][j] += x.a[i][k] * y.a[k][j]; if(z.a[i][j] > 10000) z.a[i][j] %= 10000; } return z; } inline matrix Pow(matrix now, int y) { matrix res; for(R int i = 0; i < n; ++i) res.a[i][i] = 1; while(y) { if(y & 1) res = res * now; now = now * now; y >>= 1; } return res; } inline void init() { for(R int i = 1; i <= 12; i++) { G[i] = fuu; for(R int j = 1; j <= Nfish; j++) { int to = att[j][((i + 1) % ff[j]) ? ((i + 1) % ff[j]) : ff[j]]; for(R int k = 0; k < n; k++) G[i].a[k][to] = 0; } } } inline matrix solve() { Pow_time = K / 12; leftn = K % 12; matrix ans, fff; for(R int i = 0; i < n; ++i) ans.a[i][i] = fff.a[i][i] = 1; for(R int i = 1; i <= 12; ++i) fff = fff * G[i]; ans = ans * Pow(fff, Pow_time); for(R int i = 1; i <= leftn; ++i) { ans = ans * G[i]; } return ans; } inline int read() { int x=0; char c=getchar(); bool flag=0; while(c<'0'||c>'9'){if(c=='-')flag=1; c=getchar();} while(c>='0'&&c<='9'){x=(x<<3)+(x<<1)+(c^48);c=getchar();} return flag?-x:x; } int main() { n = read(), m = read(), s = read(), t = read(), K = read(); for(R int i = 1; i <= m; ++i) { x = read(), y = read(); fuu.a[x][y] = fuu.a[y][x] = 1; } Nfish = read(); for(R int i = 1; i <= Nfish; ++i) { ff[i] = read(); for(int j = 1; j <= ff[i]; ++j) att[i][j] = read(); } init(); ans = solve(); printf("%d\n", ans.a[s][t]); return 0; } 3 Replies to “[ZJOI2005]沼泽鳄鱼” 1. hey there and thank you for your info – I’ve definitely picked up something new from right here. I did however expertise several technical issues using this site, since I experienced to reload the site lots of times previous to I could get it to load correctly. I had been wondering if your hosting is OK? Not that I am complaining, but sluggish loading instances times will often affect your placement in google and could damage your high quality score if advertising and marketing with Adwords. Anyway I’m adding this RSS to my email and could look out for a lot more of your respective interesting content. Make sure you update this again soon.. https://kikipedia.win/wiki/Are-You-Smoking-Dirty-Medical-Marijuana 发表评论 电子邮件地址不会被公开。 必填项已用*标注
__label__pos
0.997163
Take the 2-minute tour × Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required. I stumbled upon this 'list of programming' languages and found that popular languages like Python are not standardized? Why is that, and what does 'Standardized' mean anyway? share|improve this question 3 Answers 3 up vote 26 down vote accepted "Standardized" means that the language has a formal, approved standard, generally written by ISO or ANSI or ECMA. Many modern open-source languages, like Python, Perl, and Ruby, are not formally standardized by an external body, and instead have a de-facto standard: whatever the original working implementation does. The benefits of standardizing a language are a) you know the language won't randomly change on you, b) if you want to write your own compiler/interpreter for the language, you have a very clear document that tells you what behavior everything should do, rather than having to test that behavior yourself in the original implementation. Because of this, standardized languages change slowly, and often have multiple major implementations. A language doesn't really have to be standardized to be useful. Most nonstandard languages won't just make random backwards-incompatable changes for no reason (and if they do, they take ten years to decide how to *cough*Perl6*cough*), and nonstandard languages can add cool new experimental features much faster (and more portably) than standardized languages. A few standardized languages: • C • C++ • Common Lisp • Scheme (?) • JavaScript (ECMAScript) • C# • Ruby Nonstandardized languages: • Perl • Python • PHP • Objective-C A full list is on Wikipedia. share|improve this answer 2   Great, informative, answer. Thanks! :) –  3zzy Oct 8 '09 at 5:10 9   It's the only way I can fight the faster guns in this wild, wild West. –  Chris Lutz Oct 8 '09 at 5:13      Thanks for this informative answer! –  jpmelos Oct 8 '09 at 5:24 3   A great answer, my only argument would be that if a Standard is just slightly vague on a certain feature, you can guarantee that the Microsoft version will use the most obscure and unusual interpretation of said ambiguity, while every other product does something sensible. –  too much php Oct 8 '09 at 6:00      Ruby is now a standardized language by ISO/IEC 30170 –  harsha Nov 27 '13 at 16:52 Standardized means there exists a specification for the language (a "standard"). Java, for example, has a specification. Perl 5 does not (the source code is the "standard") but Perl 6 will. See Is there a Python language specification? share|improve this answer There are "standards" and there are "standards". Most folks mostly mean that a standard is passed by a standards-writing organization: ISO, ECMA, EIA, etc. Lawyers call these De Jure Standards. There's the force of law. Further, there are "De Facto Standards". Some folks, also, corrupt the word by adding "Industry Standard", or "vendorname Standard". This is just meaningless marketing noise. A De Facto Standard is something that's standardized in practice (because everyone does it and agrees they're doing it that way) but it is not backed by some standards organization. Python has a De Facto Standard, not a De Jure Standard. share|improve this answer Your Answer   discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged or ask your own question.
__label__pos
0.835855
Surftware Troubleshooting 101: How to Fix a Computer That Will Not Boot Up March 16, 2022 | by Taofeeq Troubleshooting 101 How to Fix a Computer That Will Not Boot Up Encountering a computer that refuses to boot can be a perplexing and frustrating experience. In this comprehensive guide, we’ll explore the step-by-step process of troubleshooting and fixing a non-booting computer, covering a range of potential issues and providing solutions to get your system up and running again. 1. Check Power Supply and Connections: • Power Cable: Ensure the power cable is securely connected to both the power outlet and the computer. • Power Button: Confirm the power button is functioning correctly. 2. Verify Monitor and Display Connections: • Monitor Connection: Check if the monitor is properly connected to the computer. • Monitor Power: Ensure the monitor is powered on. What To Do When Your Computer Screen Is Black? 3. Examine External Devices: • Disconnect Peripherals: Remove external devices like USB drives, printers, and external hard drives. • Check USB Ports: Ensure no foreign objects or damaged USB ports are causing issues. 4. Test the Power Button: • Direct Connection: If available, try shorting the power button pins directly on the motherboard. • Replace Power Button: If the power button is faulty, consider replacing it. Why Is My Computer So Slow and How To Fix It? 5. Assess Hardware Components: • RAM Modules: Reseat or replace RAM modules. Faulty RAM can cause boot failures. • Graphics Card: Ensure the graphics card is properly seated and functional. • CPU and Motherboard: Inspect for physical damage and reseat if necessary. 6. Boot in Safe Mode: • Windows: If applicable, boot into Safe Mode to identify and address potential software issues. • macOS: Use Safe Boot to troubleshoot startup problems on Mac. How to fix Computer Screen Sideways (rotate)? 7. Run Diagnostic Tools: • Windows: Utilize built-in tools like Windows Memory Diagnostic and System File Checker (SFC). • macOS: Run Apple Diagnostics or Apple Hardware Test for hardware checks. 8. Perform System Restore: • Windows: Restore your system to a previous working state using System Restore. • macOS: Use Time Machine to revert your system to a previous snapshot. 9. Check for Disk Errors: • Windows: Run CHKDSK to check and repair disk errors. • macOS: Use Disk Utility to verify and repair disk issues. How to Hide Your Folders or Files on a Computer 10. Reinstall or Repair the Operating System: • Windows: Perform a repair installation or reinstall Windows using installation media. • macOS: Reinstall macOS using macOS Recovery. 11. Seek Professional Help: • Hardware Issues: If all else fails, consult a professional to diagnose and address potential hardware problems. • Data Recovery: In case of critical data loss, seek professional data recovery services. Conclusion Facing a computer that won’t boot is undoubtedly a challenging situation, but with systematic troubleshooting, many issues can be resolved. By following the steps outlined in this guide, you can identify the root cause of the problem and implement the necessary solutions to bring your computer back to life. RELATED POSTS View all view all
__label__pos
0.906014
How Many Characters In A Domain Name? [A Character Count Guide] We click or type them into our browser every day: domain names.  Thousands of new domains are registered every day, but for every domain owner, it’s important to understand that there are certain domain name rules, such as the domain name character limit of 63. How Many Characters In A Domain Name? [A Character Count Guide] You can’t just use any random name or characters for your domain. We find out how many characters a domain name can have, and what characters are allowed. We also put together a guide on how to choose the right domain name, so you don’t exceed the character limit. How Many Characters Can A Domain Name Have? A domain name can have up to 63 characters. The 63 character limit does not include the protocol identifier, also commonly known as https:// or http://. Also the domain extension, such as .org or .com, is not included in the character limit. The 63 character limit for domain names only applies to what is known as the label, which is usually the name of your business or brand. It’s a good idea however to keep your domain name as short as possible and don’t near the maximum length of characters. This is to ensure that users can easily remember your domain name and they can then quickly type it into the browser. What Characters Are Allowed In A Domain Name? When it comes to choosing a domain name for your site, there are a few rules that you need to bear in mind. You can only use certain types of characters in your domain name. Here are some of the characters that are allowed in a domain. Standard Letters You can use any standard Latin letters for a domain name as long as they do not exceed the 63 character limit. It’s a good idea to go with a domain name that is a word, a business name or a brand name. This is memorable and your users can associate the domain name with you. Also remember that domain names are commonly written in lowercase letters.  Using upper case letters is not very intuitive for users, and the majority of domains on the internet are in lowercase. Numbers You can include numbers in your domain name. Saying this, many domain name owners tend to avoid numbers because they are not intuitive enough in a domain name. Many people find that adding a number in a domain name creates a barrier for users who want to access a website. This applies to domain names which use the number as a written word or a digit character. There are some exceptions where you may want to consider using a number character. Some of these are commonly used terms, such as MP4 or B2B. They are commonly used phrases and you can add them to your domain with a number. Again, it’s best to keep the letters in lowercase however to ensure that users can just type in the URL easily. If you are unsure whether to register a domain name with a numerical digit or with the written word, then it can be a good idea to simply register both domain names. You can then redirect one domain to the other to ensure your users get to see the right website. Hyphens Domain names can also contain hyphens. However, they are very rarely included in a number because they add complexity to the name. This can put users off from using your domain name and you may not see as many visitors coming to your website as with a web domain name without hyphens. Domain experts recommend not to use hyphens and numbers. Although they are officially allowed, it’s best to consider how your audience can find you as easily as possible. What Characters Are Not Allowed In A Domain Name? What Characters Are Not Allowed In A Domain Name? While hyphens and numbers are allowed to be used in a domain name, there are quite a few different characters that you cannot use. Here are the main characters that aren’t allowed in domain names. Periods When you register a domain name, then you cannot include periods in the name. This is because periods are used for subdomains, such as subdomain.domainname.com. So, only domain names with a subdomain use a period but this is not included in the domain name.  A subdomain is essentially content that sits still under the same website but needs to stay separate from the main site. This could be an ecommerce shop or even a blog. Symbols, Underscores And Spaces You are only allowed to use hyphens and numbers in your domain name but other symbols, such as spaces and underscores, are not allowed. Some other symbols that aren’t permitted in a domain name are < > / \ = + & * ( ) ; : , ? @ # $ % ^ !  Capital Letters Domain names don’t respond to capital letters. This means that when a user types a domain name in upper case characters, then it redirects him to the same domain name with lower case letters. As a rule of thumb, you aren’t allowed to register a domain name that contains capital letters as they are the same characters as lowercase letters. Choosing The Right Domain Name Now that you know that your domain name can only be 63 characters long and you can include only certain characters, here are some tips on choosing the right name for your domain. Keep Your Domain Name Short A good domain name is short and easy to remember. Even though you can use up to 63 characters, it’s best not to use the maximum length. Plus, the shorter your domain name, the lower the risk that a user misspells the name. The average domain name on the internet is around 8 characters long, and the majority of websites have a domain name that is maximum 10 characters in length. Saying this, the domain name should fit your brand and business, so character count isn’t everything. Make Your Domain Name Memorable Your domain name should leave a lasting impression so make sure that you use a name that reflects your branding and business name. Try to avoid names that are too generic or too complex. A balanced middle is the best way to go. Domain Names Should Be Easy To Spell When you are looking for a good domain name make sure that it is easy to pronounce and easy to spell. It should be a name that’s also easy to share with friends, family and other businesses. After all, you want your site to be found quickly and easily. Use The Right Extension Extensions such as .com or .org may not be exactly part of your domain name but they can also contribute to how memorable your domain is. It’s best to stick with a .com extension as this is most widely used across the internet. This being said, you may also want to consider an industry specific extension, such as .biz or .film. Match Your Domain Name With Your Brand Many businesses use a website as a shop window to their brand. Even if you don’t have an ecommerce store online, you should still choose your domain based on your business name or your brand name. Final Thoughts Domain names may be limited to 63 characters but when you choose your domain wisely, you don’t even need to get near this character limit. Alan Reiner Latest posts by Alan Reiner (see all)
__label__pos
0.869763