w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Does it matter what I name a C file?
No, the source files can in principle be called anything. However, the name should reflect the contents of the file for readability. Header files also don't have to be called the same as the corresponding source files; they just should.

Categories : C

do the parantheses matter?
I believe that in the second test you are either forgetting to reset j to 1E4, or you meant to use an i in one of the loops. See this test: http://jsperf.com/bit-increment/2 I added a snippet using i in the first loop and j in the second and it performs just as fast as the first test.

Categories : Javascript

Why does it matter how I execute this code?
I'm sure you're right that it's to do with the delay between declaring the synthdef and it being ready. I'm not really experienced enough with sclang to immediately tell you exactly how you should change your code (I generally use scsynth via OSC, only using sclang to write SynthDefs), but you should be able to do something with the optional completionMsg argument to SynthDef.add.

Categories : Misc

mysqli_num_rows returns 1 no matter what
When you use COUNT(*) you always get one row returned even if the count is zero. You either: Want to remove the count(*) and then use mysqli_num_rows() or Get the result of count(*) . $row = mysql_fetch_assoc($query); echo $row['COUNT(`user_id`)'];

Categories : PHP

Does it matter where I put the declaration of a variable?
It's a micro-optimization. So no, performance wise, it doesn't really matter. Any difference in performance will be made irrelevant in practically all non-trivial programs. And it's entirely possible that an optimizer would convert the less efficient form to the more efficient form (don't ask me which is which). I'd prefer the first since it's slightly less code and limiting variable scope as much as possible is generally considered good practice. Actually, to be more similar to method 1, method 2 should look like this: Person person1 = null; foreach (string name in nameList) { person1 = new Person(); person1.fullname = name; } person1 = null; Because after the loop, person1 will still point to the object created in the last iteration, the garbage collector will only be able t

Categories : Performance

