w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Apache & OS X FileVault 2
I disabled FileVault, did a system reboot, and everything is back to normal. So apparently there are some issues with running Mac Apache and FileVault. Not much has been said about it online. Hopefully this thread can serve some purpose and we can figure out a solution.

Categories : Osx

FileVault in cq5 with GIT repository on Windows platform
Do yourself a favor and dump filevault ASAP - especially on Windows, it's slow and unstable, and has a tendency to mess up its .vlt files and end up nuking your files. Move towards a proper setup using maven for builds and deploys, it will save you a lot a lot of headaches in the long run. VLT should basically only be used for checking out the /lib and /apps/geometrixx, so you can look at Adobes demo (not "OOTB"!) components - they're a good reference for how not to do things :)

Categories : GIT

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

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

Random access to an encrypted file and write encrypted data into a specific offset in Android
The whole file has to be re-encrypted, with a new initialization vector, every time it is changed. Any other approach is insecure. ECB mode supports random access without re-encryption, but ECB does not satisfy the "secure" requirement per se. CBC mode does not support random access. CTR mode does support random access, but you must never use it this way, because it counts as nonce reuse, which results in plaintext recovery.

Categories : Android

Custom ClassLoader uses secret key to decrypt pre-encrypted class files (which had been encrypted with the secret key)
You already answered your own question: Your decrypting class loader still has to call defineClass. Anyone can launch your app launcher in their own class loader and simply hand your app launcher a version of java.lang.ClassLoader that will write out anything that is passed to defineClass. There is no way around defineClass (aside from native code, I suppose). If you are so worried about your classes being decompiled you're better off with an obfuscator (ProGuard or the like) or possibly an ahead of time native compiler (GCJ, Jet).

Categories : Java

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

How to resize image automatically on browser width resize but keep same height?
You should learn about the Media queries for CSS. The site you referring to is using the same. The site is basically using the different CSS everytime the browser window size is changining. Here's the link for samples http://css-tricks.com/css-media-queries/

Categories : HTML

HTML resize height based on width without using $(window).resize()
This is function I wrote to do something similar. I wanted to make my side bar div that same height as my main content div. It may or may not help. function resetEqualHeight() { $(document).ready(function(){ var sideHeight, mainHeight, maxHeight; var sidebar = $("#sidebar"); var main = $("#main"); sideHeight = parseFloat(sidebar.css("height")); mainHeight = parseFloat(main.css("height")); if (sideHeight != mainHeight) { if (sideHeight < mainHeight) { maxHeight = mainHeight; } else { maxHeight = sideHeight; } maxHeight += 25; main.css("height", maxHeight); sidebar.css("height", maxHeight); } });

Categories : Jquery

JavaScript doesn't work until I resize the window then resize it back
Scripts should be enqueued for execution using wp_enqueue_script in functions.php file of your theme. This is the preferred method to enqueue scripts and style. http://codex.wordpress.org/Function_Reference/wp_enqueue_script Perhaps this might be preventing your script from being executed right from start.

Categories : Javascript

Highcharts charts don't resize properly on window resize
I forked your fiddle to a working solution @ http://jsfiddle.net/AxyNp/ The most important code snippet from there is this: $(window).resize(function() { height = chart.height width = $("#chartRow").width() / 2 chart.setSize(width, height, doAnimation = true); }); The solution bears on this SO post's answer. It seems like the best you can do to resize the chart's container (and cell) properly is to rely on your own resize trigger. Note that I set the reflow to "false" in the chart's options to remove the existing trigger.

Categories : Highcharts

how to resize image as we resize browser window
Use the resize event as describe in (plain Javascript) Javascript window resize event or (jQuery) How can I detect window size with jQuery?. Then set the image size you want.

Categories : Javascript

How to resize Listview and TreeView with window resize wpf
Basically, the last "column" in your GridView is filling the remaining space in your window? And it is not actually a column, but just empty space? If that is the case, you should check out the answer for WPF : Extend last column of ListView's GridView I would personally ditch the ListView/GridView, however, and use the DataGrid (if you are using .net 4 or greater).

Categories : Wpf

resize wrapper/mask on browser resize
This doesn't really require javascript. I would put in a media query (when you switch to your mobile styling) that sets your #wrapper, #mask and #item1 to: height: auto !important;

Categories : Javascript

iFrame resize to content on page resize.
This project on Github does what your after. https://github.com/davidjbradshaw/iframe-resizer Without seeing your code I expect the issue is your using scrollHeight rather than offsetHeight.

Categories : Jquery

Jquery - Resize mask when browser resize?
Currently, you are using some javascript which sets the absolute window size to the #mask div. That is causing your problems - you should use CSS instead. To override the useless properties set by your javascript, you can use !important. Simply add #mask { width: 100% !important; height: 100% !important; /* other stuff */ } into your stylesheet and it will work fine. Or, to avoid using the !important ugliness, just remove the troublesome piece of code from your script, and the CSS will work even without being !important. // THIS IS THE BAD CODE YOU SHALL REMOVE var maskHeight = $(document).height(); var maskWidth = $(window).width(); $('#mask').css({'width':maskWidth,'height':maskHeight});

Categories : Jquery

How do I resize a UIView and force its subviews to resize
Since you are using not putting the view inside scrollview directly from the xib, the IB doesn't provide the options to give constraints that has anything to do with superview. You might have to add the constraints programatically.See here. EDIT: Also try using the below on the view (haven't tried, should work according to documentation, but not sure with auto-layout): self.view.autoresizesSubviews = YES; Or if you don't want to use auto layout at all then the earlier method of setting the view to expand (horizontal/vertical) in the size inspector would do. For this you have to disable auto-layout. Select xib-> File Inspector -> Uncheck auto-layout checkbox

