w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to edit initramfs to add a new partition after boot in CentOs
I'm gonna go on a guess here. If I understand what you want to do correctly, what you want to do is to make another ext3 partition visible in CentOS. If so, you want to make sure that the partition exists. Maybe you have a disk called /dev/sda it might have 2 partiotions sda1 ext3 mounted at /boot and sda2 ext3 mounted at / To view this use "sudo blkid" fdisk-l or similar. These partitions are loaded at boot from the list found in /etc/fstab say you still have space left on the disk. use fdisk/gparted to create a new ext3 partition sda3. add a line for that disk in /etc/fstab now it should be accessible after a reboot or after "sudo mount -a" I might have completely misunderstood your question. Edit: I think I understand what you want to do now, and you probably want to edit

Categories : Linux

git - dual boot ubuntu and windows with separate data partition
I'm guessing there's an issue with line endings. You probably have commited your code with windows line endings and when you checked out the code in ubuntu git converted those to unix style line endings. Take a look at this page Dealing with line endings

Categories : Windows

ORA-14288 when setting default attributes on an index partition
I think that this means that you cannot define a default tablespace for an index partition if that partition does not contain subpartitions. The reason for that would be that the default tablespace for an object is the one to which new partitions or subpartitions would be assigned on creation. If a table or index is not partitioned then of course it could not have a default tablespace for new partitions, and if a table or index partition is not subpartitioned then it cannot have a default tablespace for the addition of new subpartitions. You probably want to: alter index myindex1 modify default attributes tablespace myNewIndexTablespace; ... and then rebuild the current index partitions to the new tablespace. http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10

Categories : Oracle

After new partition gets created insert partition info in another table through trigger
You can do it with DDL Trigers. Check out this link One important note from the author you should consider adding a partition is not DDL if Oracle decides to do it internally, it’s only DDL if it’s an end-user statement Implicit partition creation is a new feature of 11g and it reffers to the interval partition option.

Categories : Oracle

Hoare partition : is this implementation more/less efficient than the standard partition algorithm?
I always prefer the standard Hoare's implementation. If you look at it, it is not very intuitive, but it has a visible advantage: Less number of swaps. While your implementation effectively always does exactly N comparisons and N swaps, the Hoare's implementation does only N comparisons, but it does not swap anything if it is not needed. The difference is significant in some scenarios. At first in a case you use environment where swaps or assignment of variables/objects is a costy operation. For example if you use C/C++ with arrays of objects. Another typical examples where Hoare's partition implementation performs better if when many of the items in your array are of the same value or when the array is almost sorted and needs just to swap a few items. In that cases Hoare's version perfor

Categories : Matlab

Is there a way to define more than one itemtemplate in the default treeview?
A simplest example I am taking here is to show Contacts with different background color based on their sex(Male/Female). So this is how the ItemTemplateSelector class will look class MyDataTemplateSelector : DataTemplateSelector { public override DataTemplate SelectTemplate(object item, DependencyObject container) { if (item != null) { Contact objContact = item as Contact ; switch (objContact.Sex) { case "Male": return App.Current.MainWindow.FindResource("TemplateMale") as DataTemplate; case "Female": return App.Current.MainWindow.FindResource("TemplateFemale") as DataTemplate; } } return null; } } and this is how you can use it in your XAML <

Categories : Wpf

Using a variable to define default value in a form input
You can't assign variable to textbox via HTML. Instead place the value directly input type="number" name="sum-due" readonly="readonly" value="5" This is only possible using javascript or jQuery. For eg: <input id="my-input" type="number" name="sum-due" readonly="readonly" /> JS: var totaldue = 5; document.getElementById('my-input').value = totaldue; UPDATES: From your comments, <script> var totaldue = 10; document.getElementById('paythis').value = totaldue; </script> <form id="pay1" action="hotguidebelize-com.cgi-data.com/webform/5627816.cgi"; method="post"> <label>Total amount due:</label> <input id="paythis" type="number" name="sum-due" readonly="readonly" /> <input type="submit" value="Proceed To Paymen

Categories : Forms

Query to define a default value in a database migration
How about: class SetDefaultCurrencyForShops < ActiveRecord::Migration def up currency = Currency.find_by_iso_code('EUR') if currency change_column :shops, :currency_id, :integer, :default => currency.id end end end

