Posts

Showing posts from January, 2012

scaling - Android - setScaleX/Y makes image clipped -

Image
i have banner @ bottom of screen, , use setscalex + setscaley zoom fit screen width. before , after : the main different that, bottom part of image clipped after scaling (you can see bottom part of white horn in banner cut) below code (adview banner dimension 320x50) displaymetrics metrics = new displaymetrics(); getwindowmanager().getdefaultdisplay().getmetrics(metrics); float scale = metrics.widthpixels / metrics.density / 320; adview.setscalex(scale); adview.setscaley(scale); any solution? thanks! p.s. may suggest using smart banner adsize of adview. however, can't use smart banner reasons can play setscalex/y trick. set adsize smart_banner , layout_width match_parent change in xml android:layout_width="match_parent" android:layout_height="wrap_content" ads:adsize="smart_banner"

javascript - JQuery cut an image w/o cropping plugin -

i trying show part of image jquery, example, 0 - 200 px of it's width. i have solved problem, so... i want know if there's easier way, instead of creating div each image , using script each time. a way of animating it, right left, instead of left right. this script, suggestion? $("button").click(function(){ if($('#hello2').css("opacity") != "0"){ $('#hello2').animate({ "width" : "0px", "opacity" : "0" }); } else{ $('#hello2').animate({ "opacity" : "1", "width" : "500px" }); } }); fiddle thanks in advice i changed use background:url() property instead of separate div, effect looks little different though. but @ least have animate width of div. $(document).ready(function () { $("button").click(function () {

ruby - Delete from where? -

below have written piece of code that's supposed count number of occurrences of characters in string , display result in hash. idea rid of letter in string right after i've counted don't put hash more once. my original code this: def letter_count_spec(str) letter_count = hash.new #create hash letter = str.split('') #separate letters letter.each{ |e| if( /[a-za-z0-9]/.match(e) ) occurances = letter.count{ |x| x==e} letter_count[e] = occurances letter.delete(e) #delete letter end } return letter_count end letter_count_spec("cat") result: => {"c"=>1, "t"=>1} i lose "a"! so tried this: def letter_count_spec(str) letter_count = hash.new #create hash letter = str.split('') #separate letters letter.each{ |e| if( /[a-za-z0-9]/.match(e) ) occurances = letter.count{ |x| x==e} letter_count[e] = occurances end } letter.each{ |e|

java - why spring handles only unchecked exceptions -

i want know why spring handles unchecked exceptions..... can 1 explain reason behind . spring using design patterns avoid checked exceptions ? spring using design patterns avoid checked exceptions ? not design pattern best practices exception handling . consider below code: public void consumeandforgetallexceptions(){ try { ...some code throws exceptions } catch (exception ex){ ex.printstacktrace(); } } what wrong code above? once exception thrown, normal program execution suspended , control transferred catch block. catch block catches exception , suppresses it. execution of program continues after catch block, if nothing had happened. how following? public void somemethod() throws exception{ } this method blank one; not have code in it. how can blank method throw exceptions? java not stop doing this. i want know why spring handles unchecked exceptions? personally prefer unchecked exceptions declared in throws c

Connecting Mongodb to C++ API #include problems -

i got mongoshell , json file set up. need connecting mongodb c++ i typed in command prompt gave a syntax error. (my file name connectormain.cpp) -i/usr/local/include -l/usr/local/lib -pthread -lmongoclient -lboost_thread-mt -lboost_filesystem -lboost_program_options -lboost_system app/connectormain.cpp -o connectormain this person had same problem: mongo c++ driver: mongo/client/dbclient.h: no such file or directory the reason there need type in cmd pmt because allow access weird #inclue files like: #include "mongo/client/dbclient.h" i've visited http://api.mongodb.org/cplusplus/current/files.html and dbclient.h file #pragma once #ifdef mongo_expose_macros #error dbclient.h c++ driver consumer use #endif #define libmongoclient_consumer #include "mongo/client/redef_macros.h" #include "mongo/pch.h" #include "mongo/client/connpool.h" #include "mongo/client/dbclient_rs.h" #includ

How can i install a local rpm using puppet -

i trying install particular rpm using puppet, init.pp is: class nmap { package {'nmap': provider => 'rpm', source => "<local path rpm>", } } and rpm in ...modules/nmap/files if move rpm manifests, , provide rpm name in source => '' class nmap { package {'nmap': provider => 'rpm', source => "rpm-name.rpm", } } it works, how can specify source path ../files/ , puppet apply successfully when use : source => 'puppet:///files/nmap-6.45-1.x86_64.rpm', i error: debug: executing '/bin/rpm -i puppet:///files/nmap-6.45-1.x86_64.rpm' error: execution of '/bin/rpm -i puppet:///files/nmap-6.45-1.x86_64.rpm' returned 1: error: open of puppet:///files/nmap-6.45-1.x86_64.rpm failed: no such file or directory error: /stage[main]/nmap/package[nmap]/ensure: change absent present failed: execution of '/bin/rpm -i puppet:///files/nmap-6.45-1.x86_6

algorithm - Finding bridges in graph without recursion -

i have code find bridges in connected graph: void dfs (int v, int p = -1) { used[v] = true; tin[v] = fup[v] = timer++; (size_t i=0; i<g[v].size(); ++i) { int = g[v][i]; if (to == p) continue; if (used[to]) fup[v] = min (fup[v], tin[to]); else { dfs (to, v); fup[v] = min (fup[v], fup[to]); if (fup[to] > tin[v]) printf("%d %d", v, to); } } } how rewrite without using recursion? know, it's possible , should use stack, line must executed after recursive call of dfs() , can't achieve stack: fup[v] = min(fup[v], fup[to]) so, how rewrite algorithm iteratively? you want make "stack frame" structure struct frame { frame(int v, int p, int i, label label); int v; int p; int i; }; // constructor here and, say, stack<frame> . between of these fields, it's possible simulate call stack ( untested

simulation - using copula in r with own data -

i have created simulated data outside of r (e.g. matrix with, say, 3 columns, each 10,000 values , each equal probability). extract of data below total1 total2 total3 1 448824 7895.13 42233 2 297701 8068.44 37376 3 399065 4823.11 10423 4 425672 7567.62 65052 5 487482 7360.86 74758 6 400459 4344.44 39242 7 504143 7336.72 42842 i want define own correlation matrix between these 3 variables represented data in columns , produce aggregate distribution using copula function in r. need turn 10,000 values in each column distribution first before can use in copula, create user-defined distribution margin object in copula package? documentation says "a user-defined distribution, example, fancy, can used margin provided dfancy, pfancy, , qfancy available." so, how create 3 user-defined distributions each of 10,000 values , how apply copula (e.g. normal one) using own specified 3x3 correlation matrix, create aggregate distribution?

How to retrieve youtube videos more than 500 using youtube rest api -

i using api https://gdata.youtube.com/feeds/api/videos?q=skateboarding+dog&start-index=1&max-results=10 data, incresing start-index parameter dynamically next results. problem , able receive 500 records after showing exception saying "you cannot request beyond item 500."

c# - How to unit test Request.Form[""]? -

below controller's method :- [httppost] public actionresult search(searchviewmodel model) { string selection = request.form["options"]; if (selection == "str1") { ----------------------------- } } and it's based on condition getting value request.form.but request.form provide property , can't set it's value on unit testing method.is there way set it's value ? do not use request.form["options"] inside. can have option property inside searchviewmodel class , can use instead. scenario required use session in controller method can use modelbinder

php - JMSTranslationBundle extract translation key in Entity static function -

i have static function in entity contains translation keys in array. public static function astaticfunction() { return array( 0 => 'a.translation.key', 'another.translation.key', ); } when run extract command of jmstranslationbundle, translation keys not extracted. how make detect , extract them? the jmstranslationbundle not extracting translation keys entity. so, here did: create service , tag jms_translation.file_visitor : acmecustom.translator.entity.extractor: class: acme\custombundle\translator\entityextractor tags: - { name: jms_translation.file_visitor } and extractor class (some lines/functions truncated): <?php namespace acme\custombundle\translator; use jms\translationbundle\model\filesource; use jms\translationbundle\model\message; use jms\translationbundle\model\messagecatalogue; use jms\translationbundle\translation\extractor\filevisitorinterface; class entityextractor implements filev

node.js - npm ERR! network getaddrinfo ENOTFOUND -

Image
i getting npm err! network getaddrinfo enotfound error while trying install package using npm. know there numerous threads on same issue not find thread can me. i have set proxy & think proxy not being set correctly\not using correct url. npm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080 is there way check url using while setting proxy correct? there steps need take in order rectify issue? maybe it's because proxy not stand https . clear proxy content of ~/.npmrc, or use npm config delete proxy what's more, nrm recommended problem.

No Guest Checkout in PayPal Chained/Simple Payment [Android] -

i had referred android sample application (application name: pizzaapp-complete ) provided paypal. application based on simple payment. while transferring money business-pro account , paypal not asking guest payment.it directly shows paypal login dialog. using sand-box testing. why paypal not asking guest payment? had upgraded business account business account pro, accept credit/debit payments made user. check in paypal profile under payment receiving preferences , make sure paypal account optional enabled.

duplicates - How to avoid while-loop code duplication? -

string s = console.readline(); while( s!= null) { // // .... s = console.readline(); } the code above input, verify it, process , input again, obviously, s = console.readline(); code duplication. what tricks there avoid duplication? in python (where there no do-while loop guaranteed @ least 1 iteration), trick use infinite loop explicit break. while( true ) // or whatever evaluates true unconditionally { s = console.readline(); if (s == null) { break; } // }

merge - Merging two MySQL tables with sorted datetime -

sorry if sounds silly. right now, have basic understanding of mysql , relational databases. can simple selects ;) usual, did google , stackoverflow research before posting this, couldn't find suitable answer (the ones on every time "0" value). try make generic possible useful else. let's have 2 tables: tbuy qtybuy : integer datebuy : datetime tsell qtysell : integer datesell : datetime i able write query can have resulting table of qtybuy/qtysell sorted "merge" of 2 dates, e.g. if 2 tables "history" of items beign bought , sold, know history of item, sorted date. know it's easy make 2 different selects , then, in whatever programming language using, merging result "by hand". wondering if there better way using mysql. thinking like select * (select * tbuy union select * tsell) order whichdate?! but not know how specify "whichdate". thank you. have tried: select "buy" ac

rebase - Is git rebasing the wrong branch? -

i have 3 branches: master dev feature my branch master date. want rebase branch feature master git checkout feature git rebase master but @ beginning see: first, rewinding head replay work on top of it... applying: ajout model widget desc + stats using index info reconstruct base tree... ajout model widget desc + stats first commit on branch. rebase using wrong version of branch. the result lot of conflits, , file have committed gone. exemple : <<<<<<< head $this->createwidget('samples/footer','content', array('channeltitle'=>$channeltitle)); ======= $this->createwidget('samples/desc','desc', array('channeltitle' => $channeltitle)); $this->createwidget('samples/statistics','statistics', array('channeltitle' => $channeltitle)); $this->createwidget('samples/footer','footer'); >>>

backbone.js - Rendering Multiple Collections into Region with Backbone Marionette -

i've started trying out marionette after building couple of vanilla backbone applications. right out of gate i'm running questions region management , multiple collections. i have following nested model , collection structure fooscollection foomodel barscollection barmodel i want take advantage of great views , layout/region managers marionette provides. however, need render information on page in bit of unique way. html looks this: <div id="container"> <div id="foos-description"></div> <div id="bars-list"></div> </div> basically, high level information each of foomodels needs rendered foos-description element. then, each barscollection needs rendered bars-list . structure needs such list directly below corresponding information in foos-description container. so, love use compositeviews solve this, looks view/dom element structure needs nested in same way collection/m

ios - Size of UIView subclass depending on device -

i've created subclass of uiview bunch of subviews in ( uilabels , uibuttons ) arrange using autolayout. done programmatically. displays ok , functionallity ok. i've seen worries me. if have size of iphone 3.5" on interface builder , run 3.5" simulator, ok. if have 4" size on simulator , 4" size on interface builder, ok. however, if size of simulator , size of interface builder not match, uiview subclass either short or large. i have 3.5" iphone available, cannot test on device 4" screen. do need worry or normal behaviour? if need worry, how can fix it? commented, not set size on code done autolayout reference of self.bounds.size.width , instance. any thougths? in advance! they're skewed because you're loading 3.5" interface on 4" device , vice versa. long simulator , device automatically picks screen size , load corresponding layout without explicitly changing these around, work fine. you're creating prob

unit testing - AngularJS + Karma + Jasmine + Karma-Coverage: Empty coverage report -

Image
i'm trying integrate current angularjs project karma coverage. please find below package.json , karma-config . package.json { "name": "project", "description": "description", "repository": "https://www.repo.com", "devdependencies": { "karma": "~0.10.9", "karma-junit-reporter": "~0.2.1", "karma-jasmine": "~0.1.5", "karma-ng-scenario": "~0.1", "karma-script-launcher": "~0.1.0", "karma-chrome-launcher": "~0.1.3", "karma-firefox-launcher": "~0.1.3", "karma-phantomjs-launcher": "~0.1.4", "karma-ng-html2js-preprocessor": "~0.1", "karma-coverage": "~0.1" } } karma config 'use strict'; module.exports = function (config) { config.set({ basepath: 

python 2.7 - Tags with an underscore cause failure with BeautifulSoup selector -

xml file: <?xml version="1.0" encoding="utf-8"?> <sites> <site> <name>default</name> <url_namespace>default</url_namespace> </site> </sites> soup info: soup = beautifulsoup(xml) soup.select('url_namespace') error: valueerror: unsupported or invalid css selector: "url_namespace" how 1 select xml tag, or , id contains underscore? i'd suggest lxml because done simple xpath, fun of showing how select invalid css selector... well, don't. there couple of things can done, 1 of replace offensive tag perhaps div tag specific class, can select it. however, 1 hackish way of doing change name property of each element find. from bs4 import beautifulsoup bsoup data = """ <?xml version='1.0' encoding='utf-8'?> <sites> <site> <name>default</name> <url_namespace>default1&

sql - Counting the number of dowloads on a database oracle -

i creating database online store going sell, movies, music , books final project in uni. i have created tables , made sure working. database supposed have "historical" table. want have on thistab number of downloads specific client makes. the primary keys on table "clients" suscriber_number , id_download. these 2 foreign keys-primary key on historical tab. how can make sure thatevery download client makes gets store on historical tab new download , not replacement of previous data? afraid override previous information , not keep count of downloads on each suscriber. able keep track in oracle of times using update statement on existing data retrieve later on?

python - How to get all methods (including all parents' methods) of a class in its metaclass? -

for example: class meta(type): def __new__(cls, name, parents, attrs): new_attrs={} k,v in attrs.items(): # here attrs has methods defined in "name", not want. print(k,v) new_attrs[k] = v return type.__new__(cls, name, parents, new_attrs) class meta(metaclass=meta): pass class a(object): def a1(self): return self.a2() def a2(self): print('a2 voked') class b(a): def b1(self): return self.b2() def b2(self): return self.a1() class c(b): def c1(self): return self.b1() class d(c,meta): def d1(self): return self.c1() x=d() x.d1() the result is: >>> __qualname__ meta __module__ __main__ __qualname__ d d1 <function d.d1 @ 0x0000000002a7b950> __module__ __main__ a2 voked as can see, in __new__ of meta , except special methods, d1 accessible. want parents' methods well(.i.e a1 a2 b1 b2 , c1 objects)

ios7 - clear text UISearchBar -

i have uisearchbar odd behaviour (ios 7). these steps take: 1) search , select result table. 2) clear search text code (either line) -(void) tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { [[[self searchdisplaycontroller] searchbar] settext:nil]; [[[self searchdisplaycontroller] searchbar] settext:@""]; //other stuff } 3) second search. no results shown unless first hit "clear button" inside search field. after hitting "x", behaviour returns normal. how supposed clear search string after user selects 1 of search results?

javascript - Node script doesn't ever end -

i have node script below copy contents of files , insert them mongo. the script never seems end , though data gets inserted successfully, have ctrl+c kill it. is there i'm supposed use in node.js end script? var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/testdb'); var dir = './seeds'; var db = mongoose.connection; // show connection error if there 1 db.on('error', console.error.bind(console, 'database connection error:')); // if connected mongo db.once('open', function callback() { var fs = require('fs'); // used files in directory // read files in folder fs.readdir(dir, function(err, list) { // log error if went wrong if(err) { console.log('error: '+err); } // every file in list list.foreach(function(file) { // set filename without extension variable collection_name var collection_name =

WPF get ListView height in C# when Window Size is changed -

i have following question: have layout grid , listviews. these listviews contain 5 items. these items should fill complete height of listview. thought height of listview devide 5 , set height of each row result. listview.height property returns strange values. listen window sizechanged event. hope can tell me how it, or if there better alternative. <window x:class="kalenderdesingtest.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="kalender" height="600" width="800" sizechanged="window_sizechanged"> <grid> <grid.resources> <style targettype="{x:type listviewitem}"> <style.setters> <setter property="template"> <setter.val

wav - pause() from audio library not working in r project -

after using play() function sound plays continuously. how stop it. code below shows used pause() function gives me error message, i've tried using close() function. > pause(saw) error in usemethod("pause") : no applicable method 'pause' applied object of class "c('wave', 'wavegeneral')" i guess use these 2 different packages: tuner import wave file audio for playback functions unfortunately these packages each have own object classes: wave class in tuner , audiosample class in audio . if want use playback functions of audio first need object of class audiosample . can importing wave file audio's own import function mywav <- load.wave("myaudiosample.wav") but since tuner can import mp3 files , has more import options may necessary create own audiosample object manually wave object. simple mono file example converted following way: mywave <- readwave("myaudiosample.wav&qu

python - project nested columns in mongodb -

i have collection in mongo data looks this: { "myinput": "myinput", "myoutput": { "result": { "crossdata": { "crossdto": [ { "col1": "11", "col2": "12", }, { "col1": "21", "col2": "22", }, { "col1": "31", "col2": "32", } ], "reqpartnumber": "myinput" } }, "status": { "code": "0", "message": "successful operation", "success": &qu

java - Having problems with the recursion -

my goal program have bullseye colors switch , forth. colors not switch makes new colors instead. more pressing problem when try repeat in way. screen comes when program ran blank , nothing. when there no loop bullseye comes up. import java.awt.color; import java.awt.graphics; import java.util.random; import javax.swing.jpanel; public class bullseye extends jpanel { public void paintcomponent( graphics g ) { super.paintcomponent( g ); random rand = new random(); int top = 2; int r = rand.nextint(256); int b = rand.nextint(256); int h = rand.nextint(256); int t = rand.nextint(256); int u = rand.nextint(256); int v = rand.nextint(256); color randomcolor = new color(r, h, b); color randcolor = new color(t,u,v); //sets colors first bullseye g.setcolor(randomcolor); g.filloval( 10, 10, 200, 200 ); g.setcolor(randcolor); g.filloval( 35, 35, 150, 150 ); g.setcolor(randomcolor); g.filloval(60, 60,

SQL Subquery - return specific result -

edited: changes: reworded more ask question problem: trying update data. complications: the table updating is: p_far_sbxd.t_claim_service_typ_dim inner joining table table (p_far_stg_vw.v_claim_60_policy_stg) see missing in first table. i updating 2 fields. 1: coverage type code, found in second table. , 2: coverage type description found in lookup table, based on coverage type code the problem running updating description. code easy enough. example. m = cancer, f = ltc, etc. here logic: if row has code of m, looked table , field description populated correct description. query select p_far_sbxd.t_claim_service_typ_dim.*, p_far_stg_vw.v_claim_60_policy_stg.coverage_typ_cde stg_ctc, (select distinct p_far_cr_vw.v_rule_translation_element.translated_value_txt, p_far_cr_vw.v_rule_translation_element.input_value_txt p_far_cr_vw.v_rule_translation_element p_far_cr_vw.v_rule_translation_eleme

jquery - Jssor Slider: How to target specific slide with text/image link? -

can tell me how target particular slide using simple text/image link? specifically, using jssor slider cluster ( http://www.jssor.com/demos/slider-cluster.html ). currently slides can navigated using bullet navigator , arrow navigator in standard dimension and/or spaced equally apart. attempting create own links have different sizes/lengths. thank in advance. there 2 ways, 1. use api call play specified slide. jssor_slider1.$playto(2); //or jssor_slider1.$goto(2); 2. customize thumbnail navigator own format. please see 12 thumbnail navigator skins in package. note can compose thumbnail in format (html, text, image or combination)

java - While(rs.next()) not executing -

sorry code large. problem rs.next not seem execute @ because system.out.println("//////////////////////////////////"); not print anything. string temp2; temp2 = ""; //initialise variable system.out.println("*************************************************"); try { string filename = "database.mdb"; string database = "jdbc:odbc:driver={microsoft access driver (*.mdb)};dbq="; database += filename.trim() + ";driverid=22;readonly=false"; conn = drivermanager.getconnection(database, "", ""); for(int id = 1; id < 16; id++)//will repeat 15 times (for each player) { for(int x = 1; x < 18; x++)//will repeat 18 times (once each team fixture) { statement sta2 = conn.createstatement(); resultset rs2 = sta2.executequery("select * tblplayers playerid = "+ playerid +" , fixturenumb

c# - Calling Method only once from a Threading.Timer -

i have system.threading.timer fires (let's every second simplicity), in callback need call action (which passed in via constructor, sits in class) within processing (let's takes 2+ seconds), how prevent processing logic being called multiple times? seems lock() doesn't work within action call? i using .net 3.5. public testoperation(action callbackmethod) { this.timer = new system.threading.timer(timer_elapsed, callbackmethod, timerinterval, timeout.infinite); } private void timer_elapsed(object state) { action callback = (action) state; if (callback != null) { callback(); } } // example of callback, in class. private void callbackmethod() { // how can stop running every 1 second? lock() doesn't seem work here thread.sleep(2000); } thanks! there's nothing pretty having solve problem. note using lock bad idea, make threadpool explode when callback consistently takes time. happens when machine gets loaded. us

formula - SINGLEVALUEQUERY and MULTIVALUEQUERY with Pentaho Report Designer -

i have multiple data sets drive pentaho report. data derived handful of stored procedures. need access multiple data sources within report without using sub reports , believe best solution create open formulas. singlevaluequery believe return first column or row. need return multiple columns. as example here stored procedure named header in pentaho (call stored_procedure_test (2014, header)), returns 3 values - header_1, header_2, header_3. i'm uncertain of correct syntax return 3 values open formula. below tried unsuccessful. =multivaluequery("header";?;?) the second parameter denotes column contains result. if dont give column name here, reporting engine take first column of result. in case of multivaluequery function, various values of result set aggregated array of values suitable passed multi-select parameter or used in in clause in sql data-factory. for more details see https://www.on-reporting.com/blog/using-queries-in-formulas-in-pentah

php - Facebook API not returning message_tags to application -

i have created application using facebook api. application plan on getting user feed of authenticated users. have set extended permissions read_stream know that's not problem. have checked in graph explorer running following query: /me/feed?fields=id,message,message_tags,likes.fields(id,name),created_time,shares,from&limit=3000 when run above query in graph explorer returns request fine when run following query php sdk in application doesn't return message_tags here query: $user_feed = $facebook->api("/{$user['userid']}/feed?fields=id,message,message_tags,likes.fields(id,name),created_time,shares,from&limit=3000&access_token={$user['accesstoken']}"); and yes have valid accesstoken , userid, because when put query in graph explorer return should. so, question why isn't being returned when query application? thanks. ps: have 1 file authenticating user app , file using userid , accesstoken data of user ... above pro

c# - Setting Property Doesn't Set Its Inner Property -

i took address: http://csharpindepth.com/articles/chapter8/propertiesmatter.aspx , reason not head around it. can explain me why console.writeline(holder.property.value); outputs 0. void main() { mutablestructholder holder = new mutablestructholder(); holder.field.setvalue(10); holder.property.setvalue(10); console.writeline(holder.field.value); // outputs 10 console.writeline(holder.property.value); // outputs 0 } struct mutablestruct { public int value { get; set; } public void setvalue(int newvalue) { value = newvalue; } } class mutablestructholder { public mutablestruct field; public mutablestruct property { get; set; } } class mutablestructholder { public mutablestruct field; public mutablestruct property { get; set; } } is equivalent class mutablestructholder { public mutablestruct field; private mutablestruct _property; public mutablestruct property { { return _property; }

c++ - CMake: The C compiler identification is unknown -

i trying build project cmake 2.8.12 visual studio 10 in 32bit architecture. getting these error , cmake unable create project. can please suggest me solution. thanks. this error showing in cmake-gui window: cmake error @ c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/cmakedeterminecompilerid.cmake:446 (execute_process): execute_process given command argument no value. call stack (most recent call first): c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/cmakedeterminecompilerid.cmake:48 (cmake_determine_compiler_id_vendor) c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/cmakedetermineccompiler.cmake:131 (cmake_determine_compiler_id) cmakelists.txt:3 (project) c compiler identification unknown cmake error @ c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/cmakedeterminecompilerid.cmake:446 (execute_process): execute_process given command argument no value. call stack (most recent call first): c:/program files (x86)/cmake 2.8/share/

django - "python manage.py syncdb" not creating tables -

i first ran python manage.py syncdb and created database , tables me, tried add more apps, , here's did: create apps by python manage.py startapp newapp then added 'newapp' installed_apps in setting.py: installed_apps = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'newapp', ) at last ran syncdb : python manage.py syncdb and here's result get: creating tables ... installing custom sql ... installing indexes ... installed 0 object(s) 0 fixture(s) i checked db , there no table named newapp , no table's name including newapp . if run: python manage.py inspectdb > somefile.txt you can check out if database structure matching django models.

java - JavaFX8 Accordion animation low framerate -

i'm using accordion-control contains 2 titledpanes. in first pane there spreadsheet-view controlsfx , in second there standard tableview containing custom controls. when open or close second titledpane (with tableview) animation's framerate low. other one's performance okay. fix animation's performance?

javascript - How to use LIMIT and OFFSET for pagination in MYSQL? -

by code can able retrieve first 5 records database. but need display remaining 5 rows database after pressing pagination arrow. doing 1 video sharing website same youtube. <?php include "config.php"; $q = mysql_query("select * register r join videos v on r.id = v.video_id order r.id limit 5") or die (mysql_error()); $headers = $col = ""; $row=mysql_num_rows($q); $s=null; echo "<h1> top videos </h1>"; while ($row = mysql_fetch_array($q)) { if($row['id']!=$s) { $s = $row['id']; echo "<div class='property'>"; echo "<div class='property1' >"; echo "<a href='#'><video src=\"".$row['path']."\" height='100' width='170' style= margin:5px; controls='controls'></video></a>"; echo "</div>"; echo "<div class='p

Covariance with C# -

i met interesting covariance problem in c# code. i have generic matrix<t> class, , it's been instantiated example matrix<int> , matrix<object> , matrix<apple> . for business logic, i've wrapped them generic wrapper<t> . wrapper implements non-generic inongenericwrapper interface. so, have wrapper<int> , wrapper<object> , wrapper<apple> . my problem is: define container 3 wrapper s. can't list<wrapper<object>> , because can't insert wrapper<int> collection. can't list<inongenericwrapper> , because inside foreach, access generic matrix<t> parameter. cheesy part: wrappers (de-)serialized definite type: myserializer<wrapper<apple>>.serialize(_myinstanceofwrappedapple) . i think it's clear avoid huge switches of typeof when serializing.. what possible workarounds? i'm kinda stuck. thanks in advance, recently i've come across such limit

javascript - HTTP Live Streaming detection on mobiles -

i want detect if mobile phone/tablet can play http live streaming (m3u8). i'm testing script: function ishlsenabled() { var videoelement = document.createelement('video'), canplayappmpeg = videoelement.canplaytype('application/x-mpegurl'), canplayapplempeg = videoelement.canplaytype('vnd.apple.mpegurl'); return ( (canplayappmpeg == 'probably' || canplayappmpeg == 'maybe') || (canplayapplempeg == 'probably' || canplayapplempeg == 'maybe') ); } but doesn't work on samsung browsers (stock, dolphin, etc) - returns false (because canplaytypes empty strings) able play video. are there bulletproof(ish) solutions detecting kind of streaming support? i not sure if there bulletproof solution available @ point. using video element's canplaytype method thing 'works'. there around +/- 5/6 media formats have oke support modern browsers. so create list of

jquery - Changing textContent using javascript, Cushy CMS -

ok, i'm going bad rep here asking many questions. have javascript dynamically changes content on page. works fine. issue need able tag text 'class="cushycms"' in order allow access site owner easy content changes. here basic code script, there more 1 set give idea of i'm doing. tried adding class tag inside innerhtml, cushy couldn't see it. <script language="javascript" type="text/javascript"> function changetext(idelement) { if(idelement==0){ document.getelementbyid('tagmain').innerhtml ='<class="cushycms">default text display on page load.'; document.getelementbyid('tagtext').innerhtml ='<class="cushycms">more default body text on page load.'; } </script> i looking way put these text fields in hidden div , pull textcontent there. example of section works cushy <h2 class="cushycms">preventative maintanence</h2

java - How to go back to steps in a program? -

i have bank account program rewriting when wrote in school , wondering how go step within program. so, after create account, , choose option withdrawl, go , prompt option once again, how done? (see comment in code) thanks.. main class: import java.text.*; public class bankaccounttest { public static void main (string args[]){ numberformat formatter = numberformat.getnumberinstance(); formatter.setmaximumfractiondigits(2); // helps formatter format final output formatter.setminimumfractiondigits(2); consolereader console = new consolereader(system.in); system.out.println("hello, make new bank account?"); string newa = console.readline(); if(newa.equalsignorecase("yes")){ system.out.println("how deposit initially?"); double init = console.readdouble(); bankaccount account = new bankaccount(init); system.out.println("your account created,

Google Analytics medium : "banner" and "Banner" (not in the same channel group) -

Image
i'm exploring google analytics features , i've noticed surprising. unless i'm mistaken, banner medium associated default system channel group display , although banner medium associated ground (other) . according default channel definitions , display group use regex ^(display|cpm|banner)$ the filters on regex seems case-insensitive(as explained here ). result, when try data google analytics api when filter ga:medium=~^(display|cpm|banner)$,ga:addistributionnetwork==content;ga:adformat!=text , results both "banner" , "banner" medium. however, when check on google analytics website, banner medium in display group, , banner in (other) group. could please confirm me point (and explain if possible :)) ? thanks lot ! banner being placed under (other) because capitalized. can create filter convert campaign parameters lowercase. to this: create new filter > select "custom filter" select lowercase filter and dr

c - Allocating memory using malloc in a function, segmentation fault -

i trying run following program, in dynamically allocate memory variable using function called reserve. when run application, segmentation fault because of allocating memory in separate function empty pointer, if want allocate memory in main, don't error. doing wrong? here code: #include <stdlib.h> #include <stdio.h> #include <string.h> typedef struct{ unsigned char state; /* socket fd of client */ int fd; /* file path requested client */ char file_path [255]; /* current file offset */ unsigned long int offset; } state; void reserve(int length, void *context_data ,void *buffer) { context_data = (char *) malloc(length); memcpy(context_data, buffer, length); } int main() { state test; int length = sizeof(state); char buffer[1500]; char *ptr = buffer; test.state = 10; strcpy(test.file_path, "hello how you"); memcpy(ptr, &test, length); ptr += length; char *context_data; reserve(length, c

java - how to sove chinese garbled with ajax request in jquery.validate.js remote function -

example:name = 资源 rules: { name: { required: true, remote: { url: location.href.substring(0,location.href.lastindexof('/'))+"/resourcename/check/exists", datatype: "text", beforesend: function(req) { req.setrequestheader ("contenttype", "text / html; charset = uft-8"); }, type: "get" } }, url: { required: true, url: true }, menu_id: "required" } in controller got name èµæº ,how can solve problem? @requestmapping(value = "/resourcename/check/exists", method = requestmethod.get) public void isresourcenameexists(httpservletresponse response, @requestparam(value = "name", required = false) string name) throws ioexception { name

java - Object in arraylist printing null -

i'm trying make diary stores list of diary entries (diary) each title, date , entry. these added, deleted , displayed diarybook class. right i'm trying test printing out fields printing null. i've looked through similar questions , still can't work out why. i'm new java help/comments appreciated. public class diarybook { arraylist<diary> diarylist = new arraylist<diary>(); static scanner scanner = new scanner(system.in); public void adddiary () { string title; string content; calendar date; string[] splitdate; system.out.print("entry title: "); title = scanner.nextline(); system.out.print("entry date (dd/mm/yyyy): "); splitdate = scanner.next().split("/"); scanner.nextline(); int day = integer.parseint(splitdate[0]); int month = integer.parseint(splitdate[1]); int year = integer.parseint(splitdate[2]); date = new gregoriancalendar(year,month-1,day); syste

ios - Camera Overlay View on Just Capture Section -

Image
i trying add cameraoverlayview on uiimagepickercontroller , want overlay cover part of screen shows captured camera, not "cancel" button, take photo button, flash settings, or that. how can dynamically determine frame of uiimageview of overlay should be? i've attached image illustrate section i'm talking about. you can use avcamcapturemanager overlay cover part of screen shows captured camera , not buttons

html - No word break in two floating divs -

Image
<table class="project-table"> <thead> <tr class="align-top"> <td class="short-col heading">project name</td> <td class="short-col heading align-center">project id</td> <td class="short-col heading">date &amp; time</td> <td class="short-col heading">student</td> </tr> </thead> <tbody> <tr class="bottom-row-dashed"> <td class="long-col"> <div class="achievement-box float-left">winner</div> <div class="float-left margin-left">intrusion detection system in cloud architecture</div> <div class="clear"></div>