w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Performance issues: Single CPU core vs Single CUDA core
Why would anyone try to do such a thing? Sorry, but I don't get it.... you can (and absolutely SHOULD) run thousands of GPU threads instead of one! If you still think you want to create a naive implementation you can still avoid the two outermost for-loops. What's the point of this? P.S.: btw, if a CPU-Thread would not be faster than ONE GPU-Thread, why would anyone still use them for calculations?

Categories : Performance

Azure VM pricing - Is it better to have 80 single core machines or 10 8-core machines?
Billing According to Windows Azure Virtual Machines Pricing Details, Virtual Machines are charged by the minute (of wall clock time). Prices are listed as hourly rates (60 minutes) and are billed based on total number of minutes when the VMs run for a partial hour. In July 2013, 1 Small VM (1 virtual core) costs $0.09/hr; 8 Small VMs (8 virtual cores) cost $0.72/hr; 1 Extra Large VM (8 virtual cores) cost $0.72/hr (same as 8 Small VMs). VM Sizes and Performance The VMs sizes differ not only in number of cores and RAM, but also on network I/O performance, ranging from 100 Mbps for Small to 800 Mbps for Extra Large. Extra Small VMs are rather limited in CPU and I/O power and are inadequate for workloads such as you described. For single-threaded, I/O bound applications such as describe

Categories : Azure

How to measure each core CPU utilization/load (in %) in Micromax C4, using adb command?
I am not sure if there is any file which will be able to directly report the percentage CPU utilization but you can use /proc/stat to calculate the CPU utilization. adb shell cat /proc/stat gives the following output cpu 22251 758 19056 1170320 2786 0 243 cpu0 13628 401 14782 275769 1645 0 237 cpu1 4712 147 2394 295111 622 0 5 cpu2 2451 116 1149 298977 291 0 1 cpu3 1460 94 731 300463 228 0 0 intr 724661 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 184059 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 337 0 0 0 0 0 0 0 0 0 0 0 14401 0 0 21902 0 0 6 0 0 0 0 0 0 0 0 0 0 48850 175 0 0 0 0 0 0 0 0 0 0 0 0 2901 16819 5708 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8879 0 31124 0 0 0 0 5431 0 579 0 5 0 0 0 0 0 15043 0 0 0 0 0 6644 328 13085 0 6779 0 70695 1279 47348 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Categories : Android

I have created a new core in solr and once I restart my tomcat server the core gets deleted.why does the core in solr gets deleted?
Check for the persistent attribute in the solr.xml <solr persistent="true"> which will persist the changes made through Admin UI and these would be available after restarts as well. If persistence is enabled (persist=true), the configuration for this new core will be saved in 'solr.xml'.

Categories : Solr

Can use core data to undo/redo in iOS/core graphics?
You can create and register managed objects with it, make changes to the objects, and undo and redo changes as you wish. If you make changes to managed objects associated with a given context, those changes remain local to that context until you commit the changes by sending the context a save: message.

Categories : IOS

how to force an application to run in one core and no other applications run in that core on windows?
a. In case you have a multicore platform: Stay away from core 0. Windows assigns certain tasks specifically to core 0. See the SetThreadAffinityMask function to get information how to run a thread on specific cores. b. Possibly raise the thread/process priority. See the SetThreadPriority function and the SetPriorityClass function for details about setting priorities and Scheduling Priorities for dertails about the priority ranges. Priority class REALTIME_PRIORITY_CLASS with thread priority THREAD_PRIORITY_TIME_CRITICAL will run your thread at utmost priority whenever it is ready to run. Be aware that such a priority setting will disallow any other process/thread to gain CPU on that core while your thread is running.

Categories : Matlab