Categories : Ruby On Rails

How to define a default entity listener programmatically?
From my understanding, no for JPA. One possibility that I can think of is to create a base class which annotated with @EntityListeners annotation and make the other entities extends from it. I'm not sure if this is feasible or acceptable in your case though.

Categories : Java

May I define two Default string in values directory?
You need to Localizing with Resources. Where you can easily do you task. Below content Reference : Supporting Different Languages To add support for more languages, create additional values directories inside res/ that include a hyphen and the ISO country code at the end of the directory name. For example, values-es/ is the directory containing simple resourcess for the Locales with the language code "es". Android loads the appropriate resources according to the locale settings of the device at run time. Once you’ve decided on the languages you will support, create the resource subdirectories and string resource files. For example: MyProject/ res/ values/ strings.xml values-es/ strings.xml values-fr/ strings

Categories : Android

XML Schema: Define default value in child complextype
You can achieve the effects of both "extension" and "restriction" via some intermediate type: serviceType -> serviceTypeIntermediate -> serviceTypeResult For example: <xsd:complexType name="serviceTypeIntermediate"> <xsd:complexContent> <xsd:extension base="serviceType"> <xsd:sequence> <xsd:element name="something" type="xsd:String"/> <xsd:sequence> <xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="serviceTypeResult"> <xsd:complexContent> <xsd:restriction base="serviceTypeIntermediate"> ... <xsd:restriction> </xsd:complexContent> </xsd:complexType> But please note the following: Extension (of complex content)

Categories : Xml

how to define a default/fallback block in jade
You can actually just write your default code in the header block. block header include ../partials/base/header If you now extend your layout you can overwrite the contents of the block with a simple standalone block statement. extends layout block header ... your code ... Alternatively you can use append or prepend to add to the block, in this case the old content persists.

Categories : Node Js

How to define default welcome page in an equinox OSGI server?
There is no standardised way yet to define a default (or welcome) page in an OSGi server. Coincidentally, I faced the same and decided to add this functionality to the Amdatu-Web project. Aside allowing non-Java resources to be served through the web, it now also allows you to define a default page like: X-Web-Resource-Default-Page: index.html or a default page for a specific directory: X-Web-Resource-Default-Page: /path=index.html The default page(s) will be served in case no file is requested. It is not entirely done yet, as it needs some reviewing and I need to update the documentation and examples a bit on the Amdatu website. But, you can already take a look at the code (especially the demo project in the BitBucket project) to get an idea of how it should work.

Categories : Java

How to define default date values in Symfony2 routes?
Dynamic Container Parameters You can set container parameters dynamically in your bundle's extension located AcmeBlogBundleDependencyInjectionAcmeBlogExtension afterwards you can use those parameters in your routes like %parameter%. Extension namespace AcmeBlogBundleDependencyInjection; use SymfonyComponentHttpKernelDependencyInjectionExtension; use SymfonyComponentDependencyInjectionContainerBuilder; class AcmeBlogExtension extends Extension { public function load(array $configs, ContainerBuilder $container) { $container->setParameter( 'current_year', date("Y") ); $container->setParameter( 'current_month', date("m") ); $container->setParameter( 'current_day',

Categories : Symfony2

