w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Message Centre Number, SMSC, ESME, SMPP
ESME and SMSC both are application installed on some machines (servers), SMS Message Centre Number is a phone number that acts as a gateway for transferring SMS messages between cellular devices.

Categories : Networking

SQL Select Count Values negativ positiv and zero values
You could; select DATE, SUM(case when value < 0 then 1 else 0 end) as NEGATIVE, SUM(case when value > 0 then 1 else 0 end) as POSITIVE, SUM(case when value = 0 then 1 else 0 end) as ZERO from T group by date

Categories : SQL

What happen when using as admin?
Both attr_accessible and :without_protection => true can be used to allow mass assignment on attributes of a model they are defined in. so its better to use which on of the following and what is the difference ? To answer this concern, I think using attr_accessible is better because you define exactly which attributes you want to allow for mass assignment compared to :without_protection => true which opens up all attributes in your model to be mass assigned. Usually, passing the :without_protection => true is okay if you know exactly what the user input is, for e.g. when seeding data. But for inputs that come from a form (user input) you want to specify exactly what is allowed for mass assignment. Hope this helps. Update: In the following statement, the as option

Categories : Ruby On Rails

What would happen if two IIS redirect to each other?
HTTP 301 is a status code not a request. It will be up to the browsers rather than the web server, as the web server would not "know" that you've been redirected back. Most browsers1 should detect a redirect loop and stop with an error. 1. I know this to be true with Chrome and relatively recent FF, no idea about IE...but I'd imagine this would be detected.

Categories : Iis

What happen to categories on the same name?
If a category overrides a method defined in another category, it is undefined what implementation will prevail. From Apple's Programming with Objective-C > Avoid Category Method Name Clashes: If the name of a method declared in a category is the same as a method in the original class, or a method in another category on the same class (or even a superclass), the behavior is undefined as to which method implementation is used at runtime.

Categories : Objective C

