[Solved] Validation...
 
Notifications
Clear all

[Solved] Validation Rule to restrict not to create any new user records with "Salesforce" Licence

0 Posts
1 Users
0 Likes
7 Views
0
Topic starter
Deep Naik Asks: Validation Rule to restrict not to create any new user records with "Salesforce" Licence
For one requirement, I was trying to write a validation rule on USER object.

Requirement: I need to restrict users not to create any new users with Salesforce licence.

I have tried this ISPICKVAL(Profile.LicenseType,"Salesforce") but it's not working. I have tried this too but no luck ISPICKVAL($Profile.LicenseType,"Salesforce") Can anyone suggest, Where i am doing wrong?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

Unreplied Posts

[Solved] Spring Cloud Gateway do not create WebSocket connection due to CORS

Alexey Usharovski Asks: Spring Cloud Gateway do not create WebSocket connection due to CORS
I have a pretty simple configuration with Eureka for service discovery, Gateway for load balancing, and one service with WebSocket API.

If I try to access the service directly with a client (Angular + SocksJS) all works fine but if I put it behind the Gateway it produces 403 errors due to CORS.

Also I use Spring Security for authentication and can’t use tricks like setAllowedOrigins("*"). Please help me to find proper configuration for Gateway.

In browser logs I see errors like that

Code:
websocket.js:6 WebSocket connection to 'ws://localhost:4200/api/v1/socket-channel/457/x0j1bjvd/websocket' failed: One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 0
.....
POST http://localhost:4200/api/v1/socket-channel/457/se02m4wm/xhr_streaming?t=1633548504411 403 (Forbidden)

Client connection code

Code:
export class OrderStatusService {

  private client;
  private state: BehaviorSubject<SocketClientState>;

  constructor() {
    this.client = Stomp.over(new SockJS("/api/v1/socket-channel"));
    this.state = new BehaviorSubject<SocketClientState>(SocketClientState.ATTEMPTING);
    this.client.connect({}, () => {
      this.state.next(SocketClientState.CONNECTED);
    });
  }

  private connect(): Observable<Client> {
    return new Observable<Client>(observer => {
      this.state.pipe(filter(state => state === SocketClientState.CONNECTED))
        .subscribe(() => {
          observer.next(this.client);
        });
    });
  }

  onMessage(topic: string): Observable<any> {
    return this.connect().pipe(first(), switchMap(client => {
      return new Observable<any>(observer => {
        const subscription: StompSubscription = client.subscribe(topic, message => {
          observer.next(JSON.parse(message.body));
        });
        return () => client.unsubscribe(subscription.id);
      });
    }));
  }
}

Spring Gateway configuration. Here I try many cases with direct URLs etc.

Code:
server:
  port: 8080

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
    fetch-registry: true

