w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to launch unit tests under EclEmma without using the VisualVM launcher with that launcher installed
I too have encountered this issue and have found no acceptable solution. I know it is not much of an answer but I ended up uninstalling VisualVM and resorting to reinstalling it when I need it, for the duration I need.

Categories : Eclipse

How Launcher decides which app icon to place in launcher?
When a developer publishes an app, he/she can decide if app has "launcher" icon(set a launcher intent in manifest file which is embedded in the APK). Other apps maybe services or other kind of apps that has no launching behavior.

Categories : Android

set custom launcher as default launcher by code
I want to set my custom launcher as default launcher That is not possible. The user can set your home screen as the default home screen, such as by pressing HOME and choosing your app as the default. However, you cannot force the user to accept your home screen as the default. But the following code is not working. It crashes That code does not set your "custom launcher as default launcher". That simply controls whether or not you are even a potential option for being a home screen (if you are disabled, you cannot possibly be the home screen). As to why it is crashing, without a stack trace, that will be difficult to determine.

Categories : Android

How to set a different java file as launcher
Update your manifest with the following code for your activity. This should now launch your activity. <activity android:name="com.example.surfaceview.SurfaceViewExample" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> I hope this helps.

Categories : Android

How to select a workspace with .yoxos launcher file?
You can go to ~/.yoxoslauncher/instances/ and find your eclipse instance. The best way to figure this out is to launch eclipse with the yoxos launcher and go to About Eclipse->Installation Details...->Configuration There you see your application folder

Categories : Misc

how to create web player in unity 4.1.3
You need to go to File > Build Settings..., upon which you'll get the following window: You can choose your settings there, and then build it when you're ready.

Categories : Unity3d