Does it matter which superview I add constraints to?
It does not matter if you add it to view A or to view B, so long as they meet the requirements you quoted from the documentation. There are not any implications that I am aware of, the layout is the same either way. The constraints are not necessarily added to the view that you explicitly add them to, according to the comments in the UIView header file (see excerpt below) they are typically installed at the closest ancestor to the views involved in the constraint (and a view is considered to be its own ancestor for this). Neither way is inherently more convenient than the other (unless you don't have a reference to A, in which case it is obviously more convenient to add it to B). It would depend on the setup of your application (what you have outlets for/references to, etc). Given that

Categories : IOS

Selecting the row of UITableView does not matter?
Set the UITableView delegate and implement this method: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { int rowSelected = indexPath.row; }

Categories : IOS

Does it matter where to run unit tests from?
It doesn't matter where your tests are run from if your tests are independent. I think your tests are dependent on the data setup by a different test. Make sure that your transactional fixtures are enabled.

Categories : Ruby On Rails

why does the order of arguments matter in here?
It's up to the program to decide what to do with the command line inputs it is given. Most programs don't care what order they are given because they are functionally distinct. But where some flags can optionally affect others the easiest way to implement it is through input ordering. ffmpeg is one such program. Its man page says: As a general rule, options are applied to the next specified file. Therefore, order is important, and you can have the same option on the command line multiple times. gcc is another program that can catch you out; its man page says: You can mix options and other arguments. For the most part, the order you use doesn't matter. Order does matter when you use several options of the same kind; for example, if you specify -L more than once, the directories

Categories : Shell

getBufferStrategy(); or createBufferStrategy(2/3); Which comes first? And does it matter?
The first example is the correct usage. There's no practical reason I can think of for creating a local bufferstrategy field every time render is called.(as in the second example) Creating a bufferstrategy and assigning it to a field (like in your first example) should only be done once, outside the render function.

Categories : Java

ScrollViewer is sizing over everything no matter what I do. :(
Need to constrain the TabControl <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"     Title="Window2"> <Grid ShowGridLines="False"> <Grid.RowDefinitions> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <TabControl Grid.Row="0" Grid.Comlumn="0"/> </Grid> </Window&g

Categories : Wpf

PHP Namespace, Do Directories Matter?
In simple terms, namespaces are ways of naming resources in a way to avoid comflicts, so yes you can extend a namespace based on another. However, you must still include the file for PHP to use it. Namespacing does not necessarily automatically include files for you. Namespacing and a registered autoloader will do that for you.

Categories : PHP

cursor wont return a row no matter what
If i'm not mistaken you have your problem on the query String[] fields = new String[]{ExpDataBase.COLUMN_ID}; Cursor cursor= database.query(ExpDataBase.TABLE_NAME, fields,ExpDataBase.COLUMN_ID+"="+id, null, null, null, null);

Categories : Java

Why does the order of alternatives matter in regex?
The regular expression engine tries to match the alternatives in the order in which they are specified. So when the pattern is (foo|foobar)&? it matches foo immediately and continues trying to find matches. The next bit of the input string is bar& b which cannot be matched. In other words, because foo is part of foobar, there is no way (foo|foobar) will ever match foobar, since it will always match foo first. Occasionally, this can be a very useful trick, actually. The pattern (o|a|(w)) will allow you to capture w and a or o differently: Regex.Replace("a foobar& b", "(o|a|(\w))", "$2") // fbr& b

Categories : C#

Does the order of xmlns elements matter
According to the current version of the XML specification, the order of attribute specifications in a start-tag or empty-element tag is not significant. So no, it shouldn't matter, assuming that the system which eventually reads your XML is compliant.

Categories : Dotnet

IE conditional statment not working no matter what I do
The problem you're having is that conditional comments do not work, and are deprecated, in Internet Explorer 10. References: 'Microsoft drop conditional comments in IE10.'

Categories : HTML

Does the order of index creation matter
Short answer - no, it doesn't matter. MySQL will try to pick the best index to use regardless of whether the column appears first or second in your WHERE clause. You can prove this by running an EXPLAIN statement on each one to get more information about how MySQL will execute the query - it should show that the same index is used in both cases. If you're talking about the order the columns appear in the index - (x,y) vs (y,x), it also doesn't matter in this case since you're selecting using both columns. If you sometimes select on just one of the columns though, that column should appear first in the index so MySQL can use the partial index to help optimize the query when only one value is provided.

Categories : Mysql

Does the order of CSS gradient definitions matter?
When dealing with prefixed CSS, the defined correct answer is always put the prefixed versions first, followed by the un-prefixed version. So -webkit-whatever and -moz-whatever must come before plain old whatever, and the plain unprefixed version must be specified (even if it isn't supported by any browsers yet). This is important because the last defined version that is recognised by the browser is the one that is used, and it is preferable for the browser to use the un-prefixed "standard" version if it understands it. Above the un-prefixed version, the order of individual prefixed versions like -moz-, -webkit-, etc is generally unimportant -- any given browser should only ever recognise one of them, so it doesn't matter what other they're in. A common answer to this is to put them in

Categories : CSS

Why does section order matter in the app.config
The order of sections doesn't matter in general, it's only the configSections element that must be first. From MSDN: If the configSections element is in a configuration file, the configSections element must be the first child element of the configuration element. I assume this is because sections need to be declared before they can be used.

Categories : C#

No matter what I do I can't get my Javascript files to run on PhoneGap
onload is some code that is run, not the name of a function. For that reason, you need parentheses after the function name. <body onload="onLoad();"> Also, while it shouldn't cause a problem, a elements go in the body, not in the head, so you should probably remove this: <a href="myapp.js"></a>

Categories : Cordova

opening descriptor and closing , why does it matter?
A file descriptor has only one position which is used both for writing and reading. When you write to the file in line 4 the position is advanced past what was just written, so the descriptor's position is at the end of the file. Calling close and open has the effect of resetting the position to the beginning of file (among other things). You could replace the calls to close and open with lseek(fd, 0, SEEK_SET) to have the same effect, without closing and reopening the file. Also, you should not mix the stdio functions scanf, printf and low level functions such as write. The results of the program will be unpredictable because of buffering in the stdio functions.

Categories : C

Php if else logic Block runs no matter what?
Did you mean to say $new_ip instead of $current_ip in your if statement? $current_ip doesn't appear to be set anywhere -- if that is the case $current_ip will always be unset and will never be equal to $old_ip.

Categories : PHP

PHP CURL timing out , no matter what timeout is
I suspect your IIS server (or the server you're running the script on) has no route to the AkamaiGHost server - this could be a firewall issue, DNS issue, or some other connectivity problem (perhaps the AkamaiGHost is not setup to listen to requests from your server?). You should check that you can make outgoing requests on the server. Try logging onto the server that the script is being run on, and ping the AkamaiGHost server -if that works try a command line curl (not SSL) - if that works then your problem could well be due to something interfering with outgoing connections on the SSL port (443) - such as your firewall.

Categories : PHP

jQuery Code runs no matter what
Here's your conditional: if(data == 0) { And here's what your AJAX call returns: echo 'No change: 0'; The conditional evaluates to false because 'No change: 0' doesn't equal 0.

Categories : PHP

Order of declaration does not matter for a struct?
Yes the order absolutely does matter. Re-order your code such that the definition of struct emp appears before the function prototype for f. #include <stdio.h> #include <stdlib.h> struct emp{ char name[20]; int age; }; void f(struct emp); ... gcc is actually trying to tell you that you did things in the wrong order, however the compiler messages are a little bit confusing if this is your first time reading through them. These two warnings: hello2.c:3:15: warning: ‘struct emp’ declared inside parameter list [enabled by default] hello2.c:3:15: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] indicate that the type of 'struct emp' was not known at the time gcc compiled line 3 of your file. The c

Categories : C

order by DAY no matter the year or month
select col1, col2, col3, col4 from ( SELECT C.Class_Name as col1, P.Person_First_Name as col2, P.Person_Last_Name as col3, P.Date_Of_Birth AS col4, DAYOFMONTH(Person.Date_Of_Birth) as ordCol FROM Person as P INNER JOIN Customer as C ON P.[Person _ID] = C.Person_ID WHERE MONTH(P.Date_Of_Birth)=Month(@d) ) tbl ORDER BY tbl.ordCol

Categories : C#

Cannot get browscap to load on OSX no matter which version I use or where I put it
I wonder what kind of valuable information you expect to get from this function. But whatever it is, please be advised that it is considered bad practice, because you are essentially practicing server based client sniffing, and the only base of information is the user agent string, which can be anything and does not need to represent the real situation. Also, information like "javascript" can only represent the coded ability of the client, not the current configured abilities, which can be less. If you still think the function to be of any use, you have to solve the task of getting a copy of that "browscap.ini" file this function wants to use, and you have to constantly update this file to include new browser versions. There is a link to a file source on the documentation page of get_br

Categories : PHP

Why does the order of static members in java matter?
The order of static members in a Java class is irrelevant. The code is compiled the exact same way. Also, your example is essentially meaningless because you're merely changing variable names for two identical classes. EDIT: Since you changed your question, I will point you to ykaganovich's answer regarding the assigning of pre-declared reference variables to each other. Your original question is answer in my paragraph above.

Categories : Java

How to show the DrawerLayout when sliding from left to right, no matter where?
Using this project SlidingMenu you can achieve that effect and integrate with ActionBarSherlock. To slide the menu from left to right just customize the menu when creating it and add: slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN); Hope this helps.

Categories : Android

The "Hide div before scrolling" codes does not work no matter what
Try using vanilla js instaead of $(window).scrollTop() try window.scrollY > 190 for the complete function I would use toggle too so: jQuery //Use jQuery to make sure we are using correct function jQuery(window).on('scroll', function () { var el = jQuery('#medfolg'); if (window.scrollY > 100) { el.show(); //Use this to toggle element visibility } else { el.hide() } }); HTML <div style="display:none" id="medfolg"> <ul> <li><a href="#">Home</a> </li> <li><a href="#">Tutorials</a> </li> <li><a href="#">Articles</a> </li> <li><a href="#">Inspiration</a>

Categories : Javascript

long and double assignments are not atomic - How does it matter?
It makes a difference if SharedInt or SharedLong are going to be accessed simultaneously. As you said, one thread may read a stale int, or a stale or corrupted long. This could be important if the value was being used to reference an array. Or with display in a GUI. How about writing some values over a network and sending bad data. Now clients are confused or crashing. Incorrect values could be stored to a database. Repeated calculations could be corrupted... As you requested in comments, For long specifically: Long values are frequently used for time calculations. This could throw off loops where you are waiting for an amount of time before performing some operation, such as a heartbeat in a networking app. You could report to a client synchronizing clocks with you time was 80

Categories : Java

Should the order of import statements matter when importing a .so?
The order of import statements matter. As documented in the python language reference: Once the name of the module is known (unless otherwise specified, the term “module” will refer to both packages and modules), searching for the module or package can begin. The first place checked is sys.modules, the cache of all modules that have been imported previously. If the module is found there then it is used in step (2) of import. Any module can change: sys.modules - the cache of all modules previously imported sys.path - the search path for modules And they can change import hooks as well: sys.meta_path sys.path_hooks sys.path_importer_cache The import hooks can provide you the ability to load modules from zip files, any kind of archive files, from the network, etc. import

Categories : C++

CSS border specification matter in content height
There are default margins in your p element that are collapsing with your article element. When you add a border to your article, it prevents that collapse from happening and causes it to contain the p element and its default margins. Your .9746589% padding is applied in both situations, but since you put it on .content it isn't actually affected by the margin collapse between its article and the p that's inside it. If you were to remove that as well as the border, though, then the margins would collapse across all elements and the green background would completely disappear. In other words, just like how your border is blocking margin collapse between article and p, your padding is also blocking margin collapse between .content and article and its contents. Lastly, margins only collapse

Categories : HTML

How to use YAML front and back matter in Ruby?
I just came across a nice example of something similar to what I am trying to do. It isn't necessarily an example of "front/back matter" but it might help someone in the future: Using the __END__ keyword, you can stop ruby from parsing the rest of the file. The rest of the file is stored in a DATA variable, which is actually a File object: #!/usr/bin/env ruby %w(yaml pp).each { |dep| require dep } obj = YAML::load(DATA) pp obj __END__ --- - name: Adam age: 28 admin: true - name: Maggie age: 28 admin: false Source

Categories : Ruby

CURTIME returns 2 hours ahead no matter what
From Mysql: The value is expressed in the current time zone. If you want it to display in your timezone, you need to convert it to the timzeone you want to do something like this Documentation: select convert_tz(now(), @@global.time_zone, '-5:00'); select date(convert_tz(now(), @@global.time_zone, '-5:00')); select time(convert_tz(now(), @@global.time_zone, '-5:00')); # The second value gets the time of the server so it knows what to convert from. # The third value is your timezone you want to display # It can either be an offset, or name (if table is installed): # 'UTC', 'PST', 'MET', and so on

Categories : PHP

Does the length of a CSS class or ID matter for file size?
Of course it matters. CSS is a text format; a CSS file is as large as the number of characters it contains. But the length of your selectors doesn't make a very appreciable difference, unless you have lots and lots of selectors with long class names. If you're concerned about file size, you can minify your stylesheet to strip whitespace and comments, as well as serve it in a compressed format. That will usually yield a much more significant reduction than simply shortening your class names and IDs. Just focus on making your class names brief yet readable.

Categories : CSS

Hash a string in Java/PHP no matter the language
This might help. public static String SHA(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException { MessageDigest md; md = MessageDigest.getInstance("SHA-256"); byte[] md5 = new byte[64]; md.update(text.getBytes("iso-8859-1"), 0, text.length()); md5 = md.digest(); return convertedToHex(md5); }

Categories : Java

Modify all columns in a table to 'not null' no matter what
A quick way is to write your alter statements into a file select concat('ALTER TABLE ', c.TABLE_NAME, ' CHANGE ', c.COLUMN_NAME, ' ', c.COLUMN_NAME, ' ', c.COLUMN_TYPE, ' NOT NULL;') as alter_statement into outfile '/tmp/alter.txt' from information_schema.COLUMNS c where c.IS_NULLABLE = 'YES' and c.TABLE_SCHEMA = 'your_database_name'; Then execute the file's content source /tmp/alter.txt and you're done... Tested it in a playground DB and it worked for me, still you might want to double check the file before executing :) P.S.: I haven't checked how NULL values are handled. IIRC you have to have a default value? Not sure right now. Please test this before using it. EDIT 1: To have one statement per table: select concat('ALTER TABLE ', c.TABLE_NAME, GROUP_CONCAT(' MODIFY COLUMN ',

Categories : Mysql

fill div height on the browser no matter its content
Following should give you what you need (http://jsbin.com/osiviq/1/): body, html { margin:0; padding:0; height:100%; background-color:grey; } #container { width:90%; background-color:white; } #yellow { float:left; width:30%; background-color:yellow; } #green { height: 100%; position:relative; margin-left: 50%; background-color:green; } Update: Add the following at the top of your css (Copied this from one of my old sites): html, ADDRESS, APPLET, AREA, A, BASE, BASEFONT, BIG, BLOCKQUOTE, BODY, BR, B, CA

Categories : HTML

Does it matter where in a unit I put the $R directive to include a resource?
Doesn't matter. The code and the resources do not affect each other (unless you try to load a resource that doesn't exist, but that's a completely different issue). Having said that, I prefer to have all options at the top.

Categories : Delphi



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