Use AutoLISP to Generate New Dimension Style

I would like an AutoLISP routine that automatically creates a new dimension style with my custom settings. I know it is possible to copy dimension styles from one drawing to another, but it is tedious and time-consuming to have to do this each time.

I have compiled a list of the variables that I would like to have for my most commonly used style, but ideally I would like to be able to add or remove variables from this list.

The process to do this manually is to set each variable in the command line, then use the “-DIMSTYLE SAVE” command to save it with a custom name. I attempted to tackle this project myself, but being relatively inexperienced in AutoLISP I quickly realized that I do not quite have the knowledge to do this properly.

Here is the list of variables that matter for creating most new styles for me:

DIMALTD 4

DIMAPOST    [null]

DIMALTF 1

DIMALTTD    4

DIMALTU 4

DIMADEC 1

DIMAZIN 0

DIMARCSYM   1

DIMBLK  ClosedFilled

DIMBLK1 ClosedFilled

DIMBLK2 ClosedFilled

DIMASZ  1

DIMCEN  0

DIMCLRD 3

DIMDLE  0

DIMLTYPE    BYBLOCK

DIMLWD  -2

DIMDLI  4

DIMLTEX1    BYBLOCK

DIMLTEX2    BYBLOCK

DIMCLRE 3

DIMEXE  0.5

DIMLWE  -2

DIMEXO  0.75

DIMFRAC 0

DIMJOGANG   45

DIMLDRBLK   ClosedFilled

DIMLUNIT    5

DIMSCALE    1

DIMRND  0

DIMSAH  Off

DIMCLRT 3

DIMTXT  1.5

DIMTIH  On

DIMGAP  0.1

DIMTOH  On

DIMTAD  0

DIMTXSTY    Standard

DIMTM   0

DIMTP   0

DIMTFAC 1

DIMTZIN 0

DIMZIN  0

select an area from image using mouse and capture this area in java [closed]

I want to select an area from an image using the mouse and get a screen shot of the selected area when i leave the button of the mouse and save it
and this is my work