How to create dialogbox in Unity (not using UnityEditor)?
Have a look at Unity GUI Scripting Guide. Example: using UnityEngine; using System.Collections; public class GUITest : MonoBehaviour { private Rect windowRect = new Rect (20, 20, 120, 50); void OnGUI () { windowRect = GUI.Window (0, windowRect, WindowFunction, "My Window"); } void WindowFunction (int windowID) { // Draw any Controls inside the window here } } Alternatively you could show a textured plane in the center of the camera.

Categories : Unity3d

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

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

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.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 write an XML file in C# in Unity?
Say you have a Player class that looks like: [XmlRoot] public class Player { [XmlElement] public int Level { get; set; } [XmlElement] public int Health { get; set; } } Here is a complete round-trip to get you started: XmlSerializer xmls = new XmlSerializer(typeof(Player)); StringWriter sw = new StringWriter(); xmls.Serialize(sw, new Player { Level = 5, Health = 500 }); string xml = sw.ToString(); Player player = xmls.Deserialize(new StringReader(xml)) as Player; xml is: <?xml version="1.0" encoding="utf-16"?> <Player xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Level>5</Level> <Health>500</Health> </Player> And you guess player is exactly the same as the origina

Categories : C#

How to solve could not create the virtual machine error of Java Virtual Machine Launcher?
Edit your Catlina.bat so that your -Xmx settings are less than your physical memory See Tomcat 7: How to set initial heap size correctly?

Categories : Java

R: Create & assign duplicate records
If I have understood you correctly, this may be one possibility: # a (minimal) data frame with all unique source-county combinations src_cnt <- data.frame(source = c("Morning Call", "AP", "AP", "AP"), county = c("Lehigh", "Lehigh", "Mercer", "Phila")) # a data frame with a unique score for each source src_score <- data.frame(source = c("Morning Call", "AP"), score = c(10, 3)) merge(src_cnt, src_score) Edit following the updated question: # Assuming your current data is named dd # select the national sources, i.e. the sources where County is missing src_national <- dd$Source[is.na(dd$County)]) # select unique counties counties <- unique(dd$County[!is.na(dd$County)]) # create all combinations of national sources and counties src_cnt <- expand.grid(Source = src_national

Categories : R

Create duplicate items in a list
You can do this with a little Linq: int instances = 3; var serviceEndPoints = (from e in Enumerable.Range(0, instances) from x in serviceEndPoints select x) .ToList(); Or if you prefer fluent syntax: var serviceEndPoints = Enumerable .Range(0, instances) .SelectMany(e => serviceEndPoints) .ToList(); Note that given a list like { A, B, C } will produce a list like { A, B, C, A, B, C, A, B, C }. If you want to produce a list like { A, A, A, B, B, B, C, C, C }, you can simply reverse the order of the collections: var serviceEndPoints = (from x in serviceEndPoints from e in Enumerable.Range(0, instances) select x) .ToList(); Or in fluent syntax: var serviceEndPoints = serviceEndPoints .SelectMany(x => Enumerable.Range(0, ins

Categories : C#

Is it okay to rely on the MD5 check sum based on the first 1024 bytes of a file for file duplicate comparison?
No; it is not uncommon for web pages to be identical in the first 1024 bytes. For example, many complex sites have JavaScript, CSS, and boilerplate HTML at the top of the HTML file which far exceed the 1024 bytes you have budgeted. Some experimentation with real-life data may reveal a reasonable buffer, but there is simply no way to predict that two otherwise identical files will not differ in the last byte other than by doing a full-file comparison. But if your input data says otherwise (perhaps what you are comparing are individual tweets, for example?) then by all means go by that. Many web servers will include a server-generated ETag: header which might be useful, but it's not standardized, and for all you know, they could easily be spoofing you.

Categories : Python

how to create "" for a column containging duplicate values
I wouldn't really recommend using blanks there. Your original data setup is perfect for a flat file and makes performing calculations like Countif/s, Sumif/s, etc really easy. If you absolutely must change it, you could use column E as a helper with this formula starting in cell E2 and copied down (note, this formula requires that the data be sorted by Product as shown in your example): =IF(B2=B1,"",B2) Then copy the helper column -> select B2 -> right-click -> paste special -> values And delete the helper column.

Categories : Excel

Create Unique Makes Duplicate Nodes
Create unique doesn't on its own try to match nodes [1]. What you can do is use the merge functionality to match the Degree Node (creating one only if necessary) and then create unique the relationship and intermediate nodes. START startNode=node(9) MERGE( phd:Degree {value: 'PHD'}) CREATE UNIQUE startNode-[:HAS_EDUCATION]->(nodeEducation1:Education{graduated_year:1901}) CREATE UNIQUE nodeEducation1-[:AWARDED]->phd RETURN phd

Categories : Neo4j

Why does Python/Django create duplicate files
pyc files are python compilation files - It contains byte code that the Python interpreter compiles from the source file. So, once you run the application, pyc files are created automatically. py~ are temporary/backup files - It is created by the editor to save the previous versions of the file.

Categories : Python

Rails: create lots of almost-duplicate records
This code is fine if your security model allows all these fields to be bulk assignable by mention in attr_accessible in the model. If it doesn't then you're better off using the block form of create. Also, if Document, Template and User are ActiveRecord instances, you should let Rails manage the details of ids. def self.publish(brand, components, template) brand.users.each do |user| Document.create do |doc| doc.component_ids = components, doc.message 'Message.', doc.template = template, doc.user = user end end end One final note is that component_ids must be serialized to store a list. This is probably a flaw in your model design. The better way is (probably) to specify Component belongs_to User and also User has_many Components. I.e. Compone

Categories : Ruby On Rails

duplicate rows and create new data frame in R
You can do something like this data <- subset(data, group %in% c("eggplant", "jasmine"))[rep(1:2, each = 3), ] data$group <- factor(paste0(data$group, LETTERS[1:3])) data ## group week1 week2 week3 week4 ## 2 eggplantA 22 32 33 63 ## 2.1 eggplantB 22 32 33 63 ## 2.2 eggplantC 22 32 33 63 ## 3 jasmineA 23 454 12 654 ## 3.1 jasmineB 23 454 12 654 ## 3.2 jasmineC 23 454 12 654 If for any reason you don't like the rownames like this and you want to change "group" to "user" rownames(data) <- NULL names(data)[1] <- "user" data ## user week1 week2 week3 week4 ## 1 eggplantA 22 32 33 63 ## 2 eggplantB 22 32 33 63 ## 3 eggplantC 22 32 33 63 ## 4 jasmineA 2

Categories : R

Json Deserialization, Create duplicate objects
Yes, if you setup your serializer as follow: JsonSerializerSettings settings = new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.All }; Json string will be: { "$id": "1", "$values": [ { "$id": "2", "Objects": { "$id": "3", "$values": [ { "$id": "4", "Name": "Scott" } ] }, "Name": "Steve" }, { "$id": "5", "Objects": { "$id": "6", "$values": [ { "$ref": "4" } ] }, "Name": "Atanas" } ] } And you will see in console: Correct, its the same object See http://james.newtonking.com/projects/json/help/index.html?topic=html/T_Newtonsoft_Json_Pr

Categories : C#

How to create folders in google drive without duplicate?
the problem that I had, is how to create folders path in google drive without ending up with duplicates folders in the dirve! the first function used to check where the folder is exist from its title, pass your drive instance and the folder's title and it's parents Id (not the title): /** * * @param service google drive instance * @param title the title (name) of the folder (the one you search for) * @param parentId the parent Id of this folder (use root) if the folder is in the main directory of google drive * @return google drive file object * @throws IOException */ private File getExistsFolder(Drive service,String title,String parentId) throws IOException { Drive.Files.List request; request = service.files().list();

Categories : Java

Perl: Find duplicate in excel/csv file and write an output file with them
Yes. To parse a CSV file: Text::CSV_XS To parse an Excel file: Spreadsheet::ParseExcel To find the common elements of two lists: my %list1 = map { $_ => 1 } @list1; my @common = grep $list1{$_}, @list2;

Categories : String

Import existing animation file to unity web player model
Resource.Load allows you to do just that. var mdl : GameObject = Resources.Load("Animations/"+ animationFolder+"/" + aName); if (!mdl) { Debug.LogError("Missing animation asset: Animations/" + animationFolder+"/"+aName + " could not be found."); } else { var aClip = mdl.animation.clip; charAnimation.AddClip(aClip, aName); Debug.Log(charAnimation[aName].name + " loaded from resource file " + animationFolder + "/" + aName + ". Length check: " + charAnimation[aName].length); }

Categories : Unity3d

Unity section in .config file using Protected Configuration Provider
Figured it out. I was missing this after the save: config.Save(ConfigurationSaveMode.Full); ConfigurationManager.RefreshSection(sectionName);

Categories : C#

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#

Create an addEdge() Gremlin query that won't duplicate for Titan
To close the loop here, this question was answered in the Aurelius Graphs Mailing List. Basically: we don't really see a use case for a uniqueness constraints to apply to pairs of vertices (a la - only one edge can exist between vertex A and B) for these reasons: most times, you can get rid of the duplication quite cheaply on the query side with a dedup(): v.out('follows').dedup()..... the likelihood of conflict is much lower (due to the N^2 combinations of vertices) which makes locks just waaaay to expensive compared to the likelihood of conflict. In short, you should validate edge existence in your application as it cannot be enforced by Titan.

Categories : Ruby

Find count of duplicate elements and create arrays of them
Irrespective of your solution if I understood your question correctly then your input would be a array (which contains duplicates) and output would be list of duplicate arrays. I have simple approch towards this problem that is a Map where Integer would be the key and List would be the value. Written a little snippet(java 1.4 supported) below. Map map = new HashMap(); int[] array = {121,122,121,122,123,121,122}; for(int i=0;i<array.length;i++){ if(map.get(array[i])==null){ // no entry available List list = new ArrayList(); list.add(array[i]); map.put(array[i],list); }else // entry is already available map.get(array[i]).add(array[i]); } I know you have constraint with java version though this could be easier with google collection library - gu

Categories : Java

py2neo create function creating duplicate nodes
The Index.add method is certainly idempotent: the same entity can only be added once to a particular entry point. The GraphDatabaseService.create method is not however. Each time you run the create method, a new node is created and each run of add appends that new node to the index. You probably want to use the Index.add_if_none, Index.create_if_none or Index.get_or_create method instead.

Categories : Neo4j

Are there issues when I create duplicate objects in controller methods?
you can reduce some time using || operator, to store end result of an expensive command in an instance variable! def index @categories ||= Category.all @category = Category.new end def new @category = Category.new @categories ||= Category.all end watch this railscasts video http://railscasts.com/episodes/1-caching-with-instance-variables

Categories : Ruby On Rails

Create duplicate buttons using Jquery live event
First off, don't use live(), it's deprecated. Instead use the on()-method, and delegate the event to the .duplicate-element within a container. Second you can use .clone() to make a copy of the element instead of typing all that markup again. $('.container').on('click', '.duplicate', function(e) { var $this = $(this), clone = $this.clone(); $this.after(clone); e.preventDefault(); }); fiddle: http://jsfiddle.net/W7ty8/2/

Categories : Jquery

Make duplicate of same file using batch file in windows
From what you're explaining it seems like you want to iterate over all the images in the folder and then create ten copies of each one. The following should do that: setlocal enabledelayedexpansion set count=10 for %%F in (*.jpg) do ( for /l %%i in (1, 1, %count%) do ( set num=0%%i set num=!num:~-2! copy "%%F" "%%~nF_!num!%%~xF" ) )

Categories : File

How to create in Django a table with unique ID that increments on duplicate keys
You can override the model Entry's save method to accomplish what you want to do: class Entries(models.Model): project_id = models.ForeignKey(Projects) def save(self, *args, **kwargs): user = kwargs.pop('user') project = kwargs.pop('project') latest = Entries.objects.filter(user=request.user, project_id=project) latest_entry = latest.entry_unique if latest else 1 self.entry_unique = latest_entry super(Entries, self).save(*args, **kwargs) Now, wherever you reference the project id, for a user, you can reference entry.entry_unique Read up about latest() here

Categories : Mysql

Neo4jClient Create Unique results in multiple duplicate nodes
CREATE UNIQUE in Cypher 1.9 is not encouraged.Please, if you can, use Neo4j 2.0.0.M05 ++ and create a unique constraint on Cities, States and Countries, see http://docs.neo4j.org/chunked/snapshot/query-constraints.html#constraints-create-uniqueness-constraint and then MERGE the city node, the create the address. Here a graphgist example: http://gist.neo4j.org/?6549962

Categories : Neo4j

Is there a way to create a constraint in a table column to prevent duplicate entries?
You can Create a unique index on this field If you create a unique index, Access doesn't allow you to enter a new value in the field if that value already exists in the same field in another record. Access automatically creates a unique index for primary keys, but you might also want to prohibit duplicate values in other fields. For example, you can create a unique index on a field that stores serial numbers so that no two products have the same serial number.

Categories : Ms Access

Race condition makes nHibernate to create duplicate entry
You should wrap your Save() in a transaction, ideally you could implement a pattern such as IUnitOfWork or use the SessionFactory, for example: using (var transaction = session.BeginTransaction()) { myEntity = new MyEntity(); myEntity.Product = product; myEntity.Company = company; myEntity.Date = date; myEntity.CurrentUser = currentUser; myEntity.IsManual = true; myEntity.Save(); transaction.Commit(); }

Categories : C#

Create DUPLICATE code window in visual studio 2012
I haven't got a copy installed here to test but I believe the answer you're looking for lies hidden under the Window menu.. Activate the window you wish to duplicate and under Window on the toolbar choose New Window. This will create a duplicate of the active document. Under the Window menu again you should find the option to make the window Floating Update for Visual Studio 2013: Vertical split of cshtml window in VS2013

Categories : Visual Studio 2012



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