How do I set up a new Solr core using data from an existing core?
You have to use segments.gen and segments_1 from the original index. Ask you collaborator to give you those files also. But since you mentioned that collaborator gave you a copy of index folder, so you must already be having those files. Note that it might not be necessary that segment_1 is present in your original index copy. It can be segment_N. Whatever segment_ file is there in original copy, copy that to new index and restart jetty. segments.gen records the current generation (the _N in segments_N) in the index, as a fallback in case directory listing of the files fails to locate the segments_N file (eg on filesystems, like NFS, where the directory listing may come from a stale cache)

Categories : Database

I have uploaded application with core data and I want to replace new core data without migration. Does apple allows it?
Apple won't care, but your users might. If there is data that your users might be sorry to lose, you should make every effort to migrate it or give an option to export it when they upgrade. If you're only using core data to cache downloaded values, then there's no problem with this at all. In fact, deleting the old store would be necessary to prevent the app crashing on upgrade, since it wouldn't be able to migrate from the existing store. The best place to do this is in the core data setup code when you receive an error - the boilerplate comments guide you toward this.

Categories : IOS

Linux - cannot generete core dump
ulimit -c will change the configuration in the current session only. You will probably need to edit /etc/profile and /etc/sysctl.conf. For more info, refer the this page: Debugging Linux Cores

Categories : Linux

Core Data: Automatically Trim String Properties
If you only need to ensure that the saved data is trimmed then you can implement willSave and use changedValues to check only the changed values. This will also make it easy to do in a loop to minimise code duplication.

Categories : IOS

