How to do GPU programming on Macbook Air? |
By GPU Programming I am assuming you mean high performance parallel
calculations on the GPU without graphics (since you mention OpenCL and
CUDA).
If so this link may be helpful: https://anteru.net/2012/11/03/2009/.
And that card definitely can't use CUDA.
|
Run terminal inside vim on a macbook? |
Why don't you do things the other way around?
You can use a terminal multiplexer such as Tmux and split a terminal window
into two panes using C-b %.
Inside the second pane you can run macvim inside a terminal with $ mvim -v
You can navigate between the two panes with C-b o, (And do much more, but
I'll leave it up to you to discover!)
Doing things this way around is much more sane in my opinion, you get the
full power of both the terminal and vim without having to hack around with
Vim too much (Plus Tmux is very handy for many other uses).
I hope doing things this way around is appealing enough for you!
|
Macbook Pro 15", backspace not working with VIM? |
Most likely you are running vim in compatible mode.
Create a file called ~/.vimrc and put the following lines in it.
set nocompatible
set backspace=indent,eol,start
Setting the backspace option should change the backspace key to behave how
you expect it to. However these should be set by the system vimrc on mac.
|
iOS Simulator changes MacBook tint |
your macbook pro have dual graphics card?
if that is your case your macbook usually works with the intel HD graphics
for low tasks
and when you open an app that needs more graphics your macbook switch from
intel to nvidia graphics that is the change in color that you notice
when you close that app your macbook switch from nvidia to intel graphics
and the color return to normal
seems to be a normal behavior same happen to me
good luck
|
How to distinguish MacBook and Mac desktops programmatically? |
You haven't specified a language, but from Terminal sysctl hw.model will
return with an identifier for the current Mac. For example, on my computer
it returns MacBookPro5,5.
|
MacBook's Switchable Graphics to toggle by script |
The best tool for this is Cody Krieger's gfxCardStatus, which not only
allows forcing the setting from the menu bar, but also does a fine job of
monitoring why your system has switched GPU modes.
|
detect start of scroll event in macbook |
Use $(window).scroll instead of $('body').scroll
http://flesler.com/jquery/scrollTo/
might be helpful
Sample code. Though not relevant with your requirements but hoping it could
help:
$(document).ready(function () {
var sidebar = $('#sidebar_content');
var top = sidebar.offset().top - parseFloat(sidebar.css('marginTop'));
$(window).scroll(function (event) {
var ypos = $(this).scrollTop();
if (ypos >= top) {
sidebar.addClass('fixed');
}
else {
sidebar.removeClass('fixed');
}
});
});
|
DataModelling or ER model building software for MacBook and MYSQL |
You won't get automatic updates (I understand automatic updates as
something that happens in the background without any action from you).
MySQL Workbench however has a two-way sync that you can use to update your
models at the same time you update your schema (from the model). You can
select to do only one direction, but you have to trigger synchronization
yourself.
|
How to take a snapshot of the entire system of Macbook Pro OS x 10.8 Mountain Lion |
I dunno about "graceful" but Carbon Copy Cloner is definitely an easy
solution for rolling back to a previous state. You can make an exact clone
of your drive, then restore it back if something goes horribly wrong. I use
CCC to make periodic backups of my Macs, as a sort of secondary backup to
time-machine, which is easy to use but which I don't have total confidence
in.
|
OpenCV- Webcam frame not working on macbook in Java |
it's been a while since this question was asked, but since I had
essentially the same problem, I will post a solution (found here) (it's a
rather simple fix actually for a stupid problem):
The camera needs time to initialize (not sure what the gory hardware
details are, but there you go). To fix it I simply added
Thread.sleep(1000), and it started working. A slightly better fix may be to
wrap this in a loop which retries every 1000ms or so until the returned Mat
is not empty.
Hope someone benefits from this :-)
EDIT: I should have read your code first. Silly me, apologies. The problem
seemed very similar to mine, so I assumed it was the same.
|
How to produce kernel panic with power button on MacBook Pro |
You don't specify which "MacBook Pro" model you're using. A built-in
ethernet port isn't the only way to do two machine debugging anymore.
You need to reboot after changing nvram, e.g.
sudo nvram boot-args="debug=0x144 -v"
sudo reboot
Also, see the video and PDF from WWDC 2013 "What's New in Kext Development"
|
Getting Warning while installing flink on MacBook "There is no C compiler on your system" |
First, you need to install Xcode and its command line tools to get the gcc
compiler
Make sure that you have working version of gcc in your /usr/bin directory
Create a symbolic link cc from installed gcc in /usr/bin
|
How do i reset Eclipse back to default settings on Macbook |
If your Eclipse explorer looks messy. Resetting package Explorer or
perspective
Window -> Reset Perspective
If the above doesn't work, You can probably clear your meta data for
resetting everything
rm -rv $WORKSPACE_DIR/.metadata/ After this restart your eclipse
|
sync xcode proj between imac and macbook -- push fails |
For anyone else who stumbles onto this:
My question is really answered at Pushing git repository to Xcode.
In summary, since iMac is on essentially all the time, and since git
(appropriately) abhores pushing to a non-bare repository, the (one)
solution to syncing is to set up a bare repository on the imac, and push
and pull from this for both working copies.
|
Displaying Java BufferedImage on MacBook with Retina display does not work |
It looks like the host peer component is expecting to render an image with
one color model but encountering another. There are just too many ways for
this to go wrong for a definitive answer, but everal things bear closer
scrutiny:
Verify that your BufferedImage has a compatible color model and space, for
example.
Consider scaling with AffineTransformOp, outlined here, as it can create a
"destination image with the correct size and number of bands."
While done() is executed on the event dispatch thread, verify hat the rest
of your program is correctly synchronized.
|
My Apple MacBook hard drive crashed - provisioning profiles lost, is there a way I can still update my app? |
Create a new certificate if needed then create a new set of provisioning
profiles. Install the updated profiles and update your apps to use the new
profiles. That's it. Not that big of deal other than spending 30 minutes
redoing this stuff.
|
iOS: DequeTableViewCell..a little bit confused |
It says clearly in documentation
dequeueReusableCellWithIdentifier:forIndexPath:
For performance reasons, a table view's data source should generally
reuse UITableViewCell objects when it assigns cells to rows in its
tableView:cellForRowAtIndexPath: method. A table view maintains a
queue or list of UITableViewCell objects that the data source has
marked for reuse. Call this method from your data source object when
asked to provide a new cell for the table view. This method dequeues
an existing cell if one is available or creates a new one based on the
class or nib file you previously registered.
.
dequeueReusableCellWithIdentifier:
Return Value : A UITableViewCell object with the associated identifier
or nil if no such object exists in the reusable-cell
|
Confused about unistd_XX.h |
So, the right way is using unistd.h for x64 and/or unistd_32.h for x86 and
ia32.
Those files are in the headers of your linux distro. but keep in mind that
the path changes between distros (and even between kernels), so the best
way to find out where exactly those files are is:
uni_hack.h
#if defined(CONFIG_X86) <---- replace with whatever you want, #ifdef
CONFIG_IA32_EMULATION for example
# include <asm/unistd_32.h>
#endif
-
Kbuild file
obj-m += kernel_module_example.o
$(obj)/kernel_module_example.o: $(obj)/real_unistd.h
$(obj)/real_unistd.h: $(src)/uni_hack.h FORCE
cpp $(c_flags) -E -dM <$< >$@ <---- this will generate
"real_unistd.h" in the directory of your kernel module, and it will contain
the content of unistd_32.h
Using the unistd.h for x64 is
|
Confused by calculation |
8.3333333333e-4 is the same as 0.00083333. It equates to:
8.3333333333 * 10^-4
= 8.3333333333 times ( ten to the power of -4 )
= 8.3333333333 * 0.0001
= 0.00083333333
N.b. After rounding
The e stands for exponent and the relevant Wikipedia article is
http://en.wikipedia.org/wiki/Exponentiation
|
Confused about NFC tag size |
Look at this. Write Tag
This is my NFC library. You can use this, if you need. :)
NFC Wrapper
|
got confused with 'this' in one form in js |
onFocus="getExpression(this.form);" , what does this represent here?
this here is your input <INPUT TYPE=text NAME="entry"/>
onFocus="this.blur();"
this here is your input <INPUT TYPE=text NAME="results"/>
|
Confused about DBus |
This sounds like you should write an isolated D-Bus service to act as a
datastore, and communicate synchronously with it in your scripts to write
and read values. You can use shelve to persist the values between service
invocations.
In the tutorial, the "Making method calls" section covers synchronous
calls, and "Exporting objects" covers writing most of the D-Bus service.
|
I'm confused with C libraries |
For the first question, glibc follows both standard C and POSIX, from About
glibc
The GNU C Library is primarily designed to be a portable and high
performance C library. It follows all relevant standards including ISO C11
and POSIX.1-2008. It is also internationalized and has one of the most
complete internationalization interfaces known.
For the second question, yes, you can compile Linux using gcc. Even gcc
itself can be compiled using gcc, it's called bootstrapping.
|
Confused about arrayList |
check out this Question
The component type of an array object may not be a type variable or a
parameterized type, unless it is an (unbounded) wildcard type.You can
declare array types whose element type is a type variable or a
parameterized type, but not array objects.
|
Confused over the JNDI |
Think about that when you are trying to access a file under
d:/users/name/text.txt you just type its name and you access its contents.
JNDI works at same concept, you go there with a name JNDI handles what you
want.
|
Confused with the Output of the query |
SELECT emp.emp_id,mast.name
FROM empmtg emp
left JOIN users mast
ON emp.emp_id=mast.id
WHERE emp.emp_mtg = 141;
here a working demo
|
How to add this array to MySQL (very confused) |
Let's say your array is $array:
$length = count($array[0]);
$rows = array();
for($i = 0; $i < $length; $i++)
$rows[] = "(".array($array[0][$i].", ".$array[1][$i].",
".$array[2][$i].", ".$array[3][$i].")";
// Ugly language with no executemany function... So we build a INSERT INTO
with many values by ourselves
$sql = "INSERT INTO table (id, url, title, percent) VALUES " . implode(',',
$rows);
$stmt = $pdo->prepare ($sql);
try {
$stmt->execute($insert_values);
} catch (PDOException $e){
echo $e->getMessage();
}
$pdo->commit();
|
Confused about how to fill an array |
You can do it like this. But i wonder why you are generating 2 random
numbers
Random rnd = new Random();
int x = rnd.Next(0, 3);
int y = rnd.Next(0, 3);
int[,] array=new int[2,2];
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 2; j++)
{
array[i,j] = yourvalue;
}
}
|
Confused about first argument in setTimeout |
A function in JavaScript is an object. go is the function object, go()
executes the go function and returns its value. setTimeout expects a
function, thus go, not go().
function go(){
return 'hello';
}
console.log(go); //=> function go(){}, a function object
console.log(go()); //=> 'hello', a string returned by the function `go`
|
Confused about python imports |
Module names are case-sensitive. Use:
import Test.foo as foo
(The as foo is so that you can call foo.bar in main.)
You must also have ~/Development listed in PYTHONPATH.
If using Unix and your login shell is bash, to add ~/Development to
PYTHONPATH edit ~/.profile to include
export PYTHONPATH=$PYTHONPATH:$HOME/Development
Here are instructions for Windows.
Further suggestions for debugging:
Place
import sys
print(sys.path)
import Test
print(Test)
import Test.foo
at the top of test_foo.py. Please post the output.
|
A little confused about access count |
Will the loginTimeMap slow the server if the size of the map exceed
10000?
A HashMap has a time complexity of O(1). That is, it hashes, then goes
straight to the value. It does not search for the value. That means that
it's performance is not proportional to the amount of elements in the
array, although with 10,000 entries it might be somewhat memory heavy!
|
Confused about the third normal form |
If you want to strictly hold to the normalization and it's normal forms,
you would have to start with 1NF. You might create separate tables for
Make,Model,Owner and rename current one into Car. Then you can add foreign
keys respectively.
To uphold 2NF you can wonder to grab the year attribute from the VIN, which
it contains as a model year number (does not necessarily have to be the
same as the actual year of making).
3NF states that table columns should contain only columns that are fully
dependent upon primary key, which would've been ok now.
|
Confused about the usage of Dropbox API |
Nope. Your app account is a way where Dropbox can allow any client
applications to access the Dropbox APIs.
That said, when other users install your application, authorize/login to
the app, they will make requests by using their own credentials, and your
App API key. Your app API key is a way for Dropbox to know that which
application is sending the request.
But, the files, and other APIs will be executed with the user's
credentials. So, the user's files will be uploaded to the user's account,
and not to the account of your App.
So, it's both, User specific + Application Specific.
|
Confused about 301 redirect, need suggestions |
You need to create a redirect for each case:
RewriteEngine on
RewriteRule ^$ http://www.newsite.com/ranking-page.php [L,R=301]
RewriteRule ^party-poker/$ http://newsite.com/party-poker.php [L,R=301]
RewriteRule ^us-poker/$ http://newsite.com/us-poker-sites.php [L,R=301]
# the other 2-3 inner page urls
# finally, everything to ranking page
RewriteRule ^ http://www.newsite.com/ranking-page.php [L,R=301]
|
Confused about this generics use case |
That's the syntax for generic methods.
The <T extends Bean> in the method declaration tells us that the
method uses generics, and you can use T inside the method body as a type.
In your code, T has no meaning.
|
Confused about unicode representations |
The plain string has been encoded using UTF-8, one of a variety of ways to
represent Unicode code points in bytes. UTF-8 is a multibyte encoding
which has the often useful feature that it is a superset of ASCII - the
same byte encodes any ASCII character in UTF-8 or in ASCII.
In Python 2.x, use the encode method on a Unicode object to encode it, and
decode or the unicode constructor to decode it:
>>> u'u222b'.encode('utf8')
'xe2x88xab'
>>> 'xe2x88xab'.decode('utf8')
u'u222b'
>>> unicode('xe2x88xab', 'utf8')
u'u222b'
print, when given a Unicode argument, implicitly encodes it. On my system:
>>> sys.stdout.encoding
'UTF-8'
See this answer for a longer discussion of print's behavior:
Why does Python print unicode characters when the default encodin
|
div using css confused using float left and right |
Assuming you want the image and description as a section starting a new
line, try something like:
#imageholder {
border: 1px dotted red;
overflow: auto;
}
#imageholder img {
padding: 50px;
float: left;
}
#divfloatright {
text-align:left;
padding-right:50px;
word-break:break-all;
}
See demo at: http://jsfiddle.net/audetwebdesign/93WGq/5/
|
Confused with Android onClickListener |
This is better than using onClick in Xml
Avoid using onclick in xml if your code is so long....
Button b=new Button(getApplicationContext());
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
// your code...
}
});
|
Confused about data types in COM, VFP and C# |
First of all, CLSCompliant attribute doesn't have anything to do with COM.
It's for Common Language Runtime compliance.
OLE Automation specification lists the types which are
automation-compatible.
Your C# class, if compiled as 32-bit assembly and registered with RegAsm,
exposes the following COM interface:
[
odl,
uuid(AFA13243-F593-3B28-A4D3-4E4138AA1F22),
hidden,
dual,
nonextensible,
oleautomation,
custom(0F21F359-AB84-41E8-9A78-36D110E6D2F9, "SampleNSpace.AnyClass")
]
interface _AnyClass : IDispatch {
[id(00000000), propget,
custom(54FC8F55-38DE-4703-9C4E-250351302B1C, 1)]
HRESULT ToString([out, retval] BSTR* pRetVal);
[id(0x60020001)]
HRESULT Equals(
[in] VARIANT obj,
[out, retval] VARIANT_BOOL* pRetVal);
|
Confused: nested "for" loop and |
I think this is what you are looking for but it is difficult to tell...
for(int count=0;count<months;count++) {
System.out.println("How much did you deposit this month?");
deposit = scanner.nextDouble();
System.out.println("How much did you withdraw this month?");
withdraw = scanner.nextDouble();
//Do the math here....
System.out.println("Your monthly interest is" + result);
}
|