HT204380 Why isnt this working
I have an Ipad2, every single time i facetime with someone using a iphone 4s, i can hear what they are saying but they can't hear what i am saying.how do i fix this?...i enjoy having to write down what i think on paper, but i would rather talk =)
Using FaceTime http://support.apple.com/kb/ht4319
Troubleshooting FaceTime http://support.apple.com/kb/TS3367
The Complete Guide to FaceTime: Set-up, Use, and Troubleshooting Problems
http://tinyurl.com/32drz3d
I saw one post where a user said dust got inside the small microphone hole. Using a vacuum cleaner removed the dust and restored the audio.
Cheers, Tom
Similar Messages
-
Why isnt this working urgent please help
why isnt this working im trying to connect a panel to a scrollpane the panel will contain several dozen text fields
the scrollpane shouls be about 350, 450 , but the pane is 350
by 1200 the problem now is that the scorllbar isnt created and even when I explictly create it it contains no knob, and it will
not scroll up or down please someone help this is urgent
import java.awt.*;
import com.sun.java.swing.*;
public class ScrollDemo extends JPanel {
private Rule columnView;
private Rule rowView;
private ScrollablePicture picture;
class UnitsListener implements ItemListener {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
// Turn it to metric.
rowView.setIsMetric(true);
columnView.setIsMetric(true);
} else {
// Turn it to inches.
rowView.setIsMetric(false);
columnView.setIsMetric(false);
picture.setMaxUnitIncrement(rowView.getIncrement());
public ScrollDemo() {
Two t = new Two(columnView.getIncrement());
JScrollPane pictureScrollPane = new JScrollPane(t);
pictureScrollPane.setPreferredSize(new Dimension(300, 250));
pictureScrollPane.setColumnHeaderView(columnView);
pictureScrollPane.setRowHeaderView(rowView);
public static void main(String s[]) {
JFrame frame = new JFrame("ScrollDemo");
frame.setContentPane(new ScrollDemo());
frame.setVisible(true);
import java.awt.*;
import com.sun.java.swing.*;
public class Two extends JPanel implements Scrollable{
private JPanel ivjJPanel3 = null;
private JScrollPane ivjJScrollPane1 = null;
private int maxUnitIncrement = 1;
public Two(int m)
getJPanel1();
maxUnitIncrement = m;
setSize(300,1200);
private void getJPanel1() {
setLayout(null);
setSize(250,1200);
add(getJLabel1(), getJLabel1().getName());
public Dimension getPreferredScrollableViewportSize() {
return getPreferredSize();
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation,
int direction) {
if (orientation == SwingConstants.HORIZONTAL)
return visibleRect.width - maxUnitIncrement;
else
return visibleRect.height - maxUnitIncrement;
public boolean getScrollableTracksViewportHeight() {
return false;
public boolean getScrollableTracksViewportWidth() {
return false;
public int getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction) {
//Get the current position.
int currentPosition = 0;
if (orientation == SwingConstants.HORIZONTAL)
currentPosition = visibleRect.x;
else
currentPosition = visibleRect.y;
//Return the number of pixels between currentPosition
//and the nearest tick mark in the indicated direction.
if (direction < 0) {
int newPosition = currentPosition -
(currentPosition / maxUnitIncrement) *
maxUnitIncrement;
return (newPosition == 0) ? maxUnitIncrement : newPosition;
} else {
return ((currentPosition / maxUnitIncrement) + 1) *
maxUnitIncrement - currentPosition;
public void setMaxUnitIncrement(int pixels) {
maxUnitIncrement = pixels;I personally didn't play with swing components when they were in the com.sun.java.swing state, but I have a strong feeling it is very buggy and could be causing your problem.
Before posting gui issues, please use a newer API, even jdk1.1 would be fine, anything would be better than what your using.
you wrote: I dont care if its javax.swing or
com.sun.java.swing
I would also gather from this statement that your attitude could be one of your other issues. -
After a big loss of out-pulled hair here is the code:
setInterval() calls getNewMess function but it happens
nothing with onNewMess function.
Instead, if i click refresh-button, it gives me result
correctly.evt.target._parent
is just using the event argument that is dispatched to and
therefore received by your listener function. It is dispatched/sent
by your button component instance. The event object from components
- in as2 - normally contains at least two properties. A type
property... in this case that's "click" , because its a click event
and a target property. The target property is a reference to the
component instance from which the event originated. It can be
particularly useful if you have one listener handling events from
many sources. So.....
evt.target._parent is referring to the container clip of the
instance that sent the event. i.e. The _parent of the button in
this case.
That's why I replaced it with t (=this) which is a reference
to the timeline that the button is running in. Now it doesn't need
to get that reference from checking the _parent of the evt.target
property from the evt argument. Which means the argument that the
newMess function receives can be ignored and its no longer reliant
on it. Sounds confusing but once you "get" it, it all makes sense.
Eventually, lol.
And of couse you don't need to have a button if you don't
want one. -
Why isnt this working? add container to frame..
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MortgageCalcFrame {
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("Mortgage calculator");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Add's a container in the frame
Container content = new Container();
frame.getContentPane().add(content, BorderLayout.SOUTH);
JButton btn = new JButton("test");
content.add(btn, BorderLayout.EAST);
JTextField input = new JTextField(5);
frame.getContentPane().add(input, BorderLayout.CENTER);
//Display the window.
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}Well the problem you got is that the layout of a Container is null. You've got several options here.
1. You set a layout for your container like this
Container content = new Container();
content.setLayout(new FlowLayout());2. You use a different container that inherits from container like Panel or JPanel since this one already got a FlowLayout set.
Panel content = new Panel();or
JPanel content = new JPanel(); //better since you're currently mixing Swing components and AWT. -
Why isnt this working?? - I really need this!!!
Hi, can you please have a go at this problem? Thnx!!
Here is the code:
import java.io.*;
public class Main {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
private String newname=null;
public void setName ()throws Exception{
System.out.print("Hello, please enter your attribute");
newname = in.readLine();}
public String getName(){
return newname;}
public Main()throws Exception{
Main m = new Main();
m.setName();
import java.io.*;
public class Main2 {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
private String newname=null;
public void setName ()throws Exception{
System.out.print("Please enter your sign");
newname = in.readLine();}
public String getName()throws Exception{
Main z = new Main();
z.setName();
if(newname.equals("=")){
return ("==" + z.getName());}
else{
return "Error";}}
public Main2()throws Exception{
Main2 p = new Main2();
p.setName();}}
import java.io.*;
public class Main3 {
public static void main(String[] args)throws Exception {
Main2 p = new Main2();
System.out.print("Hello "+p.getName());}}For one, Main2 has a recursive constructor:
public Main2() throws Exception
//Main2 p=new Main2();
//p.setName();
setName(); // You don't need another instance
}Also, there is no reason to create a new class to get every entry from standard in. You could just do:
System.out.println("Enter A: ");
a=in.readLine();
System.out.println("Enter B: ");
b=in.readLine(); -
HT4113 why isnt this thing working
why isnt this working
Because of the actions of an unsympathetic deity.
Try to ask a sensible question with a clue or two, and us folk might be able to help you. With your present standard of asking, you have no hope. -
Why isnt drawLine() working??
Does anybody know why the drawLine method isnt doing anything?
ive made sure that done is true when i call it and x1, x2, y1 and y2 all have values. i dont know why it wont work
public void paintComponent (Graphics page)
super.paintComponent(page);
for (City spot : cityList)
page.fillOval ((int)spot.getX(), (int)spot.getY(), SIZE, SIZE);
cityIcon.paintIcon (this, page, (int)spot.getX(), (int)spot.getY());
if(done1 == true)
page.drawLine(x1, y1, x2, y2);
}class Algo1
private static ArrayList<City> cityList = new ArrayList<City>();
static ArrayList<City> goodList = new ArrayList<City> ();
static City thePoint = null;
public Algo1(ArrayList<City> cityList)
Algo1.setCityList(cityList);
public static ArrayList<City> algo1 (ArrayList<City> cityList)
ArrayList<City> thisList = new ArrayList<City> ();
thisList.addAll((ArrayList<City>)cityList);
City tempPoint = null;
double firstXValue = 600;
for (int i = 0; i < cityList.size(); i++)
tempPoint = new City(thisList.get(i).getX(), thisList.get(i).getY(), true);
if (tempPoint.getX() < firstXValue)
thePoint = thisList.get(i);
firstXValue = thePoint.getX();
thisList.get(i).removeCity();
goodList.add(thePoint);
while(!thisList.isEmpty())
thisList = onlyTrue(thisList);
if(!thisList.isEmpty())
thePoint = thisList.get(0);
City nextCity = getNextPoint(goodList.get(goodList.size() - 1), thisList);
nextCity.removeCity();
goodList.add(nextCity);
return goodList;
private static ArrayList<City> onlyTrue(ArrayList<City> trueList)
ArrayList<City> finalList = new ArrayList<City> ();
for (int i = 0; i < trueList.size(); i++)
if (trueList.get(i).checkIt() == false)
trueList.remove(i);
return trueList;
private static City getNextPoint (City tempPoint, ArrayList<City> thisList)
double minDist = 1000000;
Point2D firstCity = tempPoint;
Point2D secondCity = null;
for (int i = 0; i < thisList.size(); i++)
if (firstCity.distance(thisList.get(i)) < minDist)
minDist = firstCity.distance(thisList.get(i));
secondCity = thisList.get(i);
City nextCity = (City)secondCity;
return (City)secondCity;
public static void setCityList(ArrayList<City> cityList) {
Algo1.cityList = cityList;
public static ArrayList<City> getCityList() {
return cityList;
class City extends Point
double x;
double y;
boolean onList;
public City (double x, double y, boolean onList){
this.x = x;
this.y = y;
this.onList = onList;}
public City (Point abc){
this.x = abc.getX();
this.y = abc.getY();
onList = true;}
public boolean removeCity(){
onList = false;
return onList;}
public double getX(){
return x;}
public double getY(){
return y;}
public boolean checkIt(){
return onList;}
class CityList
static ArrayList<City> cityList = new ArrayList<City>();
public CityList()
cityList = cityListReader();
public static ArrayList<City> cityListReader()
Vector<Double> xCoord = new Vector<Double>();
xCoord.addElement(new Double(78));
xCoord.addElement(new Double(399));
xCoord.addElement(new Double(207));
xCoord.addElement(new Double(557));
xCoord.addElement(new Double(280));
xCoord.addElement(new Double(156));
xCoord.addElement(new Double(285));
Vector<Double> yCoord = new Vector<Double>();
yCoord.addElement(new Double(326));
yCoord.addElement(new Double(194));
yCoord.addElement(new Double(306));
yCoord.addElement(new Double(132));
yCoord.addElement(new Double(143));
yCoord.addElement(new Double(257));
yCoord.addElement(new Double(365));
for (int i = 0; i < xCoord.size(); i++)
City newCity = new City((double)((Double)xCoord.elementAt(i)),
(double)((Double)yCoord.elementAt(i)), true);
cityList.add(newCity);
return cityList;
} -
I've been practicing some IPSec VPN scenarios, starting with the typical site-to-site VPN:
Router A
crypto map mymap 10 ipsec-isakmp
set peer 1.1.1.2
set transform-set myset
match address 101
access-list 101 permit ip 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255
Router B
crypto map mymap 10 ipsec-isakmp
set peer 1.1.1.1
set transform-set myset
match address 101
access-list 101 permit ip 10.1.2.0 0.0.0.255 10.1.1.0 0.0.0.255
This works as expected. Traffic from 10.1.1.x on Router A gets picked up by the crypto map and sent to RouterB and vice versa. What is confusing me is a more advanced scenario where I'm tunnelling GRE over IPSec with OSPF (why? Because I can).
http://www.cisco.com/en/US/tech/tk583/tk372/technologies_configuration_example09186a008009438e.shtml
Everything works just fine, but I'm bothered by the ACLs being used in the example. I don't see how everthing should be working- OSPF is fat and happy, and if I ping one spoke from another spoke from a loopback interface, it works as well. In this case, is the network traffic being picked up by the Tunnel interface first, and all the crypto map sees is GRE traffic by the time the packets make it that far?Ian
You ask a question about the access lists and I believe that it will be easier to answer the question if we have the access lists to refer to. So here they are:
7206:access-list 130 permit gre host 14.36.88.6 host 14.38.88.40access-list 140 permit gre host 14.36.88.6 host 14.38.88.20access-list 150 permit gre host 14.36.88.6 host 14.38.88.102610:access-list 120 permit gre host 14.38.88.10 host 14.36.88.63620:access-list 110 permit gre host 14.38.88.20 host 14.36.88.6
3640:
access-list 100 permit gre host 14.38.88.40 host 14.36.88.6
one of the first things to understand here (and you briefly mention it in your post) is that they are running OSPF dynamic routing protocol over the tunnels. So each router sees the path to get to the other router as being through the tunnel. So when the 2610 wants to get to the 7206 it will send that traffic to the tunnel interface. The tunnel interface will encapsulate the original packet in a GRE header. So yes the only thing that the access list will see is GRE traffic.
Anything that goes through the tunnel (whether it be a data packet or an OSPF routing update) is encapsulated in a GRE header and the access list does not see the original data but sees only GRE.
HTH
Rick -
Questions, Extreme begginer - Why wont this work.
/* My Java Program
Failing To Compile 2009 - CurrentDate()
/* Importing */
import java.util.Scanner;
import acm.graphics.*;
import acm.program.*;
class run {
public static void main(String args[]){
//Variables
Scanner ninjatext = new Scanner(System.in);
Scanner Clarinet_Request = new Scanner(System.in);
System.out.println(ninjatext.nextLine());
double pye, var1, ans;
String yodawg;
var1 = 2;
pye = 3.14;
yodawg ="I heard you like saxaphones ";
ans = var1/pye;
System.out.println("Hello Cruel World?");
System.out.print(yodawg);
System.out.print("So i bought you ");
System.out.print(ans);
System.out.println(" Saxxes");
System.out.println("So How many Clarinets Would you like????");
System.out.println("Enter Number::");
System.out.println("So " + Clarinet_Request.nextLine() + " Is how many clarinets You would like? Cool");
/*Please end up working*/
// Declaring Variables Semi-Randomly Works, Right?
String test1 = "Ok i hope this works";
int test2 = 10;
double test3 = 4.9;
int test4 = test2/test3; //Random Weird Awnser right???
System.out.println(test2 + "Divided by" + test3 + "Is Equal To" + test4);
/* This all should work, at least in theory.... But it wont right? */
/** What have i gotten myself into? Oh well it sounds like it should work */
Console console = System.console();
String username = console.readLine("Lets Do This?: ");
if (/* String? */username == "yes" || "Yes" || "YES"){
testingthiscrap LeroyJenkins = new testingthiscrap
LeroyJenkins.LetsDoThis()
/* Guaranteed to not work */
public class testingthiscrap extends GraphicsProgram {
/** Runs the program */
public void LetsDoThis() {
GRect rect = new GRect(100, 50, 100, 100 / PHI);
rect.setFilled(true);
rect.setColor(Color.RED);
add(rect);
GOval oval = new GOval(150, 50 + 50 / PHI, 100, 100 / PHI);
oval.setFilled(true);
oval.setColor(Color.GREEN);
add(oval);
/** Constant representing the golden ratio */
public static final double PHI = 1.618;
/* Standard Java entry point */
/* This method can be eliminated in most Java environments */
public static void main(String[] args) {
new FeltBoard().start(args);
}//If anything i just typed i now feel heroic.
// public static void
Ok, sorry if the titles not good enough but i am a php programmer between begginer and intermediate but who wants to know java so i can say write a applet or something that can run from the desktop directly, also i wanted to lean OO and it in php confuses me infinately so i decided in the context of knowing nothing i might pick it up better thus java.
So most of what im doing is confusing to me so i just tried to type some code (Well the first 20 maybe lines i compiled and tested but after that i couldnt test so i just ran with it. Today i tried to compile and poof, nothing.
Any clues what im doing wrong and what i should do instead?
BTW this stuff feels weird, i feel like to take imput it should have a html form or something. I dunno.
also i dont even seem to have these acm packages im trying to import, any clue why?jman888 wrote:
Ok, sorry if the titles not good enough but i am a php programmer between begginer and intermediate but who wants to know java so i can say write a applet or something that can run from the desktop directly, also i wanted to lean OO and it in php confuses me infinately so i decided in the context of knowing nothing i might pick it up better thus java. Ok?
So most of what im doing is confusing to me so i just tried to type some code (Well the first 20 maybe lines i compiled and tested but after that i couldnt test so i just ran with it. Today i tried to compile and poof, nothing.I assume you got a compile time error, if so next time you post a question incorporate this piece of information.
Any clues what im doing wrong and what i should do instead?I can take a stab at your code.
BTW this stuff feels weird, i feel like to take imput it should have a html form or something. I dunno.One step at a time
String yodawg;
yodawg ="I heard you like saxaphones ";This is not an error but plain weird IMHO, if you are declaring a variable then initializing it, you might as well do it all on one line.
if (/* String? */username == "yes" || "Yes" || "YES"){
testingthiscrap LeroyJenkins = new testingthiscrap
LeroyJenkins.LetsDoThis()
}This code will not compile and should produce one of possible many compiler errors. The condition inside the if statement requires each condition to be independent of one another. e.g. (username == "yes" || username = "Yes" || username == "YES").
This also represents one of the most common errors presented to new comers. Equivalence of Objects such as Strings are compared using a method .equals() and not the term "==". The latter actually compares two Strings by the address stored in memory.
class runBy convention all Class names begin with a capital letter
Also it appears that the class run contains main method and an inner class in which itself contains a main method. I will conclude right here that you are biting off far more then you can chew. Start with the basics, e.g. Google for Java tutorials and start from "hello world" then make your way from there. Tackle one problem at a time and learn the concepts of the tutorial which will hopefully stay with you, as these fundamental concepts will be your foundation to development using the Java language.
Mel
Edited by: Melanie_Green, apparently CODE tags don't like me tonight -
Why aint this working???
have pasted object thru a constructor like this:
Write screen = new Write(ring);
//and rezive it here in the constructor
public Write(Object ring)
buffer = ring;
// and use it like this:
System.out.println(buffer.remove()); // This line gets an errorSo why is this error comming?
cannot resolve symbol method remove()public class RingBuffer
public static void main(String[] args)
Ringen ring = new Ringen();
Write screen = new Write(ring); // Henter tekst fra ringbuffer og skriver den ut p? skjermen.
Generate genr = new Generate(); // Lager tekst "automatisk" og legger den inn i ringbufferen.
Input_txt intxt= new Input_txt(ring); // Lar brukeren taste inn noen ord som lagres i ringbufferen.
screen.start(); //
genr.start(); // Starter tr?dene.
intxt.start(); //
public class Write extends Thread
private Object buffer;
public Write(Object ring)
buffer = ring;
synchronized public void run()
//Ringen buffer = new Ringen();
while(true){
try{
System.out.println(buffer.remove()); // Pr?ver ? skrive ut hvert sekund
Thread.sleep(1000);
}//end try
catch(InterruptedException e){
System.out.println(e);
}//end while
import java.io.*;
public class Input_txt extends Thread
Object buffer;
public Input_txt(Object ring)
buffer = ring;
synchronized public void run()
try{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Skriv inn noe tull");
String inTxT = in.readLine();
buffer.insert(inTxT);
catch(Exception e) { System.out.println(e);}
public class Ringen implements Buffer
private static final int BUFFER_SIZE = 10;
int in, out; // peker p? f?rste ledige og siste okuperte.
int count; // Teller hvor mange objekter som er i bufferen.
private Object[] buffer;
public Ringen()
count = 0;
in = 0;
out = 0;
buffer = new Object[BUFFER_SIZE];
public void insert(Object item)
while (count == BUFFER_SIZE)
;// do nothing..
// Legger til et object i bufferen
++count;
buffer[in] = item;
in = (in + 1)% BUFFER_SIZE;
public Object remove()
Object item;
while (count == 0){
try{
System.out.println(buffer[0]);
Thread.sleep(4000);
}//end try
catch(InterruptedException e){
System.out.println(e);
}//end while
--count;
item = buffer[out];
out = (out + 1) % BUFFER_SIZE;
return item;
public interface Buffer
// producers call this method
public abstract void insert(Object item);
// consumers call this method
public abstract Object remove();
} -
Why isnt this loop working?
I am trying to fill an array with the Fibonacci sequence.
Oh and, I know its very silly to use 'long i' instead of 'int i' as my incrementor in the for loop. But... I have a reason.
import java.math.*;
public class euler20{
public static void main (String arghp[]){
BigInteger a[]=new BigInteger [1000000];
a[1]=new BigInteger("1");
a[2]=new BigInteger("2");
for(long i=3;i<10;i++)
System.out.println(a[(int)i]);
a[(int)i]=new BigInteger(""+a[(int)i-1].add(a[(int)i-2]));
Tell me I am doing something REALLY stupid..uhm well, I imporvised my code a little..
replace a[(int)i]=new BigInteger(""+a[(int)i-1].add(a[(int)i-2]));with
a[(int)i]=a[(int)i-1].add(a[(int)i-2]);However, the problem persists. -
Work-around The Whine: why does this work? And is it BAD?
Hello everybody, sorry to bring up The Whine again, but I was wondering if anyone can figure out why the following trick works to eliminate the noise.
Also, could doing this regularly (all the time, basically) potentially be bad for the system in any way?
This is the work-around I've been using:
1. Open Photobooth, then Force Quit that application (you must Force Quit rather than simply quit)
2. Put the Macbook to sleep, waiting a few seconds until the indicator light starts pulsing.
3. Wake up the computer.
Voila. That always does the trick, eliminating the whine until either the next time I boot up or the next time I open and quit Photobooth in the normal way.
I suppose force quitting may keep the processor slightly busy somehow?
Don't know...John P.,
You say that all the notebooks that you know of make
some kind of noise. How many notebooks is that? Not
trying to be a jerk or anything but it better be like
dozens and dozens to make this claim. I have heard
the exact opposite of this claim from users that have
owned a few notebooks as well.
Hi Jerome,
No problem... I'll clarify..
5 notebooks personally, so when I say "all notebooks that I know of", it's a true claim because that is exactly what I'm saying.
If this noise is caused by capacitor that is at some
miniature threshold then why does the noise go away
when said remedies are employed? Does the capacitor
get bigger? Doesn't make sense but I appreiate that
you want to reassure original poster.
Actually I may have misspoken--it may be called a "voltage regulator" and it sits directly West of the CPU and controller chip. They do make noise and from what I have been told and remember, they can dampen it w/ a capacitor but that's about it. It's just the nature of the beast for that type of component, I'm told.
What "I" think it may be is the power fluctuations, or lack thereof, in the Intel chip causing it--when you put a load on it, there's a power fluctuation because your CPU usage is going up/down a little bit, but when you're not doing anything it's very little it causes it to make a little noise. No big deal, but just as long as it's not blaring in your ear when you're trying to use your computer. My ZV6000 does the same thing, but it doesn't matter when you've got a load or not--seems to do it more when I have Cool 'n' Quiet enabled.
This is not right. I am sorry.
If this noise is normal then I'll take no MacBook.
You know it is being fixed apparently on the MacBook
Pros by motherboard replacement.
I never said anything about pro. I don't own one, nor have I used one. I can't say how profound in comparison to the Macbook (non pro) it is.
I'm sure if Apple thought it was a big enough problem, they would act either more quickly about it, but it's not stopping me from checking my e-mail or going on the Web. -
Filter as autoload trigger; why does this work?
In my efforts to use PS consoles more and CMD consoles less, I've been "porting" my environment over. One of the things I can't live without is my 'cd aliases'. I have several aliases like: "src=cd /d c:\src" (loaded in doskey). Separate
functions for each alias seemed kludgy, so after a bit of playing around, I came up the little module below to mimic the functionality. The function takes a look at the alias that invoked it and sets the location based on values in a hashtable.
Since the aliases are dynamically created and thus aren't available to trigger the autoload, I decided to add a filter to do the triggering (I could just import the module in my profile, but I try to keep my profile lean).
My thought was that I could type 'src' and if the module wasn't loaded, it would cause the autoload to happen which would override the filter 'src' with the alias 'src'. Typing 'src' a second time would actually set my location to my source directory.
When I tested the 'filter autoload' however, I was pleasantly surprised that not only did it autoload the module, but it did the set-location on the
first invocation.
My guess is that PS sees the command 'src' and when it's passed looks at the modules that can satisfy the command. Finding a filter named 'src' in CdAlias.psm1, it autoloads. Then PS, knowing that the needed module is now loaded, resolves 'src' against the
now-current environment, finds the alias, resolves that to Set-XLocation and we are off to the races. That said, I'm only guessing here, and since this seems like something that could be useful in other places, it would be cool if someone could confirm my
guess or explain what's really happening.
thanks,
K.
Note: This is the prototype, I will actually store the hashtable in the registry along with functions to edit the entries.
<#
.Synopsis
Sets location based on the alias name used to call the function
.DESCRIPTION
Uses the name of the alias used to call the function to look up
a path in the script-scoped dictionary 'xlocation' then sets
the location to that value.
.PARAMETER ChildPath
Optional child path, if passed it will be joined with the base.
.NOTES
Not sure why the filter trick works, but it does. Since src is my
most commonly used alias location, I can use it to auto-load. What
really confuses me is that it still sets the location to src the
first time I type it.
#>
function Set-XLocation
Param
[string]$ChildPath
$k = $MyInvocation.InvocationName
if ($Script:xlocation.ContainsKey($k))
Set-Location -Path (Join-Path -Path $Script:xlocation[$k] -ChildPath $ChildPath)
else
Write-Warning "`$xlocation does not contain the key '$k'."
$Script:xlocation = @{
src = 'C:\src';
one = 'C:\src\one';
zero = 'C:\src\zero';
mod = "$mod";
foreach ($k in $Script:xlocation.Keys) { Set-Alias -Name $k -Value Set-XLocation }
filter src
Export-ModuleMember -Function Set-XLocation -Alias *I do not understand what the issue is. If you have to create a filter for every alias you are not really gaining anything over defining a function or alias.
I do not believe the filter does anything except create a reference:
PS C:\src> get-alias src
CommandType Name
ModuleName
Alias src -> Set-XLocation
CDAlias
¯\_(ツ)_/¯ -
Why isn't this formail cgi working?
http://megacyberteck.com/contact.html
Thanks for helping>
http://megacyberteck.com/contact.html
>
the server is treating the script like a TEXT file.
http://megacyberteck.com/formmail.cgi
Properly working, that version of formmail.cgi script will
give a copyright
and "missing recipient" error message when you load it
directly into the
browser.
as the others have said- most hosts require cgi files to be
in a specific
cgi-bin directory for them to be allowed to execute.
and- if on Apache server, you have to give the file
permission to execute,
as the README instructions detail on chmod'ing the file to
755.
http://uptime.netcraft.com/up/graph?site=megacyberteck.com
okay, it's Apache/Unix
See your host's FAQ/Support section.
Also, it's fairly common for the cgi-bin folder to be in the
private top
level root of your hosting. It's also very common on that
type of hosting
for a "formmail-clone" script to already be preinstalled and
ready for use.
If your hosting has a control panel or CPanel, go to it and
look around. -
Problem with WindowAdapter, why doesnt this work ?
Hi
I have created a source file with the following code:
import java.awt.* ;
import java.awt.event.* ;
import javax.swing.* ;
public class EventDemo3 extends JFrame
EventDemo3()
// Setter tittel, st�rrelse og gj�r det synlig
setTitle("EventDemo3 - lukking av vindu") ;
this.addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent e)
System.exit(0) ;
setSize(300, 300) ;
setVisible(true) ;
public static void main(String[] args)
new EventDemo3() ;
}It compiles and runs, but when i close the window the JVM is still running and i cant figure out why, does someone know why this doesnt work ?
Message was edited by:
icebytePerhaps you want this instead:
import java.awt.* ;
import java.awt.event.* ;
import javax.swing.* ;
public class EventDemo3 extends JFrame
EventDemo3()
// Setter tittel, st�rrelse og gj�r det synlig
setTitle("EventDemo3 - lukking av vindu") ;
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e)
System.exit(0) ;
setSize(300, 300) ;
setVisible(true) ;
public static void main(String[] args)
new EventDemo3() ;
}
Maybe you are looking for
-
Media Encoder CC will not install with PPCC on Mac OS 10.9
After numerous tries after updating to Mavericks to install Media Encoder CC, it has failed each time. When trying to render projects in Premiere Pro CC a screen pops up that says I am using an old version of Media Encoder and need to update so I go
-
How do I open a PDF file in my browser instead of in Adobe Reader?
Windows XP SP3 Adobe Reader 11.0.3 SeaMonkey 2.19 (which has the same internal "guts" as Firefox 22) It used to be that, if I selected a link to a PDF file from a Web page, the file would open in my browser. Now, it opens in an Adobe Reader window.
-
I am very frustrated. I have spent over 8 hours trying to get my Dreamweaver subscription to work on my PC to no avail. Six hours have been spent with foreign support. I want to speak with someone who isn't speaking from a script who can actually
-
Adobe Acrobat 8's Distiller fails in Snow Leopard
I saw this thread: http://discussions.apple.com/thread.jspa?messageID=10084009 , which deals with Acrobat 8.0 but doesn't say whether anyone has found a way to get Acrobat's distiller to work on Snow Leopard. All of Adobe's help systems unhelpfully p
-
How can I ensure my purchased TV shows and movies transfer from my apple TV 1st gen to my apple TV 2nd gen??