Why can't I find traci.vehicle.getIDCount()? - sumo

I am trying to get the total number of vehicles in the scenario. I checked wiki, it says the method traci.vehicle.getIDCount() can do it. But somehow I cannot find the definition of this function in SUMO's Github or my local pc. But actually I can run the code without errors.
Can anyone explain why I can't locate such a function but I can run it?

The function is defined in the file traci/domain.py. All the individual domains such as vehicle, edge etc inherit from the Domain class defined in this file and so inherit this function as well. I cannot tell though why your search is not successful because the code is right there (on Github and probably on your machine as well).

Related

How to go to a folder without specify the path

I am creating a button that will open one directory in your computer (for example: C:\Users\NameOfUser\Downloads) when you click it. But if I do this on another computer or from another user account with a different name the button doesn’t work. I just used Process.Start() for the button.
Is there a different way to do this that will work from any user account?
You can get most folder paths like this just by calling Environment.GetFolderPath() with the right Environment.SpecialFolder enum value. Unfortunately, the Downloads special folder in .Net isn't quite "special" enough and (imo) is unreasonably complicated to get. If you actually need to know the path, the correct way is to follow the accepted answer here:
Getting Downloads Folder in C#?
Even worse, it's written for C# and uses code that's not very easy to translate.
The good news is there's also a NuGet package I'd expect you can use from VB. The even better news is you don't really care about the exact path in this case. You just want to open an Explorer window via Process.Start(). That means you can use this shortcut (also available via the other question):
Process.Start("shell:Downloads")

How to add a url to startup via registry

I'm trying to add a URL to my system startup. I want to do this via the registry because it fits some other things I'm hoping to do later. Here's my code at the moment;
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\", "LinkLoad", "https://www.url.link")
I'm trying to do this via vb.net if at all possible. I have given the application administrative privileges but for some reason this hasn't work. The new registry key isn't in position (and to be honest I'm not 100% sure this would work in loading the webpage!).
[FYI the link in the above code is junk, I didn't think it was important to include the actual link I want to load!)

Joomla: Allowing a user to upload an image

Alright so I learned that to have an upload button on a page, what you do is basically call a php file (call is upload.php) that would upload a file to the server. I have no idea where I am supposed to put the php file inside the server so I can call it.
I feel stupid because I can't find any answers online. I am getting very frustrated and confused because I am told I need to create a database but I have no idea how to edit a database in Joomla. I took a class in SQL so I don't have to learn about that. I just don't know where it is. I was also told I need to make a component. But this is confusing because all I want to do is have an upload button that will upload an image to the server.
I understand your frustration. I've got the basic idea on what you are trying to do. Here are a couple of options:
You might wanna take a look at Joomla! Extensions Directory ™. You might just find there a component or a module that already does this for you.
If you want to do it on your own, than you need to create a small module or a component inside Joomla! Please refer to the Joomla! Documentation or tutorials on this topic. Please note that you won't get this working instantly, because you first need to understand how Joomla! works. So your upload.php file will go in your module / component files. I don't think you need to do any SQL.
Now the part with "allowing a user" is a bit confusing... you want to "allow" any user to upload things to your server or just let's say, registered users? Generally uploading scripts need to be very strong from the security point of view. If this is the case, that you need to do a search for Joomla! ACL
You can simply create a form and add the "media" field type.
http://docs.joomla.org/Standard_form_field_types
You can also opt for the "file" field types to allow different types of fields.
Both fields can be added using the Joomla Component Creator: http://www.notwebdesign.com/joomla-component-creator/
And you might also want to take a look at K2 which has an excellent image upload functionality that allows scaling of images into three different sizes.

Multiple modules in a page ZF2

I'm using Zend framework 2 and I want to load several modules in one URL... but i don't know how to do that, I tried to play with route but nothing worked...
So here I am!
Thanks for helping :)
The quick answer is that you need to choose (perhaps create) ONE module and define the appropriate url route in there, then reference your other modules using the service manager and view helpers from your controller function and view respectively. So it all orients around a single controller function which makes calls to the other modules.
If you still need help with this let me know and I'll try to find you some code examples by the end of the weekend. Also, let me know exactly what you're trying to do (partly so I can help but partly out of curiosity).

dojox.io is undefined

I use dojo mobile for my mobile application. I like to show any contents of another site in my application. for this I will get content from my site.
I found out that for this I shold use cross site xhr. But I get error a dojox.io is undefined error!!!
I'm really frustrated. I search the whole day, but without success....
can anyone help me with a small example (with all informations and really domain-name). Which "require" do I needed?
thanks in advance
dimi
Since you are trying to call the dojox.io.xhrPlugins.addCrossSiteXhr function, to get the module name all you need to do is remove the function name:
dojo.require('dojox.io.xhrPlugins');
The only exception to this rule is when you require a class, since the class name is already the module name.
dojo.require('dojit.Tree');
If nothing still works, you can always fallback to finding the module file by hand, since the module name is correlated with the file path.