i have bunch of log files and I have to delete the files of some small sizes, which were erroneous files that got created. ( 63bytes ).
I have to copy only those files which have data in it .
Follow the following direction in:
http://wiki.developers.facebook.com/index.php/Facebook_Connect_Via_SSL
to use SSL version facebook connect, some of CanvasUtil functions regarding the resizing doesn't seem to work, the code is as
following:
FB_RequireFeatures(["Connect","Api","CanvasUtil"], function() {
FB.Facebook.init(apiKey, channel,{
"doNotUseCachedConnectState":true
});
FB.CanvasClient.getCanvasInfo(function(info){
alert("get it");
});
});
I don't see "get it". If I swtich back to http version, I could get the alert message and things are ok.
Does anyone know how to make CanvasUtils from SSL facebook connect working? It might be a bug in facebook.
Thanks a lot!
Hi,
I am developing a simple WPF application without any auto layout. The goal is when a user clicks (mouse down) a element (say textBlock) will appear at the location of the mouse click. For this I am using canvas panel embedded in a Grid of 1 row, 1 column and scrollviewer (visible). The issues are:
1. when the application window is resized the scroll viewers do not become active.
2. I want the ability to auto grow the canvas with mouse drag. Something like in MS-Excel when user drags the mouse horizontally/vertically the canvas should grow.
I have searched net a lot to figure this out and am unable to get an answer. Any help in this regard would be great.
Thanks a bunch in advance.
-P
I create a rightBarButtonItem with this method :
- (UIBarButtonItem *)customBarButtonWithSelector:(SEL)callback {
UIButton *customButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
customButton.bounds = CGRectMake(0, 0, 30.0f, 30.0f);
return [[[UIBarButtonItem alloc] initWithCustomView:customButton] autorelease];
}
At execution time the selector is fired when the bar is touched outside the button (near the middle).
Is there a way to restrict the event responder in the defined bounds or in a acceptable range ?
I need to display 2d images in opengl using textures.
The image dimensions are not necessarily powers of 2.
I thought of creating a larger texture and restricting the display to the part I was using but the image data will be shared with openCV so I don't want to copy data a pixel at a time into a larger texture.
EDIT - it turns out that even the simplest Intel on board graphics under Windows supports none-power-of-2 textures.
I'm curious what a reasonable / typical value is for the ratio of test code to production code when people are doing TDD. Looking at one component, I have 530 lines of test code for 130 lines of production code. Another component has 1000 lines of test code for 360 lines of production code. So the unit tests are requiring roughly 3x to 5x as much code. This is for Javascript code. I don't have much tested C# code handy, but I think for another project I was looking at 2x to 3x as much test code then production code.
It would seem to me that the lower that value is, assuming the tests are sufficient, would reflect higher quality tests. Pure speculation, I just wonder what ratios other people see.
I know lines of code is an loose metric, but since I code in the same style for both test and production (same spacing format, same ammount of comments, etc) the values are comparable.
Hi,
I am creating hotel booking system which requires lots of modal dialogs. For this purpose I am using jqueryUI dialog widget. yesterday I embedded it on one of the features of application but this time when dialog opens upon click then its Header is very large about 300-400px in height where as normal header is about 40px in height. Everywhere in the application it is still working fine but at only place it is giving such error. Css is also identical at all places. If anybody knows how to fix this issue then please post here.
Thanks
Ayaz Alavi
I'm looking for a nice stackoverflow-style answer to the first question in this old blog post, which I'll repeat below:
"I’d really like some tool (ideally, g++ based) that shows me what parts of compiled/linked code are generated from what parts of C++ source code. For instance, to see whether a particular template is being instantiated for hundreds of different types (fixable via a template specialization) or whether code is being inlined excessively, or whether particular functions are larger than expected."
I have the following Xaml (simplified for brevity, but will repro the problem in Xamlpad or Kaxaml):
<DockPanel Width="400">
<TextBlock DockPanel.Dock="Left" TextWrapping="Wrap">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Vestibulum massa metus, ornare in fringilla nec, fringilla at orci.
Nunc pharetra enim sit amet sapien aliquet eu euismod turpis vehicula.
Aenean gravida tempus lectus ut ornare.
Nullam massa augue, suscipit vel consectetur fringilla, pretium vitae neque.
</TextBlock>
<Button MinWidth="100" VerticalAlignment="Center" HorizontalAlignment="Left">Hello world</Button>
</DockPanel>
My problem is that I want the Button to take its minimum 100px of space, and for the text to wrap suitably to leave that space. However, what happens is that the text wraps as close to 400px as possible, and then the Button is clipped.
If I Snoop the output I can see that the button is rendering at the desired 100px, but it's being clipped off the side of the DockPanel.
If I reverse the Dock (so the button is docked "Right" and the TextBlock fills) then I get the layout I want, but unfortunately that's not an option due to the surrounding layout.
Is there something I can do that will make the DockPanel a) not clip and b) layout in a way that respects the MinWidth? Or am I stuck finding an alternative layout mechanism?
Thanks in advance!
Around how much space does a Sharepoint Collaboration Portal use up by default (when newly created)?
Just asking because I had one created but I'm thinking of using a Team Site site template--if the client won't be utilizing the default "features" of a Collaboration Portal.
I'm trying to limit the number of objects in an array controller, but I still want to be able to access the full array, if necessary. A simple solution I came up with was to subclass NSArrayController, and define a new method named "limitedArrangedObjects", that returns a limited number of objects from the real set of arranged objects. (I've seen http://stackoverflow.com/questions/694493/limiting-the-number-of-objects-in-nsarraycontroller , but that doesn't address my problem.)
I want this property to be observable via bindings, so I set a dependency to arrangedObjects on it.
Problem is, when arrangedObjects is updated, limitedArrangedObjects seems not to be observing the value change in arrangedObjects. I've hooked up an NSCollectionView to limitedArrangedObjects, and zero objects are being displayed. (If I bind it to arrangedObjects instead, all the objects show up as expected.)
What's the problem?
Here's the relevant code:
@property (readonly) NSArray *limitedArrangedObjects;
- (NSArray *)limitedArrangedObjects;
{
NSArray *arrangedObjects = [super arrangedObjects];
NSUInteger upperLimit = 10000;
NSUInteger count = [arrangedObjects count];
if (count > upperLimit) count = upperLimit;
arrayToReturn = [arrangedObjects subarrayWithRange:NSMakeRange(0, count)];
return arrayToReturn;
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key;
{
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"limitedArrangedObjects"]) {
NSSet *affectingKeys = [NSSet setWithObjects:@"arrangedObjects",nil];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKeys];
}
return keyPaths;
}
Can I configure my C# application to limit its memory consumption to, say, 200MB?
IOW, I don't want to wait for the automatic GC (which seems to allow the heap to grow much more than actually needed by this application).
I know that in Java there's a command line switch you can pass to the JVM that achieves this.. is there an equivalent in C#?
p.s.
I know that I can invoke the GC from code, but that's something I would rather not have to do periodically. I'd rather set it once upon startup somehow and forget it.
#include <iostream>
using namespace std;
int main()
{
cout << "Do you need to encrypt or decrypt?" << endl;
string message;
getline(cin, message);
int letter2number;
for (int place = 1; place < sizeof(message); place++)
{
letter2number = static_cast<int>(message[place]);
cout << letter2number << endl;
}
}
Examples of problem: I type fifteen letters but only four integers are printed. I type seven letters but only four integers are printed.
The loop only occurs four times on my computer, not the number of characters in the string.
This is the only problem I am having with it, so if you see other errors, please don't tell me. (It is more fun that way.)
Thank you for your time.
this is my model:
class Position(models.Model):
map = models.ForeignKey(Map,primary_key=True)
#members=models.CharField(max_length=200)
LatLng = models.CharField(max_length=40000)
infowindow = models.CharField(max_length=40000)
but it can't run ..
thanks
I have written a minimal wxWidgets application:
stdafx.h
#define wxNO_REGEX_LIB
#define wxNO_XML_LIB
#define wxNO_NET_LIB
#define wxNO_EXPAT_LIB
#define wxNO_JPEG_LIB
#define wxNO_PNG_LIB
#define wxNO_TIFF_LIB
#define wxNO_ZLIB_LIB
#define wxNO_ADV_LIB
#define wxNO_HTML_LIB
#define wxNO_GL_LIB
#define wxNO_QA_LIB
#define wxNO_XRC_LIB
#define wxNO_AUI_LIB
#define wxNO_PROPGRID_LIB
#define wxNO_RIBBON_LIB
#define wxNO_RICHTEXT_LIB
#define wxNO_MEDIA_LIB
#define wxNO_STC_LIB
#include <wx/wxprec.h>
Minimal.cpp
#include "stdafx.h"
#include <memory>
#include <wx/wx.h>
class Minimal : public wxApp
{
public:
virtual bool OnInit();
};
IMPLEMENT_APP(Minimal)
DECLARE_APP(Minimal)
class MinimalFrame : public wxFrame
{
DECLARE_EVENT_TABLE()
public:
MinimalFrame(const wxString& title);
void OnQuit(wxCommandEvent& e);
void OnAbout(wxCommandEvent& e);
};
BEGIN_EVENT_TABLE(MinimalFrame, wxFrame)
EVT_MENU(wxID_ABOUT, MinimalFrame::OnAbout)
EVT_MENU(wxID_EXIT, MinimalFrame::OnQuit)
END_EVENT_TABLE()
MinimalFrame::MinimalFrame(const wxString& title)
: wxFrame(0, wxID_ANY, title)
{
std::auto_ptr<wxMenu> fileMenu(new wxMenu);
fileMenu->Append(wxID_EXIT, L"E&xit\tAlt-X",
L"Terminate the Minimal Example.");
std::auto_ptr<wxMenu> helpMenu(new wxMenu);
helpMenu->Append(wxID_ABOUT, L"&About\tF1",
L"Show the about dialog box.");
std::auto_ptr<wxMenuBar> bar(new wxMenuBar);
bar->Append(fileMenu.get(), L"&File");
fileMenu.release();
bar->Append(helpMenu.get(), L"&Help");
helpMenu.release();
SetMenuBar(bar.get());
bar.release();
CreateStatusBar(2);
SetStatusText(L"Welcome to wxWidgets!");
}
void MinimalFrame::OnAbout(wxCommandEvent& e)
{
wxMessageBox(L"Some text about me!", L"About", wxOK, this);
}
void MinimalFrame::OnQuit(wxCommandEvent& e)
{
Close();
}
bool Minimal::OnInit()
{
std::auto_ptr<MinimalFrame> mainFrame(
new MinimalFrame(L"Minimal wxWidgets Application"));
mainFrame->Show();
mainFrame.release();
return true;
}
This minimal program weighs in at 2.4MB! (Executable compression drops this to half a MB or so but that's still HUGE!) (I must statically link because this application needs to be single-binary-xcopy-deployed, so both the C runtime and wxWidgets itself are set for static linking)
Any tips on cutting this down? (I'm using Microsoft Visual Studio 2010)
Hello All,
I have inherited some code that I need to maintain that can be less than stable at times. The previous people are no longer available to query as to why they ran the application in an environment with unlimited stack set, I am curious what the effects of this could be? The application seems to have some unpredictable memory bugs that we cannot find and running the application under valgrind is not an option because it slows the application down so much that we cannot actually run it. So any thoughts on what the effects of this might be are appreciated.
Thank you.
Hi,
I have an issue with the stack limit in my webservice.
I was suggested to read this article by fellow members of this forum, but I do not have an idea how to run the EDITBIN.
I am using VS2008 on Windows 7 (IIS7)
Thanks!
I am working on a system for reserving seats. A user inputs how many seats they wish to reserve and the database will return a set of suggested seats that are not previously reserved that matches the number of seats being reserved.
For instance if I had the table:
SeatID | Reserved
-----------------
1 | false
2 | true
3 | false
4 | false
5 | false
6 | true
7 | true
8 | false
9 | false
10 | true
And the user inputs that they wish to reserve 2 seats, I would expect the query to return that seats (3, 4), (4, 5), and (8, 9) are not reserved and match the given number of input seats. Seats are organized into sections and rows. Continuous seats must be in the same row.
How would I go about structuring this query to work in such a way that it finds all available continuous seats that match the given input?
How do i display directory sizes in a sorted manner in Unix while listing only innermost sub-directories? For example, I don't want to something like this -
100270480 /a/b/BP/b/bat/qc3
100270416 /a/b/BP/b/bat/qc3/logs
99020464 /a/b/BP/b/bat/qc3/logs/i
99005456 /a/b/BP/b/bat/qc5
99005408 /a/b/BP/b/bat/qc5/logs
97726832 /a/b/BP/b/bat/qc5/logs/i
I just want -
99020464 /a/b/BP/b/bat/qc3/logs/i
97726832 /a/b/BP/b/bat/qc5/logs/i
def mailTo(subject,msg,folks)
begin
Net::SMTP.start('localhost', 25) do |smtp|
smtp.send_message "MIME-Version: 1.0\nContent-type: text/html\nSubject: #{subject}\n#{msg}\n#{DateTime.now}\n", '[email protected]', folks
end
rescue => e
puts "Emailing Sending Error - #{e}"
end
end
when the HTML is VERY large I get this exception
Emailing Sending Error - 552 5.6.0 Headers too large (32768 max)
how can i get a larger html above max to work with Net::SMTP in Ruby
I want to create a wizard for the logo badge below with 3 parameters. I can make the title dynamic but for image and gradient it's hardcoded because I can't see how to make them dynamic. Code follows after pictures:
custom-styles: stylize [
lab: label 60x20 right bold middle font-size 11
btn: button 64x20 font-size 11 edge [size: 1x1]
fld: field 200x20 font-size 11 middle edge [size: 1x1]
inf: info font-size 11 middle edge [size: 1x1]
ari: field wrap font-size 11 edge [size: 1x1] with [flags: [field tabbed]]
]
panel1: layout/size [
origin 0 space 2x2 across
styles custom-styles
h3 "Parameters" font-size 14 return
lab "Title" fld_title: fld "EXPERIMENT" return
lab "Logo" fld_logo: fld "http://www.rebol.com/graphics/reb-logo.gif" return
lab "Gradient" fld_gradient: fld "5 55 5 10 10 71.0.6 30.10.10 71.0.6"
] 278x170
panel2: layout/size [
;layout (window client area) size is 278x170 at the end of the spec block
at 0x0 ;put the banner on the top left corner
box 278x170 effect [ ; default box face size is 100x100
draw [
anti-alias on
line-width 2.5 ; number of pixels in width of the border
pen black ; color of the edge of the next draw element
fill-pen radial 100x50 5 55 5 10 10 71.0.6 30.10.10 71.0.6
; the draw element
box ; another box drawn as an effect
15 ; size of rounding in pixels
0x0 ; upper left corner
278x170 ; lower right corner
]
]
pad 30x-150
Text fld_title/text font [name: "Impact" size: 24 color: white]
image http://www.rebol.com/graphics/reb-logo.gif
] 278x170
main: layout [
vh2 "Logo Badge Wizard"
guide
pad 20
button "Parameters" [panels/pane: panel1 show panels ]
button "Rendering" [show panel2 panels/pane: panel2 show panels]
button "Quit" [Unview]
return
box 2x170 maroon
return
panels: box 278x170
]
panel1/offset: 0x0
panel2/offset: 0x0
panels/pane: panel1
view main
Hey guys,
I have a div called #background. I have most of my content in it and I want it to resize when I add more content. As far as I know the way to do this is to assign it no height?
I have done this in my layout.css file.
As far as I can see, my #background doesnt close until after the last bit of content which is what I want, but it's not working. It seems to be just stopping after my #special offers div, I#m not sure why this is?
Colm
we have sensors in the wild that send their data to a server every day via TCP/IP, either through 3G or through satellite for the physical layer. The sensors can automatically switch from one to the other depending on their location and the quality of the signal with the local 3G operator.
Given that the 3G and satellite communications are very expensive, we want to minimize the amount of data to send. But also, we want to protect ourselves from lost data.
What would be the best strategy to ensure with reasonable certainty that the integrity of our data is preserved, while minimizing the amount of redundancy, i.e the amount of data transmitted ?
I've read about the zfec codec, but I'm not sure if we need to transmit all the chunks, or if we need to send a hash code along each chunk.
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if(section != 0) {
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 100, 30)];
view.backgroundColor = [UIColor redColor];
return view;
[view release];
} else {
return tableView.tableHeaderView;
}
}
This is my implementation of viewForHeaderInSection but whatever frame I make it's always showing me the same red frame. Do you see any problem with my code?
Can't post the picture because of my rep but here is the link ;-)
http://img638.imageshack.us/img638/3350/bildschirmfoto20100315uq.png