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

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#

different sized bins in matlab
Even if I don't understand your question clearly, I would suggest this. Perhaps you could sort your vector muen, pick a fixed number n, and define each bin so that it contains exactly n values of muen. For simplicity, the length of muen is assumed to be a multiple of n: n = 10; m = length(muen_sorted)/n; muen_sorted = sort(muen); edges = [-inf mean([muen_sorted(n:n:end-1); muen_sorted(n+1:n:end)]) inf ]; muen_short = mean(reshape(muen_sorted,n,m)); Note that m+1 edges (vector edges) are obtained, corresponding to m bins. Bin edges lie exactly between the closest values of neighbouring bins. Thus, the upper edge of the first bin is (muen_sorted(n)+muen_sorted(n+1)/2; the upper edge of the next bin is (muen_sorted(2*n)+muen_sorted(2*n+1)/2, and so on. The "representative value" of each

Categories : Matlab

Grouping extreme value bins into one "> x" bin
Here's one option: d <- rlnorm(1000, 3) d.cut <- cut(d, c(seq(0, 120, 10), Inf)) hist(as.numeric(d.cut), breaks=0:13, xaxt='n', xlab='', col=1, border=0, main='', cex.axis=0.8, las=1) axis(1, at=0:13, labels=c(seq(0, 120, 10), '>120'), cex.axis=0.8) box()

Categories : R

