Is there a way to do this in C#?
So for example, if your method is called and you want to know if the caller had put the method call inside a checked block?
Hello. Looking for the best practice here...
Have a form that consists of a calendar. Each day of the calendar has 2 text input fields - customer and check-in. What would be the best & most efficient way to send this form to PHP for processing?
<form action="post">
<div class="day">
Day 1<br />
<label for="customer['.$current['date'].']">Customer</label>
<input type="text" name="customer['.$current['date'].']" value="" size="20" />
<label for="check-in['.$current['date'].']">Check-In</label>
<input type="text" name="check-in['.$current['date'].']" value="" size="20" />
<input type="submit" name="submit" value="Update" />
</day>
<div class="day">
Day 2<br />
<label for="customer['.$current['date'].']">Customer</label>
<input type="text" name="customer['.$current['date'].']" value="" size="20" />
<label for="check-in['.$current['date'].']">Check-In</label>
<input type="text" name="check-in['.$current['date'].']" value="" size="20" />
<input type="submit" name="submit" value="Update" />
</day>
</form>
Is my current setup good? I feel there has to be a better option. My concern involves processing a whole year at once (which can happen) and adding additional text input fields.
What i am looking around me is the drastically change in ASP.Net Architecture. More and more company are following the approach of
JSON based wcf service in middle tier.
Plain HTML based UI tier with JQuery/Ajax.
No Postback at all, This contradicts the Default behaviour of Asp.Net Server Control/Code Behind Event handler/Postback.
I am a Asp.Net Web Developer for around 4 years, and concerned about the future of ASP.Net.
Is the Default Architecture of ASP.Net is Outdated at all?
Does MVC or ASP.Net 4.0 Tries to solve the Issue?
Hi all,
I have set up AuthLogic almost exactly as per the AuthLogic example app at http://github.com/binarylogic/authlogic_example.
After someone logs in as User, they can click on links that send them away into the system and away from the users controller. This is an incredibly noob question, but how can I access that User's ID and other attributes from anywhere else, such as an unrelated view or unrelated controller?
An example of what I'd like to do:
#matchings controller
@matching = Matching.find_by_user_id(user.id)
Being 32 years old, I did not follow debates in programming, language design, and platforms in the 1960s, 1970s, 1980s, and most of the 1990s. I sometimes hear glimpse of what the major debates were and how they turned the course of history. It makes me wonder what I take for granted.
I am curious, what were the debates. The ones I know are:
Procedural vs. Object Orientated Programming
Lisp vs. C
Software vs. Chips with Embedded Code
Hi,
I´m trying to get hold of the addresses to the currently used DNS-servers in my application, either I´m connected thru Wifi or mobile.
The DhcpInfo object should provide this but how can I get hold of a valid DhcpInfo object?
Best regards
John
Hi, I have started using the DataTables plugin (v1.6.2) for jQuery(v1.4.2), and I would like to ask you if you know a settings or a plugin that allow me to highlight the text used in search textbox on the filtered rows.
Thank you in advance
Hi All.
I have a Windows Media Player control embedded inside my webpage, I feed it some URL to stream from (ASF file).
How can I get from the WMP control the resolution in pixels of the file being played?
Thanks
Roey
So I see a number of ways to display allot of seconds in a (static) hr/min/sec. However, I am trying to produce a visual count down timer:
$('#someelement').html(minCounter + ' minutes ' + ((secCounter == 0) ? '' : (secCounter + ' seconds')));
My counter is reduced inside a SetInterval that triggers ever 1 second:
//.......
var counter = redirectTimer;
jQuery('#WarningDialogMsg').html(minCounter + ' minutes ' + ((secCounter == 0) ? '' : (secCounter + ' seconds')));
//........
SetInternval( function() {
counter -= 1;
secCounter = Math.floor(counter % 60);
minCounter = Math.floor(counter / 60);
//.......
$('#someelement').html(minCounter + ' minutes ' + ((secCounter == 0) ? '' : (secCounter + ' seconds')));
}, 1000)
It is a two minute counter but I don't want to display 120 seconds. I want to display 1 : 59 (and counting down).
I have managed to get it to work using the above, but my main question is: is there a more elegant way to accomplish the above? (note: I am redirecting once "counter == 0").
Hi all
I have a couple of pages in my site which open in a shadowbox window rather than the main window. My problem is that if the user session expires, then the user clicks on one of the links that open in a shadowbox, they are redirected to the login page INSIDE THE SHADOWBOX, which i don't want. I've been trying to think of the best way to handle this - one way i thought of, which seems a bit clumsy tbh, was on the login page to test if we're in a shadowbox, and if we are then close it and redirect the parent window to the login page.
a) does this seem like a sensible plan? I added the following to my login page, which works:
$(document).ready(function(){
if(window.parent.location != window.location){
window.parent.location.href = window.location;
}
}
but i have to wait for the shadowbox to finish loading the page and then redirect. So it's working but like i say a bit clumsy. Is there a nicer way?
grateful for any advice - max
Hi everyone,
I am sure this will have been answered but I proved unable to find it. So please excuse my redundancy.
What I am trying to do is emulating the "Home" button which takes one back to Android's homescreen. So here is what causes me problems:
I have 3 launcher activities. The first one (which is connected to the homescreen icon) is just a (password protected) configuration activity. It will not be used by the user (just admin)
One of the other 2 (both accessed via an app widget) is a questionnaire app. I'm allowing to jump back between questions via the Back button or a GUI back button as well. When the questionnaire is finished I sum up the answers given and provide a "Finish" button which should take the user back to the home screen.
For the questionnaire app I use a single activity (called ItemActivity) which calls itself (is that recursion as well when using intents?) to jump from one question to another:
Questionnaire.serializeToXML();
Intent i = new Intent().setClass(c, ItemActivity.class);
if(Questionnaire.instance.getCurrentItemNo() == Questionnaire.instance.getAmountOfItems()) {
Questionnaire.instance.setCompleted(true);
} else Questionnaire.instance.nextItem();
startActivity(i);
The final screen shows something like "Thank you for participating" as well as the formerly described button which should take one back to the homescreen. But I don't really get how to exit the Activity properly. I've e.g. used this.finish(); but this strangely brings up the "Thank you" screen again. So how can I just exit by jumping back to the homescreen??
Sorry for the inconvinience.
Regards,
Steff
Hey,
I'm trying to redirect something like foo/bar to ?foo=bar, so I can do www.mydomain.com/hey/foo/bar to www.mydomain.com/hey/?foo=bar, but I can't seem to get the syntax right. I tried the following:
RewriteEngine on
RewriteRule ^foo/(.*)$ ?foo=bar [NC]
But this doesn't work. How would I accomplish this? I tried adding a forward slash behind the question mark, but that makes it link to the root directory.
Thanks,
Jengerer
Im looking for a way to moniter system statistics, here are my main points of interest:
CPU Tempature
CPU speed, (Cycles per second)
CPU Load (Idle percent)
GPU Tempature
Some other points of interest:
Memory useage
Network Load (Traffic Up/Down)
My ultimate goal is to write an application that can be used for easily running in the backround, and allow setting many events fr certain actions, for instance When processer temp gets to 56C -> Do _Blank_ etc.
So this leaves me two main points.
Is there a framework already out there for this sort of thing?
If No to #1, How can i go about doing this?
I'm creating an editor for Eclipse. Right now the editor fires up with the user creates a new file with the appropriate extension. My question is, how can I get a reference to the project in which the file resides? For example, say I have a workspace with 2 projects, P1 and P2. I right click P2 and create a new file, can I get a reference to P2 from this somehow?
Ultimately I need to reference the AST or Java Model of the project but even a String identifying the project would work.
I am currently building a small visual designer using the Netbeans Platform. All my components that can be placed on the JPanel show correctly in the Palette Window.
What I am struggling to do at the moment, is to let the property window show the properties of the component that was either just dragged and dropped or showing the currently selected component in the JPanel in the Properties window.
Any help would be greatly appreciated.
Is it possible to find out the full path to the script that is currently executing in Korn shell?
i.e. if my script is in /opt/scripts/myscript.ksh, can I programmatically inside that script discover '/opt/scripts/myscript.ksh'?
Thanks,
Hi,
We have quite Large Web Based System, which is recently converted from Website to WebApplication, when it was an Website we not have any classes marked under the standard MyCompany.UI Namespace, now I am planning to move all the classes under the namespace, will I gain anything with doing that?
Thanks,
Manoj
Is there a way to, given a date, retrieve the season of the year? For any place on the globe?
Is this based on time zone as well as hemisphere?
Note that, In the southern hemisphere that summer is still during the warm months.
EDIT:
To clarify, I am talking about the astronomical seasons.
Hey Stackoverflow I'm working on my homework and I'm trying to reverse a circular-linked deque without a sentinel. Here are my data structures:
struct DLink {
TYPE value;
struct DLink * next;
struct DLink * prev;
};
struct cirListDeque {
int size;
struct DLink *back;
};
Here's my approach to reversing the deque:
void reverseCirListDeque(struct cirListDeque* q) {
struct DLink* current;
struct DLink* temp;
temp = q->back->next;
q->back->next = q->back->prev;
q->back->prev = temp;
current = q->back->next;
while(current != q->back->next) {
temp = current->next;
current->next = current->prev;
current->prev = temp;
current = current->next;
}
}
However when I run it and put values 1, 2 and 3 on it (TYPE is just a alias for int in this case) and reverse it I get 2, 3, null. Does anyone have any ideas as to what I may be doing wrong?
Thanks in advance.
My code that give long month name instead short name:
var monthShortName=$.datepicker.formatDate('MM d, yy', new Date(),{ monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun','Jul','Aug','Sep','Okt','Nov','Dec'] });
alert(monthShortNam); // "March" and not like i want "Mar"
Thanks
(I use JQuery 1.7.1 + jQuery UI 1.8.2)
Edit - Eliasson Solution('M' and not 'MM'):
$.datepicker.formatDate('M d, yy', new Date());
So, idea is the following. I have UITableViewCell, and when I click on it, I want to show UIActivityIndicatorView right in this cell. I cannot figure out how do I find the X/Y or any position (I can find the frame size of UITableViewCell though but it does not help much :-) for the given cell.
Any tips? Help?
Thank you!
I'm writing some application in javascript and cannot figure it out how to access the variables declared in my function, inside this jquery parse. Inside I can access global variables, but I don't really want to create global vars for these values.
Basically I want to extract file names from an xml document in the simulationFiles variable. I check if the node attribute is equal with the simName and extract the two strings inside the xml elements, that part I think it's working.
How can I extract those xml elements and append them to local variables?
function CsvReader(simName) {
this.initFileName = "somepath";
this.eventsFileName = "somepath";
$(simulationFiles).find('simulation').each(function() {
if ($(this).attr("name") == simName) {
initFileName += $(this).find("init").text();
eventsFileName += $(this).find("events").text();
}
});
}
Is there a less brute-force way to do this?
#!/bin/ksh
THIS_SCRIPT=$(/usr/bin/readlink -f $(echo $0 | /bin/sed "s,^[^/],$PWD/&,"))
echo $THIS_SCRIPT
I'm stuck using ksh but would prefer a solution that works in bash too (which I think this does).