Load automatically entity of core data relationship
You can get XCode to automatically generate an NSManagedObect subclass for you by going to the Editor drop down menu. Once you've generated the subclass, you can write any custom code into the generated subclass but it's often recommended to create a Category as if you need to regenerate the subclass it will wipe said custom code. As for the retrieving of a specific entity B, you could have another relationship to entity B but this time just a 1 to 1 relationship (say "specialRelationship" for example) and tick the "transient" box (this just means that the data isn't stored in the persistent store, but is determined programmatically). In your Category, you can then write a custom accessor for specialRelationship which will programmatically choose the correct entity B to return.

Categories : IOS

Core Data Error: Execute Fetch Request Error - Crashes when trying to access Core Data
You need to ensure that the managed object context reference is set. If it isn't set then the fetch request will not be able to locate the entity. You must have a class somewhere which is the owner of the managed object context. By default (from the Apple supplied templates) this is the app delegate. When the app delegate creates the controller class it should pass the controller a reference to the MOC. If the app delegate doesn't create the controller then the controller can go to the app delegate to get a reference.

Categories : Iphone

How to add only single value in DB with Core Data?
Each call to insertNewObjectForEntityForName creates a new object and inserts it into the managed object context. If you want only unique values, you have to check first if an object with that value already exists. That is done with an NSFetchRequest with a predicate like [NSPredicate predicateWithFormat:@"name == %@", terminaison]; If you have to insert many values, then it is more effective to fetch all objects having values from the new list first instead of many fetch requests. Compare "Implementing Find-or-Create Efficiently" in the "Core Data Programming Guide".

Categories : IOS

nasm , 64 ,linux, segmentation fault core dumped
Arguments are not passed on the stack in 64-bit mode, unless you have more than 6 of them. The first two arguments will be in RDI and RSI. There's also a difference in how you should use system calls in 64-bit mode. The syscall number and arguments should be placed in the following registers (source): syscall nr rax arg 1 rdi arg 2 rsi arg 3 rdx arg 4 r10 arg 5 r9 arg 6 r8 And the sys_write syscall number in 64-bit mode is 1, not 4. Also, instead of int 0x80 you should use syscall. Performing syscalls with int 0x80 might work in 64-bit mode depending on how your kernel has been configured, but you still need to consider how function arguments are passed.

Categories : C

Deleting a single row in Core Data not working
Maybe it's because of this line: matches = objects[1]; Arrays are zero-indexed. So maybe you were looking for the first element (objects[0])? Do some NSLogs to see if there is actually something to delete. Also, if you expect some kind of visual update in your views, don't. You must manually update your views to reflect the change in the database.

Categories : IOS

Any way to use >1 Core in PostgreSQL for a single Connection/Query?
PostgreSQL does not currently support executing a single query across multiple CPU cores (minus background things like background writing and wal writing if you're doing a write query, but that doesn't really count). It's work that's in progress, but it's a long-term project, and is not in any current version of PostgreSQL. This is the same on all platforms and architectures. It is definitely an issue, but since PostgreSQL is, as you say, focused on multi user scenarios, it's not bubbled to the top of the priority queue until recently. But there are definitely people realizing it's an issue, and working on solving it for future versions, it's just not done yet.

Categories : Performance

the meaning of multiple threading on single core cpu
One possible reason you can see greater performance from multiple threads on a single CPU is that CPUs tend to be really good at instruction reordering and making use of instruction-level parallelism. Threads have fewer data and control dependencies with respect to one another than any two sequential instructions within a single thread, and therefore they offer more possibilities for the CPU and OS-level schedulers and re-ordering mechanisms to be very clever. Don't forget that things like "reads and writes in memory" are still "I/O" when viewed in a particular way. These are relatively slow operations, and much of the pipelining in modern CPUs is used to hide memory latency - having multiple threads executing at once can be useful for filling up time that would otherwise have to be f

Categories : C++

Retreiving a single object from Core Data
If self.gallery is passed into the view controller from the previous one (presumably from a selection on a UITableView) then why can't you just do this: self.galleryInfoTextView.text = self.gallery.galleryDesc;

Categories : IOS

Run 3 parallel threads in a single core machine
No. You can't force any kind of thread order. So your first question, is it possible for them to execute simultaneously? Yes. How can you do it? You can't. The operating system chooses to do that. You can set priorities and things like that, but I still think linux (or windows) will switch threads pretty randomly and without telling you/allowing you to change the scheduler. Think about all the threads from all the programs running on your computer; which ones can execute and when? The answer is, who knows! There is no way to tell when your thread will block, even if its holding a lock (which is why you're getting a resource busy response probably). So how do you stop this from happening? Make sure you check to see if the resource is still locked before trying to use the resourc

Categories : C

Jquery overloading core function with single element
I messed around for a bit, and couldn't get it to work. This is the best answer I could find: Add jQuery function to specific elements Your first solution is a bit of a duct tape one, but it'll work. Other than that, you could make a function called close(), call that instead of hide(), and then within there call specific hides. It's basically the same as your solution above, but easier to read for follow up programmers.

Categories : Jquery

Using a single Core Data model in multiple projects
This isn't difficult to do. Basically keep all your CoreData related classes and models in a detached folder system which you can add to your CoreData projects. I have tried in the past to use a single self-contained data stack object layer i.e something which fires up the Persistent Store Coordinator, Persistent Store and Managed Object Contexts which can be instantiated on iOS or OS X but it gets sticky once you start using NSPersistentDocument so in the end I just build the stack and point it at the common model and MOGenerated classes for each platform in the most efficient way for the given platform. EDIT The OP mentions that this is a B2B application and that they wont be using 'NSDocument'/'NSPersistentDocument' to handle things on the OS X side so a Container Object could

Categories : Xcode

System Main thread on Single Core Processor
I know that an operating system has a main system thread that does tasks such as manage other threads... In every operating system I'm familiar with, the scheduler is run by all CPUs when task switching occurs. There is no "main system thread".

Categories : Multithreading

Strategy to have deleted objects in DB deleted in Core Data as well. [RestKit/Core Data]
As Wain suggested, I will have a list of deleted objects in the Database with a "deleted_date" field. Whenever I will fetch the latest objects, I will also fetch the latest deleted objects back.

Categories : IOS

Separating components of a single object model in Core Data
Unless you feel fairly certain that the name or uniqueID are going to become super long, the memory footprint is going to be pretty small even with six attributes (especially when two are BOOLs). If you find places where you need to grab a large number of the List entities but only need a couple of the attributes you can set up a fetch request that has it's return type set to dictionary and specify the attributes you want. For example you could grab all entities that aren't complete, need notification and the date has passed with a compound predicate and just have it return the name and uniqueID in a dictionary. If you do break it up then List would likely be the center with relationships to ListItem and ListDetails. If the notification date isn't something the user needs to see all th

Categories : IOS

Core Data stack with only a single context initialized with NSPrivateQueueConcurrencyType
There is nothing wrong with using a NSPrivateQueueConcurrencyType MOC for background tasks. But you will probably still need a NSMainQueueConcurrencyType MOC. From the documentation: The context is associated with the main queue, and as such is tied into the application’s event loop, but it is otherwise similar to a private queue-based context. You use this queue type for contexts linked to controllers and UI objects that are required to be used only on the main thread. As an example, for a fetched results controller, you would use the NSMainQueueConcurrencyType MOC.

Categories : IOS

How can we create single helper function for core data and sqlite
This is a bad idea, mainly for these reasons: There is most likely no compelling reason to use the Core Data and SQLite APIs in the same project. By combining two technologies in one class you are reducing the probability of being able to reuse them, violating the principle of encapsulation. That being said - you could have two helper classes that do certain things in SQLite and Core Data, and a combination class that calls methods from these two. Difficult to say this would make any sense in a realistic project environment.

Categories : Sqlite

How Would I Use Core Data Models to Build a Simple Money Based App with Single or Multiple Entities
You are on the right track! Do not worry about the complexity or data volume - Core Data can handle 100.000s of records easily on a mobile device. With relationships you can fetch and filter this data very quickly and efficiently. Your data model could look like this: Person <---->> Transaction Transaction <<----------> Location Transaction <<----------> Occasion Transaction <-----------> Gift Person (name, birthday, etc) Transaction (createdDate, status [given, pending, canceled, etc.], category, type) Location (name, lat, lon, address...) Occasion (title, category) Gift (type, amount, currency, shortName, notes) When this is set up correctly, you can sort and group easily using a NSFetchedResultsController and you can access all the properties e

Categories : IOS

Should My Class Translate to Core Data Managed Object, or Be Core Data Managed Object
I would say that both solutions are good. If you only want to save your Recorder object to a persistent store (so that you can refetch it when your app is killed for instance) the first solution is great but you'll have two classes : Recorder and RecorderCoreData let's say. If you think it's too complicated to maintain code with these two classes then convert your Recorder class to a managed object. The only thing you should be aware of is since AudioRecorder is a subclass of Recorder, AudioRecorder will also have to be a managed object ! But there's no perfect answer, just pick the one that looks easy and better depending on your needs. I hope it will help you.

Categories : Iphone

why do I have 2 core.editor in git?
Git looks for configuration settings in three locations: /etc/gitconfig ~/.gitconfig .git/config These are the system-wide, per-user and per-repository settings, respectively. More specific settings override more general ones (e.g. per-repo overrides per-user). The convenient way to get/set them is to use git config --system, git config --global and git config .

Categories : GIT

JRE on AIX, JRE 6 core dumping
That looks like the initial Java 6 release for AIX. It's 6 years out of date. You should download a newer build from http://www.ibm.com/developerworks/java/jdk/aix/service.html#java6

Categories : Java

Stanford Core NLP
SUTime uses the Jollyday library for turing holiday names into dates. This message just says that it is using this library.

Categories : Java

Core Animation Bar
A couple of things. Your scale of 100 would make your layer 100 times larger than normal. If it's 300 pixels on a side, a scale of 100 would display it as 30,000 pixels on a side. You want your to scale value to 1.0, not 100. Also, I'm not sure if scaling the transform multiplies the previous scale by a growing factor. If it does, then a starting scale value of 0 would prevent it from ever growing, since anything times zero is still zero. Try a from value of .0001 instead of 0.0, If you want your battery image to grow from left to right, wouldn't you want your anchor point to be (0,.5) rather than (.5, 1)? And, when you change the anchor point, it not only changes the center for transforms, but it moves the position of the image. You will need to adjust the position to compensate. I

Categories : Objective C

iOS: Core Data Lag…?
If your UI is not updating, it could be because the data is still cached. Maybe your detail view controller was not deallocated correctly. There is no harm in simply reloading the table view before displaying: -(void)viewWillAppear:(BOOL)animated: [super viewWillAppear:animated]; [self.tableView reloadData]; } However, your table view should be brand new, so this is supposed to happen automatically. Check your view hierarchy logic.

Categories : IOS

Does a C# Task run on one core?
If you use the Task library (PTL), you won't need to worry about this. You can read more about it here. In a nutshell: The TPL scales the degree of concurrency dynamically to most efficiently use all the processors that are available. In addition, the TPL handles the partitioning of the work... We've created a wrapper around Task as follows: public static class PeriodicTaskFactory { public static Task Start(Action action, int intervalInMilliseconds = -1, int delayInMilliseconds = 0, int duration = -1, int maxIterations = -1, bool synchronous = false, CancellationToken cancelToken = null, TaskCreationOptions periodicTaskCreationOptions = TaskCreationOptions.None); } And then we call it like so. In this case, the only work we want to perform is calling a single method every 1 mi

Categories : C#

ASP.NET MVC 4 Core routing
You can specify the default area in the defaults: routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { area = "www", controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new string[] { "WWW.Controllers" } );

Categories : Asp Net Mvc

Fix bug in PayPal PHP SDK Core
Perchance are you using json_encode/decode on your PaymentDetail record? It seems that PayPal is very particular about the component classes; stdClass (which json_decode generates) won't cut it. Serialize works, but there are warnings about using it.

Categories : PHP

Core Graphics - Shadow not seen
Try this: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGColorRef colorRef = [[UIColor blueColor] CGColor]; CGContextSetStrokeColorWithColor(context, colorRef); CGContextSetFillColorWithColor(context, [[UIColor blueColor] CGColor]); CGRect buttonRect = CGRectInset(rect, 3, 3); CGPoint centerPoint = CGPointMake(CGRectGetMidX(buttonRect ), CGRectGetMidY(buttonRect)); CGFloat radius = CGRectGetWidth(buttonRect) / 2; CGContextSaveGState(context); CGContextSetShadow(context, CGSizeMake(2.0, 2.0), 2.0); CGContextAddArc(context, centerPoint.x, centerPoint.y, radius, 0, 2*M_PI, 1); //CGContextClip(context); CGContextFillPath(context); CGContextRestoreGState(context); CGColorRelease(colorRef

Categories : IOS

Can we profile per core with dtrace?
DTrace is very suitable for lock analysis, due to it's ability to dynamically instrument lock events as required. The following commands and providers can be used for lock analysis, and were first shipped with the Solaris 10. AS dtrace is usable for identify the lock analysis it can be used in multithreaded application you can check on http://www.solarisinternals.com/wiki/index.php/DTrace_Topics_Locks Thanks & Regards, Alok Thaker

Categories : C

Core-Data Relationships
As a convention Entities should be named as singular. The relationships should be named plural or singular relative to their relationship. From the given information it is assumed that category is created by a user to group the books like a playlist or something. A category will be unique to user and it is not shared among users. A book can be included in any number of categories. So this will become User < -- >> Categories Category <-- >> Books Book < -- >> Categories A relation should have two sides. Inverse let you define that. If a user can have any number of categories and a category can only have one user. Inverse of categories is a user.

Categories : Iphone

Core Data malfunctioning
I had such an issue once I believe. In my case it had something to do with the display mechanism. --> Try reloading your data more frequently (or resetting your fetched results controller) to test this.

Categories : Objective C



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