Nothing happen delete selected row
To make a change in your underlying database you need to execute the command (in your case the Delete command). The whole set of instructions for SqlDataAdapter are of no use in this case. for (int i = dvgPerpustakaan.Rows.Count - 1; i >= 0 ; i--) { DataGridViewRow dr = dvgPerpustakaan.Rows[i]; if (dr.Selected == true) { dvgPerpustakaan.Rows.RemoveAt(i); try { using(SqlConnection db = new SqlConnection(con)) using(SqlCommand dbcmd = db.CreateCommand()) { db.Open(); dbcmd.CommandText = "delete from Perpustakaan where KodeBuku=" + i; dbcmd.ExecuteNonQuery(); } } catch(Exception ex) { MessageBox.Show("Error"); }

Categories : C#

When I press submit nothing happen
In this line: <form ng-submit="submit()" ng-controller="Ctrl"> You configure to angular execute the submit() function at the controller, but you don't have this function declared. You just need to create the submit function at the controller: $scope.submit = function () { // Put you logic inside the method. } I create a plunker with your code working: Plunker

Categories : Angularjs

Does anything bad happen if an array(list) contains itself?
It gives a pretty interesting effect when you print things out: package com.sandbox; import java.util.ArrayList; public class Sandbox { public static void main(String[] args) { ArrayList anArray = new ArrayList(); anArray.add(anArray); for (Object o : anArray) { System.out.println(o); } } } This printed out: [(this Collection)] Other than that, I haven't figured out a way to break a program like this. I don't think there's anything wrong with it. As @wobblycogs mentioned, you have to be careful when you use recursion on the list, but that's not really a special case when you think about it. It's just a circular dependency, similar to how this code gives a stackoverflow: package com.sandbox; public class Sandbox {

Categories : Java

What are possible breaking changes can happen in dot net assembly
I don't know if I can give an exhaustive list, but whenever you change the semantics or functionality of a visible type or type member (like method, constructor, property, event, and so on), that will be a breaking change. A type or member is "visible" outside your assembly if it is public or protected (including protected internal), and all containing types (classes and structs that this program element "sits" inside) are also public or protected. Also, if you change the "formal" appearance of a member, like changing a field into a property, or changing the (return) type of a method, property, event, and so on, or changing the signature of a method, including changing optional parameters or their default values. Adding a new overload to an existing method could in some cases be a breaki

Categories : Dotnet

When should cache invalidation happen?
This depends on your specific requirements. The way I see it, you have 3 options: on change - when your entry gets edited, also delete the existing cache information (also make sure it gets re-created on request) periodically - have a cron job that runs once X time, and re-do the whole cache percent based (not sure how to call it) - when an entry is requested, do something like this: (basically below code means once in 1000 requests, the cache for the requested page is cleared) if (rand(1, 1000) == 666) { /** clear the cache for current requested page */ } /** handle request */ Depending on your traffic and amount of information you cache (probably other factors as well), any can be useful. #3 works great when you have a huge cache, while #2 is great with smaller caches that g

Categories : PHP

When does [UIAlert show] actually happen?
UIKit and core animation changes are processed and applied as part of the main run loop. When you call [alert show] the appropriate view hierarchy changes, frame changes, animations etc. are queued up in the system. When you return from your code the runloop will process these as part of the core animation transaction internals and you will see the changes on screen.

Categories : IOS

When can such errors on bind() happen?
Remember that sockets and bind can be used for more than network communication. See for example Unix domain sockets which are bound as files in a file system. It's even there in your own quoted list of errors: The following errors are specific to UNIX domain (AF_UNIX) sockets

Categories : C

Why when I click on the images does nothing happen?
You could use event delegation as follows: $('#list').on('click', '.delete', function(event) { event.preventDefault(); var reply = confirm("Are you sure you want to delete this todo item?"); if(reply === true) { $(this).closest('.item').remove(); } }); $('#list').on('click', '.edit', function(event) { $(this).closest('.item').slideDown('fast'); }); Another, and more efficient, option would be to define your click handlers and then assign them to the elements after creating them: var onDeleteButtonClicked = function(event) { //delete code from above. }; var onEditButtonClicked = function(event) { //edit code from above. }; function addTo(event) { event.preventDefault(); var toAdd = $('#addition').val(); if(toAdd.length > 0) {

Categories : Javascript

How can I control when my css transitions happen and when they don't?
You could move the transition to its own class as well. On page load, add the hidden class, then, after a timeout, add the transition class. The timeout, in this case, is to let the browser apply/render the opacity: 0 style of the hidden class immediately, without any transition timing. Once that has occurred, adding the transition class causes any further changes to use the transition timing when applicable. something like (jsfiddle): $(document).ready(function () { var buttons = $('input[type="submit"], input[type="reset"]').addClass('hidden'); window.setTimeout(function() { buttons.addClass('txclasshere'); }, 0); $('form').on( 'change input', ':input', function () { buttons.removeClass('hidden'); } ).on( 'reset',

Categories : Misc

Does anything bad happen when throwing from validateValueCallback?
I think you're fine throwing a more specific exception from your validation callback. Just reflecting over the WPF code, it looks like this pseudocode: if (!validateValueCallback(newValue)) throw new ArgumentException(); So, if your validation callback throws, I can't see how it would cause any issues.

Categories : Dotnet

Nothing happen with bower install
This happened to me as well. The reason was that I was following old tutorial that said bower's package file was components.json instead of bower.json. So bower was looking for later and as it couldn't find file it would just say nothing (it should actually show warning or error). When I renamed file to bower.json it all worked.

Categories : Node Js

In the Node.js REPL, why does this happen?
Node's REPL always sets _ to the result of the last line. > 2 2 > _ 2 > 2+2 4 > _ 4 > You need to use a different identifier: var u = require("underscore"); u.isEmpty

Categories : Node Js

why this happen in type conversion?
You have a typo in your converter. You misspelled the constructor param, so the assignment has no effect. Instead of: public DateConverter(String fomatStr) { this.formatStr = formatStr; } try: public DateConverter(String formatStr) { this.formatStr = formatStr; } There may be other issues, but at a minimum you'll want to fix that. I'm assuming you are using yyyy-MM-dd for your date format?

Categories : Java

Does all evaluation happen from left to right?
Yes, java will short circuit a conditional with the OR operator from left to right. At run time, the left-hand operand expression is evaluated first; if the result has type Boolean, it is subjected to unboxing conversion (§5.1.8). If the resulting value is true, the value of the conditional-or expression is true and the right-hand operand expression is not evaluated. If the value of the left-hand operand is false, then the right-hand expression is evaluated; if the result has type Boolean, it is subjected to unboxing conversion (§5.1.8). The resulting value becomes the value of the conditional-or expression.

Categories : Java

When will default argument promotions happen?
Default promotions will happen before the function is called, in the calling context. If you're really asking about the circumstances under which default promotions are carried out, that's covered in the excerpt, though it's such a tiny piece that it's easy to miss: "When there is no parameter for a given argument...". In other words, it's essentially identical to the situation in C, with the exception that a C-style function declaration that doesn't specify parameter types simply doesn't exist in C++. Therefore, the only time you can have an argument without a parameter specifying its type is when a function has an explicit ellipsis, such as printf: int printf(char const *format, ...);.

Categories : C++

Promotion to BigDecimal doesn't happen
Clojure hasn't auto-promoted to bigint since 1.2, which is like...three years ago? These days the default is for better performance, but you can get the auto-promoting behavior by using +' instead of +, *' instead of *, and so on.

Categories : Clojure

What implicit conversions happen with istream?
I don't think there is a bool operator==(istream&, int) available [...] so is there a conversion involved? Indeed. There is a conversion operator to bool that returns true if no errors occurred, and false otherwise. Per paragraph 27.5.5.4/1 of the C++11 Standard: explicit operator bool() const; 1 Returns: !fail(). So the expression (cin >> val) gives you back a (reference to) cin, which is the left operand of ==. The right operand is 0. Now cin can be converted to bool, and that allows the comparison with 0. In other words, your if statement is equivalent to: if (!(std::cin >> val)) { // ... }

Categories : C++

HTML doesn't get rendered, why does it happen?
You are probably using innerText or textContent to set the content of your div, which just replace the child nodes of the div with a single text node. Use innerHTML instead, to have the browser parse the HTML and create the appropriate DOM nodes.

Categories : PHP

When does unresolved merge conflict happen?
Generally speaking a source code configuration system (see eg http://en.wikipedia.org/wiki/Software_configuration_management) is used to keep track of source files (and other files) as a project progresses. When file versions are merged (see http://en.wikipedia.org/wiki/Merge_%28revision_control%29) some changes can be automatically merged, but some changes cannot hence the conflict warning. Generally such conflicts occur when two different changes have been made to the same line (or adjacent lines) when both changes are compared to a common ancestor version of the file.

Categories : Visual Studio 2010

INNER JOIN should happen only when a condition is fulfilled
Have you tried something like SELECT A.* FROM [dbo].[your_table] A WHERE EXISTS ( SELECT 1 FROM [dbo].[your_table_2] B WHERE A.City_Code = B.City_Code ) OR @a = 'All'

Categories : SQL

What happen if I use setInterval to call ajax every 3 second or less?
It could cause issues if the request takes longer to complete than your polling time. The duration of the request will depend on both your user's network speed and geographical location. Browsers will limit the number of concurrent requests, but they will keep queueing the new requests and the queue will grow to an unreasonable size, possibly slowing down or even crashing some browsers. There are better ways to achieve what you want to do. The most common and cross-browser (websockets could also solve this problem in modern browsers) way is to use long polling. With long polling you send a request as soon as you receive a response, so you are always polling continuously. The web server handles the process idling and repeated checks for new messages without generating a response until eit

Categories : Javascript

How does WebPageHttpModule happen to be registered after my modules?
The WebPageHttpModule module is registered using the RegisterModule method from the Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility class. Any module registered with this method will be registered after modules defined in the config file. You could try registering your own module using this method. However, there's no way to guarantee that your module will be registered last. In most cases, the order shouldn't matter.

Categories : Asp Net

What will happen if I have nested dispatch_async calls?
The dispatch_sync statement waits until the block it covers is executed completely. dispatch_async returns immediately and proceeds to the next line of code, so everything inside is happening in parallel. If queue was a serial queue created by yourself, then: Situation 1 - The root block returns immediately. Inside it waits for [self go....], and then goes to dispatch_async, which returns immediately as well. Situation 2 - If queue was a serial queue, then there would be a dead lock since it will wait for itself to finish executing. Since you are dealing with asynchronous one, that block will be executed in parallel. (Thanks, @Ken Thomases) Situation 3 - No need in dispatch_sync here. It causes the deadlock. Situation 4 - Waits for [self ...], then returns immediately. If you repl

Categories : Iphone

what will happen is i will use Application context on dialog?
Yes, In android there's only 1 "Context" per application, is what documentation calls as Application Context, is where pretty much every single component related to your activity lives, so it doesn't matter what activity context reference you are using, in the end is the same since all the activities live within it, and taking on count that this app context follows the singleton design pattern be sure that is the very same instance object within the virtual machine... Regards!

Categories : Android

What would happen internally when "Fish f = new BlueFish();"?
Answer: javac doesn't try to realize it, becuase it would be easy to make a situation where javaccouldn't find out as easily, or even at all. You might find out whether to use CatFish or BlueFish using user input, for example. For this, see BevynQ's comment. I'm surprised he didn't add it as an answer.

Categories : Java

CSS transition doesn't happen in Firefox or IE
Firefox and IE require that you specify an initial attribute for the animated property. So: li, a { display: inline-block; } li { top: 0; /* ADD THIS! */ relative: 0; /* This is important too or the item will pop back instead of transition*/ transition: top 0.3s; } li:hover { position: relative; top: 3px; }

Categories : CSS

When does an invalid_request error happen at the Flattr api?
I don't think this is the result of an unauthorized request, for that you should be getting an '401 unauthorized' error. It is more likely the result of not sending the proper parameters. Although the documentation says that the error in that case should be invalid_parameters, in some events an '400 invalid_request' error will be returned instead.

Categories : Api

Resting a private variable that should not happen
This line is causing the issue: ZevUser user = ZevUser.GetById(Int32.Parse(Session["SessionId"].ToString())); This is because Session["SessionId"] can be null, and is null in this case. If you are looking to get the SessionId that is set by ASP.net, then use this.Session.SessionID (source). If you are storing a value in Session["SessionId"] that you are trying to retrieve, then do a null-check first: if (Session["SessionId"] != null) { ...

Categories : C#

Why SIGALRM can't happen in thread on HPUX?
Signal Handling in Multithreaded Environments: As Signal Handler: For all UNIX platforms, signal handlers are installed on a per-process basis. In a multithreaded environment, there is only one signal handler for each signal within a process. The last signal handler installed for any thread is valid for all threads in the process. The handler is called when the signal is delivered. Also the SIGALRM is the Asynchronous Signals generated by events outside the control of the process that receives them, and arrive at unpredictable times. As Asynchronous signals are delivered to the process not to Thread without regard to the instruction that is executin

Categories : Multithreading

What will happen if I try to access data over dblink and the database is down?
It depends on the problem the dblink is facing. Most of the time you will get "TNS:could not resolve the connect identifier specified". And the best way to debug is get sysdate from the source if it returns you a date than the system is perfectly fine else there is good possibility that source DB is down.

Categories : SQL

ios: requestWithURL method happen in separate thread?
Your question aims at whether the main-thread will still be running while the URL-request is made. Look at asynchronous requestWithURL, that'll most likely do what you like. (look at this SO-post: how to send Asynchronous URL Request?)

Categories : IOS

Can bad stuff happen when calling a class from an Activity?
You have to leverage the Android Activity Lifecycle. class MyActivity extends Activity { private MyWorkerClass myWorkerClass; void onCreate() { myWorkerClass = new MyWorkerClass(); myWorkerClass.startLoading(); } void onPause() { // You know the activity is going into the background // so act appropriately in your worker class myWorkerClass.stopLoading(); } } The issues you describe above are very generic, so explaining any specific implementation wouldn't help. If you wanted your worker class to complete the work even if your Activity goes into onPause then yes you would want to do the work in another Thread and possibly in a Service. You can still have your worker class though for nice OO & adhering to the SRP.

Categories : Android

Random errors appear in alert emails - how could this happen?
I have experienced very similar behavior in emails when using plain php's mail() function and postfix smtp server. It took me weeks to figure it out why HTML in those emails is randomly corrupted: it was long lines in the email source, exactly as @eggyal writes in the comments. RFC2822 states that lines should be no more than 78 chars. To comply, SMTP server inserts newlines at selected places, however this can easily corrupt space-sensitive content. Check the Content-Transfer-Encoding header in your emails, I assume it will be either 7bit, 8bit or quoted printable. Try changing it to base64 - that's the easy way. I'm not familiar with Swift Mailer but I guess this could work: $transferEncoding = $message->getHeaders()->get('Content-Transfer-Encoding'); $transferEncoding->setVal

Categories : PHP

OpenGL Shaders - Should the camera translation happen on the GPU or the CPU?
I am not entirely sure what you are currently doing. But the sane way of doing this is to not touch the VBO. Instead, pass one or more transformation matrices as uniforms to your vertex shader and perform the matrix multiplication on the GPU. Changing your VBO data on the CPU is insane, it means either keeping a copy of your vertex data on the CPU, iterating over it and uploading or mapping the buffer and iterating over it. Either way, it would be insanely slow. The whole point of having a VBO is so you can upload your vertex data once and work concurrently on the CPU while the GPU buggers off and does its thing with said vertex data. Instead, you just store your vertices once in the vertex buffer, preferably in object space (just for sanity's sake). Then you keep track of a transformati

Categories : Opengl

CMap - What will happen if we add more elements to the map than the hashtable size?
Overfilling a hash table results in collisions. The items that collide get put in a list, which must be searched. Everything still works, it just gets a bit slower. If your hash table is properly-sized and your hash function is decent, then inserts and lookups in your hash table will be constant-time. In your overfull hash table, these times will increase due to having to walk the lists that result from collisions.

Categories : C++



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