w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Converting a program that was set to use MyISAM to INNODB instead
There are several differences between MyISAM and InnoDB, nicely described in this discussion: http://dba.stackexchange.com/questions/1/what-are-the-main-differences-between-innodb-and-myisam The only aspect which could prevent the use of InnoDB would be the full text search capabilities of MyISAM, which were introduced in InnoDB with version 5.6 of MySQL. So if your program does not make use of full text search, or if your MySQL version supports full text search with InnoDB, there is no real obstruction. Given the small size of the database, and assuming a small traffic as well, I would not expect any substantial difference in terms of performances.

Categories : Mysql

Copy MyISAM tables from Solaris to Linux
As long as both servers are the same architecture you should be all right, otherwise you will need to use mysqldump. See: Copying MySQL Databases to Another Machine

Categories : Mysql

Incorrect data in MyISAM database due to concurrency
Is MyISAM unsafe to this point No. mysql_insert_id guaranteed to return the right value only. or is there another explanation that I overlook ? Most likely. Check your code.

Categories : PHP

Commit and Rollback not work in Mysql's MyISAM
MyIASM is not support the rollback and commit, you need to use the InnoDB for that. Difference b/w Innodb and MyISAM: First major difference I see is that InnoDB implements row-level lock while MyISAM can do only a table-level lock. You will find better crash recovery in InnoDB. However, it doesn't have FULLTEXT search indexes, as does MyISAM. InnoDB also implements transactions, foreign keys and relationship constraints while MyISAM does not. The list can go a bit further. Yet, they both have their unique advantages in their favor and disadvantages against each other. Each of them is more suitable in some scenarios than the other. So to summarize: InnoDB has row-level locking, MyISAM can only do full table-level locking. InnoDB has better crash recovery. MyISAM has FULLTEXT search i

Categories : PHP

MySQL query performance issue with MyISAM table
SELECT b.destination , b.release_cause_protocol_stack , b.binary_value_protocol_stack , b.release_cause FROM billing_datas b JOIN carriermasters customer ON b.carrierid_customer = customer.id JOIN technicalprofiles tpc ON b.technical_profileid_customer = tpc.id JOIN trunks kc ON b.origination_trunkid = kc.trunk JOIN carriermasters supplier ON b.carrierid_supplier = supplier.id JOIN technicalprofiles tps ON b.technical_profileid_supplier = tps.id JOIN trunks ks ON b.supplierid = ks.trunk WHERE b.start_time_date BETWEEN '2013-08-02 00:00:00' AND '2013-08-02 23:59:59' AND customer.id IN (99, 100, 101) AND tpc.id IN (83, 274, 84, 416) AND kc.trunk IN (90409, 90310, 30230, 30313) AND supplier.id IN (214, 215, 59,

Categories : Mysql

MyISAM and InnoDB Table locking issue when queried together
The whole table_c (MyISAM) will be locked in "read mode" during the course of your query. This means that concurrent reads on this table will be possible, but concurrent writes will be held. If a single write is put on hold, then all subsequent reads will also be put on hold (unless they are issued in HIGH_PRIORITY). The other two InnoDB tables will exhibit a very similar behaviour, but possibly not on the full tables. Only "some" rows will be locked if a suitable index can be used to honor the match clauses and the JOIN conditions (it is still possible that the whole tables become locked if table scans are required -- if no suitable index can be used, that is).

Categories : Mysql

Conversion myisam to innodb gives "table already exists" on (almost) all tables
To be fair, the solution is inspired by one of the last entries in the thread indicated by #takteek. Deciding the problem was probably a duplicate table (the original in MyISAM, and probably some tables in InnoDB, left over from previous experiments), I decided to use the sledgehammer approach: DROP DATABASE yyy; Reinstated the MyISAM database from a backup (Stopped the server, untarred the database archive, restarted the server). then did the ALTER TABLES xxx ENGINE InniDB on each table I generally dislike such dramatic solutions, as they give the feeling there are tools (or knowledge) lacking. In this case, I couldn't find a way to confirm or confirm the spurious tables, or a way to selectively drop those tables. Anyway, maybe this helps someone.

Categories : Mysql

Which MySQL DB engine (MyISAM vs InnoDB) for very busy tables?
As you yourself said that MyISAM tables use table-level locking. So if the traffic is high InnoDB will be the right choice. With MyISAM, only one user can interact at a time. You have to make sure that your hardware can keep up with these traffic to avoid being overrun. That suggests to me you would need a storage engine which supports row-level locking, i.e., InnoDB.

Categories : Mysql

mysql MyISAM vs NDB storege engine for heavy reads
It supports joins of course. Speed of joines will rely on indexes and columns you are joining by... As far as my practice with NDB it is much better, the 'next generation' from myisam :) Not just it is faster, but you can have multiple nodes, inserting/writing at the same time in backend files/processes... Only floe is that it doesn't support transactions, but myisam doesn't support too, so you better avoid 'heavy' updates or deletes. You can check the comparisons here Hope I helped :)

