More

Is there a way to programatically get the FeatureClass's alias name?

Is there a way to programatically get the FeatureClass's alias name?


I'd like to get the alias name of a FeatureClass, but I can't find an interface exposing that field.

UPDATE:

using IClassSchemaEdit, I'm able to specify an alias name, but I'm still unable to retreive it.


The IFeatureClass Interface exposes the AliasName.


Individual nodes don't have machine names in Drupal 6 or 7, so you can't.

If you want a unique ID for each node, and Node ID won't do (for staging or migration for example), then try taking a look at the UUID module.

This module provides an API for adding universally unique identifiers (UUID) to Drupal objects, most notably entities.

  • Automatic UUID generation for nodes, node revisions, users and taxonomy.
  • Allow choosing which content types and vocabularies to create UUIDs for.
  • Option to batch create UUIDs for objects which don't have it already.

If, however, you want the node TYPE to be available to your template, and you have the node object, it should be under $node->type , or possibly $vars['type'] .


3 Answers 3

One way I know to get such information is by using PowerShell in the Package Manager Console, from within Visual Studio.

The Package Manager Console is a PowerShell console within Visual Studio used to interact with NuGet and automate Visual Studio.

Basically you can use the Get-Package cmdlet to get a list of packages referenced in a specific project (or in an entire Solution). Regarding the license information for each package, for what I've seen you can only get the license URL and not just a short string representing the license type.

Here's an example for a Solution of mine returning a list of entries, each one consisting of the package identifier and the link to the license:


Since you can have multiple network interfaces, each of which can have multiple IPs, and any single IP can have multiple names that can resolve to it, there may be more than one.

If you want to know all the names by which your DNS server knows your machine, you can loop through them all like this:

If you need the computer description, it is stored in registry:

  • key: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceslanmanserverparameters
  • value name: srvcomment
  • data type: REG_SZ (string)

AFAIK it has nothing to do with any domain server, or with the network the PC is attached to.

For anything related to the network, I am using the following:

  • NETBIOS name: System.Environment.MachineName
  • host name: System.Net.Dns.GetHostName()
  • DNS name: System.Net.Dns.GetHostEntry("LocalHost").HostName

If the PC has multiple NETBIOS names, I do not know any other method but to group the names based on the IP address they resolve to, and even this is not reliable if the PC has multiple network interfaces.


7 Answers 7

It's called a favicon, and all you have to do is:

  1. If there's an icon at /favicon.ico , use that.
  2. Otherwise, get the content of the page, and extract the location from <link rel="shortcut icon" href /> . You’ll need to use an HTML parser and find the <link> with a rel of either icon or shortcut icon .

It will find all logos for a website in multiple sizes and return a nice json string with meta data including the url to the icon. You simply replace www.stackoverflow.com with your domain.

The site also has a gui for entering in websites manually if you prefer:

Here is a sample string returned from querying for the stack overflow website:


You didn't specify what your environment is but if you're using Unix I think a combination of dig and grep should work. ns.example.com should be the hostname of your nameserver, example.com is the domain your host is part of, and HOST is the host that you want to find all the CNAME records for. That's actually a tab character in the grep command, not literally <TAB> (you may have to adjust the grep string).

Also your nameserver needs to to be configured to allow zone transfers, the particulars of which will be implementation dependent.

Or if you're on Windows you could use nslookup:

This should output all of the records for the domain example.com that ns.example.com "knows about" to FILE. You can then use whatever tool you want to sort through the text file looking for the corresponding CNAMES.

Or with this untested (but seemly correct looking) perl script:


10 Answers 10

The classical tool top shows processes by default but can be told to show threads with the H key press or -H command line option. There is also htop, which is similar to top but has scrolling and colors it shows all threads by default (but this can be turned off). ps also has a few options to show threads, especially H and -L .

There are also GUI tools that can show information about threads, for example qps (a simple GUI wrapper around ps ) or conky (a system monitor with lots of configuration options).

For each process, a lot of information is available in /proc/12345 where 12345 is the process ID. Information on each thread is available in /proc/12345/task/67890 where 67890 is the kernel thread ID. This is where ps , top and other tools get their information.


Programatically redirect to node/nid doesn't redirect to url alias

From what I understand the module 'GlobalRedirect' has been merged into the 'Redirect' module. So the redirect module should also redirect links as node/nid to it's url alias. When creating redirects trough the interface this works perfectly. But if I programatically do a redirect to a node/nid page it isn't being redirected to it's url alias.. Not sure if this is bad coding on my part, or feature not implemented in the module.