spring:
  application:
    name: gateway-service
  cloud:
    gateway:
      routes:
        - id: backend-api
          uri: lb://BACKEND-API
          predicates:
            - Path=/api/v1/**
        - id: backend-api-ws
          uri: lb:ws://BACKEND-API
          predicates:
            - Path=/api/v1/**

Websocket configuration

Code:
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {

    private static final Logger logger = LoggerFactory.getLogger(WebSocketConfig.class);

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/socket-channel")
                .withSockJS();
    }

    @Override
    public void configureMessageBroker(MessageBrokerRegistry registry) {
        registry.setApplicationDestinationPrefixes("/order_in");
        registry.enableSimpleBroker("/order_out");
    }

}

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.
 
 
 

[Solved] how to let the domain have the SSO access cookie based on the previous AAD token in the same browser session before making a XMLHttpRequest

TheNoobDev Asks: how to let the domain have the SSO access cookie based on the previous AAD token in the same browser session before making a XMLHttpRequest

  • I have a application that is configured with SSO with Shibboleth as Service Provider and Azure AD as the IDP
  • Whenever I leave the page for 3 minutes, any links in the application will become a blank page after being clicked
  • I have opened a call with Microsoft Azure AD team and they have mentioned that once the login authentication happens the SAML token is valid for 1 hr. If the App session is again redirecting to Azure AD using xhtml request versus Ajax request for the sub components of a page, it can cause such problems. Below is their response-

Once the application gets integrated with SAML IDP (Azure AD in our case), the application should be able to manage its own access session after receiving SAML token, which means the app should not redirect user to IDP for CORS XMLHttpRequest within the same browser session.

The application must be able to avoid XMLHttpRequest without any access session cookies to its own resources. If that happens, application will go to Azure AD for a new token within XMLHttpRequest, which will violate the CORS policy at browser side. AAD login endpoint “login.microsoftonline.com” does not have a CORS header, so the only way to resolve this is to let the “my.domain.com” have the SSO access cookie based on the previous AAD token in the same browser session before making a XMLHttpRequest to its own resources.

  • How do we let the “my.domain.com” have the SSO access cookie based on the previous AAD token in the same browser session before making a XMLHttpRequest to its own resources?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] SSRS Output to multiple worksheets(including ‘All’ sheet) [closed]

Ted Asks: SSRS Output to multiple worksheets(including ‘All’ sheet) [closed]
I have no problems exporting my SSRS report to separate tabs in Excel.

I’m wondering if it’s possible for an SSRS report to be exported with separate tabs in Excel for each group and a tab at the end that contains all of the records?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] How can I make a value in MongoDB only be set once?

Pinkhron Asks: How can I make a value in MongoDB only be set once?
How can I check if a value exists on “timestamp”, and if it doesn’t exist I want it to update it but if the value exists I want it to leave it alone?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Coding a loop inside of an Array in pseudocode

compsci9298233 Asks: Coding a loop inside of an Array in pseudocode
I’m new to computer science. I’ve been told there is only 1 bug in the following Java type pseudo-code but i’m unable to figure it out. Isn’t there more then 1? First the if statement means it won’t loop as size doesn’t equal max size, but i think the loop is also incorrect as rather then i<=size shouldn’t it be i<=maxsize?

Code:
private int size = 0;
private int maxsize = 16;
private int[] arr = new int[maxsize];
public void append(val, list){
    if(size == maxsize){
        int[] newArr = new int[maxsize * 2];
        for (i = 0; i <= size ; i++)
            newArr[i] = arr[i]
        arr = newArr;
        maxsize = maxsize*2
    }
    arr[size++] = val;
}

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Primeng, dynamically uncheck p-checkbox with pButton

Chris Asks: Primeng, dynamically uncheck p-checkbox with pButton
i originally found this question, which is really similar to my situation:

how to uncheck/check a primeng checkbox manually

and this is a StackBlitz where it shows my problem:

Angular Primeng P Checkbox Issue (forked) – StackBlitz

basically, i am looping through data that can be any length and displaying it in a table.

one of the columns just has a p-checkbox with (onChange), that when checked and unchecked, it passes in some parameters for me to keep track of in an array.

i am trying to then uncheck all the p-checkboxes with a button click.

i found another question/solution that mentioned using @ViewChildren, ElementRef, QueryList but it was having a problem trying to figure out what “nativeElement.checked” was.

and other questions/solutions i found involved knowing the length of the checkboxes beforehand, and using *ngFor through an array to display the correct amount of checkboxes. i tried to use similar logic with my setup, but couldn’t get it working either.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Translate to text a Emoji Unicode String un python

eoterochio Asks: Translate to text a Emoji Unicode String un python
I have a list of tweets that has been delivered as a csv. But when I read them, the emojis unicode has been converted as str and I can’t translate them to their real name (“waffle” or “heart”).

Code:
def load_csv(csv_name):
    path = os.getcwd()
    df = pd.read_csv(path + "/" + csv_name, header=0, index_col=0, parse_dates=True, sep=",", encoding="utf-8")
    return df

csv_name = "tweets_nikekaepernick.csv"
df = load_csv(csv_name)

text = df["tweet_full_text"].iloc[0]
text

Out[]: 'Hi <U+0001F602><U+0001F602><U+0001F480><U+0001F480><U+0001F480><U+0001F480>'

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Problem in using itertuples to iterate over a Pandas DataFrame

Carlos Asks: Problem in using itertuples to iterate over a Pandas DataFrame
I want to iterate over a Pandas DataFrame and I have read in other posts that a way to do it was to use intertuples. I do not know what I am missing, as I keep getting this error: ‘DataFrame’ object has no attribute ‘intertuples’. I need to iterate over the dataframe and do some operations with the values in the columns ‘Year’ adn ‘Month’, as the example below:

Code:
import pandas as pd

df = pd.DataFrame({'Year': [2018, 2019, 2020], 'Month': [6, 7, 8]})
for row in df.itertuples():
    print(row)

Sorry, please do not consider my question. There was a missspelling noted by Mahrkeenerh! But I learnt something new from ti7! Thanks!

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Under what circumstances does PHP’s openssl_random_pseudo_bytes return false?

CJ Dennis Asks: Under what circumstances does PHP’s openssl_random_pseudo_bytes return false?
The PHP documentation for openssl_random_pseudo_bytes says:

Return Values​

Returns the generated string of bytes on success, or false on failure.

What would cause openssl_random_pseudo_bytes to fail? Can this be manually triggered for testing purposes? I tried disabling the entire openssl PHP extension, but as expected that raised an error due to the function not being found.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] I am trying to run this code I found in a book about neural networks in R

alefisto Asks: I am trying to run this code I found in a book about neural networks in R
I am using the latest version of R and Rstudio. The code is as follows:

Code:
library("neuralnet")

#Set working directory for the training data
setwd("C:UserspcDesktopOctavo IBERO 2021ServSocNeural-Networks-with-R-masterChapter01")
getwd()

#Read the input file
mydata=read.csv('Squares.csv',sep=",",header=TRUE)
mydata
attach(mydata)
names(mydata)

#Train the model based on output from input
model=neuralnet(formula=Output~Input,data=mydata,hidden=10,threshold=0.01)
print(model)

#Lets plot and see the layers
plot(model)

#Check the data - actual and predicted
final_output=cbind(Input,Output,as.data.frame(model$net.result))
colnames(final_output) = c("Input","Expected Output","Neural Net Output" )
print(final_output)

I only get the following message in console:

Code:
source('C:/Users/pc/Desktop/Octavo IBERO 2021/ServSoc/Neural-Networks-with-R-master/Chapter01/Chapter1_NN_Introduction_Squares.R', echo=TRUE)

Thanks in advance

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

Share: