|
An unformatted dump of your exception message, with no details of the code, posted in the wrong forum?
Sure, let us get right on helping you to fix that.
Quote: contact With Id = 00000000-0000-0000-0000-000000000000 Does Not Exist
That looks like something you should start your investigation with.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
What are the differences between Heap and Stack Memory in Java?
modified 1-Jun-22 13:03pm.
|
|
|
|
|
Yes, but you need to provide the details. You also need to post it in the Java forum; this one is for Javscript which is not the same thing. But do not expect anyone here to do all the work for you, even if you do offer ridiculous amounts of money.
|
|
|
|
|
I have a SharePoint List (list_dls) which has all the Email addresses. The list has a single column with Field name "Title". I need to validate that the Item in the "LookupField" is contained in the 'list_dls'. The list has over 5000 emails, hence I will need to do a CAML query. The script does not seem to find the item. Any ideas to get it to work would be really appreciated.
Here is the code.
<pre><input type='button' value='get Lists' onclick="PopulateLookupField();"/>
<p id="demo"></p>
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
var LookupField = 'lnam@xyz.com';
function PopulateLookupField()
{
var clientContext = new SP.ClientContext.get_current();
var LookupList = clientContext.get_web().get_lists().getByTitle('list_dls');
var camlQuery_list = new SP.CamlQuery();
camlQuery_list.ViewXml = @"<View Scope='RecursiveAll'><ViewFields><FieldRef Name='ID'/><FieldRef Name='Title'/></ViewFields><RowLimit Paged='TRUE'>5000</RowLimit></View>";
LookupList<ListItem> allListItems = new LookupList<ListItem>();
do
{
var listItemCollection = LookupList.GetItems(camlQuery_list);
clientContext.Load(listItemCollection);
clientContext.ExecuteQuery();
allListItems.AddRange(listItemCollection);
var ItemFound = listItemCollection.Where(item => item.FieldValues["Title"].ToString().Contains(LookupField);
if(ItemFound !== null){break;}
camlQuery_list.ListItemCollectionPosition = listItemCollection.ListItemCollectionPosition;
} while (camlQuery_list.ListItemCollectionPosition != null);
clientContext.load(ItemFound);
alert("ItemFound = " + ItemFound);
}
</script>
|
|
|
|
|
Hello everyone,
I have a problem that I'm having trouble solving, I have the following errors on my screen:
1. Error in src\App.js line 2:7: parsing error: identifier 'react' has already been declared.(2:7)
Webpack 5.72.0 compiled with 2 errors 2.in 8076 I show you an example of the code
1.Import React from "react"
2.Import react, {component} from "react";
Const App = () => {
Return(
< BrowserRouter>
<route path="/" element="{Home/">}/>
<route path = '/About'element = {About/>}
)
}
Thanks for your help
|
|
|
|
|
I think it's because you are already importing react on line 1. You don't need the "import react" on line 2.
|
|
|
|
|
I am developing in Angular 12 with the exceljs package. I am trying to add an image to a Workbook and the TS below produces and throws the client side exception:
Error: Uncaught (in promise): TypeError: u.readFile is not a function
TypeError: u.readFile is not a function
at exceljs.min.js:3:449768
Here is the code I am calling:
let imageSrc = '\assets\images\graph.jpeg'
var imageId1 = workbook.addImage(
{
filename: imageSrc,
extension: 'jpeg',
});
workbook.xlsx.writeBuffer().then((data) => {
let blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
fs.saveAs(blob, 'Random Number Generator.xlsx');
});
modified 25-Apr-22 15:36pm.
|
|
|
|
|
Based on this GitHub issue[^], it looks like addImage can't use the path of an image on the server to generate a file on the client.
The suggested workaround is to load the image as a buffer. The code in the issue uses axios, but you could use the fetch API instead[^]:
const imageSrc = '/assets/images/graph.jpeg';
const response = await fetch(imageSrc);
const buffer = await response.arrayBuffer();
const imageId1 = workbook.addImage({
buffer: imageBuffer.data,
extension: 'jpg'
});
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am learning Javascript right now and am looking to start as soon as possible, but I don't know where to begin.
In my mind I would like the user experience to be as simple as possible; focused on the centre of the screen, on a single drop down menu, of which when a choice is selected that menu visually slides out of the way (so the user doesn't feel disoriented), as a new one slides in, and so forth, until the selections are exhausted.
What should I look into to achieve this please ?
|
|
|
|
|
|
Thanks, but I'm already working through that (about half way through). What a mess JavaScript has become, how on Earth a let can be a var God only knows, especially coming from a type-safe language like Swift ?!
I found the following code, which was pretty similar to what I wanted : https://codepen.io/balapa/pen/zvObzO[^]
I am just figuring out how the code works now, to see how to load up new menu options..
|
|
|
|
|
After the file is played, you need to load a new file and start playback.
According to my plan, I did this:
the file "au.js"
function replay()
{
var aud = document.getElementById("audio_label");
aud.src = "cap.wav?cb=" + new Date().getTime();
aud.load();
aud.play();
}
function hproc(e)
{
replay();
}
var x = document.getElementById("audio_label");
x.addEventListener('ended',hproc,false);
the "index.html"
<pre><script src="au.js"></script>
<body>
<audio id="audio_label" autoplay controls src="cap.wav"
type="audio/wav"></audio>
...plays only once...
|
|
|
|
|
|
I'm using CKEditor in my Angular project. I save my text, for example, as the following in the database:
<h2>My Header 1</h2><h3>My Header 2</h3><h4>My Header 3</h4><p> </p><p> </p><p>My long text.</p>
I want to retrieve the formatted version of it and then show it to the user. How can I do this in typescript?
|
|
|
|
|
Well, i´m new in the world of programming, and i´m learning javascript where i'm confused about loops, while and this things. I don't understand how to use. Please someone help me
|
|
|
|
|
|
loops are made to process inner instructions several times, or once ( or zero ).
there are : while | for | foreach
____________________________________________
an infinite loop could be achieved by :
while(true){ instruction... ;;;;;; } // for specific use.
each loop have a (test condition) to break it.
while(condition){...; }
while(i < 24){...; }
while(output !== 'quit'){ .... ; }
it's booleans 'true' or 'false' return;
______________________________________________
the 'for' loop is a very powerful loop
as basic you have learn :
for(var init ; test_condition ; before next lap instruction ) { .....;;;; }
like :
for(i=0 ; i< 24 ; i++) { ...;;;; }
but at full use, you can provide lot of parameters in :
for(i=0,j=5,trace=true ; i < sucess() ; trigger() , run_gui() , add_components() , i++ , j-- , toggle_trace() ){ .....;;;;;;;;;;; }
it's to show you another complex methods with for..loop. very powerfull and short written
_________________________________________________
for each loop :
It's about achieve 'fetch' in a container without incrementation of vars.
foreach(row in big_container){ console.log(row) }
this way , the big container is read, and the row is display in console log.
each row in big container will be display in console log.
it's useful when high limit is unknown , it's modern syntax.
at end of big_container the loop break out.
loops are call 'iterators/iteration' statements too.
|
|
|
|
|
What is the best way in react to convert a date from
2022-09-04T00:00:00
into
04/09/2022
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
I don't know about react, but the general answer is to use the date parser to convert to an internal time representation (eg Unix time, seconds since 1/1/1970...) then the date formatter to get what you want.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Probably by using the Intl.DateTimeFormat[^] object, which is supported in all modern browsers.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
JavaScript's native date object does that.
const date = new Date(Date.parse('2022-09-04T00:00:00'));
console.log(date.toLocaleString());
I would suggest putting a Z at the end of the ISO input date though, just to make it explicit that it's in UTC.
const date = new Date(Date.parse('2022-09-04T00:00:00Z'));
console.log(date.toLocaleString());
Otherwise, JavaScript will assume the input is in the local time zone.
Jeremy Falcon
|
|
|
|
|
Overview:
COVID-19 cases have been increased in the last period. As a result, Ministry of Health has
decided to make a simple application to keep track of all citizens and their vaccination status.
In this TMA, it is required to help the Ministry implement the required application.
Requirements:
After a quick meeting with the employee in charge, you got the following information:
It is required to store the whole data in one collection
Each citizen has a unique civil ID number (national number), name and other attributes (add
at least 2 attributes from your choice). In addition, it is required to store information about
all doses taken by the citizen.
For each dose, the following information should be stored: manufacturer, when and where
has been taken, and information about the health professional who gave it.
Each health professional has a unique civil ID number, name, and it is required to store
his/her experience (in years).
Moreover, you have been informed that the following operations happen frequently:
Adding a new citizen to the list
Adding a new dose to a specified citizen
Retrieving number of fully vaccinated persons (who toke at least 2 doses)
Saving all the data into a text file after sorting them according to Civil ID.
Analysis:
Q1: There are common attributes and methods between citizen and health professional. What
is the best choice for designing and writing the codes of these two classes? Explain your
answer.
Q2: Draw a simple class diagram showing only relationships between the classes.
Implementation:
After analysing the given requirements, implement the required application:
with Object Oriented Programming style
following the rules of good programming style (e.g. adding comments, etc.)
using only the material covered in M251 (and its prerequisites)
Hints:
For each class, it is required to implement constructors, setters, getters, toString() method,
and any other necessary method
3
If the user tries to do an operation that could violate the state of objects, the operation
should be ignored and the application should display an error message (e.g. adding a citizen
twice to the list, etc.)
Checking equality of any 2 objects should be done via the equals() method
There is a class that will do the main job of the application as follows:
o It has one collection to store the whole data (all citizens)
o It has static methods, one for each operation happens frequently
o When you add a citizen to the list, a message should be displayed to the user to explain
the status of the operation (i.e. if it was successful or not)
Testing:
After implementing the required classes, design and implement a testing class to test them as
follows:
Add at least 7 citizens to the collection that stores the whole data
Add 1, 2 and 3 doses to different citizens and keep some citizens unvaccinated
Try to violate the state of the objects and show that your code prevents all violations.
Show that the other operations that happen frequently are working fine
At the end, the whole data should be saved into a text file and this file should be saved
automatically inside the folder contains your Java project
|
|
|
|
|
Nobody here is going to do your homework for you, even if you do manage to find the correct forum for the language you've been told to use.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello guys - can someone give me some advice on what I am doing wrong here?
I found out very tricky asynchronous functions in JS where "await" seems not to always mean to wait. I believe there should be similar behavior in JS but it doesn't work as expected - can someone please tell me how to achieve the goal? Let me share part of the code with a little explanation
translatedInUI.forEach(async (language) => {
const actualLanguageCode = language.code;
const actualLanguage = await file.getLanguage(language.code);
const updatesForActual = [];
const addToActual = [];
const removeFromActual = [];
updatesForActual.push(changesInEnglish);
english.forEach((line) => {
let key = line.key;
if (!actualLanguage.find((element) => element.key == key)) {
addToActual.push(key);
}
});
actualLanguage.forEach((line) => {
let key = line.key;
if (!english.find((element) => element.key == key)) {
console.log("key was removed: " + key);
removeFromActual.push(key);
}
});
toAdd.push({ language: actualLanguageCode, addToActual });
toRemove.push({ language: actualLanguageCode, removeFromActual });
toUpdate.push({ language: actualLanguageCode, updatesForActual });
console.log(toAdd);
});
console.log("to add:" + toAdd);
console.log(toRemove);
console.log(toUpdate);
in this code console.log after the loop is displayed with empty variables first - the one at the end of each loops are displayed correctly while the one after loop goes out as an empty array
Thank you very much for any kind of advice
|
|
|
|
|
You are iterating over the translatedInUI array and starting an asynchronous task for each item. You never await those tasks, so the following code will execute before the tasks have finished.
Use a combination of Array.map[^] and Promise.all[^] to wait for the tasks to complete before trying to use the variables they're updating.
const tasks = translatedInUI.map(async (language) => {
...
});
await Promise.all(tasks);
console.log("to add:", toAdd);
console.log("to remove:", toRemove);
console.log("to update:", toUpdate); Obviously the outer function will also need to be marked as async for the await to work.
Using Promises - JavaScript | MDN[^]
async function - JavaScript | MDN[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|