How to define in JSON.net a default value to an empty list or dictionary
I have implemented this feature in the custom contract resolver of my personal framework (link to the specific commit in case the file will be moved later). It uses some helper methods and includes some unrelated code for custom references syntax. Without them, the code will be: public class SkipEmptyContractResolver : DefaultContractResolver { public SkipEmptyContractResolver (bool shareCache = false) : base(shareCache) { } protected override JsonProperty CreateProperty (MemberInfo member, MemberSerialization memberSerialization) { JsonProperty property = base.CreateProperty(member, memberSerialization); bool isDefaultValueIgnored = ((property.DefaultValueHandling ?? DefaultValueHandling.Ignore) & DefaultValueHandli

Categories : C#

How to define a default Action for any http method in Play 2.1 (Scala)?
You should not try to figure out all possible bad access points to generate error messages. Instead, you can override the onHandlerNotFound method in the application's Global object. Adapted from Play's official documentation: ScalaGlobal import play.api._ import play.api.mvc._ import play.api.mvc.Results.__ object Global extends GlobalSettings { override def onHandlerNotFound(request: RequestHeader): Result = { // implement methodNotAllowed controller Action } }

Categories : Http

Can my SQLITE schema define a default value based on other column values?
This is possible with a trigger that updates the record directly after is has been inserted: CREATE TRIGGER MyTable_col4_default_value AFTER INSERT ON MyTable FOR EACH ROW WHEN NEW.col4 IS NULL BEGIN UPDATE MyTable SET col4 = NEW.col1 || NEW.col2 || NEW.col3 WHERE rowid = NEW.rowid; END;

Categories : Sqlite

What's does it mean of" /* overloaded elements data types */ #define OE_IS_ARRAY (1<<0) #define OE_IS_OBJECT (1<<1) #define OE_IS_METHOD (1<<2)"?
This is usually used to make it unambiguous that you're talking about bit flags. 1, 2, and 4 will make most programmers realize that we're talking about a sequence of powers of 2; not everyone will instantly know that 1<<14 is 16384. The compiler will do these computations for you, so it will not slow the program down. It's all about clarity. You'll sometimes also see these things written in hexadecimal, because that maps more closely to the underlying binary representation than decimal constants and can be more compact.

Categories : PHP

MySQL table Partition with FLOOR function (partition function not allowed)?
MySQL documents the partitioning functions here. The floor() function appears to have some special considerations. In this case, I think the issue might be that the division is returning a float/double result rather than a decimal result. This is easily fixed in your case because you do not need to do the division: CREATE TABLE `fact_events` ( `event_key` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `event_type_key` tinyint(3) unsigned NOT NULL, `analytic_file_id` bigint(20) unsigned NOT NULL, `sdk_session_id` bigint(20) unsigned NOT NULL, `virtual_button_create_id` bigint(20) unsigned NOT NULL, PRIMARY KEY (`event_key`), KEY `idx_events_event_type` (`event_type_key`) ) PARTITION BY RANGE(event_key) ( PARTITION p0 VALUES LESS THAN (0), PARTITION

Categories : Mysql

define default named arguments in terms of other arguments in scala
You can use type-classes: // Represents no argument object NoArg // Resolves start, duration, stop trait DurationRes[A,B,C] { def resolve(s: A, d: B, e: C): (Float, Float, Float) } object DurationRes { implicit object startEndRes extends DurationRes[Float, NoArg.type, Float] { def resolve(s: Float, d: NoArg.type, e: Float) = (s, e-s, e) } implicit object startDurRes extends DurationRes[Float, Float, NoArg.type] { def resolve(s: Float, d: Float, e: NoArg.type) = (s, d, s+d) } // etc. } def test[A,B,C](start: A = NoArg, dur: B = NoArg, end: C = NoArg) (implicit res: DurationRes[A,B,C]) { val (s,d,e) = res.resolve(start, dur, end) // s is start, d duration, e end } test(start = 1f, end = 2f) This way it is even type-safe and you cannot call someth

Categories : Scala

Accessing declared variables inside a #define from another #define
If the struct is declared static within a function, its visibility will be limited to that function. Example (without macros): struct hoppa { int i; }; void start(void) { static struct hoppa one = {1}; } void use_it(void) { one.i = 2; //FAIL }

Categories : C

sequelize.define error: has no method 'define' in nodejs
This is because you have to instantiate Sequelize. var Sequelize = require("sequelize"); var sequelize = new Sequelize('database', 'username'); var Project = sequelize.define('Project', { title: sequelize.STRING, description: sequelize.TEXT });

Categories : Node Js

there is __cond_lock(x,c) define in compiler.h file , but no __cond_unlock(x,c) define?
Protecting critical sections using locking is up to the programmer. That means, if you hold a lock to protect a critical reason, you've must have to release the lock when you're finished. There are various types of locking primitives inside Linux kernel like. spinlock(), spinlock_irq(), spin_trylock(). They have their own purposes. Now, spin_trylock() using __cond_lock inside of it, it's because to make sure, whether that particular lock is available for locking or it's been already taken. Take a look at few examples of how spin_trylock or __cond_lock is being used. For ex. at kernel/sched/fair.c::rebalance_domain (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/sched/fair.c?id=d8dfad3876e4386666b759da3c833d62fb8b2267#n5574) see how the balancing is used, it's

Categories : Linux

define a variable in C (for example: #define PRE_WORD 1), then use that number later?
#defines are simple replacements in the code. In your case you're setting a variable count_char_line to 0. What you did: count_char_line=0; will work just fine. You could just as easily do: count_char_line=PRE_WORT; They will result in the exact same thing as the compiler will come through and replace any instances of PRE_WORT with the number 0. The only reason to pick one over the other is to make things clearer to those reading it, or if it's a value you use frequently in many places that could change (always good to have variables for hardcoded constants); but it's really up to you what to use. As far as your code goes, it looks like it will do what you want (as far as I can tell what you're asking), but it's a bit overkill. When you have the same code in a if as you do in

Categories : C

Define a foreign key on a CLR type or not define
My personal preference is to use define the FK and to set the key value (AuthorId) when defining the relationship. There's 2 great article here and here by Julie Lerman that explain some of the benefits of taking this approach. Here's the summary: Save the Grief and Use That Foreign Key Rather than setting the navigation property and having to worry about the state of the [related entity], just set the [Id] property, because you do have access to that value in the [related entity] instance. This is something I find myself frequently suggesting to developers. Even on Twitter, I see the question: “Why is EF inserting data that already exists?” And I often guess correctly in reply: “Any chance u r setting a navigation property on a new entity instead of an FK? J”

Categories : Dotnet

Define the layout perimeters manually,means i want to use my values to define the boundries of the layout
My idea is, that you manually check what is the color of pixel where you pressed, and based on that, you can switch different touch events (different color cases). I don't think there is easier way to achieve what you want to achieve. But what if your image consist of gradient, or same colors in different clickable areas? Consider the following example: As you can see there is a picture with 4 different color regions, but there is also a lot of white pixels in each region right? If a button background is not a solid color, but for example consist of gradients etc, then you could make each of them having different transparency value (255,254,253 etc.) which wouldn't be noticeable by the user but which you could easily use to distinguish between area where you pressed. So inside onClick

Categories : Android

SUM OVER PARTITION BY
remove partition by and add group by clause, SELECT BrandId ,SUM(ICount) totalSum FROM Table WHERE DateId = 20130618 GROUP BY BrandId

Categories : SQL

Why only one active partition in MBR
Wikipedia has a nice article on MBR with a lot of useful links. "Only one active partition" seems to be a design choice from the early IBM/DOS bootloader, and has remained that way since. Basically they defined multiple active partitions as an error, and checked for this error at boot. It kind of makes sense because you can only boot one operating system at a time anyway, and a forced single active partition will prevent ambiguity. If I recall correctly LILO and possibly GRUB (linux bootloaders) don't mind if there are multiple active partitions, so I think this is a DOS/Windows issue mostly. As for your questions. An "active" partition only means that the first byte is different from an "inactive" partition. There's no advantage or disadvantage, it's just a flag. Partition information

Categories : Misc

how do I give partition in the
Here is mark-up for the layout you describe (without all the style - just the layout)... <ul class="menu"> <li><a href="/home">Home</a></li> <li><a href="/about">About</a></li> <li><a href="/songs">Songlist</a></li> </ul> And the CSS ul.menu { margin: 0; padding: 0; text-align: center; } ul.menu li { display: inline-block; width: 33%; } ul.menu a { display: block; width: 100%; padding: 0.2em 0; }

Categories : HTML

Only get the partition label
As far as I know, Get-PSDrive doesn't know the difference betwee network and local drive. You can use Get-WMIObject Win32_LogicalDisk, which supports filtering drives by type. Filtering example: Get-WmiObject Win32_LogicalDisk | select-object DeviceID, DriveType, @{Name="Type";Expression={[IO.DriveType]$_.DriveType}} | ? {$_.Type -eq 'Fixed'} or Get-WmiObject Win32_LogicalDisk | ? {$_.DriveType -eq 3}

Categories : Powershell

How should I partition this table?
I suggest Sharding the database. More information can be found here importance of sharding and approaches towards MySQL sharding. Hope this helps.

Categories : Mysql

Add sub partition on another column in oracle
No alter query for adding subpartitions as far as i know. To get the desired result performe the folowing steps Create the table in the structure you want using create as select with the partitions and the sub partitions. switch the names of the two tables. you can also explore the use of dbms_Redefinition but if you have a luxury of a littel downtime it's not worth it.

Categories : Oracle

SQL Server Switch more than one Partition at once
Not that I'm aware of. What I'd typically do is place the switch inside the loop. Something like this: DECLARE @Partitions TABLE (PartitionId int PRIMARY KEY CLUSTERED); DECLARE @PartitionId INT; INSERT @Partitions(PartitionId) SELECT prv.boundary_id PartitionId FROM sys.partition_functions AS pf INNER JOIN sys.partition_range_values prv ON prv.function_id=pf.function_id WHERE (pf.name=N'PartitionFunctionName'); WHILE EXISTS (SELECT NULL FROM @Partitions) BEGIN SELECT TOP 1 @PartitionId = PartitionId FROM @Partitions; ALTER TABLE MS_PROD SWITCH PARTITION @PartitionId TO MS_Stage PARTITION @PartitionId; RAISERROR('Switched PartitionId %d to Stage',0,1,@PartitionId) WITH NOWAIT; DELETE @Partitions WHERE PartitionId = @Parti

Categories : Sql Server

Array Partition with pointer
A pointer to a pointer is not the same as an array of arrays. You can however use a pointer to an array instead: const char (*pointer)[20]; You of course need to update the printGrid function to match the type. As for the reason why a pointer-to-pointer and an array-of-array (also often called a matrix) see e.g. this old answer of mine that shows the memory layout of the two.

Categories : C++

Cassandra: choosing a Partition Key
Indexing in the documentation you wrote up refers to secondary indexes. In cassandra there is a difference between the primary and secondary indexes. For a secondary index it would indeed be bad to have very unique values, however for the components in a primary key this depends on what component we are focusing on. In the primary key we have these components: PRIMARY KEY(partitioning key, clustering key_1 ... clustering key_n) The partitioning key is used to distribute data across different nodes, and if you want your nodes to be balanced (i.e. well distributed data across each node) then you want your partitioning key to be as random as possible. That is why the example you have uses UUIDs. The clustering key is used for ordering so that querying columns with a particular clusteri

Categories : Cassandra

How to partition a list in Haskell?
Here's one option: partition :: Int -> [a] -> [[a]] partition _ [] = [] partition n xs = (take n xs) : (partition n (drop n xs)) And here's a tail recursive version of that function: partition :: Int -> [a] -> [[a]] partition n xs = partition' n xs [] where partition' _ [] acc = reverse acc partition' n xs acc = partition' n (drop n xs) ((take n xs) : acc)

Categories : Haskell

Parallelizing std::nth_element and std::partition
Cuda THRUST has partition function implemented (http://docs.nvidia.com/cuda/thrust/index.html#reordering). The main idea should be following: Using prefix sums to calculate position of element it the array and then rearrange the array.

Categories : C++

Inconsistent SUM when using OVER PARTITION in MSSQL
For floating point arithmetic the order that numbers are added in can affect the result. But in this case you are using Decimal(12,2) which is precise. The issue is that with duplicate values for nGroup, nUser, dTransaction the ROW_NUMBER is not deterministic so different runs can return different results. To get deterministic behaviour you can add guaranteed unique column(s) into the end of the ORDER BY to act as a tie breaker.

Categories : Sql Server

Partition by consecutive values
You need to group rows by sets of operation. One method is to use a running total that increases when it reaches a new "set", as in: SQL> SELECT mat, op, dt, 2 SUM(change_set) over (PARTITION BY mat ORDER BY dt) set_group 3 FROM (SELECT mat, op, dt, 4 CASE WHEN op != lag(op) over (PARTITION BY mat 5 ORDER BY dt) 6 THEN 1 7 END change_set 8 FROM DATA); MAT OP DT SET_GROUP ----- ---------- ----------- ---------- M1004 100 25/08/2013 M1004 100 25/08/2013 M1004 100 29/08/2013 M1004 600 29/08/2013 1 M1004 600 30/08/2013 1 M1004 600 30/08/2013 1 M1004

Categories : SQL

using different storage engines per partition
I would suggest having two separate tables, one for your archives and one for your working set. I don't think MySQL views are smart enough to optimize this. It would also give you complete control over the schema but puts the burden on your application.

Categories : Mysql



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