Search Results

Search found 233 results on 10 pages for 'mat banik'.

Page 6/10 | < Previous Page | 2 3 4 5 6 7 8 9 10  | Next Page >

  • C++ Vector of vectors is messing with me

    - by xbonez
    If I put this code in a .cpp file and run it, it runs just fine: #include <iostream> #include <vector> #include <string> using namespace std; typedef vector<int> row; typedef vector<row> myMatrix; void main() { //cout << endl << "test" << endl; myMatrix mat(2,2); mat[0][1] = 2; cout << endl << mat[0][1] << endl; } But, if I make a .h and a .cpp file with the .h file like this, it gives me boatloads of errors. #ifndef _grid_ #define _grid_ #include<iostream> #include<vector> #include<string> using namespace std; typedef vector<int> row; typedef vector<row> myMatrix; class grid { public: grid(); ~grid(); int getElement(unsigned int ri, unsigned int ci); bool setElement(unsigned int ri, unsigned int ci, unsigned int value); private: myMatrix sudoku_(9,9); }; #endif These are some of the errors I get: warning C4091: 'typedef ' : ignored on left of 'int' when no variable is declared error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    Read the article

  • Problem with redirecting *.domain.com & domain.com to www.domain.com for HTTPS

    - by Mat E.
    We have a site I'll call acme.com. Most of the time you see http://www.acme.com and sometimes we redirect you to https://www.acme.com. We want to redirect anyone going to http://acme.com or http://*.acme.com to http://www.acme.com, and the same for https. (It's mainly to avoid the alert you get if you go to https://acme.com instead of https://www.acme.com) Our vhost file is at the end of the post. It works nicely except for one strange behavior: http://acme.com - successfully redirects to http://www.acme.com http://www.acme.com - successfully does not redirect http://foo.acme.com - successfully redirects to http://www.acme.com https://acme.com - successfully redirects to https://www.acme.com https://www.acme.com - successfully does not direct https://foo.acme.com - ERROR - redirects to http://www.acme.com It's this last result I can't fathom. I've tried a lot of trial and error solutions from Google & Stack Overflow but nothing seems to change it. Even if we swap the order of the configurations (so that 443 is before 80) it still redirects https://foo.acme.com to http://www.acme.com We are running Apache/2.2.12 on Ubuntu. Here's the configuration file: <VirtualHost *:80> ServerName www.acme.com ServerAlias acme.com *.acme.com ServerSignature On DocumentRoot /var/www/acme.com/public RailsEnv 'production' PassengerHighPerformance on <Directory /var/www/acme.com/public> AllowOverride all Options -MultiViews </Directory> SSLEngine Off CustomLog /var/log/apache2/acme.log combined ErrorLog /var/log/apache2/acme-error.log # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. LogLevel warn RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^[^\./]+\.[^\./]+$ RewriteRule ^/(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </VirtualHost> <VirtualHost *:443> ServerName www.acme.com ServerAlias acme.com *.acome.com DocumentRoot /var/www/acme.com/public RailsEnv 'production' PassengerHighPerformance on <Directory /var/www/acme.com/public> AllowOverride all Options -MultiViews </Directory> SSLCertificateFile /etc/ssl/certs/www.acme.com.crt SSLCertificateKeyFile /etc/ssl/private/acme.com.private.key SSLCACertificateFile /etc/ssl/certs/EV_intermediate.crt SSLEngine On CustomLog /var/log/apache2/ssl-acme.log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" ErrorLog /var/log/apache2/ssl-acme-error.log # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. LogLevel warn RewriteEngine On RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} ^[^\./]+\.[^\./]+$ RewriteRule ^/(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] </VirtualHost>

    Read the article

  • BlackBerry barcode scanning library?

    - by Mat Nadrofsky
    Anyone got a good handle on a barcode scanning library that can be used to read in UPC-A, EAN-13 or other major barcode formats based on input from the digital camera? Does RIM have a standard library already available for this? I know that BlackBerry Messenger has 2D barcode scanning built-in so I'm guessing there must be something available, though not sure if it's proprietary or not.

    Read the article

  • Android Development Tips, Tricks & Gotchas

    - by Mat Nadrofsky
    I'm starting down the road of Android Development. At this point I'm looking for some insight from other developers who have been doing 'droid development and have some experience to share with someone who is just starting out. This can be anything from API to AVM to IDE. Any unexpected things come up while building your apps? Any tips for project layout or organization that help facilitate the deployment process to the Android AppStore? Any patterns which specifically helped in a particular situation? Even links to great blogs or sample apps and resources beyond those which you can grab from Google Code would be appreciated.

    Read the article

  • Raytraced Shadows Problem

    - by Mat
    Hey There! I've got a problem with shadowrays in my raytracer. Please have a look at the following two pictures 3D sMax: My Raytracer: The scene is lit by a very bright light, shining from the back. It's so bright that there is no gradient in the shading, just either white or dark (due to the overexposure). both images were rendered using 3DStudioMax and both use the exact same geometry, just in one case the normals are interpolated across the triangles. Now consider the red dot on the surface. In the case of the unsmoothed version, it lies in a dark area. this means that the light source is not visible from this triangle, since it's facing away from it. In the smoothed version however, it lies in the lit area, because the interpolated normal would suggest, that the light would be visible at that point (although the actual geometry of the triangle is facing away from the lightsource). My problem now is when raytraced shadows come in. if a shadowray is shot into the scene, from the red dot, to test whether the light-source is visible or not (to determine shadowing), the shadowray will return an intersection, independent of whether normals are interpolated or not (because intersections only depend on the geometry). Therefore the pixel would be shaded dark. 3dsamx is handling the case correctly - the rendered image was generated with Raytraced shadows turned on. However, my own Raytracer runs exactly into this problem when i turn on raytraced shadows (in my raytracer, the point is dark in both cases, because raytraced shadows determine the point lying in the shadow), and i don't know how to solve it. I hope someone knows this problem and how to deal with it.. thanks!

    Read the article

  • Problem setText UITextView

    - by Mat
    Hi i have a problem. I have 2 viewcontroller, in the first there is a mapView that implements the function "calloutAccessoryControlTapped" to tap a button on an annotation on the mapView; in the second there is just a UITextView. I want to change the text of the UITextView (and show the SecondViewController) in the second controller once the button on annotation is clicked; here is my code (FirstViewController) Header @interface FirstViewController<MKMapViewDelegate>{ IBOutlet MKMapView *mapView; SecondViewController *secondV;} @end Implementation @implementation FirstViewController - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control{ secondV = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; NSString *myS = @"some text here"; [secondV.myTextView setText:myS]; //Switch from this to the secondview [self presentModalViewController:secondV animated:YES]; @end (SecondViewController) Header @interface SecondViewController{ IBOutlet UITextView *myTextView; } @property(nonatomic, retain)UITextView *postitTextView; - (IBAction)backToMAp; - (void)setText:(NSString *)string; @end Implementation @implementation SecondViewController - (IBAction)backToMAp{ //Back To First View; [self dismissModalViewControllerAnimated:YES];} - (void)setText:(NSString *)string{ myTextView.text = string;} In this code when i tap on the button ([self presentModalViewController:secondV animated:YES];) on annotation the first time the second view show up but the text of UITextView don't change, when i back on the FirstView ([self dismissModalViewControllerAnimated:YES];) and then again tap the button to switch again to secondView the text of UITextView change..... Sorry for long thread and for my bad english!! Thank you stack!

    Read the article

  • fast sphere-grid intersection

    - by Mat
    hi! given a 3D grid, a 3d point as sphere center and a radius, i'd like to quickly calculate all cells contained or intersected by the sphere. Currently i take the the (gridaligned) boundingbox of the sphere and calculate the two cells for the min anx max point of this boundingbox. then, for each cell between those two cells, i do a box-sphere intersection test. would be great if there was something more efficient thanks!

    Read the article

  • Can Django admin handle a one-to-many relationship via related_name?

    - by Mat
    The Django admin happily supports many-to-one and many-to-many relationships through an HTML <SELECT> form field, allowing selection of one or many options respectively. There's even a nice Javascript filter_horizontal widget to help. I'm trying to do the same from the one-to-many side through related_name. I don't see how it's much different from many-to-many as far as displaying it in the form is concerned, I just need a multi-select SELECT list. But I cannot simply add the related_name value to my ModelAdmin-derived field list. Does Django support one-to-many fields in this way? My Django model something like this (contrived to simplify the example): class Person(models.Model): ... manager = models.ForeignKey('self', related_name='staff', null=True, blank=True, ) From the Person admin page, I can easily get a <SELECT> list showing all possible staff to choose this person's manager from. I also want to display a multiple-selection <SELECT> list of all the manager's staff. I don't want to use inlines, as I don't want to edit the subordinates details; I do want to be able to add/remove people from the list. (I'm trying to use django-ajax-selects to replace the SELECT widget, but that's by-the-by.)

    Read the article

  • WinForms data binding with a Save button?

    - by Mat
    How is data binding in C# WinForms supposed to work when you have a Save button? I don't want the data updated until I press Save! I have two forms (list and detail) backed by a BindingList<T> collection and my custom object from that collection, respectively. I can bind each form to the list or object appropriately. However, any changes made in the detail form are immediately reflected in the list form - I don't want to save the changes and update the details shown in the list until the Save button is pressed. Is data binding designed to support this? Is there a common pattern for doing so? Whichever way I look at it, binding doesn't seem to be able to support this scenario. I've considered the following: Pass a clone of the object to the detail form, but then I have to reconcile the changes on Save - changes may have been made to the copy in the list in the meantime. Implementing IEditableObject and calling EndEdit on save almost works as I can prevent the list being notified of the changes made until Save is pressed, but if something else causes a refresh the list is updated with the interim data. I'm currently left with dispensing with data binding in my detail view, and doing it all manually. Which is rather annoying.

    Read the article

  • Versioned RDF store

    - by Mat
    Let me try rephrasing this: I am looking for a robust RDF store or library with the following features: Named graphs, or some other form of reification. Version tracking (probably at the named graph level). Privacy between groups of users, either at named graph or triple level. Human-readable data input and output, e.g. TriG parser and serialiser. I've played with Jena, Sesame, Boca, RDFLib, Redland and one or two others some time ago but each had its problems. Have any improved in the above areas recently? Can anything else do what I want, or is RDF not yet ready for prime-time? Reading around the subject a bit more, I've found that: Jena, nothing further Sesame, nothing further Boca does not appear to be maintained any more and seems only really designed for DB2. OpenAnzo, an open-source fork, appears more promising. RDFLib, nothing further Redland, nothing further Talis Platform appears to support changesets (wiki page and reference in Kniblet Tutorial Part 5) but it's a hosted-only service. Still may look into it though. SemVersion sounded promising, but appears to be stale.

    Read the article

  • Which revision of html5lib is stable?

    - by Mat
    html5lib notes that it's latest release (0.11) is somewhat old. Using the Python portion, I have recursion problems as noted in Issue 70 and Issue 59 but can't find a recent Mercurial revision that is stable. The latest tip is no good, I got the following error from python setup.py install: byte-compiling build/bdist.linux-x86_64/egg/html5lib/treewalkers/_base.py to _base.pyc File "build/bdist.linux-x86_64/egg/html5lib/treewalkers/_base.py", line 40 "data": []} ^ SyntaxError: invalid syntax And I get the following errors at runtime: soup = parser.parse(page.read()) File "build/bdist.linux-x86_64/egg/html5lib/html5parser.py", line 165, in parse File "build/bdist.linux-x86_64/egg/html5lib/html5parser.py", line 144, in _parse File "build/bdist.linux-x86_64/egg/html5lib/html5parser.py", line 454, in processDoctype TypeError: insertDoctype() takes exactly 4 arguments (2 given) I'm using it on Python 2.5.2 with lxml and BeautifulSoup.

    Read the article

  • Essential Programming Tools

    - by Mat
    We all have different needs due to the platform and/or stack we work with, and simple programmer preference is famous for starting religious wars. However, in each area there is usually a set of tools that get recommended over and over, even though people might individually prefer one member over the others. Unix text mode code editors, for example, is an extremely contentious issue but no one can deny that most people will choose either vi or emacs. So, without criticising the alternatives, recommend me developement tools. Text editors for different platforms, version control systems, bug trackers, database engines, templating systems... whatever! What do you enjoy using every day? I'll edit together the answers as a list of highly recommended tools in each area. Please don't start discussing which is the best ;)

    Read the article

  • Using AWK, treate files

    - by Mat
    Hi all, I have something to do that it must be finished before 4.00PM. I want create a batch file with awk, grep or sed that keep all lines beginning with 'INSERT' and delete the other lines. After this, i want replace a string "change)" by "servicechange)" when the 3rd word in the treated line is "donextsit". I don't know how to do this before my deadline (4.00 PM). Please HELP ME!! Thx for your answers. And Sorry for my english ;)

    Read the article

  • Good tool to visualise database schema?

    - by Mat
    Are there any good tools for visualising a pre-existing database schema? I'm using MySQL if it matters. I'm currently using MySQL Workbench to process an SQL create script dump, but it's clunky, slow and a manual process to drag all the tables about (which would be okay if it wasn't so slow).

    Read the article

  • Letting users trial your web app before sign-up: sessions or temp db?

    - by Mat
    I've seen a few instances now where web applications are letting try them out without you having to sign-up (though to save you need to of course). example: trial at http://minutedock.com/ I'm wondering about doing this for my own web app and the fundamental question is whether to store their info into sessions or into a temp user table? The temp user table would allow logging and potentially be less of a hit on the server correct? Is there a best practice here?

    Read the article

  • MySQL VARCHAR strange column behavior

    - by Mat
    I have the following SQL statement which returns a single record as expected: select * from geodatasource_cities C, geodatasource_countries D where C.CC_FIPS = D.CC_FIPS and D.CC_ISO='AU' and UCASE(TRIM(C.FULL_NAME_ND)) LIKE '%JAN JUE%'; However, If I use the following SQL statement, no records are returned. I have only changed the LIKE clause to an equal to clause: select * from geodatasource_cities C, geodatasource_countries D where C.CC_FIPS = D.CC_FIPS and D.CC_ISO='AU' and UCASE(TRIM(C.FULL_NAME_ND)) = 'JAN JUE'; Can anybody please help me understand why this may be happening?

    Read the article

  • .Net Compact Framework Tips, Tricks, and Gotchas

    - by Mat Nadrofsky
    Hey everyone, We work extensively in the .Net Compact Framework and Windows Mobile. I've seen plenty of questions come up regarding specifics to development of ASP.Net apps or other .Net based desktop apps but nothing CF specific. Anyone else a mobile developer out there that can share some things to start doing, stop doing, and avoid doing when developing in the Compact Framework?

    Read the article

  • Symfony2 Setting a default choice field selection

    - by Mat
    I am creating a form in the following manner: $form = $this->createFormBuilder($breed) ->add('species', 'entity', array( 'class' => 'BFPEduBundle:Item', 'property' => 'name', 'query_builder' => function(ItemRepository $er){ return $er->createQueryBuilder('i') ->where("i.type = 'species'") ->orderBy('i.name', 'ASC'); })) ->add('breed', 'text', array('required'=>true)) ->add('size', 'textarea', array('required' => false)) ->getForm() How can I set a default value for the species listbox? Thank you for your response, I apologise, I think I should rephrase my question. Once I have a value that I retrieve from the model, how do I set that value as SELECTED="yes" for the corresponding value in the species choice list? So, that select option output from the TWIG view would appear like so: <option value="174" selected="yes">Dog</option>

    Read the article

  • array_map applied on a function with 2 parameters

    - by mat
    I've 2 arrays ($numbers and $letters) and I want to create a new array based on a function that combines every $numbers with every $letters. The parameters of this function involes the value of both $numbers and $letters. (Note: $numbers and $letters doesn't have the same amount of values). I need something like this: $numbers = array(1,2,3,4,5,6,...); $letters = array('a','b','c','d','e',...); function myFunction($x,$y){ // $output = some code that use $x and $y return $output; }; $array_1 = array( (myFunction($numbers[0],$letters[0])), (myFunction($numbers[0],$letters[1])), myFunction($numbers[0],$letters[2]), myFunction($numbers[0],$letters[3]), etc); $array_2 = array( (myFunction($numbers[1],$letters[0])), (myFunction($numbers[1],$letters[1])), myFunction($numbers[1],$letters[2]), myFunction($numbers[1],$letters[3]), etc); $array_3 = array( (myFunction($numbers[2],$letters[0])), (myFunction($numbers[2],$letters[1])), myFunction($numbers[2],$letters[2]), myFunction($numbers[2],$letters[3]), etc); ... $array_N = array( (myFunction($numbers[N],$letters[0])), (myFunction($numbers[N],$letters[1])), myFunction($numbers[N],$letters[2]), myFunction($numbers[N],$letters[3]), etc); $array = array($array_1, $array_2, $array_3, etc.); I know that this may work, but it's a lot of code, especially if I have a many values for each array. Is there a way to get the same result with less code? I tried this, but it's not working: $array = array_map("myFunction($value, $letters)",$numbers)); Any help would be appriciated!

    Read the article

  • How do I create rows with alternating colors for a UITableView on iPhone?

    - by Mat
    Hi all, i would to have alternate 2 colors of rows, like the first black, the second white, the third black, etc, etc... my approach is like a basic exercise of programming to calculate if a number is odd number or not: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; cell = ((MainCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]); if (cell==nil) { NSArray *topLevelObjects=[[NSBundle mainBundle] loadNibNamed:@"MainCell" owner:self options:nil]; for (id currentObject in topLevelObjects){ if ([currentObject isKindOfClass:[UITableViewCell class]]){ if ((indexPath.row % 2)==0) { [cell.contentView setBackgroundColor:[UIColor purpleColor]]; }else{ [cell.contentView setBackgroundColor:[UIColor whiteColor]]; } cell = (MainCell *) currentObject; break; } } }else { AsyncImageView* oldImage = (AsyncImageView*) [cell.contentView viewWithTag:999]; [oldImage removeFromSuperview]; }return cell; The problem is that when i do a rapid scroll, the background of cells become like the last 2 cell black, the first 2 cell white or something like this, but if i scroll slow works fine. I think the problem is the cache of reusableCell. Any ideas? TIA

    Read the article

  • Letting users try your web app before sign-up: sessions or temp db?

    - by Mat
    I've seen a few instances now where web applications are letting try them out without you having to sign-up (though to save you need to of course). example: try at http://minutedock.com/ I'm wondering about doing this for my own web app and the fundamental question is whether to store their info into sessions or into a temp user table? The temp user table would allow logging and potentially be less of a hit on the server, correct? Is there a best practice here?

    Read the article

  • How to do query auto-completion/suggestions in Lucene?

    - by Mat Mannion
    I'm looking for a way to do query auto-completion/suggestions in Lucene. I've Googled around a bit and played around a bit, but all of the examples I've seen seem to be setting up filters in Solr. We don't use Solr and aren't planning to move to using Solr in the near future, and Solr is obviously just wrapping around Lucene anyway, so I imagine there must be a way to do it! I've looked into using EdgeNGramFilter, and I realise that I'd have to run the filter on the index fields and get the tokens out and then compare them against the inputted Query... I'm just struggling to make the connection between the two into a bit of code, so help is much appreciated! To be clear on what I'm looking for (I realised I wasn't being overly clear, sorry) - I'm looking for a solution where when searching for a term, it'd return a list of suggested queries. When typing 'inter' into the search field, it'll come back with a list of suggested queries, such as 'internet', 'international', etc.

    Read the article

  • Should a developer write their own test plan for Q/A?

    - by Mat Nadrofsky
    Who writes the test plans in your shop? Who should write them? I realize developers (like me) regularly do their own unit testing whilst developing and in some cases even their own Q/A depending on the size of the shop and the nature of the business, but in a big software shop with a full development team and Q/A team, who should be writing those official "my changes are done now" test plans? Soon, we'll be bringing on another Q/A member to our development team. My question is, going forward, is it a good practice to get your developers to write their own test plans? Something tells me that part of that might make sense but another part might not... What I like about that: Developer is very familiar with the changes made, thus it's easy to produce a document... What I don't like about that: Developer knows how it's supposed to work and might write a test plan that caters to this without knowing it. So, with the above in mind, what is the general stance on this topic? I'm of course already reading books like the Mythical Man-Month, Code Complete and a few others which really do help, but I'd like to get some input from the group as well.

    Read the article

  • iPhone app runs on iPad simulator, but the background is inverted!!

    - by Mat
    Hi all, i've installed new sdk 3.2 pre-release wich have iPad simulator, i have tried to launch an iPhone app created by me in iPad simulator; the main view of this app has an image as background; when launch it on iPad simulator this background(self.background = [[UImage..... ) it comes inverted, from top to bottom. Any idea?? thanks in advance....:)

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10  | Next Page >