Categories : Mysql

Can i use some tables with InnoDB engine and some with MyIsam on my MySQL database?
Yes you can, but I'd go with InnoDB only unless there is some serious performance bottleneck same question on SO MySQL forum

Categories : Mysql

Can I reduce ibdata1 file size by converting table to MyISam?
No. Dropping the InnoDB table will free up space within the InnoDB tablespace (ibdata1 file), but it will not shrink the ibdata1 file. The exception is that if the table was created while the server innodb_file_per_table variable was set, then the table will be in its own separate InnoDB tablespace (datafile), and when the table is dropped, the space used by the table will be released. See: 14.3.3. Using Per-Table Tablespaces http://dev.mysql.com/doc/refman/5.5/en/innodb-multiple-tablespaces.html

Categories : Mysql

Partitioning of table in mysql for MYISAM eninge based on year
As the error message advises: A PRIMARY KEY must include all columns in the table's partitioning function Your partitioning function refers to j_id and g_d while your primary key only covers j_id. By the way, your UNIQUE constraint is useless (UNIQUE KEY(j_id, g_d)) because j_id is already unique by definition (it is primary key). In fact you probably want your primary key on (j_id, g_d)

Categories : PHP

Large InnoDB data size even though entire database is MyISAM?
disambiguation: "Data size" is not "Buffer pool". Data Size is the size of database files on disk. It can be configured via the innodb_data_file_path server option. Buffer Pool is the memory (RAM) space used as a buffer for InnoDB tables data and indexes. Its configuration option is innodb_buffer_pool_size. First, make sure there is no InnoDB table at all in your instance: SELECT * FROM information_schema.tables WHERE engine='InnoDB'; Then if there is indeed no InnoDB table, you can rebuild the InnoDB tablespace from scratch (only way to reduce the table space, this is an annoying missing feature of MySQL). Even if there are InnoDB tables, you can still rebuild the tablespace to reclaim some unused space (see also this answer for more information). Notice you cannot set innodb_buf

Categories : Mysql

Emulate MyISAM's composite primary key with an autoincrement behavior in InnoDB
It's a neat feature of MyISAM that I have used before, but you can't do it with InnoDB. InnoDB determines the highest number on startup, then keeps the number in RAM and increments it when needed. Since InnoDB handles simultaneous inserts/updates, it has to reserve the number at the start of a transaction. On a transaction rollback, the number is still "used" but not saved. Your MAX(id) solution could get you in trouble because of this. A transaction starts, the number is reserved, you pull the highest "saved" number + 1 in a separate transaction, which is the same as that reserved for the first transaction. The transaction finishes and the reserved number is now saved, conflicting with yours. MAX(id) returns the highest saved number, not the highest used number. You could have a MyISAM

Categories : Mysql

Will switch to MyISAM Engine help to improve the speed of reading operations?
I think you should stick with your current setup. InnoDB is supposed not to lock the table when inserting rows, since it uses the MVCC technique. On the other hand, MyISAM locks the entire table when new rows are inserted. So, if you have many writes, you should stick with InnoDB.

Categories : Mysql

