w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

column pk dual varchars or int?
If you add a surrogate autoincrement integer column, you still need a unique index on the JobID, SubJobID columns. This is the natural primary key. It may not add much value except using more disk and memory to store the extra column. Saying that, if the composite (JobID, SubJobID) index is used in child tables as a foreign key, it can make more sense to use one. 10000 rows here could have 10 million child rows: then the varchar overhead matters. However, there is no truth in anything you read that says Thou shalt always have an identity/autoincrement primary key It is an implementation decision for performance depending on the design.

Categories : SQL

three.js dual viewports only one displays
Needed the following statement (in the javascript init function) to prevent renderer clearing its buffer after rendering the first viewport:- renderer.autoClear = false

Categories : Javascript

Dual authentication mode
It is possible technically. The classic Mode doesn't requires much effort and can be implemented more or less easily. However when in integrated mode , some careful work is required to achieve the same. Check one post here which may be of help to you for getting started.

Categories : Asp Net

Dual divs on the same place
When I click on About me the "slide down div" will slide down and show the about me section. And when I click on contact the contact section will be showed...) How can I make this, and I'm a beginner when it comes to coding and hopefully this can be solved with a simple line of code... Actually, this can be done with a simple line of code! Change your "About me" link to this: <a href="#AboutMe">About Me</a> And, create a div like this: <div id="AboutMe">This is about me!</div> When you click the link, your browser will scroll to the AboutMe div. JsFiddle: http://jsfiddle.net/NmrbP/11/

Categories : Javascript

Function dual to std::move?
If you can manipulate T you could template the constructor. #include <iostream> using namespace std; class B { int x; public: B (int i) : x(i) { } B (B && b) : x(b.x) { cout << "B moved (" << x << ")" << endl; } B (B const & b) : x(b.x) { cout << "B copied (" << x << ")" << endl; } }; class A { B b; public: template<typename TB> A (TB && init_b) : b(std::forward<TB &&>(init_b)) { } }; B foo (void) { B x(3); return x; } int main (void) { A a1(foo()); B b1(4); A a2(b1); return 0; } Prints B moved (3) B copied (4) As far as I understand reference collapsing you should come out with a constructor A(B&) forwarding to the copy constructor of B and a A(B&&a

Categories : C++

Dual play frameworks on the same system
There is answer for similar problem dedicated for mac/unix. In Win you can create symlinks pointing to the proper version of Play directly in the instance folder

Categories : Java

Best Practice for Dual Layouts in Rails 3
It seems to me an admin might be doing different things with a user than an end user would be doing so different controllers may not be completely unDRY. However, if they are completely the same and you just want to have a different layout, then you can just set your layout based on the current user. Something like this would work: layout :determine_layout def determine_layout return 'admin' if current_user && current_user.admin? 'application' end

Categories : Ruby On Rails

Highcharts - Dual yAxis not displaying
You've got two problems I can see right off the top: 1.) You haven't assigned any series to plot against the 2nd y axis. yAxis: 1 2.) You have a right margin of -4, which is suppressing the drawing of the right y axis. marginRight: -4, // where's the axis going to draw if it doesn't have space? Updated fiddle.

Categories : Javascript

Has anyone had success with ADT on a (dual-booted) Chromebook?
Are you sure you installed the driver correctly? If so, try switching Nexus 7's usb mode from storage mode to pics transfer??/view?? mode(forgot the exact name here). Hopefully it does help.

Categories : Android

