w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Virtual filesytem over multiples files
Not sure what exactly you want but I think "synchronize securely an encrypted containter" is ok? I suggest you to synchronize securely the content of your containter becouse to sync all the containter will take always too much time. To do that you can sync the containter while you are working in the files that is unencrypted(truecrypt). Take a look at http://sparkleshare.org/ It syncronize your files through ssh that is a secure connection and you can store remotely in an encrypted manner. Hope it helps, regards.

Categories : Linux

Windows to ios files for Unity?
i have the free version now, so if i develop a game with it, can i use the same project when i purchase the licences? Yes you can. Btw now iOS and Android licenses are free. So you can already deploy on those devices for free. am using windows and the free version says that i cannot export an ios version of the app im making on windows, so if i get an apple computer will unity open a project that i have made on a windows computer? Yes you can. Unfurtunately you can't deploy on iOS devices from Windows, since Unity3D export an XCode project and you must have OSX to build it.

Categories : Android

Unity Cannot find Constructor of partial class
Try this format: IUnityContainer container = new UnityContainer().RegisterType<ProductMasterServiceClientClient>( new InjectionConstructor(username, password, test));

Categories : C#

Find a obfuscation tool for android package built from Unity 4.*
There are few code obfuscation tools for unity, but in order to use them well with your code some guidelines need to be kept in mind while coding, so you might need to change your code in some places, most of the code obfuscation tools don't have proper documentation for using with android . you can see the following detailed link of the unity code obfuscation tool and how to use it with android http://www.4infinity.com.hk/tutorial/code_obfuscation

Categories : C#