[https://i.stack.imgur.com/Tzk5O.png][1]

JFileChooser file = new JFileChooser();
file.setCurrentDirectory(new File(System.getProperty(“user.home”)));
//filter the files
FileNameExtensionFilter filter = new FileNameExtensionFilter(“*.Images”, “jpg”, “gif”, “png”);
file.addChoosableFileFilter(filter);
int result = file.showSaveDialog(null);
//if the user click on save in Jfilechooser
if (result == JFileChooser.APPROVE_OPTION) {
File selectedFile = file.getSelectedFile();
String path = selectedFile.getAbsolutePath();
imageLabel.setIcon(ResizeImage(path));

No ‘Access-Control-Allow-Origin’ header is present on the requested resource—when trying to get data from a REST API

I’m trying to fetch some data from the REST API of HP Alm. It works pretty well with a small curl script – I get my data.

Now doing that with JavaScript, fetch and ES6 (more or less) seems to be a bigger issue. I keep getting this error message:

Fetch API cannot load . Response to preflight request doesn’t
pass access control check: No ‘Access-Control-Allow-Origin’ header is
present on the requested resource. Origin ‘http://127.0.0.1:3000‘ is
therefore not allowed access. The response had HTTP status code 501.
If an opaque response serves your needs, set the request’s mode to
‘no-cors’ to fetch the resource with CORS disabled.

I understand that this is because I am trying to fetch that data from within my localhost and the solution should be using CORS. Now I thought I actually did that, but somehow it either ignores what I write in the header or the problem is something else?

So, is there an implementation issue? Am I doing it wrong? I can’t check the server logs unfortunately. I’m really a bit stuck here.

function performSignIn() {

  let headers = new Headers();

  headers.append('Content-Type', 'application/json');
  headers.append('Accept', 'application/json');

  headers.append('Access-Control-Allow-Origin', 'http://localhost:3000');
  headers.append('Access-Control-Allow-Credentials', 'true');

  headers.append('GET', 'POST', 'OPTIONS');

  headers.append('Authorization', 'Basic ' + base64.encode(username + ":" + password));

  fetch(sign_in, {
      //mode: 'no-cors',
      credentials: 'include',
      method: 'POST',
      headers: headers
    })
    .then(response => response.json())
    .then(json => console.log(json))
    .catch(error => console.log('Authorization failed : ' + error.message));
}

I am using Chrome. I also tried using that Chrome CORS Plugin, but then I am getting another error message:

The value of the ‘Access-Control-Allow-Origin’ header in the response
must not be the wildcard ‘*’ when the request’s credentials mode is
‘include’. Origin ‘http://127.0.0.1:3000‘ is therefore not allowed
access. The credentials mode of requests initiated by the
XMLHttpRequest is controlled by the withCredentials attribute.

Using a variable in Where statement

I have made a PowerShell script to report hourly/daily current running processes via email excluding known processes.

I now want to make this easier to update with new processes added to a list.

Below is an example of the current script:

$Yday = (Get-Date).AddDays(-1)
$pros = Get-Process | Where {($_.StartTime -GT $Yday -and $_.ProcessName -notmatch "chrome|outlook|powershell")}

Output of $pros will contain the results of processes started in the last 24 hours minus the processes chrome, outlook and powershell.

I would like to achieve:

A file called “Known_Processes.txt” containing a list of processes like

chrome
outlook
powershell

Then using the following script to create the same string of text used to pass through as a filter in the where statement.

$Yday = (Get-Date).AddDays(-1) 
[string]$Known_Processes = (Get-Content -Path C:\PS\known_processes.txt | Out-String).Replace("`n", "|").TrimEnd("|")
$pros = Get-Process | Where {($_.StartTime -GT $Yday -and $_.ProcessName -notmatch $Known_Processes)}

The output of this will show all processes including the processes I am trying to filter out even though the variable $known_processes is the same value as “chrome|outlook|powershell”.

I have tried searching and the only alternative to getting this to work is to use regex. Whilst I could do this my fear is other admins that do not have PowerShell knowledge could make mistakes when attempting to update the where statement. As where it would be easier for them to insert process names into a text file in a list.

select all or only specific rows from a table

Is it possible to fetch records based on where condition and if the condition is not satisfied , then all the records from the table must be displayed.

for example, i have customer ids 1,2,3,4. if i give 1 as c_id in where condition, it must display that particular record. if i give 5 as c_id, it must display all the records from the table. is it possible to achieve in a single query?

Below is the query which i have tried.

SELECT case
 WHEN c_id in ('6') then 1          
      else 0
       END as y from customer

how to change web server url with listview?

how to change WEB_URL with listview in android.
The server is based on each city and the server is changed when the city is selected.

Constant.java

public class Constant extends Activity {

/**
 * -------------------- EDIT THIS WITH YOURS -------------------------------------------------
 */

// Edit WEB_URL with your url. Make sure you have backslash ('/') in the end url
public static String WEB_URL= "http://hajaghaali.com/armaghan/";

/* [ IMPORTANT ] be careful when edit this security code  */
/* This string must be same with security code at Server, if its different android unable to submit order */
public static final String SECURITY_CODE = "";

// Device will re-register the device data to server when open app N-times
public static int OPEN_COUNTER = 50;


/**
 * ------------------- DON'T EDIT THIS -------------------------------------------------------
 */

// this limit value used for give pagination (request and display) to decrease payload
public static int NEWS_PER_REQUEST = 10;
public static int PRODUCT_PER_REQUEST = 10;
public static int NOTIFICATION_PAGE = 20;
public static int WISHLIST_PAGE = 20;

// retry load image notification
public static int LOAD_IMAGE_NOTIF_RETRY = 3;

// Method get path to image
public static String getURLimgProduct(String file_name) {
    return WEB_URL + "uploads/product/" + file_name;
}

public static String getURLimgNews(String file_name) {
    return WEB_URL + "uploads/news/" + file_name;
}

public static String getURLimgCategory(String file_name) {
    return WEB_URL + "uploads/category/" + file_name;
}

I want to change the server when I click on one of the items in the list.

How to make a recursive function to get a max money earned in a family?

So we have a dict of the family and who is who’s kid. (it’s a global variable)

kids= {
"Adam": ["Matjaž", "Cilka", "Daniel"],
"Aleksander": [],
"Alenka": [],
"Barbara": [],
"Cilka": [],
"Daniel": ["Elizabeta", "Hans"],
"Erik": [],
"Elizabeta": ["Ludvik", "Jurij", "Barbara"],
"Franc": [],
"Herman": ["Margareta"],
"Hans": ["Herman", "Erik"],
"Jožef": ["Alenka", "Aleksander", "Petra"],
"Jurij": ["Franc", "Jožef"],
"Ludvik": [],
"Margareta": [],
"Matjaž": ["Viljem"],
"Petra": [],
"Tadeja": [],
"Viljem": ["Tadeja"],
}

Now we have a recursive function:

def richest(person, money):

Money is a local variable, that has the amount of money of each person.

money = {
        "Adam": 42,
        "Aleksander": 3,
        "Alenka": 3,
        "Barbara": 37,
        "Cilka": 242,
        "Daniel": 4,
        "Erik": 32,
        "Elizabeta": 8,
        "Franc": 16,
        "Herman": 12,
        "Hans": 55,
        "Jožef": 7,
        "Jurij": 5,
        "Ludvik": 37,
        "Margareta": 20,
        "Matjaž": 142,
        "Petra": 3,
        "Tadeja": 45,
        "Viljem": 55
    }

When I call the function richest("Elizabeta", money) it should return the person/s with the max money and the amount of money.
In this case that would return: [("Ludvik", 37), ("Barbara", 37)]

I’ve tried to make a recursive function but it doesn’t work properly.

def richest(person, money):
      people=[]
      for kid in kids[person]:
         #goes for each kid of that person and their kids.
      return #somehow append it into the people array

What am I doing wrong could someone help me? I’ve also tried something with the the generator but it appended [None] into each kid so it didn’t work too..

How to set up a task to execute gradle wrapper in vscode?

At the root of my repo, I have a gradle wrapper script (gradlew.bat). Using Visual Studio Code, I’d like to set up my workspace so I can execute builds through Gradle via this wrapper script. Here is what I have at the moment:

"tasks": [
   {
      "label": "MyApp: x86 Debug",
      "command": "gradlew",
      "args": [
         ":Applications:MyApp:assemblex86debug"
      ]
   }
]

This is in my .vscode/tasks.json file. When I execute this task, the terminal pane opens but I don’t see anything happening. What am I missing?