I'm using this code to redirect a product group to it's first referenced entity node, which uses automated url structure generated by a pathauto pattern, but the url alias isn't being shown after the redirect, it shows node/nid. I've verified that the url alias on that page actually works, and even added a redirect from that specific node/nid to it's url alias trough the interface, but no luck.

Am I doing something wrong? Is this working as intended? Is there a cleaner/better way for me to redirect? Still quite new to Drupal 8..

Using:
Drupal 8.1.3
Redirect 8.x-1.0-alpha1
Pathauto 8.x-1.0-alpha3


Drupal: How do I programatically create a URL alias for a node that already has an alias on node save?

I have a custom module that implements hook nodeapi to execute some code when the node is created or updated.

Basically I want to create an alias based off of the automatically generated alias on node save or update.

Right now I'm using a call to path_set_alias and I only want to do this with a specific type of content, "product".

Here is my nodeapi call to get me started

Then I have this function, the one I'm trying to get to save my second URL alias for me.

This doesn't set the alias though, it just creates a duplicate of the product's original alias. So If i started off with my product being "Green Fern". I would save it, and it would use pathauto to generate products/green-fern then after call my module code and make an alias "alt/products/green-fern" and still make it point back to the "node/nid" path.

However, when I run this code a duplicate in the database is created. So I save Green Fern one time and all of a sudden I see two duplicate records at the end of the url_alias in the database. "products/green-fern" and "products/green-fern"

I feel like I'm thinking about this in a much too comlpex way. My client is aware of the SEO hit they get when making more than one alias point to the same node, they just want it to do this. Halp!


Fields and field properties

When you create a feature class in ArcCatalog or the Catalog window, you can specify the fields to be included in the feature class. You can also specify properties for fields, such as the field type and the maximum size of the data that can be stored in the field. Each field type has special properties.

All fields have properties, such as the following:

  • Alias: This is an alternate name for the feature class field. Unlike a field's true name, an alias does not have to adhere to the limitations of the database and may therefore contain spaces and special characters and start with a number. You can only specify field aliases for feature classes in geodatabases.
  • Allow Nulls: This controls whether the field will have a NOT NULL constraint on it when the field is created. If Allow Null Values is set to No, the field definition in the database will contain the NOT NULL constraint. If, on the other hand, you stay with the default of Yes, the field will be NULLABLE.

The geodatabase model is such that it will insert an empty value (numeric = 0, text = "") instead of a database NULL if, and only if, the field in the database has a NOT NULL constraint on it.

All feature classes have a set of required fields necessary to record the state of any particular object in the feature class. These required fields are automatically created when you create a feature class, and they cannot be deleted. Required fields can also have required properties such as their domain property. You cannot modify the required property of a required field.

For example, in a polygon feature class, OBJECTID and Shape are required fields. They do have properties, such as their geometry type, that you can modify, but these fields cannot be deleted.

If you create a line feature class in a geodatabase, an additional field is added to the feature class automatically to record the length of the line. If you create a polygon feature class, two additional fields are added automatically to record the length (perimeter) and area of each polygon feature. The units of measure for these values depends on the spatial reference defined for the feature class. The names of these fields vary depending on the database and spatial type you use. These are required fields and cannot be modified.

Certain field names appear in ArcGIS with their fully qualified names for feature classes stored within an enterprise geodatabase. For example, if you create or import a polygon feature class that contains a field named Area, the database, schema, and feature class name are appended to it. This is the name you will see in the attribute table of the feature class. That means for a polygon feature class named archsites stored in the prof schema of the museum database, the Area field looks like this:

The following list contains all the field names that are fully qualified within an enterprise geodatabase:

FID, AREA, LEN, POINTS, NUMOFPTS, ENTITY, EMINX, EMINY, EMAXX, EMAXY, EMINZ, EMAXZ, MIN_MEASURE, MAX_MEASURE

For cases such as this, you might consider using a different field name or a field alias.

Importing fields

When you create a feature class, you have the option to import fields from another feature class or table. This option enables you to use another feature class or table as a template for the field definitions of the one you are creating. Once you have imported the fields, you can edit the field names, their data type, and their properties.

When you import fields when creating a feature class, the required fields aren't affected. For example, if you have set the Geometry type property for the new feature class to be Point, importing field definitions from a feature class in which the SHAPE field's Geometry type property is polygon will not overwrite the Point property.