Logarithmic y-axis bins in python
try plt.yscale('log', nonposy='clip') http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.yscale The issue is with the bottom of bars being at y=0 and the default is to mask out in-valid points (log(0) -> undefined) when doing the log transformation (there was discussion of changing this, but I don't remember which way it went) so when it tries to draw the rectangles for you bar plot, the bottom edge is masked out -> no rectangles.

Categories : Python

Exact number of bins in Histogram in R
The integer specified as argument for nclass is used as a suggestion: the number is a suggestion only An alternative solution is to cut your vector into a specified number of groups and plot the result: plot(cut(data, breaks = 4))

Categories : R

HOG Trilinear Interpolation of Histogram Bins clarification
Histogram of Oriented Gradients as discussed by Navneet Dalal, discusses interpolation of the gradient magnitudes of the cells into orientation bins ( for 0 to 180 degrees we have 9 bins with a bin step size or bandwidth of 20 degrees) A naive approach would be to just do this for every cell in the window/image but this would result in aliasing effects. In order to reduce aliasing it is discussed that the image should be partitioned into blocks (preferably overlapping) of n x n cells. eg. for a 64 x 128 pixel image you could define the following: 1. Cell Size = 8x8 pixels 2. Block Size = 2x2 cells this gives: 8x16 cells, or 4x8 NON-overlapping block's or 7x15 Blocks with a stride of 8 i.e 7x15 50% overlapping blocks So instead of performing linear histogram interpolation of every cel

Categories : Algorithm

R: Specifying bins for table (or easier breaks for hist?)
Convert to a factor and specify the levels.... a <- c(1, 1, 7, 7, 7, 7, 15, 15) b <- c(1, 15, 15, 15, 15) levs <- c(1,7,15) table( factor( a , levels = levs ) ) # 1 7 15 # 2 4 2 table( factor( b , levels = levs ) ) # 1 7 15 # 1 0 4

Categories : R

How to make bins with the size 100 for a start and end numbers using awk?
I do not know how those "bins" should be presented, but a quick hack for the base problem: cat >infile <<XXX NM_75 X + 3000623 NM_47 X - 3000333 NM_60 X + 3000132 NM_70 X - 3000258 XXX awk '{print "start coordinate -1500+"$4"="$4-1500; for(i=-1400; i<1500; i+=100) print $1,$2,$3,$4+i print "end coordinate "$4"+1500="$4+1500}' infile Output: start coordinate -1500+3000623=2999123 NM_75 X + 2999223 NM_75 X + 2999323 ... NM_75 X + 3001923 NM_75 X + 3002023 end coordinate 3000623+1500=3002123 start coordinate -1500+3000333=2998833 NM_47 X - 2998933 NM_47 X - 2999033 ... NM_47 X - 3001633 NM_47 X - 3001733 end coordinate 3000333+1500=3001833 start coordinate -1500+3000132=2998632 NM_60 X + 2998732 NM_60 X + 2998832 ... NM_60 X + 3001432 NM_60 X + 3001532 end coordi

Categories : Shell

Separate huge dataset into bins and average them out in R
Sounds like a simple enough job for ddply, which you already reference in your question? require(lubridate) require(plyr) mylen <- 3000 mydf <- data.frame(mydate = seq(as.Date('2000-01-01'), length.out = mylen, by = 'day'), value = runif(mylen, 10, 10000)) mydf$month <- month(mydf$mydate) mydf$year <- year(mydf$mydate) newdf <- ddply(mydf, .(year, month), summarise, my.mean = mean(value)) Output looks like this: > tail(newdf) year month my.mean 94 2007 10 5103.671 95 2007 11 5034.605 96 2007 12 5534.769 97 2008 1 4437.816 98 2008 2 4717.377 99 2008 3 5862.858 >

Categories : R

pandas - binning with bins definitions based on value in another column
Does this solves your problem? df = pd.DataFrame({'A' : ['one', 'one', 'two', 'three'] * 3, 'B' : np.random.randn(12)}) bins = {'one': (-10,-1,0,1,10), 'two':(-100,0,100), 'three':(-999,0,1,2,3)} def func(row): return pd.cut([row['B']], bins=bins[row['A']])[0] df['C'] = df.apply(func, axis=1) This returns a DataFrame: A B C 0 one 1.440957 (1, 10] 1 one 0.394580 (0, 1] 2 two -0.039619 (-100, 0] 3 three -0.500325 (-999, 0] 4 one 0.497256 (0, 1] 5 one 0.342222 (0, 1] 6 two -0.968390 (-100, 0] 7 three -0.772321 (-999, 0] 8 one 0.803178 (0, 1] 9 one 0.201513 (0, 1] 10 two 1.178546 (0, 100] 11 three -0.149662 (-999, 0] Faster version of binnize: def binize2(df):

Categories : Python

Histogram from data which is already binned, I have bins and frequency values
Perhaps the weight parameter would be of help in your problem. import matplotlib.pyplot as plt a= [1,2,3,4,5,6,7,8,9] b= [5,3,4,5,3,2,1,2,3] plt.hist(a,9, weights=b) plt.show() Or, as tcaswell said, you could just make a bar plot and change the x-axis. Using matplotlib how could I plot a histogram with given data in python Is a link.

Categories : Python

matlab histogram with same x axis, but reasonable number of bins
Use hist() to plot or histc() to count.

Categories : Matlab

How do I plot a bar graph in ggplot where my bins are year-months
I think this works: Edit: Per the comments below mydates$months <- month.abb[as.numeric(format(mydates[, 1], format = "%m"))] mydates$Months <- paste(mydates$months, format(mydates[, 1], format = "%y")) mydates$Months <- factor(mydates$Months, levels = paste(month.abb, c(rep(12, 12), 13))) ggplot(mydates, aes(Months)) + geom_bar()+ scale_x_discrete(drop=FALSE) + theme(axis.text.x = element_text(angle=90, vjust=.3)) The labels could be adjusted by making the bars horizontal with coord_flip() or using theme(axis.text.x = element_text(angle=90, vjust=.3))

Categories : R

R - Cut numeric vector into bins using closed and open intervals
If your input data and desired no. of bins both aren't too large, you can use nested ifelses. y <- ifelse(x < 10, 1, ifelse(x <= 20, 2, ifelse(x < 30, 3, ifelse(x < 48, 4, ifelse(x <= 48, 5, .....))))) Is there any structure in the data that you can exploit?

Categories : R

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#

Hist in matplotlib: Bins are not centered and proportions not correct on the axis
You should adjust the keyword arguments of the plt.hist function. There are many of them and the documentation can help you answer many of these questions. a. ) You can pass the keywords bins=range(1,7) and align=left. Setting the bins keyword to a sequence gives the borders of each bin. For example, [1,2], [2,3], [3,4], ..., [5, 6]. b. ) Check your bin widths (rwidth!=1). From the matplotlib.pyplot.hist documentation: If True, the first element of the return tuple will be the counts normalized to form a probability density, i.e., n/(len(x)*dbin). In a probability density, the integral of the histogram should be 1; you can verify that with a trapezoidal integration of the probability density function: This means that the area under your bins is summing up to one, but becau

Categories : Python

matplotlib.pyplot.hist returns a histogram where all bins have the same value when I have varying data
The problem is that spectrumnoise is a list of arrays, not a numpy.ndarray. When you hand hist a list of arrays as its first argument, it treats each element as a separate dataset to plot. All the bins have the same height because each 'dataset' in the list has only one value in it! From the hist docstring: Multiple data can be provided via x as a list of datasets of potentially different length ([x0, x1, ...]), or as a 2-D ndarray in which each column is a dataset. Try converting spectrumnoise to a 1D array: pp.hist(np.vstack(spectrumnoise),50) As an aside, looking at your code there's absolutely no reason to convert your data to lists in the first place. What you ought to do is operate directly on slices in your array, e.g.: data[20:40] += y1

Categories : Python

