How can I use touchesbegan in a table's cell without having to subclass a whole cell. Something like addTarget..... which is available for a UIButton?
(in vb.net this would be like AddHandler I think)
Last year I heard that Installer Projects were going away and we should be switching to Windows Installer XML. Whatever happened with that?
So you know where I'm coming from, support for TFS-based buil machines is very important to me. I know Installer Projects kinda-sorta work with TFS, but they have issues.
I'm using the post-receive-email script included with git. (Source is here.) It works just fine, but I want each email to be sent from the author of the commits pushed. How do I do it?
My post-receive file currently looks like this, and I want to customize the from-email-address.
#!/bin/sh
export [email protected]
$(dirname $0)/post-receive-email
The alerts that I setup for source code changes isn't being triggered. I suspect that the email server settings are wrong, but where would I configure them?
Hi, I'm looping a two-dimensional array like this:
if (!empty($aka)) {
foreach ($aka as $ak) {
if($ak["lang"]=="es") {
$sptitle=$ak["title"];
}
}
}
Pretty simple. If the array ($aka) is not empty I loop trough it and when it finds that the "lang" index is equal to "es" I just save the "title" value for that index in $sptitle.
The problem is that the array ($aka) contains a lot of information and sometimes there is no "lang" index... and I get this error: Notice: Undefined index: lang.
How can I fix this???
This is a extract of the array to help you understand. Notice that [1] doesn't have a [lang] index but [2] does have:
[1] => Array
(
[title] => The Lord of the Rings: The Motion Picture
[year] =>
[country] => USA
[comment] => promotional title
)
[2] => Array
(
[title] => Señor de los anillos: La comunidad del anillo, El
[year] =>
[country] => Argentina
[comment] => Chile, Mexico, Peru, Spain
[lang] => es
)
Thanks!
Found the following in an Oracle-based application that we're migrating (generalized):
SELECT
Table1.Category1,
Table1.Category2,
count(*) as Total,
count(Tab2.Stat) AS Stat
FROM Table1, Table2
WHERE (Table1.PrimaryKey = Table2.ForeignKey(+))
GROUP BY Table1.Category1, Table1.Category2
What does (+) do in a WHERE clause? I've never seen it used like that before.
Hi!
I need to retrieve the name, email and picture from a google account.
I am already using the openid to make the user login with it's google acc.
Can I have the picture URL from the openid proccess?
with OAuth I cant'seem to find the right scope to retrieve this information... See this link:
http://code.google.com/apis/gdata/docs/directory.html
there is a list of scopes that you can fetch with REST api to google and I didnt't see the one related to the profile.
Btw, I am using PHP and the openid is already working, but didn't start with the oauth untill I know if I can(and need) retrieve the picture (because email and name already comes within the openid proccess)
thanks,
Joe
We're being told that fewer HTTP requests per page load is a Good Thing. The extreme form of that for CSS would be to have a single, unique CSS file per page, with any shared site-wide styles duplicated in each file.
But there's a trade off there. If you have separate shared global CSS files, they can be cached once when the front page is loaded and then re-used on multiple pages, thereby reducing the necessary size of the page-specific CSS files.
So which is better in real-world practice? Shorter CSS files through multiple discrete CSS files that are cacheable, or fewer HTTP requests through fewer-but-larger CSS files?
Hi,
I've got a problem when I'm calling a static var from another class. I get this pretty syntax error where php is unexpected the '.'
Here is where I'm calling it :
private $aLien = array(
"menu1" => array("Accueil","statique/".Variable_init::$langue."/accueil.html",0,0), //This line
"menu2" => array("Infos Pratiques","statique/".Variable_init::$langue."/info.html",0,0),
"menu3" => array("Faire une réservation","statique/".Variable_init::$langue."/reserver.html",0,0),
"menu4" => array("Pour Nous Joindre","statique/".Variable_init::$langue."/nousJoindre.html",0,0),
"menu5" => array("Plan du site","statique/".Variable_init::$langue."/plansite.html",0,0)
);
And here is my static var declaration from another class:
class Variable_init implements iVariable_init{
public static $langue;
public static $id_choix;
public static $id_contenu;
I recently installed PHP on IIS/Windows 7, but it isn't working. I am getting the entire source file in the browser window.
FastCGI Settings shows c:\Program Files (x86)\PHP\php-cgi.exe
Handler Mappings has
Request Path: *.php
Modue: FastCgiModule
Executable: C:\Program Files (x86)\PHP\php-cgi.exe
Request Restrictions: File or Folder, All verbs, Script Access
As a personal hobby I am looking to build an online audio mixer where I can upload individual instrument tracks, control individual volumes of each track, and export the mixed down version. I've been trying (and have come pretty close) with javascript. I really would like to stay away from flash if possible, but I'm really looking for suggestions for technologies to try. If anyone has any suggestions on languages that are good at stuff like this or libraries that I am missing, please let me know!
I have a test environment that I have been using:
http://driverstestpractice.com/sandbox
Currently all tracks on the site are set to the click track in order to test the track sync (which as you can tell is a little off)!
Thanks!
Does anyone know where I can get documentation on "Lists Web Service" for SharePoint. I tried this link, but it seems that every child link goes to a random page.
http://msdn.microsoft.com/en-us/library/dd587198(office.11).aspx
How would I programatically access a SharePoint document library from another machine? I want to recursively scan all the folders and generate a list of files with a certain custom property.
I am using the Jquery Validation plug-in, however i need to add a "custom rule", i have 2 date fields and i need to ensure that the end date is not less than the start date. My problem is how to pass the two fields in as elements.
As i understand u set up a custom function something like this :
function customValidationMethod(value, element, params){ }
But can't see how i could use it with two fields, if anyone has any ideas it would be greatly appreciated.
Hi, i don't know about regular expressions, I asked here for one that:
gets either anything up to the first parenthesis/colon or the first word inside the first parenthesis. This was the answer:
preg_match('/(?:^[^(:]+|(?<=^\\()[^\\s)]+)/', $var, $match);
I need an improvement, I need to get either anything up to the first parenthesis/colon/quotation marks or the first word inside the first parenthesis.
So if I have something like:
$var = 'story "The Town in Hell"s Backyard'; // I get this: $match = 'story';
$var = "screenplay (based on)"; // I get this: $match = 'screenplay';
$var = "(play)"; // I get this: $match = 'play';
$var = "original screen"; // I get this: $match = 'original screen';
Thanks!
I have a variable "fila" with a full line with excel's values; The problem is when in excel I have --#N/A-- vba take that value like "Error 2042" and I cannot asign that value to "valor" and produce me an error, until this point everything is ok, now I am trying to define a "On error goto" for go to the "next" iteration in the loop "for", but I dont know Why vba doesnt handle the error.
Do While Not IsEmpty(ActiveCell)
txt = ActiveCell.Value2
cell = ActiveCell.Offset(0, 1).Value2
fila = Range("C20:F20")
For j = 1 To UBound(fila, 2)
On Error GoTo Siguiente
If Not IsEmpty(fila(1, j)) Then
valor = fila(1, j)
cmd = Cells(1, j + 2).Value2
devolver = function1(cmd, txt, cell, valor)
arrayDevolver(p) = devolver
p = p + 1
End If
Siguiente:
Next
Loop '
I have a login form using a UITableView. One of the cells has a UISwitch which when on will delete the row above it and when off reinsert it.
But the first cell automatically has the keyboard up when the cell is created (basically when the view loads) (by using [cell becomeFirstResponder];)
Inserting/deleting any of the cells means that the keyboard animates out and then animates back in.
I'd like to remove this so the keyboard stays up while rows are deleted/inserted.
Hi there
I am not sure if the title has the correct terms, I have a developer and am very new to cubes.
I have a cube which has data associated to materials that are broken down into chemical compounds.
For example a rock material has 10% of this chemical and 10% of that chemical, etc. Samples are taken daily and sample is a dimension with date, etc.
So, the measure needs to average by the sample dimension but needs to sum across the chemical compound dimension (To add up to 100% for example).
Is this at all possible?
When running the following code I get no output but I cannot work out why.
# include <stdio.h>
int main()
{
fputs("hello", stdout);
while (1);
return 0;
}
Without the while loop it works perfectly but as soon as I add it in I get no output. Surely it should output before starting the loop? Is it just on my system? Do I have to flush some sort of buffer or something?
Thanks in advance.
The select() and pselect() system calls modify their arguments (the 'struct fd_set *' arguments), so the input value tells the system which file descriptors to check and the return values tell the programmer which file descriptors are currently usable.
If you are going to call them repeatedly for the same set of file descriptors, you need to ensure that you have a fresh copy of the descriptors for each call. The obvious way to do that is to use a structure copy:
struct fd_set ref_set_rd;
struct fd_set ref_set_wr;
struct fd_set ref_set_er;
...
...code to set the reference fd_set_xx values...
...
while (!done)
{
struct fd_set act_set_rd = ref_set_rd;
struct fd_set act_set_wr = ref_set_wr;
struct fd_set act_set_er = ref_set_er;
int bits_set = select(max_fd, &act_set_rd, &act_set_wr, &act_set_er, &timeout);
if (bits_set > 0)
{
...process the output values of act_set_xx...
}
}
My question:
Are there any platforms where it is not safe to do a structure copy of the struct fd_set values as shown?
I'm concerned lest there be hidden memory allocation or anything unexpected like that. (There are macros/functions FD_SET(), FD_CLR(), FD_ZERO() and FD_ISSET() to mask the internals from the application.)
I can see that MacOS X (Darwin) is safe; other BSD-based systems are likely to be safe, therefore. You can help by documenting other systems that you know are safe in your answers.
(I do have minor concerns about how well the struct fd_set would work with more than 8192 open file descriptors - the default maximum number of open files is only 256, but the maximum number is 'unlimited'. Also, since the structures are 1 KB, the copying code is not dreadfully efficient, but then running through a list of file descriptors to recreate the input mask on each cycle is not necessarily efficient either. Maybe you can't do select() when you have that many file descriptors open, though that is when you are most likely to need the functionality.)
There's a related SO question - asking about 'poll() vs select()' which addresses a different set of issues from this question.
https://docs.google.com/viewer is awesome, but there are some customizations I need to make, and documentation would be helpful. Discovered here http://googlesystem.blogspot.com... . Haven't seen any public documentation that would help.
http://code.google.com/apis/documents/overview.html covers the Google docs - where the above is more a clone of the Google Books previewer http://books.google.com/books .
I have a method that attempts to update a sql server database in an ASP.NET application. If the update fails, it catches the exception and then queues the update in MSMQ, and then spins up a new thread that will later de-queue the pending update and try again. When the thread starts, it fails to open a database connection because it is attempting to connect using Network Service as the login. The sql connection is using Windows Authentication, and will work outside of the thread. If I put a breakpoint in the code that executes inside the new thread and check the Thread.CurrentPrincipal, it shows the Identity as being the correct user. Why is the sql connection attempting to be opened by the Network Service account?
I can elaborate further is necessary.
Thanks.
Not sure I fully understand what phpmyadmin does.
I created a database in phpmyadmin, and would now like to start accessing the data in it from php. However I have no idea where the database is?
Should I export in the phpmyadmin software? I tried that but it came up with a .sql file which can be opened in notepad and contains the SQL statements used to create the datbase and the one table inside. Basically that doesn't look like a database to me.
I have an HTML page that needs to open in word. I created the document in word and saved the document as an HTML document. So word spits out all its nasty HTML syntax. This is the opened through internet explorer which will display the word document within the browser.
When I view the page word modifies some of the tags. More specifically it adds a Width and Height tag and ignores the width and height within the style tag. If I try setting the Width and Height tags it overrides with new values. I have tested on different environments and get different results as word makes decision how to handle.
A bit of background this img starts off as this, and is rendered via data rendering syntax.
<asp:Image id="as" runat="server" Src"<%# ImgSource %>" style="width:178px;height:130px" />
It ends up like this in word
<img width=32
height=32 id=barCodeImage
src="http://myurl/BarcodeImages/1136574_129180418198008169.png"
style='border-bottom-width:0px;border-left-width:0px;border-right-width:0px;
border-top-width:0px;height:130px;width:178px'>
I want to stop word from reformatting the HTML.
Simply stated, I am trying to make a game I am working on full-screen.
I have the following code I am trying to use:
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gs = ge.getDefaultScreenDevice();
if(!gs.isFullScreenSupported()) {
System.out.println("full-screen not supported");
}
Frame frame = new Frame(gs.getDefaultConfiguration());
Window win = new Window(frame);
try {
// Enter full-screen mode
gs.setFullScreenWindow(win);
win.validate();
}
Problem with this is that I am working within a class that extends JPanel, and while I have a variable of type Frame, I have none of type Window within the class.
My understanding of JPanel is that it is a Window of sorts, but I cannot pass 'this' into gs.setFullScreenWindow(Window win)... How should I go about doing this?
Is there any easy way of calling that, or a similar method, using a JPanel?
Is there a way I can get something of type Window from my JPanel?
-
EDIT: The following method changes the state of JFrame and is called every 10ms:
public void paintScreen()
{
Graphics g;
try{
g = this.getGraphics(); //get Panel's graphic context
if(g == null)
{
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setExtendedState(frame.getExtendedState()|JFrame.MAXIMIZED_BOTH);
frame.add(this);
frame.pack();
frame.setResizable(false);
frame.setTitle("Game Window");
frame.setVisible(true);
}
if((g != null) && (dbImage != null))
{
g.drawImage(dbImage, 0, 0, null);
}
Toolkit.getDefaultToolkit().sync(); //sync the display on some systems
g.dispose();
}
catch (Exception e)
{
if(blockError)
{
blockError = false;
}
else
{
System.out.println("Graphics context error: " + e);
}
}
}
I anticipate that there may be a few redundancies or unnecessary calls after the if(g==null) statement (all the frame.somethingOrOther()s), any cleanup advice would be appreciated...
Also, the block error is what it seems. I am ignoring an error. The error only occurs once, and this works fine when setup to ignore the first instance of the error... For anyone interested I can post additional info there if anyone wants to see if that block can be removed, but i'm not concerned... I might look into it later.