Get selected values in a dual listbox PHP
This is the weird code: function listbox_selectall(listID,isSelect) { var listbox=document.getElementById(listID); for(var count=0;count<listbox.options.length;count++) { istbox.options[count].selected=isSelect;//<-- ? } } Maybe, you wanted to say: listbox.options[count].selected=isSelect; You said, that only 1 value from "destination" is submitted to PHP. To allow multiple values to be submitted, add [] to the names of the <select>-s: <SELECT id="s" size="10" name="source[]" multiple> <SELECT id="d" size="10" name="destination[]" multiple> Also, there is no need to use name attribute for options. You don't use it anywhere.

Categories : PHP

Formatting column name in dual table
Try this SELECT 'HELLO WORLD' as HELLOWORLD FROM dual; or SELECT 'HELLO WORLD' as "HELLO WORLD" FROM dual; See SQL Fiddle

Categories : SQL

Dual use of composite foreign keys
Here's what you started with. CREATE TABLE medication ( "id" INTEGER NOT NULL, -- You don't need this. "therapy_id" INTEGER NOT NULL, "day" INTEGER NOT NULL, "revision" INTEGER NOT NULL, "substance" VARCHAR(100), "dosage" VARCHAR(50), PRIMARY KEY (id), -- Drop this. FOREIGN KEY(therapy_id, day, revision) REFERENCES day (therapy_id, day, revision), -- Ok, but should be PK. FOREIGN KEY(therapy_id) REFERENCES therapy (id) -- You don't need this. ); The column "id" serves no useful purpose, and has instead convinced you that you don't need a unique constraint on the real key: {therapy_id, day, revision}. Replace the useless primary key constraint on "id" with a primary key constraint on {therapy_id, day, revision

Categories : SQL

Duplicate a pop window display on dual monitors
My guess is the only way to do it is to use JavaScript to generate two popups and then use CSS to push the popups to the correct locations. The problem I would think you are going to run into is knowing whether or not you have two displays to manage or not.

Categories : Javascript

How to properly represent inheritance in dual hierarchy?
This is a classic generic case: EDITED One more time - still the same concept, but the inheritance chain is fully there. You have to have hiding properties (new) in order to do what you need, but since you're implementing the ICar interface, you still get the base property for when you have a mixed collection. I think this is the best you're going to be able to do. public interface ICar { IEngine Engine { get; set; } } public abstract class BaseCar<T> : ICar where T : IEngine { public T Engine { get; set; } IEngine ICar.Engine { get { return Engine; } set { Engine = (T)value; } } } public class Car : BaseCar<Engine>, ICar { } public class SportsCar : Car, ICar { IEngine ICar.Engine { get { return Engine; } set { Engine = (TurboEn

Categories : C#

How can I create a dual has_many relationship in Laravel?
Employee migration use IlluminateDatabaseSchemaBlueprint; use IlluminateDatabaseMigrationsMigration; class CreateEmpoyeeTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('employee', function(Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->string('name'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('employee'); } } Customer migration use IlluminateDatabaseSchemaBlueprint; use IlluminateDatabaseMigrationsMigration; class CreateCustomerTable extends Migration { /** * Run the migrations.

Categories : Database

FreeRADIUS Google Dual Factor Authenticator
After so much internet surfing and forum hunting I manage to fix this problem. If anyone else having this issue this might help them :) Thu Sep 26 16:38:19 2013 : Debug: pam_pass: using pamauth string <radiusd> for pam.conf lookup Thu Sep 26 16:38:19 2013 : Debug: pam_pass: function pam_authenticate FAILED for <test>. Reason: Cannot make/remove an entry for the specified session The above line actually means a auth fail, even though it doesn't sound like it, also it could mean that .google_authenticator file in the user's home directory isn't accessible. FreeRadius log file not help you much with this issue, but have a look through /var/log/secure on CentOS and /var/log/auth.log in Ubuntu. This will explain which is the issue. Issue with my system was my time was out and

Categories : Misc

Dual-parent nested resources or is polymorphism right for me?
I would use polymorphic: routes.rb resources :students do resources :evaluations end resources :goals do resources :evaluations end models/evaluation.rb class Evaluation < ActiveRecord::Base attr_accessible :some_attribute belongs_to :evaluable, polymorphic: true end models/student.rb class Student < ActiveRecord::Base attr_accessible :some_attribute has_many :evaluations, as: :evaluable end models/goal.rb class Goal < ActiveRecord::Base attr_accessible :some_attribute has_many :evaluations, as: :evaluable end your relation between goal and student will look like: id evaluable_id evaluable_type other_field 1 4 'Goal' 'other goal content 1' 2 1 'Student' 'other student content 1' 3

Categories : Ruby On Rails

MySQL INSERT INTO with dual condition for IF NOT EXIST
Replace WHERE NOT EXIST( With WHERE email_addr NOT IN( EDIT Replace SELECT email_addr FROM list_email WHERE NOT IN ( SELECT email_addr FROM email_addr WHERE email_addr = $post_addr ) WHERE NOT IN ( SELECT email_addr FROM list_no_email WHERE email_addr = $post_addr )LIMIT 1 with SELECT email_addr FROM list_email WHERE NOT IN ( SELECT email_addr FROM email_addr WHERE email_addr = $post_addr UNION ALL SELECT email_addr FROM list_no_email WHERE email_addr = $post_addr ) LIMIT 1

Categories : Mysql

OpenGL Shadow Mapping dual shader
There are a few things that strike me odd in your code. First off, why are you using glTexGen if there are shaders? Everything glTexGen could be used for, is far easier done using a fragment shader. Then your shadow map generating, and the resulting shadow map are not what you want for a shadow map. First and foremost you don't set "colours" in a shadow map. In fact when rendering the shadow map there's no need to sample a texture or write into a "colour" component in the first place. What you actually place in a shadow map is the distance from the light, i.e. the distance from the origin (point light) or an arbitrary plane (direction light). The resulting picture is a depth map, that has gradients on almost all geometry (except faces parallel to the projection plane). In your "shadow ma

Categories : Java

Issues with dual-pane preference screens
The key idea behind the code below came from the Commonsware blog entry linked in the question, so it feels relevant. I specifically had to extend the concept to deal with an orientation change issue that sounds very similar to the one in the question, so here's hoping it gives you a start. The Settings class should not have any bearing on the orientation issue, but including it anyway to be clear. Per my code comment, see if the checkNeedsResource call in onCreate will help at all: public class SettingsActivity extends PreferenceActivity { @SuppressWarnings("deprecation") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Show settings without headers for single pane or pre-Honeycomb. Make sure to check the // single

Categories : Java

Why java monothread is capped at 25% on a dual core (i5)
Your processor uses hyper-threading, so the 2 physical cores become 4 logical cores. Now as you've only got a single thread, that can only use one of those logical cores - i.e. 25% of your available logical cores, hence the capping. If you change your application to use multiple threads (assuming that's feasible in your particular task) then you'll see more cores being used. You may find that you can turn off hyper-threading in your BIOS, at which point I'd expect Windows to report 2 cores instead of 4. You may then find that your application runs faster than it did before - but there'll be a lot of different factors in that calculation. (Modern processors are rather smart, and do all kinds of things automatically - such as turning off unused cores and boosting the clock speed of the sti

Categories : Java

how to evaulate 2 queries output data into one with dual
When you union two result sets the column names in the combined set are taken from the first branch of the union. You've effectively got: select statusA from test union select statusB as statusA from test1 So there is no statusB to work with in the result set. You maybe want to do something like: select case when (select nvl(max(statusA), 'N') from test) = 'N' and (select nvl(max(statusB), 'N') from test1) = 'N' then 'N' else 'Y' end from dual Though I'm not quite sure if you expect a single value from each table, and quite what you're trying to do. OK then, with an ID value linking the two tables, and with a given ID being in one or both of the tables, you can use a full outer join: select coalesce(t.id, t1.id) as id, t.statusa, t1.statusb, case when nvl(statusa, 'N') = 'N

Categories : SQL

How to find out which SIM is making the outgoing call (Dual SIM)
You can create BroadcastReceiver, which will accept all outgoing calls. Then: String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); int slot=intent.getIntExtra("com.android.phone.extra.slot",-1); //0 or 1 are valid in my case number is dialed number slot is through which slot you make that call You will need to register that receiver, and give proper permissions. This works for dialed USSD codes also. It is tested on Privileg GSM S7589 2 SIM cards, Android 4.2.1

Categories : Android

Using dual polymorphism through a join table in Rails 4
if you still want to do so without STI, you can checkout( even though it is not recommended) joins on polymorphic table

Categories : Ruby On Rails

Can a C function have dual use depending on a parameter being volatile or not?
In C++, you could certainly do this using templates: template <class T> void circbufu8_reset(T &cb) { // code here } Of course, this function template would be callable with any type (but likely fail instantiation), so you might want to limit its use like this: class Helper { friend void circbufu8_reset(circbuf_u8_st &); friend void circbufu8_reset(volatile circbuf_u8_st &); private: template <class T> static void reset(T &cb) { // use cb here, guaranteed to be circbuf_u8_st & or volatile circbuf_u8_st & } }; inline void circbufu8_reset(circbuf_u8_st &cb) { Helper::reset(cb); } inline void circbufu8_reset(volatile circbuf_u8_st &cb) { Helper::reset(cb); } EDIT An even more C++ way would be this: struct circbuf_u8_s

Categories : Misc

qt dual-stack ipv4 & ipv6 application
Definitely create a local IPv6 network environment. A lot of things work the same in IPv6 as in IPv4, but a lot of other things are different. When developing applications that use IPv6 you should have some hands-on experience. You wouldn't expect someone who has never used IP to develop an application that uses IPv4, would you? Some key differences: IPv6 addresses are written in hexadecimal IPv6 hosts will probably have multiple addresses An IPv6 address that starts with fe80:This is the link-local address. Every IPv6 hosts has one for every interface it has. Link-local addresses exist on every link (ethernet segment, LAN) and they use the same address range on each LAN. It is therefore impossible to route them, but they are very useful when communicating only within the LAN. One or m

Categories : Qt

Dual GridView simultaneous and syncronised scrolling
So I ended up biting the bullet and going back to one grid view and battling through the complicated code since no matter what I tried with the scrolling there was always a lag before the other grid caught up and I just couldn't find a way to smoothly scroll both grid views at the same time.

Categories : Android

Choose SIM card when sending SMS on a dual SIM Android device
Please refer to this Dual Sim Android article. If you follow this direction, I think you can make it, even if current android api doesn't support it.

Categories : Android

How to differentiate data / voice usage for dual sim in Android
There is no support for dual slim as for today. Thats mean - there is no any official public API available. Issue 14799: Dual SIM cards supporting

Categories : Android

Dreamweaver change file in dual screen view
What I see from you screen grab is you are using Code Inspector - it displays your HTML in a floating window so you see your working pages in their full glory rather than have them cut in half as in Split View. Have you tried Dreamweaver's Code Split View, please read link

Categories : Javascript

android application is not able to access GPRS in dual sim phon
Is there any lines of code related to Network connectivity type in your pgm? Following if a simple method to detect connectivity. public boolean isConnectingToInternet(){ ConnectivityManager connectivity = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); if (connectivity != null) { NetworkInfo[] info = connectivity.getAllNetworkInfo(); if (info != null) for (int i = 0; i < info.length; i++) { Log.d("Connectivity", "info:"+info[i]);//Here you can check network info if available if (info[i].getState() == NetworkInfo.State.CONNECTED) { return true; } } } return false; }

Categories : Android

Dual hover-effects for nested list items in CSS
You want to declare the :hover on the li and then select the img or the title after that. Also, your markup could be a bit better. For example: <li class="item"> <a href="#"> <img src="http://placekitten.com/g/200/300" /> <br /> <span class="p_title">Entry 6</span> </a> </li> li.item:hover img { opacity: 1; } li.item:hover { background-color: #fb8008; }

Categories : HTML

GDI+ Double Buffering: backbuffer dual-colored monochrome
When creating a memory DC using CreateCompatibleDC its display surface is exactly one monochrome pixel wide and one monochrome pixel high. Consequently when calling CreateCompatibleBitmap on this memory DC a monochrome bitmap is created. Since the bitmap selected into a memory DC controls the color characteristics, you have to make sure that it matches the DC you are eventually using to display the contents of the memory DC. To do so you should pass the destination DC to CreateCompatibleBitmap. Corrected code: hdc = GetDC(hwnd); hdcBuf = CreateCompatibleDC(hdc); hbmpBuf = CreateCompatibleBitmap(hdc, 640, 480); // uses source DC SelectObject(hdcBuf, hbmpBuf);

Categories : C++

Dual debugger Java + (Perl/Python) script
Yes, alter the host program (the java program ) so that it runs the perl program in a debugger You might well run into problems with the way that debuggers "attach" in different programming language environments. perl -d assumes a tty is there for interactive commands whereas java does something completely different

Categories : Java

Detecting a change in box2View in jquery Dual ListBox
You can put a change function on #i1View then if the selected value is 1 (the second one, it starts with 0), then the command that you wish will be triggered. $(document).ready(function() { $("#i1View").change(function(){ if($("#i1View").find(":selected").val() == '1'){ $("#i1View").css('background','green'); } else{ $("#i1View").css('background','red'); } }) });

Categories : Jquery

Android IMEI Confusion for "Dual Simcard Devices"
IMEI number should be associated with the phone and not with the sim, so also in dual sim devices you should have only one IMEI number. "The IMEI is only used for identifying the device" [...] "Instead, the subscriber is identified by transmission of an IMSI number, which is stored on a SIM card" - ref: Wikipedia EDIT: Check the source code, maybe you can find some hint: Source of Settings app Here a snippet of the "IMEI" part: // NOTE "imei" is the "Device ID" since it represents // the IMEI in GSM and the MEID in CDMA if (mPhone.getPhoneName().equals("CDMA")) { setSummaryText(KEY_MEID_NUMBER, mPhone.getMeid()); setSummaryText(KEY_MIN_NUMBER, mPhone.getCdmaMin()); if (getResources().getBoolean(R.bool.config_msid_enable)) {

Categories : Android

Double-ended priority queue using dual structure approach
you will be ending up with creating wrapper object and store in an array or a map(if you want to retrive it later with an id). I did not understand for what is the purpose of referencing each other. if you want to add and remove you have to write the logic for that.

Categories : Java

signtool failing to dual sign SHA2 and SHA1 with timestamps
Try using signtool.exe sign /as /fd sha256 /tr http://timestamp.geotrust.com /td sha256 /f certificate.pfx /p XXXXXX file.dll /tr is for RFC3161 timestamping, /td obviously for the hash to use.

Categories : Windows

Transfer BT Low Energy GATT profiles via EDR between two dual mode devices
You are right that the BT 4.0 spec does not allow 2 devices to be connected using LE + BR/EDR at the same time. The BT 4.1 spec seems to have loosened this requirement. However, in practice, iOS does allow a LE+BR/EDR accessory to connect using either (and both at the same time as well!) In fact, iOS does not even support GATT over BR/EDR (source: an Apple engineer told me in person). Note that this means users need to pair twice, assuming the application requires encryption for the LE link. BT 4.2 added "Cross Transport Key Generation" which should resolve this issue. Supposedly iOS 8.2 supports BT 4.2, but I have not tried this feature yet.

Categories : IOS



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