w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How to HIGHLY restrict users with "specific roles" to access the application from "a certain place"?
UPDATE: The only way to restrict users in a certain place is the following: You must define Fixed IP's in the Office! Or, at least, a subnet mask for the office and it's branches. In your application, check the subnet mask from the request and compare it to fixed preconfigured office subnet mask. Thus, either you put those fixed IP's into webconf.xml or the subnet mask for the IPs; In any event, the solution will always be connected to a network solution. You could try something like this to check a fixed IP: public class TestFilter implements Filter{ public void destroy() {} public void init(FilterConfig arg0) throws ServletException {} public void doFilter(ServletRequest request, ServletResponse response, FilterChain filter) throws IOException, Servlet

Categories : Java

How can I place directives in a table?
If you are careful to use valid table elements and rely on something like attribute directives it seems to work just fine: http://jsfiddle.net/Tz83w/1/ '<tr ng-repeat="d in data" info="d"></tr>' ... .directive('info', function () { return { restrict: 'A', ... template: '<tr><td>{{info.name}}</td><td>{{info.Age}}</td></tr>'

Categories : Angularjs

How to place output from an external php file to a specific place on the page
Firstly, you shouldn't be using the ID "allContent" on two separate elements. IDs are supposed to be unique. Classes can be used for styling multiple elements. Why not change it to the code below? Is there a reason you want them to be different? echo '<div class="commentBox"><p>' . 'This is from external PHP' . '</p></div>'; echo '<div class="commentBox"><p>' . 'This is also from external PHP' . '</p></div>';

Categories : PHP

AngularJS : "Deep" application vs. "wide" application? AKA many components/directives vs. many controllers
I vote for "deep" variant. Code reuse is a very important thing. You must first go to the template, figure out which component the radio directive is probably in Why? Just look at name of the directive and open corresponding file. Create predictable folder structure when you can find any necessary file by name of directive or controller or service. For example, your directive named acme-radio where acme is your vendor-prefix, so file should be in folder vendor/acme/directives/radio.js. Other directive is exclusive for some app and named acme-appName-radio - file should be in appName/directives/radio.js. It's just rough example.

Categories : Angularjs

directory or site specific php.ini directives with php and iis 6+
Similar functionality actually does exist - if you're using php 5.3+. You can easily edit your php.ini and add entries similar to the following per each site you want to modify at the end of your existing php.ini file: [PATH=C:/code/website1.com/] upload_max_filesize = 2M [PATH=C:/code/website2.com/] upload_max_filesize = 12M

Categories : PHP

Using Angular JS directives to create a domain-specific language for forms (with binding)
I'd take the silence thus far on your post as general approval. Nobody has much to add. All your general principles make sense to me, and you're doing a nice job of using declarative property names to make your components reusable. For that reason, I won't be surprised if somebody comes along and tags this with 'not appropriate', as there isn't much of a concrete technical answer to your question. But, that's 'cause you seem to be doing it right. Cheers.

Categories : Angularjs

How does angular application handle refresh page and could we use $history on loading directives
There is probably no way to preserve any javascript variable through a page reload and $rootScope is just a javascript variable. It seems though that what you are looking for is a way to make your application "start from the same point" that it was left at when a page was reloaded. I would recommend you to get familiar with notion of state. Every application can be viewed as a set of states and transitions between them. Every user interaction or any other actions that happen within applications either change the state of application or keep it in the same state. For example: clicking a user link from a list of users changes the state from "view users list" to "view user details for user with id=213", clicking an "Edit" button on "view user details for user with id=213" changes state to

Categories : Angularjs