Categories : Objective C

jquery resize only firing sometimes on window resize
the document and the window are not the same thing : $(document).ready(function() { $(window).on('resize', function() { $('#wrapper').css('width', $(window).width()); $('#circle').css({ height: $(window).width() * 0.2, width : $(window).width() * 0.2 }); }).trigger('resize'); }); FIDDLE

Categories : Jquery

Resize event not working with div resize:both
You could use jquery ui to resize the div: $("#mydiv").resizable(); FIDDLE If you want to do something on window resize you need something like this: $(window).resize(function() { alert("DO SOMETHING"); }); And check this plugin too, I think that will help you!

Categories : Javascript

JQuery UI resizable Resize event bind/on resize event to Backbone View
Don't create the listeners from within the resizable call, use the events hash to listen for the changes, then you have direct access to your view from the callbacks. events : { 'resizestart' : 'start', 'resizestop' : 'stop', 'resize' : 'resize' }, render: function(){ ... //template and other stuff // JQ-UI resizable this.$el.resizable({ aspectRatio: true }); }, start: function(e, ui) { // alert('resizing started'); }, resize: function( event, ui ) { // this is the View var oldW = ui.originalSize.width; var newW = ui.size.width; var deltaWidth = newW - oldW; var deltaRatio = deltaWidth/oldW; }, stop: function(e, ui) { // alert('resizing stopped'); }

Categories : Javascript

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

jQuery is only loading on resize and I want it to load on both resize and page load
Just call "matchHeight" in your "ready" handler: jQuery.event.add(window,"resize",matchHeight); matchHeight(); Also that's kind-of a weird way to establish an event handler: $(window).resize(matchHeight);

Categories : Javascript

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

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

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

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 decrypt once I have encrypted?
First get the encrypted string : final String encryptedString = Base64.encodeBase64String(encrypted) and then decrypt using: cipher.init(Cipher.DECRYPT_MODE, secretKey); final String decryptedString = new String(cipher.doFinal(Base64.decodeBase64(encryptedString)));

Categories : Java

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

Pig Latin Partition By clause
What is the use of "Partition By" clause in Pig Latin? This allows you to set the Partitioner of your choice. Pig uses the default one i'e HashPartitioner except for order and skew join. But sometimes you might wanna have your own implementation to enhance the performance. Partition By helps there. Also please provide an example usage. DATA = LOAD '/inputs/demo.txt' using PigStorage(' ') as (no:int, name:chararray); PARTITIONED = GROUP DATA by name PARTITION BY org.apache.pig.test.utils.SimpleCustomPartitioner parallel 2; Does it allow only custom partition or allows partition by column? It is just to specify custom partitioners and not to partition directly based on some field. See PIG-282 for more details.

Categories : Hadoop

PARTITION BY doesn't work in H2 db
I don't think H2 supports window functions (aka analytic functions). However, you can do the query in the link using standard SQL: SELECT t.* FROM yourtable t join (select vendorname, max(incidentdate) as maxdate from yourtable yt group by vendorname ) vn on vn.vendorname = yt.vendorname ORDER BY vn.maxDate DESC, t.VendorName ASC, t.IncidentDate DESC; Although this should run in both environments, the over form probably performs better in SQL.

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

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

Partition an array with this algorithm
Say you start with an array a with length l. Then you should create two arrays lesser and greater with l-1 length (since all values could be smaller or larger than the pivot). double[] lesser = new double[a.length() - 1]; double[] greater = new double[a.length() - 1]; After that, it is simply (as in your exercise) copying the data to these arrays. Keep track of the length of both arrays like lesserlength = 0; greaterlength = 0; and incrementing that each time you insert a value. That way you know where you can insert the next value in lesser and greater. Eventually you can copy lesser into a new array of length l. double[] result = new int[a.length()]; You know that lesserlength + 1 + greaterlength == a.length() You can use System.arraycopy(source, srcpos, dest, dstpos, len) to

Categories : Java

Assigning a letter to OEM Partition
Partitions are storage units used to divide physical disks into smaller, independent parts. Basically they're containers for filesystems. Volumes are storage units with a filesystem. A volume can be inside a partition, but it's also possible for a volume to span multiple partitions. As for assigning a drive letter to that particular partition: you need to determine the type of the filesystem inside that partition first. GParted might prove helpful there. Windows can only mount FAT(32) and NTFS volumes. For other filesystems (like Ext2/3/4 or XFS) you're going to need 3rd party tools.

Categories : Powershell

Find partition size using df and awk
You can use sed instead of awk again: df -h | grep "/partition" | awk '{print $3}' | sed -e 's,[A-Z]$,,' Keep in mind that this (and your one-liner) does not print the size of the partition, but the size used.

Categories : Linux

SQL "over" partition WHERE date between two values
row_number() operates after where. You'll always get a row 1. For example: declare @t table (id int) insert @t values (3), (1), (4) select row_number() over (order by id) from @t where id > 1 This prints: 1 2

Categories : SQL

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

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

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++

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



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