Daily Archives

Articles indexed Wednesday August 29 2012

Page 13/19 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Changing Career to Game Development

    - by Don Carleone
    I m enthusiastic about and ready to shifting my career to Game Development sector, but before that I wonder some situations, I m now working as Senior .net programmer, i can only write code in c# right now, but i started to learn c++, I m computer engineer so before I know how to write in C but I didnt work with big projects, I wrote "Game of Life" before with C and used only Linked List DataStructure becouse of pushed my limits. But now I m thinking to shift Game Development, I love to play Console Games, I respect people who works about that business. But I just wonder, I see a lot of great developers who write codes with C++ and I ask myself that guys dont think to join Game Industry so why I think I can join! is that True? I dont live in USA or big country like. I live in a poor country, and here is no any Game Development Company, so I have to move to USA for working that job. So can you tell me if I start to learn something (c++,game enginees,physic enginees,3d math etc.) right now and working my usual job, after 7-8 month is it good time to move and finding a job about Game development in USA as junior game developer? is that possible? or is this just a dream? I realy need your advices. You can give down vote about that no problem, at least one advice can help me in my life.

    Read the article

  • Adjusting server-side tickrate dynamically

    - by Stuart Blackler
    I know nothing of game development/this site, so I apologise if this is completely foobar. Today I experimented with building a small game loop for a network game (think MW3, CSGO etc). I was wondering why they do not build in automatic rate adjustment based on server performance? Would it affect the client that much if the client knew this frame is based on this tickrate? Has anyone attempted this before? Here is what my noobish C++ brain came up with earlier. It will improve the tickrate if it has been stable for x ticks. If it "lags", the tickrate will be reduced down by y amount: // GameEngine.cpp : Defines the entry point for the console application. // #ifdef WIN32 #include <Windows.h> #else #include <sys/time.h> #include <ctime> #endif #include<iostream> #include <dos.h> #include "stdafx.h" using namespace std; UINT64 GetTimeInMs() { #ifdef WIN32 /* Windows */ FILETIME ft; LARGE_INTEGER li; /* Get the amount of 100 nano seconds intervals elapsed since January 1, 1601 (UTC) and copy it * to a LARGE_INTEGER structure. */ GetSystemTimeAsFileTime(&ft); li.LowPart = ft.dwLowDateTime; li.HighPart = ft.dwHighDateTime; UINT64 ret = li.QuadPart; ret -= 116444736000000000LL; /* Convert from file time to UNIX epoch time. */ ret /= 10000; /* From 100 nano seconds (10^-7) to 1 millisecond (10^-3) intervals */ return ret; #else /* Linux */ struct timeval tv; gettimeofday(&tv, NULL); uint64 ret = tv.tv_usec; /* Convert from micro seconds (10^-6) to milliseconds (10^-3) */ ret /= 1000; /* Adds the seconds (10^0) after converting them to milliseconds (10^-3) */ ret += (tv.tv_sec * 1000); return ret; #endif } int _tmain(int argc, _TCHAR* argv[]) { int sv_tickrate_max = 1000; // The maximum amount of ticks per second int sv_tickrate_min = 100; // The minimum amount of ticks per second int sv_tickrate_adjust = 10; // How much to de/increment the tickrate by int sv_tickrate_stable_before_increment = 1000; // How many stable ticks before we increase the tickrate again int sys_tickrate_current = sv_tickrate_max; // Always start at the highest possible tickrate for the best performance int counter_stable_ticks = 0; // How many ticks we have not lagged for UINT64 __startTime = GetTimeInMs(); int ticks = 100000; while(ticks > 0) { int maxTimeInMs = 1000 / sys_tickrate_current; UINT64 _startTime = GetTimeInMs(); // Long code here... cout << "."; UINT64 _timeTaken = GetTimeInMs() - _startTime; if(_timeTaken < maxTimeInMs) { Sleep(maxTimeInMs - _timeTaken); counter_stable_ticks++; if(counter_stable_ticks >= sv_tickrate_stable_before_increment) { // reset the stable # ticks counter counter_stable_ticks = 0; // make sure that we don't go over the maximum tickrate if(sys_tickrate_current + sv_tickrate_adjust <= sv_tickrate_max) { sys_tickrate_current += sv_tickrate_adjust; // let me know in console #DEBUG cout << endl << "Improving tickrate. New tickrate: " << sys_tickrate_current << endl; } } } else if(_timeTaken > maxTimeInMs) { cout << endl; if((sys_tickrate_current - sv_tickrate_adjust) > sv_tickrate_min) { sys_tickrate_current -= sv_tickrate_adjust; } else { if(sys_tickrate_current == sv_tickrate_min) { cout << "Please reduce sv_tickrate_min..." << endl; } else{ sys_tickrate_current = sv_tickrate_min; } } // let me know in console #DEBUG cout << "The server has lag. Reduced tickrate to: " << sys_tickrate_current << endl; } ticks--; } UINT64 __timeTaken = GetTimeInMs() - __startTime; cout << endl << endl << "Total time in ms: " << __timeTaken; cout << endl << "Ending tickrate: " << sys_tickrate_current; char test; cin >> test; return 0; }

    Read the article

  • Grid based collision - How many cells?

    - by Fibericon
    The game I'm creating is a bullet hell game, so there can be quite a few objects on the screen at any given time. It probably maxes out at about 40 enemies and 200 or so bullets. That being said, I'm splitting up the playing field into a grid for my collision checking. Right now, it's only 8 cells. How many would be optimal? I'm worried that if I use too many, I'll be wasting CPU power. My main concern is processing power, to make the game run smoothly. RAM is not a big concern for me.

    Read the article

  • Java REST Interface

    - by Vikram
    I have a PHP web application environment. I am using Slim Framework as REST interface for my application. My application front-end is written using Backbone.js and jQuery. There is a utility (.jar file) which when I use command line makes a remote call (I guess this is a Web Service) which returns me the data. how do I best incorporate this into my webapplication described on top? My application front end will have a Button that should make an AJAX call to the REST Interface and fetch the data as JSON. My approach: PHP-REST interface url is: /api/phprestapi.php exists Add a JAVA-REST interface at url: /api/javarestapi.java (Perhaps) to separate these two Existing Environment: LAMP Stack on Ubuntu How do I achieve this? What is the kind of effort involved? Thanks for your pointers

    Read the article

  • Objective C map view delegate viewForAnnotation for MKAnnotation gets just called after click

    - by user1185486
    I have a simple Map view. It has a method -(void)loadAndDisplayPois{ NSLog(@"loadAndDisplayPois"); if(mapView.annotations.count > 0) [mapView removeAnnotations:mapView.annotations]; self.pois = [self loadPoisFromDatabase]; NSLog(@"self.pois.count: %i", self.pois.count); [mapView addAnnotations:self.pois]; NSLog(@"mapView.annotations.count: %i",mapView.annotations.count);} This method gets called, and I am sure that the method gets called because of the Log, after I downloaded data and saved it into the database. The class which handles the download executes after saving the data to the database [self.senderObj performSelector:@selector(loadAndDisplayPois)]; Where senderObj is the MapViewControlller. The count Log from the pois array shows 4 after the first time I clicked. But no Annotations on the view, because viewForAnnotation is not called (one Annotation in the array ( my current position)). After I execute the method again by clicking a TEST button shows everything on the map. The viewForAnnotation method gets called after viewWillAppear and after I clicked the TEST button. It is driving me nuts since 2 days. I cant anymore ...

    Read the article

  • Adding on touch event to images inside gridview

    - by Steve
    I have a gridview where each item has a image and a textview (an app), i added the onItemClick to the gridview in order to launch the app, i also removed the orange selection and made selector in xml so when pressed the text would change to grey and on release it would return to white. My problem is that i need the image to apply an alpha value when pressed and restore the previous alpha on release i tested a lot of ways and none did worked correctly. I came close with the updated answer from the autor of the question: How to set alpha value for drawable in a StateListDrawable?, but some how the state pressed never gets called, i don´t know if this is because i am using the onitemClick to launch the app or not. Also i since i can´t define the alpha on imageview xml i don´t know what else to do Any help will be appreciated

    Read the article

  • Complex multiple join query across 3 tables

    - by Keir Simmons
    I have 3 tables: shops, PRIMARY KEY cid,zbid shop_items, PRIMARY KEY id shop_inventory, PRIMARY KEY id shops a is related to shop_items b by the following: a.cid=b.cid AND a.zbid=b.szbid shops is not directly related to shop_inventory shop_items b is related to shop_inventory c by the following: b.cid=c.cid AND b.id=c.iid Now, I would like to run a query which returns a.* (all columns from shops). That would be: SELECT a.* FROM shops a WHERE a.cid=1 AND a.zbid!=0 Note that the WHERE clause is necessary. Next, I want to return the number of items in each shop: SELECT a.*, COUNT(b.id) items FROM shops a LEFT JOIN shop_items b ON b.cid=a.cid AND b.szbid=a.zbid WHERE a.cid=1 GROUP BY b.szbid,b.cid As you can see, I have added a GROUP BY clause for this to work. Next, I want to return the average price of each item in the shop. This isn't too hard: SELECT a.*, COUNT(b.id) items, AVG(COALESCE(b.price,0)) average_price FROM shops a LEFT JOIN shop_items b ON b.cid=a.cid AND b.szbid=a.zbid WHERE a.cid=1 GROUP BY b.szbid,b.cid My next criteria is where it gets complicated. I also want to return the unique buyers for each shop. This can be done by querying shop_inventory c, getting the COUNT(DISTINCT c.zbid). Now remember how these tables are related; this should only be done for the rows in c which relate to an item in b which is owned by the respective shop, a. I tried doing the following: SELECT a.*, COUNT(b.id) items, AVG(COALESCE(b.price,0)) average_price, COUNT(DISTINCT c.zbid) FROM shops a LEFT JOIN shop_items b ON b.cid=a.cid AND b.szbid=a.zbid LEFT JOIN shop_inventory c ON c.cid=b.cid AND c.iid=b.id WHERE a.cid=1 GROUP BY b.szbid,b.cid However, this did not work as it messed up the items value. What is the proper way to achieve this result? I also want to be able to return the total number of purchases made in each shop. This would be done by looking at shop_inventory c and adding up the c.quantity value for each shop. How would I add that in as well?

    Read the article

  • Xcode debugger showing assembler for nested classes in a static library

    - by Massif
    I have a project A which creates a static library. I have a project B which uses this library. When I am debugging project B, certain functions within project A will display assembler when stepped into or when a breakpoint set inside them is hit. In the debug navigator, the line containing the function is grey instead of black. The strange part is that other functions in the same source file have no problems displaying. The thing that all these functions seem to have in common is that they belong to nested classes. However, I'm not totally convinced that this is the issue since functions from other nested classes display correctly. Does anyone know the cause of this?

    Read the article

  • Apache crash on launch - W2008 Server

    - by user1634444
    I installed Xampp on my Windows Server 2008. It worked fine, untill I decided to install some updates. Now Apache doesn't start any more and I get these errors; [Wed Aug 29 23:31:20.328125 2012] [core:warn] [pid 1540:tid 312] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Wed Aug 29 23:31:20.968750 2012] [ssl:warn] [pid 1540:tid 312] AH01873: Init:Session Cache is not configured [hint: SSLSessionCache] I'm trying to install Cacti on the server to monitor everything... Don't think it's relevant, but just saying

    Read the article

  • Sharing cookies/session from WebView to HttpClient doesn't work

    - by Toni Kanoni
    I know this question has been asked a hundred times, and I've read and tried for 2 hours now, but I can't find my error :-( I am trying to create a simple webbrowser and therefore have a webview, where I login on a site and get access to a picture area. With help of a DefaultHttpClient, I want to make it possible to download pictures in the secured area. Therefore I am trying to share the cookies from the webview and pass them on to the HttpClient, so that it is authenticated and able to download. But whatever I try and do, I always get a 403 response back... Basically the steps are the following: 1) Enter URL, webview loads website 2) Enter login details in a form 3) Navigate to picture and long hold for context menu 4) Retrieve the image URL and pass it on to AsynTask for downloading Here's the code of the AsyncTask with the Cookie stuff: protected String doInBackground(String... params) { //params[0] is the URL of the image try { CookieManager cookieManager = CookieManager.getInstance(); String c = cookieManager.getCookie(new URL(params[0]).getHost()); BasicCookieStore cookieStore = new BasicCookieStore(); BasicHttpContext localContext = new BasicHttpContext(); localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore); String[] cookieParts = null; String cookies[] = null; cookies = c.split(";"); for(int i=0;i<cookies.length;i++) { cookieParts = cookies[i].split("="); BasicClientCookie sessionCookie = new BasicClientCookie(cookieParts[0].trim(), cookieParts[1].trim()); sessionCookie.setDomain(new URL(params[0]).getHost()); cookieStore.addCookie(sessionCookie); } DefaultHttpClient httpClient = new DefaultHttpClient(); httpClient.setCookieStore(cookieStore); HttpGet pageGet = new HttpGet(new URL(params[0]).toURI()); HttpResponse response = httpClient.execute(pageGet, localContext); if(response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) -- NEVER Happens, always get 403 .) One of the problems is that the webview saves some cookies for the host *www.*example.com, but the image-URL to download (params[0]) is *static.*example.com. The line cookieManager.getCookie(new URL(params[0]).getHost()); returns null, because there is no cookie for static.example.com, but only for www.example.com. .) When I manually say cookieManager.getCookie("www.example.com"); I get some cookies back, which I add to the HttpClient cookie store: There are 5 cookies added - testcookie = 0 - PHPSESSID = 320947238someGibberishSessionId - email = [email protected] - pass = 32423te32someEncodedPassGibberish - user = 345542 So although these cookies, a session ID and other stuff, get added to the HttpClient, it never get's through to download an image. Im totally lost... though I guess that it either has something to do with the cookies domains, or that Im still missing other cookies. But from where the heck should I know which cookies exist in the webview, when I have to specify a specific URL to get a cookie back?? :-( Any advice?

    Read the article

  • Keep a javascript variable after an ajax call

    - by Guillaume le Floch
    I'm new in javascript and jQuery. I'm using ajax calls to get data from my server. The fact is, I'm losing my javascript variables after the call .. Here is what I did : the variable is define outside any function and treat in an other function. var a = 0; function myfunction(url){ $.ajax({ url: url, timeout: 20000, success: function(data){ // Do some stuff // The a variable is now undefined }, error: function(){ // Do some stuff } }); } Everything is working fine, the only thing is that I need to keep my variables ... but it looks like it's gone .. Does anyone know why? Thanks

    Read the article

  • Freeing memory with Pointer Arithmetic

    - by Breedly
    C++ newb here. I'm trying to write my own implementation of an array using only pointers, and I've hit a wall I don't know how to get over. My constructor throws this error array.cpp:40:35: error: invalid conversion from ‘int*’ to ‘int’ [-fpermissive] When my array initializes I want it to free up all the spaces in the array for ints. Array::Array(int theSize){ size = theSize; int *arrayPointer = new int; int index = 0; while(theSize > index){ *(arrayPointer + index) = new int; //This is the trouble line. ++index; } } What am I doing wrong stackoverflow?

    Read the article

  • mobile device - different background - media query not working

    - by AMC
    Live site. This is my first attempt at utilizing a different CSS for mobile devices vs. regular screens. To do this, I'm using- @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { background: url('img/background.jpg') no-repeat center center fixed; background-size: cover; height: 100%; } However, it doesn't seem to be working (I can only test on iPhones). Any ideas as to why that may be? I've also tried @media all to no avail.

    Read the article

  • Dynamically change ViewPagerIndicator titles

    - by msal
    My current project uses some ListFragments to show rows of data. The rows get updated dynamically every some seconds. The amount of rows varies with every update and in every ListFragment. I would like to show the amount of rows to the user, and think that the perfect place for that would be next to the Fragment's title in the ViewPagerIndicator. I provided a sample image for better comprehension: Sadly I am pretty clueless how to achieve this. I tried the following: public class PagerAdapter extends FragmentPagerAdapter { private int numOne = 0; private int numTwo = 0; // ... @Override public CharSequence getPageTitle(int position) { switch (position) { case 0: return "List 1 (" + numOne + ")"; case 1: return "List 2 (" + numTwo + ")"; default: return ""; } public void setNumOne(int num) { this.numOne = num; } public void setNumTwo(int num) { this.numTwo = num; } } When I now call the setNumXXX() method, nothing happens, until I move between fragments, what seems to trigger the getPageTitle() to fire. My question is: How can I force an update of the title(s), everytime when the num value changes?

    Read the article

  • Getting a `free()` error when deallocating with `delete` in the backtrace

    - by wonko
    I got the following error from gdb: *** glibc detected *** /.root0/autohome/u132/hsreekum/ipopt/ipopt/debug/Ipopt/examples/ex3/ex3: free(): invalid next size (fast): 0x0000000120052b60 *** Here's the backtrace: #0 0x000000555626b264 in raise () from /lib/libc.so.6 #1 0x000000555626cc6c in abort () from /lib/libc.so.6 #2 0x00000055562a7b9c in __libc_message () from /lib/libc.so.6 #3 0x00000055562aeabc in malloc_printerr () from /lib/libc.so.6 #4 0x00000055562b036c in free () from /lib/libc.so.6 #5 0x000000555561ddd0 in Ipopt::TNLPAdapter::~TNLPAdapter () from /home/ba01/u132/hsreekum/ipopt/ipopt/build/lib/libipopt.so.1 #6 0x00000055556a9910 in Ipopt::GradientScaling::~GradientScaling () from /home/ba01/u132/hsreekum/ipopt/ipopt/build/lib/libipopt.so.1 #7 0x00000055557241b8 in Ipopt::OrigIpoptNLP::~OrigIpoptNLP () from /home/ba01/u132/hsreekum/ipopt/ipopt/build/lib/libipopt.so.1 #8 0x00000055556ae7f0 in Ipopt::IpoptAlgorithm::~IpoptAlgorithm () from /home/ba01/u132/hsreekum/ipopt/ipopt/build/lib/libipopt.so.1 #9 0x0000005555602278 in Ipopt::IpoptApplication::~IpoptApplication () from /home/ba01/u132/hsreekum/ipopt/ipopt/build/lib/libipopt.so.1 #10 0x0000005555614428 in FreeIpoptProblem () from /home/ba01/u132/hsreekum/ipopt/ipopt/build/lib/libipopt.so.1 #11 0x0000000120001610 in main () at ex3.c:169` And here's the code for Ipopt::TNLPAdapter::~TNLPAdapter () TNLPAdapter::~TNLPAdapter() { delete [] full_x_; delete [] full_lambda_; delete [] full_g_; delete [] jac_g_; delete [] c_rhs_; delete [] jac_idx_map_; delete [] h_idx_map_; delete [] x_fixed_map_; delete [] findiff_jac_ia_; delete [] findiff_jac_ja_; delete [] findiff_jac_postriplet_; delete [] findiff_x_l_; delete [] findiff_x_u_; } My question is : why does free() throw an error when ~TNLPAdapter() uses delete[]? Also, I would like to step through ~TNLPAdapter() so I can see which deallocation causes the error. I believe the error occurs in the external library (IPOPT) but I have compiled it with debug flags on ; is this sufficient?

    Read the article

  • How to add a column via a query which counts the total rows with a specific criteria in a table with circular relationship in MS ACCESS 2007

    - by Xaqron
    I have a simple table "Employees" with this fields: ID, ParentID, Name ParentID is Nullable since an employee may have no Manager. This table has a one-to-many relationship with itself: ID --one--to--many--> ParentID Now I want a query which returns this columns: Name, Count of rows where their ParentID equals to the current row ID (the row is the manager of that rows) Sample Table: ID | ParentID | Name ====================== 1 | 0 | John ---------------------- 2 | 1 | Bob ---------------------- 3 | 1 | Alice ---------------------- 4 | 3 | Jack This way I can find an employee is the manager of how many other employees. The result should be something like this: Name | Count of Employees ========================== John | 2 -------------- Bob | 0 -------------- Alice | 1 -------------- Jack | 0 How can I achieve this in MS ACCESS 2007? * I have tried built-in query builder without any success.

    Read the article

  • Passing JS variable from child Iframe to parent JSP on cross sub domain

    - by Tarun
    I am stuck at 1 location and need some help. I created two subdomains on apache tomcat server like domain1.localhost.com and domain2.localhost.com in server.xml. On domain1 I have a JSP that includes iFrame (hosted on domain2). How can we pass the JS variable from child Iframe to parent JSP and store it in local variable of JSP hosted on domain1.localhost.com? I tried defining document.domain = "localhost" on both JSP but didn't work. Even parent DOM window is also not available in child iFrame (on sub-domain) because of obvious cross domain policies. Any help would be highly appreciated.

    Read the article

  • typedef of a template with a template type as its parameter

    - by bryan sammon
    Im having a problem with a typedef below, I can seem to get it right: template <typename T> struct myclass1 { static const int member1 = T::GetSomeInt(); }; template <int I> struct myclass2 { typedef myclass1< myclass2<I> > anotherclass; static int GetSomeInt(); }; anotherclass MyObj1; // ERROR here not instantiating the class When I try and initialize a anotherclass object, it gives me an error. Any idea what I am doing wrong? There seems to be a problem with my typedef. Any help is appreciated, Thanks Bryan

    Read the article

  • Implicit constructor available for all types derived from Base excepted the current type?

    - by Vincent
    The following code sum up my problem : template<class Parameter> class Base {}; template<class Parameter1, class Parameter2, class Parameter> class Derived1 : public Base<Parameter> { }; template<class Parameter1, class Parameter2, class Parameter> class Derived2 : public Base<Parameter> { public : // Copy constructor Derived2(const Derived2& x); // An EXPLICIT constructor that does a special conversion for a Derived2 // with other template parameters template<class OtherParameter1, class OtherParameter2, class OtherParameter> explicit Derived2( const Derived2<OtherParameter1, OtherParameter2, OtherParameter>& x ); // Now the problem : I want an IMPLICIT constructor that will work for every // type derived from Base EXCEPT // Derived2<OtherParameter1, OtherParameter2, OtherParameter> template<class Type, class = typename std::enable_if</* SOMETHING */>::type> Derived2(const Type& x); }; How to restrict an implicit constructor to all classes derived from the parent class excepted the current class whatever its template parameters, considering that I already have an explicit constructor as in the example code ? EDIT : For the implicit constructor from Base, I can obviously write : template<class OtherParameter> Derived2(const Base<OtherParameter>& x); But in that case, do I have the guaranty that the compiler will not use this constructor as an implicit constructor for Derived2<OtherParameter1, OtherParameter2, OtherParameter> ? EDIT2: Here I have a test : (LWS here : http://liveworkspace.org/code/cd423fb44fb4c97bc3b843732d837abc) #include <iostream> template<typename Type> class Base {}; template<typename Type> class Other : public Base<Type> {}; template<typename Type> class Derived : public Base<Type> { public: Derived() {std::cout<<"empty"<<std::endl;} Derived(const Derived<Type>& x) {std::cout<<"copy"<<std::endl;} template<typename OtherType> explicit Derived(const Derived<OtherType>& x) {std::cout<<"explicit"<<std::endl;} template<typename OtherType> Derived(const Base<OtherType>& x) {std::cout<<"implicit"<<std::endl;} }; int main() { Other<int> other0; Other<double> other1; std::cout<<"1 = "; Derived<int> dint1; // <- empty std::cout<<"2 = "; Derived<int> dint2; // <- empty std::cout<<"3 = "; Derived<double> ddouble; // <- empty std::cout<<"4 = "; Derived<double> ddouble1(ddouble); // <- copy std::cout<<"5 = "; Derived<double> ddouble2(dint1); // <- explicit std::cout<<"6 = "; ddouble = other0; // <- implicit std::cout<<"7 = "; ddouble = other1; // <- implicit std::cout<<"8 = "; ddouble = ddouble2; // <- nothing (normal : default assignment) std::cout<<"\n9 = "; ddouble = Derived<double>(dint1); // <- explicit std::cout<<"10 = "; ddouble = dint2; // <- implicit : WHY ?!?! return 0; } The last line worry me. Is it ok with the C++ standard ? Is it a bug of g++ ?

    Read the article

  • server automatically changes the case of files extensions

    - by AlanChavez
    I have the following problem, if I upload any file to my web server it automatically renames the file to an uppercase extension. For instance: If I upload picture.jpg my server automatically changes it to picture.JPG If I use <img src="picture.jpg"> my server returns a 404 error but if I use <img src="picture.JPG"> then the server displays the image. Can the .htaccess solve this issue? something with RewriteRule and RewriteCond? RewriteCond %{HTTP_HOST} ^$\.jpg [NC] RewriteRule ^(.*)$ $1\.JPG [R=301,L] Any help will be greatly appreciated! Thanks!

    Read the article

  • need to query MongoDB using php

    - by Mario Villarroel
    I need to query mongodb with something like this: ("something" < X OR "something" = "nll") AND ("someother"X OR "someother"= "nll") AND z=$z AND s=1 I've tried a few things, but can't get it to work, this is what I've tried: find( array( '$or'=array(array("something"=array("$le",$X)),array("something"="nll")), '$or'=array(array("someother"=array("$ge",$X)),array("someother"="nll")) )) But that's getting me the OR overwritten, so I'm lost on that... After diggin a bit more, I assembled this code that seems to be what I need, but doesn't work either: find( array('$and'=array( array( '$or' = array( array("something"=array('$gte'=$X)),array("something"="nll"))), array('$or' = array( array("someother"=array('$lte'=$X)),array("someother"="nll")))),"Z"=$z, "s"="1"); But this doesn't work as it returns zero results and I know for sure that there are more than 2 items that match on the db. (100% certain)

    Read the article

  • http authentication fails in cucumber when adding @javascript tag

    - by JESii
    I have a feature in my Rials app that works just fine with the message "Responds to browser_basic_authorize" from the Background Given step. However, if I add a @javascript tag before the scenario, then my Background Given fails with "I don't know how to login". What's going wrong and how do I go about testing javascrpt interactions on my app? Background: Given I perform HTTP authentication as "<id>/<password>" When I go to the homepage Then I should see "Text-that-you-should-see-on-your-home-page" Scenario: Displaying injury causative factors Given I am on the new_incident_report page When I choose "incident_report_employee_following_procedures_true" Then I should see "Equipment failure?" Then I should not see "Lack of training" When /^I perform HTTP authentication as "([^\"]*)\/([^\"]*)"$/ do |username, password| puts "id/pswd: #{username}/#{password}" ### Following works ONLY if performed first before even going to a page!!! if page.driver.respond_to?(:basic_auth) puts 'Responds to basic_auth' page.driver.basic_auth(username, password) elsif page.driver.respond_to?(:basic_authorize) puts 'Responds to basic_authorize' page.driver.basic_authorize(username, password) elsif page.driver.respond_to?(:browser) && page.driver.browser.respond_to?(:basic_authorize) puts 'Responds to browser_basic_authorize' page.driver.browser.basic_authorize(username, password) else raise "I don't know how to log in!" end end Rails 3.0.9, current gems, other tests passing.

    Read the article

  • Azure Service Bus Scalability

    - by phebbar
    I am trying to understand how can I make Azure Service Bus Topic to be scaleable to handle 10,000 requests/second from more than 50 different clients. I found this article at Microsoft - http://msdn.microsoft.com/en-us/library/windowsazure/hh528527.aspx. This provides lot of good input to scale azure service bus like creating multiple message factories, sending and receiving asynchronously, doing batch send/receive. But all these input are from the publisher and subscriber client perspective. What if the node running the Topic can not handle the huge number of transactions? How do I monitor that? How do I have the Topic running on multiple nodes? Any input on that would be helpful. Also wondering if any one has done any capacity testing with Topic/Queue and I am eager to see those results... Thanks, Prasanna

    Read the article

  • Drupal module permissions

    - by Trevor Newhook
    When I run the code with an admin user, the module returns what it should. However, when I run it with a normal user, I get a 403 error. The module returns data from an AJAX call. I've already tried adding a 'access callback' = 'user_access'); line to the exoticlang_chat_logger_menu() function. I'd appreciate any pointers you might have. Thanks for the help The AJAX call: jQuery.ajax({ type: 'POST', url: '/chatlog', success: exoticlangAjaxCompleted, data:'messageLog=' + privateMessageLogJson, dataType: 'json' }); The module code: function exoticlang_chat_logger_init(){ drupal_add_js('misc/jquery.form.js'); drupal_add_library('system', 'drupal.ajax'); } function exoticlang_chat_logger_permission() { return array( 'Save chat data' => array( 'title' => t('Save ExoticLang Chat Data'), 'description' => t('Send private message on chat close') ), ); } /** * Implementation of hook_menu(). */ function exoticlang_chat_logger_menu() { $items = array(); $items['chatlog'] = array( 'type' => MENU_CALLBACK, 'page callback' => 'exoticlang_chat_log_ajax', 'access arguments' => 'Save chat data'); //'access callback' => 'user_access'); return $items; } function exoticlang_chat_logger_ajax(){ $messageLog=stripslashes($_POST['messageLog']); $chatLog= 'Drupal has processed this. Message log is: '.$messageLog; $chatLog=str_replace('":"{[{','":[{',$chatLog); $chatLog=str_replace(',,',',',$chatLog); $chatLog=str_replace('"}"','"}',$chatLog); $chatLog=str_replace('"}]}"','"}]',$chatLog); echo json_encode(array('messageLog' => $chatLog)); // echo $chatLog; echo print_r(privatemsg_new_thread(array(user_load(1)), 'The subject', 'The body text')); drupal_exit(); }

    Read the article

  • What would be a better implementation of shared variable among subclass

    - by Churk
    So currently I have a spring unit testing application. And it requires me to get a session cookie from a foreign authentication source. Problem what that is, this authentication process is fairly expensive and time consuming, and I am trying to create a structure where I am authenticate once, by any subclass, and any subsequent subclass is created, it will reuse this session cookie without hitting the authentication process again. My problem right now is, the static cookie is null each time another subclass is created. And I been reading that using static as a global variable is a bad idea, but I couldn't think of another way to do this because of Spring framework setting things during run time and how I would set the cookie so that all other classes can use it. Another piece of information. The variable is being use, but is change able during run time. It is not a single user being signed in and used across the board. But more like a Sub1 would call login, and we have a cookie. Then multiple test will be using that login until SubX will come in and say, I am using different credential, so I need to login as something else. And repeats. Here is a outline of my code: public class Parent implements InitializingBean { protected static String BASE_URL; public static Cookie cookie; ... All default InitializingBean methods ... afterPropertiesSet() { cookie = // login process returns a cookie } } public class Sub1 extends Parent { @resource public String baseURL; @PostConstruct public void init() { // set parents with my baseURL; BASE_URL = baseURL; } public void doSomething() { // Do something with cookie, because it should have been set by parent class } } public class Sub2 extends Parent { @resource public String baseURL; @PostConstruct public void init() { // set parents with my baseURL; BASE_URL = baseURL; } public void doSomethingElse() { // Do something with cookie, because it should have been set by parent class } }

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19  | Next Page >