Pandas timeseries, binning on one columnn and accumulate time spent in the bins
In [117]: binned_time = df.groupby(pd.cut(df.speed, bins=[0,20,40,60,80]))['time'] In [118]: binned_time.sum() Out[118]: speed (0, 20] 0.30 (20, 40] 3.30 (40, 60] 1.11 (60, 80] 1.24 Name: time, dtype: float64

Categories : Python

App Launcher in Blackberry 10
This is not supported in BB10, as any system-wide services: http://developer.blackberry.com/android/apisupport/unsupportedapi_blackberry10_intents.html

Categories : Android

Load launcher app again?
In this code: c.startActivity(selector); p.setComponentEnabledSetting(cN, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); when you call startActivity(), the activity isn't started immediately. What this does is just tell the Android framework that you would like to start another activity at the next possible time that the framework gets control. In the next line you disable the component so that when the Android framework goes to start the activity, your launcher component has been disabled again. The call to startActivity() is not synchronous.

Categories : Android

about Launcher android
getPackageManager().clearPackagePreferredActivities(defaultLauncherPackgeName); Added: If you want to set your launcher as default, try: ComponentName cN = new ComponentName(mContext, FakeHome.class); p.setComponentEnabledSetting(cN, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); Intent selector = new Intent(Intent.ACTION_MAIN); selector.addCategory(Intent.CATEGORY_HOME); mContext.startActivity(selector); p.setComponentEnabledSetting(cN, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); And in AndroidManifest.xml: <activity android:name="com.test.FakeHome" android:enabled="false" > <intent-filter> <action andro

Categories : Android

How to organize values in a numpy array into bins that contain a certain range of values?
Numpy has some pretty powerful bin counting functions. >>> binplace = np.digitize(avgs, bins) #Returns which bin an average belongs >>> binplace array([1, 6, 2, 3, 5, 4, 1, 4, 6, 6, 2, 3, 5, 6, 3, 1, 2, 3, 5, 7, 5, 3, 4]) >>> np.where(binplace == 1) (array([ 0, 6, 15]),) >>> np.where(binplace == 2) (array([ 2, 10, 16]),) >>> avgs[np.where(binplace == 1)] array([ 11.02, 11.3 , 11.01])

Categories : Python

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

Getting launcher activity class name
One way you could do it is by using startActivityForResult() instead of startActivity(Intent) and then have the second activity use getCallingActivity() to get the CallerClass.

Categories : Java

Using Java application launcher
Using the package name (with dots) is better, since it is cross-platform (remember that Windows uses ) and is closer to what you would need if your program is in a jar file (where Main-Class has to be specified as a class name).

Categories : Java

customized launcher in android
Put your code that use internet in a separate thread or in a Async task. As ICS and Jelly bean do not allow internet based process on main thread otherwise your app will give you android.os.NetworkOnMainThreadException. Check out this links below Link-1 Link-2 Hope it will help you.

Categories : Android

USB missile launcher on Linux
The main problem here is that libusb is returning an error code, "Resource busy". This could be a permissions problem. Try running your program with sudo and see if that fixes it. This link looks promising, because it talks about how to set up a udev rule so you don't have to run as root: pyusb: cannot set configuration If that does not help, you could Google around for "libusb resource busy".

Categories : Python

Why is my Android app name same as the launcher activity name?
Naming my application in android This is a bit weird in android... App name is pretty much determined by first activity label.. or application label if it isn't set.

Categories : Android

how to add my application inside launcher app?
As far as i understand your question, you want to see your app displayed in the launcher ? This is related to intent-filters : http://developer.android.com/guide/components/intents-filters.html Black launcher looks for applications that are flagged as being "LAUNCHER" applications. As you can see in their code here : https://github.com/strider2023/Black-Launcher--Android-/blob/master/Black%20Launcher/src/com/touchmentapps/black/functions/AppInfoHandlerFunctions.java You have to add your activity tag in your Manifest file and include the LAUNCHER category. <activity android:name=".MyActivity" android:launchMode="singleTask" android:clearTaskOnLaunch="true" android:stateNotNeeded="true" android:windowSoftInputMode="adjustPan" android:

Categories : Android

Xna game launcher not working
Do you can try this ? Thread thread = new Thread(() => { Game1 game = new Game(); game.Run(); }); private void Startgame_Click(object sender, EventArgs e) { thread.Start(); thread.Join(); }

Categories : C#

Distributing LWJGL launcher
Share it here Java-Gaming.org/sharecode and just put utility in the Thread name. Also could you post a link here as comment to the thread, so I could check it out and perhaps pass it on as well?

Categories : Java

how to get the right icon in Android Launcher?
Please recycle your Bitmaps, use the following link. It will stop your application from getting crashed. http://developer.android.com/training/displaying-bitmaps/index.html

Categories : Android



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