Posts

sdl - SDL2 C++ - Multiple Image Rendering Bug -

before begin, ide use code::blocks. i going practice things learned online sdl in project separate study project. wanted load image of ball on top of background. worked fine in study project. replicated code on test project, , ball disappeared. background visible. i removed codes involve background , worked fine. my code: #include <iostream> #include <cstdlib> #include <sdl.h> #include <sdl_image.h> #undef main using namespace std; sdl_texture *loadtexture (string filepath, sdl_renderer *rendertarget){ sdl_texture *texture = 0; sdl_surface *surface = img_load(filepath.c_str()); texture = sdl_createtexturefromsurface(rendertarget, surface); sdl_freesurface(surface); return texture; } int main () { sdl_window *window = 0; sdl_texture *ball = 0; sdl_texture *background_sky = 0; sdl_renderer *rendertarget = 0; int framew, frameh; int texturew, textureh; //--crop instructions--// framew = textu...

c# - Caching a Dynamic Portal -

currently working on large portal website , information shows user specific .now experiencing performance issues , have address possible number of users keep increasing.i heard caching in mvc4 , want know how effective in dynamic sites portal , kind of caching method should adopt.is there chance of backfire ? in general important understand caching bringing resources closer consumer in order choose caching method use, should analyze portal potential bottlenecks. if example, bottleneck remote database - use local database runs on same machine portal (embedded data base/ in memory storage / key-value storage , etc.) or using session cache user data - in case resource consumer mvc application. in 1 of our projects, had similar issue describing in question. in case bottleneck remote database, implemented sessionstate provider redis db (we couldn't use default session provider because of load ballancer) , solved issue us. another caching may performed bring data ...

asp.net - "Could not load file or assembly" error when installing Google.api.customsearch.v1 client library -

i trying install google.api.customsearch.v1 client library nuget error when try run asp.net website. could not load file or assembly 'newtonsoft.json, version=4.5.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) i have discovered stackoverflow such issue, non of them resolved problem. suggestion? ok, fixed problem updating newtonsoft.json package. run following command in package manager console update-package newtonsoft.json

r - Unable to reference an object in a variable within colnames -

i unable reference object contained in variable "symb" within colnames function. example: symb <- "ibm" colnames(paste0(symb)) <- c("open","high","low","close","volume","adjusted") if understand question correctly, name columns of data frame called ibm, , variable symb character vector contains string "ibm". if so, might try df <- get(symb) colnames(df) <- c("open","high","low","close","volume","adjusted") assign(symb, df)

android - How to align ViewGroup to the bottom of the screen -

so, have activity launched dialog (theme.dialog). use play video, dimming background, , looks pretty cool... it's centered on screen , don't know how move bottom programmatically. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/lr_layout" android:background="#ff000000" android:padding="0dp" > <relativelayout android:id="@+id/lr_progresscontainer" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ff000000"> <progressbar android:id="@+id/lr_progress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerinparent="true" ...

javascript - Responsive DIv Containing 2 images -

Image
i working on joomla based website template called xtec www.crosstec.de not me using jquery based code inserted articles. i trying create responsive div has 2 images in , trying entirely in css. this trying acheive. 1) normal width screen/browser has both images each 465px wide x 507 pixel in height - side side 2 pixel gap between them centered horizontally in browser window 2) reduce screen/browser width images should both shrink proportionally until @ point of screen / browse rreaching 850px wide images should move single column , both images aligned vertically on top of each other, reduce screen / browser continue reduce proportionally in size, still centered in column. i used code " 2-column css responsive layout responsive image " as starter my site url http://www.clickandrent.mobi , 2 images trying perform on below full width slider , above bottom 2 images. many - martyn please add code stylesheet, should work. tested on website , it's w...

java - Printing numbers divisible by 2 but not 3? -

for (int i=n1; < n2; i++){ if (i % 2 == 0){ system.out.println(i); } } this code prints out numbers between n1 , n2 (which generated randomly) both divisible 2 , 3, want print out numbers divisible 2. how do this? you're literally halfway there. you need second condition in mandate number not divisible 3. this: !(i % 3 == 0) now, need boolean operator return true if both conditions true. that, i'll leave exercise reader.