Using Unity to resolve user control views inside another view
Let DataTemplates do the work for you. Given a simple window, with the following ViewModel: public sealed class ViewModel : INotifyPropertyChanged { private object _derper; public event PropertyChangedEventHandler PropertyChanged = (o, e) => { }; public object Derper { get { return this._derper; } set { this._derper = value; PropertyChanged(this, new PropertyChangedEventArgs("Derper")); } } public ICommand OnDerp { get; set; } public ViewModel() { OnDerp = new DerpCommand(this); } } We want to show different UI for different values of the property Derper. This property is set by the DerpCommand: public sealed class DerpCommand : ICommand { public event EventHandler CanExecut

Categories : C#

Facebook Unity SDK has error when send request with custom friends in Unity Webplayer
One of the Facebook software engineers here. Are you passing in null to the data or title param for FB.AppRequest()? There's a bug where it doesn't handle that correctly currently. Either exclude that or pass in an empty string. We'll get that fix ASAP. Thanks for finding that. Update: The latest SDK version has that fix.

Categories : Facebook

Is it practical to start a Unity game from an Android app and revert back from Unity to the app?
You should be able to have two activities in your app, one using your java code and another with the Unity game. Android is already pretty good at switching between activities. Check out this: http://developer.android.com/training/basics/firstapp/starting-activity.html You'll probably need to add your Java project as a plugin in Unity and override the AndroidManifest.xml in the Unity project to load the Java activity. Check out this documentation on extending android projects in Unity: http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html

Categories : Android

Xcode cannot parse exported project from Unity 4 after being upgraded from unity 3
Some Unity packages install editor scripts that modify the XCode project after it's generated. These scripts can cause the symptom described, if they have a bug, or if they subtly interfere with each other. Search your project for OnPostprocessBuild calls, try disabling them one-by-one, generate a fresh XCode project each time, and see if it starts opening with XCode. If it does start working, diff the working and non-working versions of Unity-iPhone/project.pbxproj, and see if you can figure out why.

Categories : IOS

Unity Register For One Interface Multiple Object and Tell Unity Where to Inject them
In the example below you have an interface implemented twice and injected on demand into two different client classes, just as you request. The trick is to use named registrations. class Program { static void Main(string[] args) { IUnityContainer container = new UnityContainer(); container.RegisterType<IFoo, Foo1>("Foo1"); container.RegisterType<IFoo, Foo2>("Foo2"); container.RegisterType<Client1>(new InjectionConstructor(new ResolvedParameter<IFoo>("Foo1"))); container.RegisterType<Client2>(new InjectionConstructor(new ResolvedParameter<IFoo>("Foo2"))); Client1 client1 = container.Resolve<Client1>(); Client2 client2 = container.Resolve<Client2>(); } } public interface IF

Categories : C#

Unity iOs - screen gets black when changing rotation while Unity is paused
Not sure if you have fixed this, Its been a while... But the reason that your UnityViewController is not functioning properly is because a view controller that is not visible will not receive rotation events. Because you are setting your view controller as the root view controller, the UnityDefaultViewController defined in "iPhone_View.mm" is not receiving rotation events. I have been studying Unity's rotation for a while now as I have my own issue with a similar setup. There are a few things that you might be able to try: In iPhone_View.mm there is a function that is defined called: UpdateOrientationFromController(UIViewController* controller) that might be able to solve your problem. You would want to call this function on the view controller that you designed yourself where you plac

Categories : IOS

angularjs: directive creates two child scope(not isolation scope)? and how to get scope of an element?[Solved by clear answer]
it's hard to figure out without any jsfiddle for the context. What is your link function? and what is your controller function? By the way, it is the normal behaviour as documentation says transclude:true creates also a new scope. Look at here : https://github.com/angular/angular.js/wiki/Understanding-Scopes The transcluded and the isolated scope (if any) are siblings -- the $parent property of each scope references the same parent scope. When a transcluded and an isolate scope both exist, isolate scope property $$nextSibling will reference the transcluded scope. So if you want to access the 2 siblings from one another, you have to use a 2-way binding with their parent

Categories : Angularjs

Unity.AutoRegistration ?? Convention Based Registration Unity
It appears that what you are looking for is this: container.ConfigureAutoRegistration() .LoadAssemblyFrom(typeof(ITest).Assembly.Location) .LoadAssemblyFrom(typeof(Test).Assembly.Location) .Include(If.ImplementsITypeName, Then.Register()) .ApplyAutoRegistration(); This will tell Unity.AutoRegistration to register all types where there is an interface with the same name, prefixed with I.

Categories : C#

How to search for few files out of hundred files in UNIX and if not find replace with 0 byte file
Assuming by shell u mean bash: Skeleton to start with: luk32:~/projects/tests$ cat ./process_files.sh #!/bin/bash DEST=./copies for num in "$@"; do file="AllResponses_"$num"_6_20_2013.txt" if [ -f $file ]; then cp $file $DEST else touch $DEST/$file fi done; It takes numbers as arguments, then tries to find a file with given pattern in current working directory. If found copy to destination folder, else touch the file. You will probably have to tinker a little bit to get friendlier than hard-coded date handling. Example: luk32:~/projects/tests$ ls -l total 40116 -rw-r--r-- 1 luk32 luk32 4 cze 21 11:33 AllResponses_1_6_20_2013.txt -rw-r--r-- 1 luk32 luk32 5 cze 21 11:33 AllResponses_3_6_20_2013.txt -rw-r--r-- 1 luk32 luk32 0 cze 21 11:32 AllResponses_4_6_20

Categories : Unix

Find Missing files and sub directories with it's files list while copy and paste?
Can i make one simple exe tool for this. Of course. How to i find that missing files can any one give some guide to do. You need two lists. You'll need to read and fill one, and then read and compare to determine what's missing. The code might look something like this: var targetFiles = new List<string>(); foreach (var f in Directory.GetFiles(targetDir)) { targetFiles.Add(Path.GetFileName(f)); } var missingFiles = new List<string>(); foreach (var f in Directory.GetFiles(sourceDir)) { if (targetFiles.Contains(Path.GetFileName(f))) { continue; } missingFiles.Add(Path.GetFileName(f)); } Now all of the missing files in the target are in the missingFiles list. You can then loop through that list to copy those missing files to the target.

Categories : C#

How to add security constraints in .clsss files to strict user decompiles class files
I want to add security in my classes so that no one can de-compile my class files or open jar files. You can't. It is mathematically impossible. If someone can get hold of the JAR file / ".class" files, they can extract and decompile the classes. (There are ways to make it a bit harder ... but there is nothing you can do to stop a skilled and motivated attacker ... apart from not delivering code to him, in any form.) I also want to add constraints in my web.xml file so that no one can try to access from another servlet. Also impossible: If you are talking about another servlet in the same web container, then anything you can put into the web.xml file can be edited out by the person who controls web container. If you are talking about a servlet in another web container, th

Categories : Java

find+xargs: for all files in a dir find pair in other nested dir and move there
This bash script should work. Sometimes a solution cannot be easily stuffed into a pipeline: #! /bin/bash for svg in svg/*.svg ; do name=${svg##*/} # Remove the path. name=${name%.svg} # Remove the extension. png=$(find -name $name.png -not -path '*thumb*') dir=${png%$name.png} # Remove the filename. mv "$svg" "$dir" done

Categories : Bash

how to find list of files file name starts with All_Responses_11367*.txt and copy total files to another directory in unix command
This find command should give all file starting with All_Responses_11367* in current directory modified/created in last 77 days: find . -name "All_Responses_11367*" -maxdepth 1 -type f -mtime -77 -exec cp '{}' dest ; Change dest to some other directory where you want to copy these files.

Categories : Unix

How can I find the instance of a user in this javascript user system codebase?
I've never used it, but it's built using Mongoose and it exposes a db.users collection which you can query for user information. If you're interested in that, you can use it like so: db.users.findOne({ username: 'pinky' }, function(err, user) { // work with user here if it was found! }); You will have access to the following user properties and functions based off of the schema: var userSchema = new mongoose.Schema({ username: { type: String, unique: true }, password: String, email: String, roles: { admin: { type: mongoose.Schema.Types.ObjectId, ref: 'Admin' }, account: { type: mongoose.Schema.Types.ObjectId, ref: 'Account' } }, isActive: String, timeCreated: { type: Date, default: Date.now }, resetPasswordToken: String, twitter: {}

Categories : Javascript

Rails 4 scope to find parents with no children
This should do the job you want: scope :without_children, includes(:children).where(:children => { :id => nil }) The big difference here is the joins becoming a includes: an include loads all the relations, if they exists, the join will load only the associated objects and ignore the object without a relation. In fact, scope :with_children, joins(:children) should be just enough to return the Parent with at least 1 child. Try it out! As @MauroDias pointed out, if it is a self-referential relationship between your parent and children, this code above won't work. With a little bit of research, I found out how to do it: Consider this model: class Item < ActiveRecord::Base has_many :children, :class_name => 'Item', :foreign_key => 'parent_id' How to return all ite

Categories : Ruby On Rails

How to ssh to a certain directory and then be able to use the FIND command to find certain files and gunzip them
NB: don't confuse "zip" and "gzip", two different animals This should work: cd <local_directory> # collect files names as $1 $2 ... $N set -- *.gz # or use your own filter like "dumps*.gz" # put source file a tar archive and send it as input to ssh # then, on the other side, untar the file then decompress tar cf - $* | ssh <user>@<remote_host> "cd <remote dir> && tar xf - && gunzip $* Note: using "&&" instead of ";" to prevent "tar" command to be executed if "cd" fails for any reason

Categories : Unix

How to separate javascript into files without using global scope?
You can create global modules and expose only the needed functions like this... // In some JS file var moduleX = (function(window){ var Utils = function(){ }; return { "Utils" : Utils }; })(window); // In a some other JS file var util = new moduleX.Utils(); Btw, you cannot instantiate a JSON object(Utils in your case). So please change that to a function.

Categories : Javascript

Global JS variables within a user control scope?
Give your code an anonymous local scope instead of writing everything globally: (function(any, globals, you, need, to, pass, in, as, an, instance){ //All code local to your control goes here global = "etc..." .... }(any, globals, you, need, to, pass, in, as, an, instance)); By passing globals in as themselves, their local version overrides the global and prevents interaction. Edit: To do this from an external JS file, simply declare your code as a single function, and call it once for each time your control loads. You would then include the JS file only once on your template: in the js file: var myFuncLib = function(any, globals, you, need, to, pass, in, as, an, instance){ //All code local to your control goes here global = "etc..." .... }; in your contro

Categories : Javascript

Adding a scope to user model with devise
You might have to create a migration that removes the unique constraint on the "index_users_on_email" index added by Devise. Perhaps as such: def up remove_index :users, :name => 'index_users_on_email' add_index :users, :email, :unique => false end def down remove_index :users, :name => 'index_users_on_email' add_index :users, :email, :unique => true end

Categories : Ruby On Rails

How do I connect between parent $scope, directive $scope and a modal $scope?
Like I said in the comment you can access the variables from the parent scope in the modal popups scope. HTML <div ng-app="app" id="app"> <div ng-controller="MainCtrl"> <label-select color="{{color}}"></label-select> <div class="flyout"> <ul> <li ng-click="setColor(color)" ng-repeat="color in colors">{{color}}</li> </ul> </div> </div> </div> JS var app = angular.module('app', []); app.controller('MainCtrl', function ($scope) { $scope.color = "#AAADDD"; $scope.colors = ["#AAA", "#BBB", "#CCC", "#DDD", "#EEE"]; $scope.setColor = function (color) { angular.element(".flyout").removeClass("show"); $scope.color = color;

Categories : Javascript

Can't find AD user using the command get-aduser when the user is an object
You can assign the username to a variable and use it in the query: $name = $arr[0].username $user = get-aduser -filter {Name -eq $name} or use an expanded string instead of a script block: $user = get-aduser -filter "Name -eq '$($arr[0].username)'"

Categories : Powershell

How come selectors in $.fn.find() cannot reference the tree beyond the current $ scope?
Because there is no <html> tag nested inside <html> tag But: $('html').find('html, head').length // return 1 here coz comma means 'or'

Categories : Javascript

How can I find out which namespace an attribute refers to in the current scope?
Would setAttribute work? It doesn't require a namespace. https://developer.mozilla.org/en-US/docs/Web/API/element.setAttribute?redirectlocale=en-US&redirectslug=DOM%2Felement.setAttribute Or you can pass null to setAttributeNS.

Categories : Javascript

Create/dispose user scope on same thread, per request
I would look into using ServiceSTack's IHttpRequest.Items dictionary. This dictionary is available pretty much anywhere the request is available including the Request and Response filters. You can store your scope and retrieve it when needed. As for the same threading issue you can't guarantee that the entire request will happen in the same thread. See http://stackoverflow.com/a/1644015/215502 If you worried about threading with your asp.net I would be tempted to think you might be over-engineering something but hard to say without knowing what you are trying to do.

Categories : Web Services

Rename list files cannot find files
I think you should change os.rename(f, f.replace(',','')) to os.rename(os.path.join(self.dirname, f), os.path.join(self.dirname, f.replace(',',''))). Essentially the rename function expects a valid path to a file, and you need to concatenate the base directory path to the filename if the file is not in the current directory.

Categories : Python

How do I use Google Picker to access files using the "drive.file" scope?
In addition to setting the app ID, make sure the page you're serving the picker on is listed in your javascript origins in the APIs console. Both the app ID and the origin need to match for files to be authorized.

Categories : Javascript

Resolving Unity Dependencies without a Unity.MVC
You're doing it in the right way. With DI you can remove dependencies from your application. So that you can get a "Repository agnostic" application. And you have effectively done it. At least on the projects that 'declare' the dependencies. However, when the application has to run, you need to specify the concrete objects which will be used for the "declared" abstract dependencies (interface, abstract class) is required. You do this by registering the types which object will be used for each abstract dependency. In you sample, when a IUnitOfWork or a DbContext, an instance of MyDbContext is provided. So the projects that 'declare' the dependencies are completely independent of a particular implementation. However, when you register the dependent types, you're loosing that independen

Categories : C#

Calling a $resource action from inside a user defined $scope function
Introduction I solved my own problem. I used this Github comment from Misko Hevery as reference. Why my PUT request wasn't executing: Apparently, in Angular 1.1.x, if you ever leave the angular execution context, you'll be outside of Angular's $scope.$apply function. In my case, I was working with JQuery UI's sortable function - whenever a Card was placed in a new Deck, I wanted to update the Deck's cards to reflect that update. To the best of my understanding, because of this, I was outside the angular execution context. ngResource wouldn't execute the PUT statement and the $then function of the Angular's promise object will never be called. The solution: Simply wrapping the $scope.$apply function around the Card.updateaction allowed the action to execute, which subsequently allowe

Categories : Ruby On Rails

How can php-files find namespaces in other php-files?
The use function in php is completly different then the import in python. Use is there for creating aliases for very long namespaces. example: use MyVeryLongOmgItsSoooooLongHowStupid as veryshort; Now every class inside that long namespace is available under the namespace veryshort. More info: http://php.net/manual/en/language.namespaces.importing.php Then, how does php find the correct file? It doesn't. You will have to include it yourself, however if you use a strong naming convention for your files you can use autoloaders with the spl_autoload_register function. A good standard can be found here: http://www.php-fig.org/psr/0/

Categories : PHP

Why ng-transclude's scope is not a child of its directive's scope - if the directive has an isolated scope?
Why ng-transclude's scope is not a child of its directive's scope if the directive has an isolated scope? ng-transclude designed to allow directives to work with arbitrary content, and isolated scopes are designed to allow directives to encapsulate their data. If ng-transclude didn't preserve scopes like that, any arbitrary content that you're transcluding would need to know the implementation details of your directive (i.e. it would need to know what's available on the isolated scope you created). If it's not a bug, how can a container directive pass data to it's content, if not by setting attributes like I tried. If the container directive and contained directives are coupled - i.e. you wrote both of them and need them to act together - then they should communicate via a shar

Categories : Angularjs

Is the scope of an oauth2 access token bound to the token or the user?
It sounds like your implementation is not quite complete. The client app is requesting a resource on behalf of the resource owner. When the resource server receives a request with an access token, it should check that (1) the token is valid and not expired, (2) the requested resource is within the scope the token was granted for and (3) the resource owner can access the requested resource. For #1, the authorization server will need to keep track of all tokens and when they expire. For #2, the authorization server will have to remember the scope for each token and be able to relate a particular resource to a scope. The resource server should know how to check #3. To answer your question "Is the scope of an oauth2 access token bound to the token or the user?", the scope is associated wi

Categories : Dotnet

How to update $scope.items array order in response to user re-sorting the DOM array using Angular-UI ui-sortable directive
You are Missing ng:model <ul ui:sortable ng:model="list"> <li ng:repeat="item in list" class="item">{{item}}</li> </ul> Please check below working example Demo It display the updated array <div ng:repeat="item in list">{{item}}</div> Array is updated automatically by the directive

Categories : Angularjs

Where can I find the SVN .lib files?
DLL's are libs, but they are dynamic libs, loaded and executed during run time. Lib files, however, are libraries that have been loaded into the compiler and used to compile the binaries. In your case, there wouldn't be lib files because the .exe binaries already have the libs built into them. Where-as, you do get the DLL's because they aren't built into the binaries, but instead are loaded somewhere inside the binary during execution. There is no reason to include the .lib's in a binary download since the binaries don't need them anymore to function. The only reason you would need .lib files is if you had the rest of the source code in order to build your own .exe again.

Categories : C++

C++ Find all .wav files
Obviously, you do indeed need a FindNextFile call, and repeat that using a loop of some sort, until it returns a "no more files" return code. To then search the entire disk, you will need to look for directories in the "current directory" (the root directory), and for every directory search into it - you can do that either by calling finddata recursively (adding the name of the directory as an argument to the function), or implement a stack in the code to track which directory you are in, and which one to "walk back to" for the next level. I'm intentionally NOT writing the code for you, but describing what you need to do, since you are the one learning programming. I did this sort of thing in 1985 or so.

Categories : C++

AngularJS $scope.$watch properties of $scope.foo but send old values to server before change
The second parameter of $scope.$watch is a function which receives two parameters : the first one is the new value, the second one the old value. You can simply watch for the whole foo object, and set the third parameter of $scope.$watch to true in order to compare object for equality rather than for reference. Notice that this can be a pretty bad idea if your object is really large : $scope.$watch( 'foo', function (newFoo, oldFoo) { // send old $scope.foo to server with the // previous $scope.foo.bar and $scope.foo.baz }, true ); You can also watch separately foo.bar and foo.baz : var sendAndReplace = function (parameterName, oldParameter) { oldFoo = angular.copy($scope.foo); oldFoo[parameterName] = oldParameter; // send old oldFoo to s

Categories : Angularjs

Angularjs custom directive child scope access parent scope method?
The problem is that the slide directive from angular-ui-bootstrap has created an isolated scope, scope.$parent in the link function isn't the scope of carousel, therefore you can't access play and pause functions. In link function, you can get the carousel's scope by calling scope() on carousel element: var carouselScope = element.parent().parent().scope(); Then, use carouselScope to replace where you have put scope.$parent. http://plnkr.co/edit/1HCiqvTm1Fd9Rh0o8Mtw

Categories : Angularjs



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