|
There may be some hacks out there, but unless you're on a domain, that should not be possible and would be considered a security risc.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Have your Java-based web app send a current user object to the client, where it can be interpreted by your JS...?
Not 100% sure what you are asking here.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
Hi,
I have an intranet application in which i should be able to get the client machines windows user login. usually our staff login by their employee Id, if i could be able to get the login id based on that i will display the menu list(access control). this functionality i am trying to avoid login phase for intranet application.
|
|
|
|
|
If you're in an Active Directory environment and your users are on Windows computers, you can use Windows Authentication in IIS in order to automatically use their currently logged in claims principal. I don't know the interface for Java, but I'm sure there is one, and it's trivial using asp.net.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
Dear
Nathan Minier ,
Thank you so much.
|
|
|
|
|
// ------- Please begin your work below this line: -------
function exerciseOne(){
// In this exercise, write a simple 'for loop' that starts the variable 'i' at 0 and
// increases i until it reaches 6.
// Fill in the blanks in the parentheses, and then console.log(i) inside of the for loop
(;;)
for(let i=0; i < 7; i++){
console.log("This is i:",i);
}
console.log(str);
// Please write your answer in the line above.
}
}
function exerciseTwo(){
let count = 0;
// In this exercise write your own for loop (you can look at the syntax above).
// It should loop 10 times.
// You are given a variable called: count .
// For each loop reassign count to the current value of count + 1 .
for (var i = 0; i < 10; i++) {
count ++;
}
//Please write your answer in the line above.
return count;
}
//Assignment 13 exercise 1 is showing correct but 2 is undefined
function ClassOne(name, pw, mail){
// Exercise One: In this exercise you will be creating your own class!
// You are currently in the class, you are given three strings, name, pw, and mail.
// You need to create three properties on this class.
// Those properties are: 'username', 'password', and 'email'
// Set the value of username to name,
// Set the value of password to pw,
// Set the value of email to mail
this.username = name;
this.password = pw;
this.email = mail;
}
// Note: Remember you DO NOT need to return anything in a class!
function ClassTwo(name, pw, mail){
// Exercise Two: Now that you have created your own class,
// you will create a class with a method on it.
// In this class create 4 properties: username, password, email, and checkPassword.
// Set the value of username to name,
// Set the value of password to pw,
// Set the value of email to mail
// Set the value of checkPassword to a function.
// The checkPassword function takes a string as it's only argument.
// Using the 'this' keyword check to see if the password on the class is the same as
// the string being passed in as the parameter. Return true or false.
this.username = name;
this.password = pw;
this.email = mail;
this.checkPassword = function(){}
if (this.checkPassword === pw){
return true;
}
}
|
|
|
|
|
function exerciseOne(){
(;;)
for(let i=0; i < 7; i++){
console.log("This is i:",i);
}
console.log(str);
}
}
|
|
|
|
|
I am trying to write a javascript helper function in my Ember application called compare.js, and that js file is trying to import Ember, where its throwing error, can anybody please suggest me something how to get-rid of this type errors? Here is my compare.js files code - thank you.
import Ember from 'ember';
export function compare(params) {
if (params[3]) {
params[0] = params[0].toLowerCase();
params[2] = params[2].toLowerCase();
}
let v1 = params[0];
let operator = params[1];
let v2 = params[2];
switch (operator) {
case '==':
return (v1 == v2);
case '!=':
return (v1 != v2);
case '===':
return (v1 === v2);
case '<':
return (v1 < v2);
case '<=':
return (v1 <= v2);
case '>':
return (v1 > v2);
case '>=':
return (v1 >= v2);
case '&&':
return !!(v1 && v2);
case '||':
return !!(v1 || v2);
default:
return false;
}
}
export default Ember.Helper.helper(compare);
I want to be able to import or use this function in my hbs file, how can I do it any help please to fix these two things please - need some help - thank you.
|
|
|
|
|
simpledeveloper wrote: import Ember from 'ember';
I would imagine your issue is here.
It is case sensitive, or perhaps the location is wrong, or it's not registered.
Check the file, and work back to the source of 'ember'
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Yes it was case related, I figured that out, but now it says my function is not a helper function any help buddy?
My helper function is as below:
export default () => {
Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
alert("hi");
if (params[3]) {
params[0] = params[0].toLowerCase();
params[2] = params[2].toLowerCase();
}
let v1 = params[0];
let operator = params[1];
let v2 = params[2];
switch (operator) {
case '==':
return (v1 == v2);
case '!=':
return (v1 != v2);
case '===':
return (v1 === v2);
case '<':
return (v1 < v2);
case '<=':
return (v1 <= v2);
case '>':
return (v1 > v2);
case '>=':
return (v1 >= v2);
case '&&':
return !!(v1 && v2);
case '||':
return !!(v1 || v2);
default:
return false;
}
});
}
And I am trying to use it as below:
{{#each novi.violations as |noviv index|}}
{{#if (ifCond novv.ViolationId '==' noviv.ViolationId true)}}
{{log 'someVariable'}}
<br />
{{/if}}
{{/each}}
Here is the error that I am getting
sayingember.debug.js:43618 Uncaught (in promise) Error: Compile Error: ifCond is not a helper
Any help buddy?
modified 5-Nov-19 21:27pm.
|
|
|
|
|
Hi, I have an ember hbs component, in which we have table, in which the value of a td should be decided depending upon the value of the previous td, here is my hbs code, any help please?
<div class="row">
<div class="col-md-12">
{{#if model.novs}}
<table class="table table-striped">
<thead>
<tr>
<th>Notice#</th>
<th>Type</th>
<th>Violation</th>
<th>Inspection Item</th>
<th>
Action
</th>
</tr>
</thead>
<tbody>
{{#each model.novs as |nov index|}}
<tr>
<td>{{nov.NOVNumber}}</td>
<td>{{nov.NOVNoticeTypeName}} {{nov.ViolationTypeName}}</td>
<td>
{{#each nov.Violations as |novv index|}}
{{novv.ViolationNumber}}
{{novv.Year}}
{{novv.Make}}
{{novv.Model}}
{{#if novv.Vin}}(VIN#:
{{novv.Vin}})
{{/if}}
<br />
{{/each}}
</td>
<td>
{{#each model.result.items as |novi index|}}
{{novi.itemNum}}
<br />
{{/each}}
</td>
<td>
{{#if isResCompletedStatus}}
<div class="btn btn-xs btn-default" onclick={{action "editNov" nov.NOVId}}>
class="fa fa-eye">
<div class="btn btn-xs btn-default" onclick={{action "generatePreCase" nov.NOVId }}>
^__i class="fa fa-file">
Generate Investigation
</div>
{{else}}
<div class="btn btn-xs btn-default" onclick={{action "editNov" nov.NOVId}}>
^__i class="fa fa-edit">
Edit Notice
</div>
{{/if}}
</td>
</tr>
{{/each}}
</tbody>
</table>
{{else}}
{{#unless isResCompletedStatus}}
{{#link-to 'result.details.nov.details' 0 disabled=isResFormDisabledBoolean}}
<div class="well text-center no-margin">
Click here to add a Notice.
</div>
{{/link-to}}
{{else}}
<div class="well text-center no-margin">
No notices...
</div>
{{/unless}}
{{/if}}
</div>
</div>
In the above code, the model.result.items has Violation element, how can I display the novi.itemNum for the novv.ViolationNumber that is displayed, any help please - thanks in advance.
|
|
|
|
|
I understand your question but you posted too much HTML for me to figure out which "td" element your referring to, and you have no comments. Why post so much HTML?
Keep in mind that we can't read your mind when you post your troubled thoughts, and you have to help us along to tell the story again.
But on the other hand, it's really about working within the limitations of React, and using React HTML operators like "if", "switch" and so forth or building a better model to start with. If it's a violationType , then switch with that. I'm sure React has some support for containers and sections to hold the proper HTML based on a violationType for example.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Yes I understand it, but I figured out that
|
|
|
|
|
js code that avoid plagiarism based on string
|
|
|
|
|
Sorry, but this is not a question.
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
It could be a crossword clue.
|
|
|
|
|
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
Or a thought experiment...he appears to be using plagiarism to stop plagiarism.
|
|
|
|
|
There are multiple ways that you can perform plagiarism detection using string inputs. One popular method is to use search engines to use search engines to do this for you; this isn't a terribly efficient mechanism because search engines can end up choking on really large input text, meaning you would tend to look for suspicious phrases that don't seem to be in keeping with the language used in the rest of the text. If you were to roll your own plagiarism detection code, you would end up using something like affinity analysis[^] but this requires you to have a sufficiently large dataset to check the work against (this is why most people tend to search Google/Bing/DuckDuckGo, because they already have these massive datasets).
|
|
|
|
|
This is the first time i've posted on this website, so if i'm doing something wrong just let me know. Anyways, I'm having a problem getting my geolocation to work. I absolutely cannot figure out what the problem is. Without the geolocation bit of code, the default location, markers, and such work fine. Then when I try to add in the geolocation the map won't appear at all and just the button appears.
<pre><div id="map"> </div>
<script>
var map;
function initMap() {
var myLatLng = {lat: 41.413118, lng: -82.072537}
map = new google.maps.Map(document.getElementById('map'), {
center: myLatLng,
zoom: 18
});
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'My Location'
});
var marker = new google.maps.Marker({
position: {lat: 41.412726, lng: -82.072047},
map: map,
title: 'PS Building',
label: {text:'PS Building'}
});
infoWindow = new google.maps.InfoWindow;
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
var marker = new google.maps.Marker({
position: pos,
map: map,
title: 'Your Location'
});
infoWindow.setPosition(pos);
infoWindow.open(map);
map.setCenter(pos);
}, function() {
handleLocationError(true, infoWindow, map.getCenter());
});
} else {
handleLocationError(false, infoWindow, map.getCenter());
}
}
function handleLocationError(browserHasGeolocation, infoWindow, pos) {
infoWindow.setPosition(pos);
infoWindow.setContent(browserHasGeolocation ?
'Error: The Geolocation service failed.' :
'Error: Your browser doesn\'t support
geolocation.');
infoWindow.open(map);
}
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=
KEY&callback=initMap"
async defer></script>
<form>
<input type="button" onclick="GetLocation();" value="click"/>
</form>
|
|
|
|
|
Why are you repeating this question? It's been answered, below. (Though you may also need to put
'Error: Your browser doesn\'t support
geolocation.');
on one line first, if that's not just a formatting issue on this site.)
And your
onclick="GetLocation();" attached to the button won't do anything unless you define a function with that name in your script.
|
|
|
|
|
This is the first time i've posted on this website, so if i'm doing something wrong just let me know. Anyways, I'm having a problem getting my geolocation to work. I absolutely cannot figure out what the problem is. Without the geolocation bit of code, the default location, markers, and such work fine. Then when I try to add in the geolocation the map won't appear at all and just the button appears.
<pre><div id="map"> </div>
<script>
var map;
function initMap() {
var myLatLng = {lat: 41.413118, lng: -82.072537}
map = new google.maps.Map(document.getElementById('map'), {
center: myLatLng,
zoom: 18
});
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'My Location'
});
var marker = new google.maps.Marker({
position: {lat: 41.412726, lng: -82.072047},
map: map,
title: 'PS Building',
label: {text:'PS Building'}
});
infoWindow = new google.maps.InfoWindow;
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
var marker = new google.maps.Marker({
position: pos,
map: map,
title: 'Your Location'
});
infoWindow.setPosition(pos);
infoWindow.open(map);
map.setCenter(pos);
}, function() {
handleLocationError(true, infoWindow, map.getCenter());
});
} else {
handleLocationError(false, infoWindow, map.getCenter());
}
}
function handleLocationError(browserHasGeolocation, infoWindow, pos) {
infoWindow.setPosition(pos);
infoWindow.setContent(browserHasGeolocation ?
'Error: The Geolocation service failed.' :
'Error: Your browser doesn\'t support
geolocation.');
infoWindow.open(map);
}
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=
AIzaSyCyO4aFysnjiQ9DO5VSDSJ_DtPd6O9mkDI&callback=initMap"
async defer></script>
<form>
<input type="button" onclick="GetLocation();" value="click"/>
</form>
|
|
|
|
|
One glaring issue:
infoWindow = new google.maps.InfoWindow;
You never declare the variable, and you need the constructor when calling it, so...
var infoWindow = new google.maps.InfoWindow();
All of this should be visible as errors in your javascript console. Are you not using browser Dev tools to debug?
Edit: Stupids
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
modified 29-Oct-19 8:47am.
|
|
|
|
|
Javascript doesn't require that variables are declared before they're used, unless you enable "strict" mode[^].
It also doesn't always require the parentheses when calling a constructor. For example, foo = new Date; seems to work fine without any errors or warnings.
Basically, Javascript is the VB6 of the web.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Haven't worked outside of strict mode in ages, forgot about that bunk.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|