Using a Mysql Trigger to break down a URL Field and store it's parts in a MyISAM Table
DELIMITER // DROP TRIGGER IF EXISTS url_trigger_before_insert // CREATE TRIGGER url_trigger_before_insert BEFORE INSERT ON url_table FOR EACH ROW BEGIN DECLARE no_proto CHAR; SET NEW.scheme = SUBSTRING_INDEX(NEW.url, ':', 1); SET @no_proto = REPLACE(NEW.url,CONCAT(NEW.scheme,'://'),''); SET @no_proto = SUBSTRING_INDEX(@no_proto, '/', 1); SET NEW.subdomain = SUBSTRING_INDEX(@no_proto, '.', 1); SET NEW.host = SUBSTRING_INDEX(@no_proto, '.', -2); END // DROP TRIGGER IF EXISTS url_trigger_before_update // CREATE TRIGGER url_trigger_before_update BEFORE UPDATE ON url_table FOR EACH ROW BEGIN DECLARE no_proto CHAR; SET NEW.scheme = SUBSTRING_INDEX(NEW.url, ':', 1); SET @no_proto = REPLACE(NEW.url,CONCAT(NEW.scheme,'://'),'');

Categories : Mysql

Equivalent of "GoTo" in Google Apps Script (equivalent VBA-GAS )
You don't need GoTo, most people would argue that it is terrible programming practice to use it even when it is present. Using other control structures will do the job. if() { } else if() { } else { } for(;;) { continue; break; } while() { } do { } while(); switch() { case: default: } // for errors throw "Error string" try { } catch(error) { } You'll have to shuffle your logic around a bit, but it will result is better more maintainable code.

Categories : Javascript

Is there a C++ equivalent (or equivalent technique) of Perl's __DATA__ segment?
There’s nothing like that in general. However, the Linux ELF binary format allows the inclusion of data files via the GNU tool objcopy. On Windows you can use resource files and assign the linker to include those in the executable. OS X conventionally uses application bundles to achieve a similar effect.

Categories : C++

Is e1 && e2 equivalent to e2 && e1?
Logically, yes. e1 && e2 will never have a different result than e2 && e1 from a logical standpoint. But from a code standpoint, if evaluation of e1 or e2 has side effects, then no, they are not completely equivalent. Specifically, sometimes people use functions in a chain of &&. if( isHungry() && hasFood() ) eat() ; Usually you would want to put the cheapest to evaluation condition first, and only check the 2nd condition if the first condition held up as true. Short circuit evaluation is what guarantees this will happen. If the 1st condition in an AND logical operation is false, then the 2nd statement isn't even evaluated, because the end result won't be TRUE anyway (FALSE && (TRUE && TRUE && TRUE && TRUE)) == FALSE

Categories : C

d3.js equivalent to $(this)
It turns out d3.select(this) is the correct answer. Code now is : var buttons = svg.selectAll(".button"); buttons.on("click",function(d){ var target = $(this).attr('target'); var visible = $(this).attr('visible'); if(visible==='1'){ svg.selectAll(".bar."+target).transition().duration(500).ease("elastic").style('display','none'); d3.select(this).attr('visible','0').style('text-decoration','line-through'); }else{ svg.selectAll(".bar."+target).transition().duration(500).ease("elastic").style('display','inline'); d3.select(this).attr('visible','1').style('text-decoration',''); } });

Categories : Jquery

Vb.net equivalent of C#
Simple convertion should do it : Dim model = New PlotModel("MouseDown HitTestResult", "Reports the index of the nearest point.") Dim s1 = New LineSeries() s1.Points.Add(New DataPoint(0, 10)) s1.Points.Add(New DataPoint(10, 40)) s1.Points.Add(New DataPoint(40, 20)) s1.Points.Add(New DataPoint(60, 30)) model.Series.Add(s1) s1.MouseDown += Function(s, e) model.Subtitle = "Index of nearest point in LineSeries: " & Math.Round(e.HitTestResult.Index) model.InvalidatePlot(False) End Function Sources : http://www.developerfusion.com/tools/convert/csharp-to-vb/

Categories : C#

equivalent tr of CSS?
The clear property will do this for you. You can add it to your #container for example: #container { display: table; clear:both; } Clear means something like: clear all elements on both sides of this element

Categories : CSS

VB Equivalent of "To" in C#
I think what you're looking for is this: System.Array.Resize(ref indexCorr, fDefMatchs.Length); However, in .NET you cannot set the lower bound of an array. From the documentation: Arrays are zero indexed: an array with n elements is indexed from 0 to n-1.