How to create reusable AngularJs directives that copy existing directives
Bind a controller and inject $scope for ease. .controller('Amount', ['$scope', function($scope) { $scope.myMoney = '2'; }]) .directive("amount", function(){ restrict: 'EA', replace: true, controller: 'Amount', template: "<div class='amount'><input type='text' ng-model='myMoney'/></div>", //Cleaner to include as URL if the partial is bigger. //templateUrl: '/views/amount.html', link: function(scope, controller) {} });

Categories : Angularjs

Angular directives: can we use '_' instead of '-' for separating words in directives
Off the top of my head, I would say that they aren't equivalent and the second one is invalid. But, much to my surprise, after doing a quick test it seems that both are valid and functional, except for the ng-app directive. This jsFiddle illustrates it. This is not documented, though. What the documentation says is: (...) The normalization is needed since all of these are treated as equivalent in Angular: <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a"> That said, I think it's safer if you stick to the docs and pick one of the official formats in order to keep you code future-proof. Update I've just found out the following in the Angular docs: Directives have camel cased names such as ngBind. The directive can be invoked by translating the camel case na

Categories : Angularjs

Is it possible get a place object with specific lat and lng?
To be precise, what you're asking is called Reverse Geocoding. Wiki: Reverse geocoding is the process of back (reverse) coding of a point location (latitude, longitude) to a readable address or place name. Yes Google provides reverse geocoding service. But it is not a single line which you mentioned in your question. It has its own procedure. Check Google's Reverse Geocoding for more information. You may find the below code useful. var geocoder; var map; function initialize() { geocoder = new google.maps.Geocoder(); // * initialize geocoder class var latlng = new google.maps.LatLng(40.730885,-73.997383); var mapOptions = { zoom: 8, center: latlng, mapTypeId: 'roadmap' } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

Categories : Google Maps

Mysql: How do I select a if a bit on a specific place is 1?
IF options is an integer type, you can select the rows with at least bit 5 set in their options like this: SELECT * FROM `users` WHERE `options` >= POW(2, 5) To select only columns with bit 5 set in their options, do SELECT * FROM `users` WHERE (`options` & POW(2, 5))

Categories : SQL

Redirect information to specific place in file
this should do the trick use a temp file, write your info, append the previous logfile and rename tempfile to overwrite the previous one echo %yourinfo%> c: emp emp.txt type c: emplogfile.txt >> c: emp emp.txt ren c: emp emp.txt c: emplogfile.txt

Categories : Batch File

OnButtonClick Repeat Specified code at Specific Place
protected void AddButton_Click(object sender, EventArgs e) { int count = DropDownList.Items.Count + 1; DropDownList.Items.Add(count.ToString(),count.ToString()); } Is it what you want?

Categories : C#

Disable warning at a specific place in Intel Compiler
As Jarod42 suggested you could use #pragmas to ignore warnings at particular locations and simple example is mentioned here.

Categories : C++

View bytes at specific place in memory in Java
You have not misunderstood how memory works; you have merely assumed that Java will let you touch it. It won't. The memory and pointers are still there, but must be accessed through proper Object creation and dereferentiation, as opposed to direct pointer memory access. On the bright side, you don't really have to worry about freeing memory that you no longer need though.

Categories : Java

How to append text to a specific place in a file using Phing
The only solution I came up with was to replace the existing text before where you want to include data and then just add it back. For example: <reflexive file="config.php"> <filterchain> <replaceregexp> <regexp pattern="line2" replace="line2 ${line.separator} Hello World" /> </replaceregexp> </filterchain> </reflexive>

Categories : PHP

Putting the cursor in a specific place in a live template
You can arrange the order that your variables are visited in. You find the information under bullet number five in this IntelliJ help document: http://www.jetbrains.com/idea/webhelp/creating-and-editing-template-variables.html To arrange variables in the order you want IntelliJ IDEA to switch between associated input fields, use the Move Up and Move Down buttons. Edit You have to update the macro definition to similar to this: # $varComment$ is an insance of the $objectTypeComment$ class assert isinstance($var$, $objectType$)$END$ And then you define the order and expression to something like this (I didn't have any good expression for the var and orderType for you): Since you fill in the Skip if defined for the two comment variable they will just take the values from the va

Categories : Intellij Idea

where is best place to save application files in IOS
Due to the nature of iOS (and app sandboxing), you can only save within your app's document directory. To obtain the path to this directory, you can use: NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentPath = [searchPaths objectAtIndex:0]; One advantage of the sandbox approach is the fact that when your app is updated on the device, the files in the document directory will remain untouched and hence can be updated by the app as required. I'd recommend a read of the File System Programming Guide, as it covers this topic (and a lot more), including iCloud file management, etc.

Categories : Iphone

How to Place a Pause in a Windows Phone 8 Application
According to this article, the minimal duration is 0.1 seconds, while you are setting it to 0.04. Also I would try to call the VibrateController.Stop() method.

Categories : C#

Creating an application that moves a collection files from one place to another using VB
In answer to the .ZIP unpacking, use the System.IO.Packaging (more can be found at CodeProject - Zip Files Easy) Don't you think using a database would be easier to store that data?

Categories : Vb.Net

For simple web application, how can you use ".main" as the URI extention in place of .php or .html ?
You can use the apache extension mod_rewrite. Here's a sample of what you can do. RewriteEngine On RewriteRule ^(.*).main$ $1.php This will take any request with the extension .main and actually serve the file with the same name but extension .php.

Categories : PHP

How to get access to specific instance of AutoCAD application via C# external application
This is typical behavior for "heavy" programs, like AutoCAD. MS Word is another example. They are single-instance apps. If you already have AutoCAD running then the second time you start it, it passes the command line to the first instance to ask it to open the document. And exits. So there really is only one process, it has multiple documents opened. Use Taskmgr.exe, Processes tab to verify this.

Categories : C#

Where to store MAC OS application specific data (Accessible only by the application and not the user) ?
Is there a provision to store data generated by the app (be it an image or any other document) at a location accessible only by the application. No. An administrative user can access any file on the machine. I can think of three options: Rethink the requirement. The user should be in charge of the application, not the other way around. An application that needs to hide user data from the user sounds suspicious. Store the data on a server that the user can only access through your application. Encrypt the data so that the user will have a hard time using it. By the way, data is only hidden from the user on iOS because the entire file system is hidden. The permission system is about the same as on OS X.

Categories : Objective C

Where is the best place to store a web service endpoint URI string in an android application?
Is the URI subject to change based on user input and need to persist when the application is closed? If so, store it in SharedPreferences Otherwise, you could store it as a static final variable, You could store it as a resource in strings.xml, You could store it as a final variable referenced through a subclass of Application, and retrieve it through getApplicationContext(). If you only need it in a single activity, you could just instantiate it when that activity is created. There's no best option, take your pick.

Categories : Android

Why does less directives/more html take longer to compile than more directives/less html?
EDIT - your repeater directive does nothing special - it is just a wrapper for ng-repeat. To understand why repeater is faster than manipulating the DOM from the controller, you need to understand how ng-repeat works, what are compilation and linking phases. AFAIR Miško Hevery - has a talk about this here http://www.youtube.com/watch?v=WqmeI5fZcho There are few things you are doing in your example that cause it to be slower than angular ng-repeat Manipulating DOM in controller - don't do that! This practice is very bad! The reason ng-repeat is faster in this case is because it compiles the DOM once and only produces copies of the repeated element for each element in the array. In your case, you are creating element from string after the DOM has been rendered, then you modify the DOM s

Categories : Angularjs

Can I create a user in AWS IAM that only has rights to create users and place them in a specific Group?
Yes, you need to create an IAM user and then give it this iam policy. { "Statement": [ { "Sid": "Stmt1375475989975", "Action": [ "iam:AddUserToGroup", "iam:CreateUser" ], "Effect": "Allow", "Resource": "arn:aws:iam::152997954706:user/AMISTACK-02-WEB-User-WYEMFOJZ4BDP" } ] } arn:aws:iam::152997954706:user/AMISTACK-02-WEB-User-WYEMFOJZ4BDP is an example user ARN. You'll need to add in yours specific user's arn. An easy way to create policy files is to use: http://awspolicygen.s3.amazonaws.com/policygen.html

Categories : Amazon

How to allocate memory in a specific place in memory (C programming)?
You could take a look at Hoard memory allocator. I believe it tries to solve the same problem you are hitting. Hoard is a drop-in replacement for malloc that can dramatically improve application performance, especially for multithreaded programs running on multiprocessors and multicore CPUs Particularly, the problem of 'False sharing` seems to be what you want to avoid. False Sharing The allocator can cause other problems for multithreaded code. It can lead to false sharing in your application: threads on different CPUs can end up with memory in the same cache line, or chunk of memory. Accessing these falsely-shared cache lines is hundreds of times slower than accessing unshared cache lines.

Categories : C

How to make the function return to a certain place if invalid input takes place?
change you if to a while this way. While no selection occured the code stays on this block and only continues when a user made a selection function Choice(options) { wait() function wait() { // only proceed after a selection is made; selection = parseInt(selectedchoice); while (selection !== 1 || selection !== 2 ) { selection = parseInt(selectedchoice); } // Finding what the user selected for (var i in options.choices) { m++ if (m === selection) { //console.log("PICK IS " + i); pick = i; break } console.log(options.choices[pick].condition) if (selection >= options.choices.length || selection <= 0 || options.choices[pick].condition === false) { selection = 0;

Categories : Javascript

Android - Where is the best place to place the "addProvider" / "Security.insertProviderAt" code line
Personally, I also don't like the idea of inserting it subclass of Application. I prefer to add this static initialising block in my main Security/CryptoManager class for security related things, whose instance you know what you will always refered to/create before doing any operation which will require SC. Just to be on safer side, you can make sure that this static block is executed by calling some method like CyrptoManager.init()

Categories : Android

How to check for specific application installed in machine or can we get list of installed application in gwt ?
Browser and OS detected via Window.Navigator are not fail proof. They only observe pattern in the way a browser does stuff and classify into OS and Browser groups. Browser run Javascript ( i.e GWT Code ) do not have privilege to query OS regarding installed software or hardware details!!!!! There is no possible solution in GWT/Javascript for this.

Categories : Gwt

Is the id of the place, returned by google place api remain constant?
Yes and no. If ID 1 is specified for Place 1, then ID 1 will never be used for another place. But, theoretically, another place with ID 2 could be created and then Place 1 is merged into it because both virtual places represent the same physical place. Then, the same queries that were returning ID 1 for this place could now return ID 2. Both ID 1 and ID 2 would be valid for this place.

Categories : Google Maps

Port specific RMI application
Apart from the part where you ask the user for the data, in an RMI client this is just a matter of building the lookup string for Naming.lookup() dynamically instead of statically: e.g. instead of MyRemote mr = (MyRemote)Naming.lookup("rmi://somehost:someport/MyRemote") you would have String host; // initialized by dialogue with user int port; // initialized by dialogue with user MyRemote mr = (MyRemote)Naming.lookup("rmi://"+host+":"+port+"/MyRemote") At the RMI server end, the port number is provided to super() when constructing your remote object, if you extend UnicastRemoteObject, otherwise to UnicastRemoteObject.exportObject() if you don't extend UnicastRemoteObject. Normally you don't need to specify your own host at all; an exception is if you are behind a NAT device or so

Categories : Misc

how to run a web application using specific php version
Some PHP hosts will run multiple versions of PHP at the same time, and allow you to choose between them either in a global configuration somewhere or in a .htaccess file for specific directories. If it's the latter, then this is simple. I suggest you contact your host and ask them if that is a possibility. - If it's not, then you are likely out of luck. It would be easiest to just host it separately. Supporting sites that require outdated PHP versions is a pain

Categories : PHP

Wait for a specific key in a Win32 application
Your application is a GUI subsystem application and its main thread must regularly pump its message queue. You are not doing that because you enter a tight loop looking for specific key state. Because you don't service your queue, the system concludes that your application is broken and ghosts your window. Before we go on to how to do it right, your existing approach is broken in other ways. Suppose that the key is pressed and released during the Sleep(100). Then you miss that event. Or suppose your app is not in the foreground. Then it responds to key presses meant for other applications. To solve the problem you simply need to let your normal message loop process and dispatch messages. When you get a WM_KEYDOWN message for the appropriate key you can react accordingly. Using the messa

Categories : C++

Restricting an application to a specific orientation on IOS 5
Use shouldAutorotateToInterfaceOrientation for iOS 5 and shouldAutorotate for iOS 6. In iOS5 method, use if case for your supported orientations and return YES for them. In your app summary, enable all the orientations. Hope these will help you.

Categories : IOS

How to open an specific application in PC when connecting a USB?
I don't understand why you tagged the question with ASP.NET. ASP.NET is a server-side technology, and ASP.NET applications are "started" by IIS in response to an HTTP request (typically from a browser). What you're looking for is to detect a USB device insertion event, and for that you need an application that runs on the client (and have certain permissions). Here's a thread that would get you started.

Categories : C#

Open application in specific workspace
I don't know anything about gmemusage and xlogo, but I do know about Perl's special variables. Did you mean to use $ARGV[0] instead of $1? $ENV{DISPLAY} = "$ARGV[0]:0.0";

Categories : Perl

Embed specific Web Browser in C++ application
No, you cannot "embed" a specific version of Internet Explorer in your application. But you probably don't need to: when you use the IE COM WebBrowser Control in your application, by default it runs in IE7 Compatibility mode. Later modes are only used if you explicitly set the FEATURE_BROWSER_EMULATION registry key listing your executable name.

Categories : C++

how can get uri of an specific android application programatically?
Please Try it will list out package list of app in your device List<ApplicationInfo> packages; PackageManager pm; pm = getPackageManager(); // get a list of installed apps. packages = pm.getInstalledApplications(0); ActivityManager mActivityManager = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); for (ApplicationInfo packageInfo : packages) { //packageInfo.packageName contains package name }

Categories : Java

Amazon EC2 - access application through specific Port.
In AWS you need to ope port through Firewall (Security Groups). It is not necessary to have Elastic IP, but you can, just remember not to hold IP non-attached (as it will be then charged), but for attached IP - it is totally fine. Go to: EC2 > Security Groups > 'select your group' > 'tab Inbound' > Add IP > Apply

Categories : Amazon



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.