Categories : C#

JS equivalent to C++ .at()
You can use the in operator: if("bar2" in foo) { //do stuff with foo['bar2'] } or you can check to see if foo['bar2'] is undefined: if(typeof foo['bar2'] !== "undefined") { //do stuff with foo['bar2'] } Also, what you're working with are objects and not arrays (well, they're associative arrays, but also objects in JavaScript).

Categories : Javascript

What is the equivalent CSS in IE7?
Although you mention not wanting to use an IE7 hack, here is a valid way of creating IE7 only styles without adding additional style sheets, this will solve your problem, add the following code <!--[if IE 7 ]> <html class="ie7"> <![endif]--> <!--[if !(IE 7)]><!--> <html> <!--<![endif]--> in place of your usual html tag. You can then use: .ie7 .css-selector { to target any element in ie7 only. For full disclosure, this works for all versions of ie if you use conditional comments such as: <!--[if lt IE 7 ]> <html class="ie6"> <![endif]--> <!--[if IE 7 ]> <html class="ie7"> <![endif]--> <!--[if IE 8 ]> <html class="ie8"> <![endif]--> <!--[if IE 9 ]> <html cla

Categories : HTML

TFS equivalent of "hg cat"?
TFS needs a workspace to have a mapping between the server repository and your local machine. If you already defined a workspace that includes $/dev/components/log.zip, then switch to that folder in the command line tool. If you want to get the file to the folder where you are at the moment, you need to create a new workspace. This can be done in Team Explorer or by using tf.exe: tf workspace /new logZipWs /collection:http://tfsserver:8080/tfs/DefaultCollection Now you have a workspace, but you need to map the server path to the local folder: tf workfold /map $/dev/components . /collection:http://tfsserver:8080/tfs/DefaultCollection /workspace:logZipWs Now your command should work. But the creation of workspaces is much easier using the Team Explorer. When you're done, make sure yo

Categories : Tfs

What is the equivalent of @Value in CDI world?
CDI is a specification about Dependecy Injection and Context so it doesn't have such configuration things out of the box. But it also provides a very powerful extension mechanism that allows third party projects to add new portable features (i.e that works with all CDI implementation and that are not tied to a server). The most important project providing CDI extensions is Apache Deltaspike and good news, it provides what you need. So you need to add deltaspike-core in your project. If you use Maven, you need to add this dependencies to your pom.xml <dependency> <groupId>org.apache.deltaspike.core</groupId> <artifactId>deltaspike-core-api</artifactId> <version>0.4</version> </dependency> <dependency&g

Categories : Java

set a tag equivalent for UIImagePickerController
Keep a reference to the different image pickers you have as properties. Then just compare their pointer values: if (picker == self.picker1) { // ... } else if (picker == self.picker2) { // ... } ... When you are done with the pickers, set their properties to nil to allow them to be cleaned up. If you really want to 'tag' them, you can use Objective-C associative references.

Categories : IOS

String(33, 0) in VB 6.0 and equivalent in C#
In VB6, that function creates a string that contains 33 characters, all of whom have zero ordinal value. Typically you do that because you are about to pass the string to some native function which fills out the buffer. In C# the closest equivalent to that would be to create a StringBuilder instance which you would then pass to the native code in a p/invoke function call. I think that a direct translation of that single line of code is not particularly useful. That code exists in context and I strongly suspect that the context is important. So, whilst you could create a new C# string with 33 null characters, what would be the point of that? Since the .net string is immutable, you cannot do very much of interest with it. In your VB6 code you will surely be mutating that object, and so St

Categories : C#

Is there an equivalent to C++'s std::vector in PHP?
Have a look at SPL datastructures. An example is http://www.php.net/manual/en/class.splfixedarray.php which is faster than normal array. http://www.php.net/manual/en/spl.datastructures.php

Categories : PHP

VB equivalent to powershell
Is smCmnd a string of shell commands? If so, you can call them directly from PowerShell, without trying to get a wscript.shell COM object to run them against like you'd need to do in VBScript. VBScript wasn't a shell. Powershell is. You can write shell commands directly in .ps1 or .ps2 files, just like in a batch file. I'm not a powershell expert here, but try doing & $smCmnd

Categories : Powershell

Is there an equivalent to cfdump in JSP
One approach I use is to set up your servlet container to allow debugging. You can then set up a breakpoint on the code in question. When you hit the breakpoint, your IDE will let you inspect all the variables in scope. It'll depend on the IDE and server you're using, but if you're using Eclipse and a server which Eclipse is managing, it's built-in: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.wst.server.ui.doc.user%2Ftopics%2Ftdbgjsp.html

Categories : Jsp

"net use * /delete" equivalent in C#?
Just use Process.Start System.Diagnostics.Process.Start("CMD.exe","/c net use * /delete"); If you insist on a managed code approach (why?) you can do something like: foreach(var letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ") { try { network.RemoveNetworkDrive(letter + ":"); } catch {} } or better yet (depending on how flexible you are with the required behviour), iterate on this instead: // assumes using System.IO var networkDrives = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Network)) foreach(var networkDrive in networkDrives) I'd still opt for just using Process.Start as being far cleaner and more reliable. Once you start down the road of re-implementing 'trivial' functionality you often quickly find out how non-trivial it really is. Further on why your q

Categories : C#

method_missing equivalent in R
tryCatch should be the equivalent of method_missing, if I've understood your question properly: tryCatch(foo(options, named=option1,...), EXCEPTION-CLAUSE-HERE)

Categories : R

Mootools equivalent of $.each
Array.each() should work according to the documentation: Array.each(['Sun', 'Mon', 'Tue'], function(day, index){ alert('name:' + day + ', index: ' + index); }); // alerts 'name: Sun, index: 0', 'name: Mon, index: 1', etc. It seems you just got the order of parameters in the callback wrong. It is fn(item, index, object)

Categories : Javascript

sed equivalent to PCRE's `.?`
Just now I mis-read your question, I thought you want to do .*? with sed. .. Ok, now I understand what you mean. In another question from you, I mentioned, for BRE, you have to escape those chars to give them special meaning. But for ERE, you have to escape chars which have special meaning to get literal string. You used -r, to let sed use ERE, but you escaped ?, it means, you want to match literal string ?. try this: sed -i.bak -r 's/(.?)aaa/1bbb/g' filename.ext or this: sed -i.bak 's/(.?)aaa/1bbb/g' filename.ext test: default with BRE kent$ echo "aaasdf xaaasdf"|sed 's/(.?)aaa/1bbb/' bbbsdf xbbbsd with -r, ERE: kent$ echo "aaasdf xaaasdf"|sed -r 's/(.?)aaa/1bbb/' bbbsdf xbbbsdf

Categories : PHP

What is the equivalent in apply_async?
I think your problem is: def unwrap_self_f(arg, **kwarg): return C.f(*arg,**kwarg) #here you call a CLASS method of C but you define it as a instance method: class C: def f(self, name): #self in here, so instance method print 'hello %s' % name return name Problem with multiprocessing is that you don't get your exceptions on stderr.

Categories : Python

vb6's mid equivalent for jquery
This can be simulated in several ways although there is no such specific function (splice is standard only on Arrays, not Strings). The easiest one-expression way I know of is with a String.replace when adding to a location "past the end of the string" is not required. Of course String.slice is also a perfectly valid approach, and may be arguably easier to understand. mystring = "__1__" // where 3 represents the "characters to skip before inserting" // and 1 represents the "number of characters to replace" midstr = mystring.replace(/([^]{3})[^]{0,1}/, "$1x") Neither the above nor a basic slice will work like the 2nd example without additional prepend-as-needed logic.

Categories : Javascript

Is there a vim equivalent to bash's '!$'?
Using :vsp with no arguments splits the current window. Not exactly what you're asking for, but I often use % which is the current filename: :e some_file :vsp % See :help cmdline-special

Categories : Bash

iOS equivalent to a stylesheet?
There's Appearence. You often see this being used for colours, but it also does fonts, sizes, and a few other things. Here's another good article from a well known source. Additionally, a common way to style/'skin' is by having different sets of background/button/... images. You can also style by parameterizing drawing code. Have a look at the fabulous tool PaintCode. Then, some companies do (part of the) UI in HTML/JavaScript. Another thing to mention in this context is iOS' Auto Layout

Categories : IOS



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