Posts

Showing posts from February, 2010

sql server - Order SQL query by the sum of specefic columns -

sql server - Order SQL query by the sum of specefic columns - here extract big table (sql server 2005) i'm querying against: id (primary key) | business relationship | phone | employee | address ------------------------------------------------------------------ 1 | 123 | y | y | n 2 | 456 | n | n | n 3 | 789 | y | y | y i need homecoming rows have @ to the lowest degree 1 y in phone, employee, or address (there 10 others not shown here). need order results number of y's have in of three. i've tried getting "tagtotal" this: select sum( case when [phone] = 'y' 1 else 0 end + case when [employee] = 'y' 1 else 0 end + case when [address] = 'y' 1 else 0 end ) table grouping id this returns: tagtotal --------------- 2 0 3 i'm @ loss on how combine existing giant query , order without

regression - LINEST function in Microsoft excel; curve fitting tri-quadratic equation -

regression - LINEST function in Microsoft excel; curve fitting tri-quadratic equation - im trying curve fit first graph in set of 4 using linest. curve needs graph of 3, possible 4, variables: suction pressure level (sp), od temp, id wb temp, , possible id db temp (other graphs didnt need db work, may not needed here). isnt simple linest, tri- or quad-quadratic linest. attempted: 2nd, 3rd grade linest fits using corresponding x,y values first graph. how do this? ok if have info in table format can utilize next formula =linest(knownys, knownxs^{1, 2, 3}) when come in select 4 cells across, set in formula , come in ctrl+shift+enter. values returns a1,a2,a3, , b going left right if formula has next equation: y=a1*x^3+a2*x^2+a3*x+b. another alternative fit curves using chart trendline , can exponents there. source edit based on edits suggest find improve statistical software excel 1 alternative utilize solver. set bunch of cells constants wan

wpf - Uploading datas to skydrive without overwriting the existing file content in windows phone8 -

wpf - Uploading datas to skydrive without overwriting the existing file content in windows phone8 - i tried upload data(ie.) add together info existing file in skydrive everytime content has been overwriting. want add together datas existing file without overwriting previous contents. thanx help in advance you should obtain liveconnect sdk, add together apis project, login service, , upload file skydrive. have on these threads. how access skydrive, write , read files? , this 1 too. wpf windows-phone-8 skydrive

How to call a method in WPF application from a WCF Service hosted by the same WPF application? -

How to call a method in WPF application from a WCF Service hosted by the same WPF application? - i've created wcf service hosted in wpf application. works. clients can access wcf service without issue. now, when client phone call method in service, eg: setdata(mydataobject data), want method send "data" object wpf host processing. how wire up??? my service hosted in wpf app: host = new servicehost(typeof(wcftestservice.service1), new uri("http://localhost:8733/wcftestservice/")); // service host opened on ui thread host.addserviceendpoint(typeof(wcftestservice.iservice1), new basichttpbinding(), ""); // enable metadata exchange servicemetadatabehavior smb = new servicemetadatabehavior() { httpgetenabled = true }; host.description.behaviors.add(smb); // enable exeption details servicedebugbehavior sdb = host.description.behaviors.find<servicedebugbehavior>(); sdb.includeexceptiondetailinfaults = true; host.open(); my wcf serv

incrementing shell variable.. what's wrong? -

incrementing shell variable.. what's wrong? - i want print hey %d 5 times using shell script. #/bin/csh set i=0 while ($i < 5) echo "i=$i" echo "hey $i" set i=$i+1 end it gives me while: badly formed number. i'm sure problem in incrementing line because if remove line, prints hey 0 repeatedly. you can utilize expr : #/bin/csh set i=0 while ($i < 5) echo "hey $i" set = `expr $i + 1` end shell

c# - mono and passing on unicode strings -

c# - mono and passing on unicode strings - i'm embedding mono in application of mine have issues mono's string conversion. c++ code: static inline void p_print(monostring *str) { cout << "utf8: " << mono_string_to_utf8(str) << endl; wcout << "utf16: " << ((wchar_t*)mono_string_to_utf16(str)) << endl; } //... mono_add_internal_call("sampsharp.gamemode.natives.native::print", (void *)p_print); c# code: [methodimpl(methodimploptions.internalcall)] public static extern void print(string msg); //... print("characters \u00d6 working? (should o \" above it)"); output: utf8: characters ├û working? (should o " above it) utf16: characters Í working? (should o " above it) as can see, output not quite should print, should printing "characters Ö working? (should o " above it)", neither mono_string_to_utf8 or _to_utf16 should do. how can solve issue

sql - line count with in the text files having multiple lines and single lines -

sql - line count with in the text files having multiple lines and single lines - i using utl_file utility in oracle info in csv file. here using script. so getting set of text files case:1 sample of output in test1.csv file is "sno","name" "1","hari in singapore ramesh in usa" "2","pong in chaina chang in malaysia vilet in uk" now counting number of records in test1.csv using linux commans as egrep -c "^\"[0-9]" test1.csv here getting record count as 2 (according linux) but if calculate number of records using select * test; count(*) ---------- (according info base) 2 case:2 sample of output in test2.csv file is "sno","name","p" "","","" "","","ramesh in usa" "","","" now counting number of records in test2.csv usi

android - Instiantate ParseUser object -

android - Instiantate ParseUser object - according android api documentation in parse.com, code below should sign new user. however, next exception when seek instiantate new parseuser: java.lang.illegalargumentexception: must register parseobject subclass before instantiating it . code 1 follows: private void createuser() { parseuser user = new parseuser(); user.setusername(mfirstname + " " + mlastname); user.setpassword(mpassword); user.setemail(memail); user.signupinbackground(new signupcallback() { public void done(parseexception e) { if (e == null) { // whatever } else { // whatever } } }); } what doing wrong? i not initializing library. fixed! android parse.com

c# - Wich path to access e.x. pictures from the whatsapp folder with StorageFolder.GetFolderFromPathAsync() -

c# - Wich path to access e.x. pictures from the whatsapp folder with StorageFolder.GetFolderFromPathAsync() - i tryed access files folder wich located in knownfolder.pictures folder, e.x. files pictures/whatsapp. want create storagefolder, path? here code, not work storagefolder picturesfolder = await storagefolder.getfolderfrompathasync("data///pictures//whatsapp"); thanks in advance, christian pictureslibrary virtual location - exists both on phone , sd card. it's hard tell direct path may depend on user settings. can access folder this: storagefolder pictures = knownfolders.pictureslibrary; storagefolder folder = await pictures.getfolderasync(@"whatsapp"); // should have folder // create folder: storagefolder newone = await folder.createfolderasync(@"newfolder", creationcollisionoption.openifexists); also remember add together suitable capabilities (pictureslibrary) in package.appxmanifest file. as way - possible folder

OPNET , The application has failed to start because COREDLL.dll was not found -

OPNET , The application has failed to start because COREDLL.dll was not found - i'm trying modify standard model in opnet (install opnet in win xp) , have omitted stdmod in preference network simulation repositories . however, when want run project, error : "the application has failed start because msvcr90.dll not found. reinstalling application may prepare problem" and add together msvcr90.dll ...\microsoft visual studio 9.0\vc\ce\dll\x86 . error changed to: "the application has failed start because coredll.dll not found. reinstalling application may prepare problem" i searched lot cannot found useful. how can solve problem? give thanks much... dll

git - Clean up cache in IntelliJ IDEA 13 by deleting cache manually -

git - Clean up cache in IntelliJ IDEA 13 by deleting cache manually - i'm trying clean cache there bugs fixed cleaning thought cache. far understand can clicking menu file-> invalidate caches / restart . if doesn't help, folder should visit in c:\users\<username>\.intellijidea13\system\ clean cache? seems folders renamed? git caching intellij-idea

Handling an expired long lived access token, server side - facebook -

Handling an expired long lived access token, server side - facebook - in web app, need post on users facebook feed while offline. store long lived access tokens users. these tokens expire after 60 days. the fb docs mention necessary redirect users login flow renewed access token. i thinking of checking facebook session validity of user, whenever login app , give them alternative of re-authenticating facebook in case access token has expired. involve user interaction if user not logged in facebook account. are there alternative solutions at. also, how sites quora manage posting user's wall, without needing re-authenticate facebook after every 60 days. ps - using latest facebook php sdk. simple answer: not possible extend access token on server. create whole concept void. earlier there permission called "offline access", changed extended token maximum 60 days avoid things. should never post on wall of user without authorization, every single post. no

java - Parsing negative numbers with jparsec -

java - Parsing negative numbers with jparsec - using jparsec, i'm trying parse numbers may or may not negative: @test public void canparseintegervalues() { assertequals(0, valueparser.parser.parse("0")); assertequals(276, valueparser.parser.parse("276")); assertequals(-3874, valueparser.parser.parse("-3874")); } i've not been able figure out how declare parser . i've tried: private static final parser<integer> integer_value_parser = terminals.integerliteral.tokenizer .map(new map<fragment, integer>() { @override public integer map(fragment from) { homecoming integer.valueof(from.text()); } }); this doesn't work because terminals.integerliteral.tokenizer not accommodate minus sign. next, tried: private static final parser<integer> integer_value_parser = parsers.sequence( scanners.string("-").optional().tok

Error wrapping Eigen/C++ with Python using Swig -

Error wrapping Eigen/C++ with Python using Swig - i'm having problem wrapping little project uses eigen (the linear algebra package) using swig. i'm getting python error don't understand , can't find much online - suspect there c++ memory corruption somewhere. i've boiled downwards toy example.. unfortunately it's still reasonable long: --- testfunc.cxx ---- #include "eigen/dense" eigen::vectorxd test(eigen::matrixxd data){ eigen::vectorxd temp; homecoming temp; } --- testswig.i ----- %module testswig %{ #define swig_file_with_init #include "eigen/core" #include <python.h> #include <numpy/arrayobject.h> #include "testfunc.cxx" %} %init %{ import_array(); %} %include "numpy.i" %typemap(out) eigen::vectorxd { npy_intp dims[1] = {$1.size()}; pyobject* array = pyarray_simplenew(1, dims, npy_double); double* info = ((double *)pyarray_data(

python - Django understanding urls -

python - Django understanding urls - in core urls.py, have url(r'^student/', include('studentportal.urls')), in studentportal.urls, have url url(r'^project/(?p<project_id>[0-9])/edit/$', views.editproject, name='editproject'), url(r'^project/(?p<project_id>[0-9])/upload/$', views._upload, name='upload_document'), url(r'^project/(?p<project_id>[0-9])/$', views.viewproject, name='viewproject'), url(r'^download/(?p<document_id>[0-9])/', views.download, name='download_document'), noreversematch errors popping while rendering template @ line <p><a class="btn btn-default" href="{% url 'viewproject' p.id %}" role="button">view details »</a></p> it checks these urls 2 pattern(s) tried: ['student/project/(?p<project_id>[0-9])/$', '$project/(?p<project_id>[0-9])/$

javascript - How can I position the caret in a text area with cross-browser compatibility? -

javascript - How can I position the caret in a text area with cross-browser compatibility? - i want know how move caret character's position in text area javascript. is possible? javascript textarea

.net - Animate objects of type `dynamic`in c# -

.net - Animate objects of type `dynamic`in c# - so passing window dll receive object of type dynamic dynamic thewindow = ...; i need animate property of window, tried following: thewindow.beginanimation(thewindow.leftproperty, _leftanimation); but doesnt work. step took check if can access thewindow.leftproperty next exception: microsoft.csharp.runtimebinder.runtimebinderexception: fellow member 'system.windows.window.leftproperty' cannot accessed instance reference; qualify type name instead @ callsite.target(closure , callsite , object ) @ system.dynamic.updatedelegates.updateandexecute1[t0,tret](callsite site, t0 arg0) @ blablabla ... it says 'qualify type name instead' have no thought means... however attributes accessible , work expected: thewindow.maxwidth = thewindow.width + 108; thanks help. window.leftproperty static method , can't accessed dynamically. try thewindow.beginanimation(window.leftproperty,

Xcode 5.1 constantly indexing cmake generated project -

Xcode 5.1 constantly indexing cmake generated project - i generated xcode c++ project using cmake -gxcode generator, , works great — except xcode indexing project. i've tried regenerating scratch. i've tried defaults write com.apple.dt.xcode ideindexdisable 1 , works xcode 4, seems have no effect on xcode 5.1. if forget save (or build) while, may finish indexing. nail save shortcut key combination compulsively while editing, , saving less not great way avoid this. obviously, building unavoidable. it's slowing downwards scheme , making borderline unusable. tips appreciated. xcode cmake xcode5

r - How to move backward parent folder -

r - How to move backward parent folder - in r, i'm working on "./parent/child/a". want move parent folder "child", when type total path. lost many times. setwd('..') will move 1 directory without entering absolute path. here's example > getwd() [1] "c:/users/d/desktop/edabaseball" > setwd('..') > getwd() [1] "c:/users/d/desktop" r file

simple illumination correction in images openCV c++ -

simple illumination correction in images openCV c++ - i have color photos , illumination not regular in photos. on 1 side of image brighter other side. solve problem correcting illumination. think local contrast help me don't know how :( please help me piece of code or pipeline?? convert rgb image lab color-space (e.g., color-space luminance channel work fine), apply adaptive histogram equalization l channel. convert resulting lab rgb. what want opencv's clahe (contrast limited adaptive histogram equalization) algorithm. however, far know not documented. there an illustration in python. can read clahe in graphics gems iv, pp474-485 here illustration of clahe in action: and here c++ produced above image, based on http://answers.opencv.org/question/12024/use-of-clahe/, extended color. #include <opencv2/core/core.hpp> #include <vector> // std::vector int main(int argc, char** argv) { // read rgb color image , convert lab cv::ma

php - Send notification from server to client on server event -

php - Send notification from server to client on server event - how can send message server client php, avoiding extraneous ajax calls. here idea: user: alice makes alter gets sent server. the server checks see users not date, , if not calls code send info pertaining alter bob (who not date in case). how send bob message? you can utilize server sent events. these on looked cousin of websockets lighter weight , 1 way. allow client wait message server (which can respond via different channel such ajax) example client code: var source = new eventsource('/newfile'); source.addeventlistener('message', function(e) { // utilize ajax , pull new file here }, false); unfortuantely seems (of course) there no ie support. 1 utilize library such eventsource hq back upwards cross browser server sent events. abstract away needing handle devil's browser. php ajax client-server

Android errors when using code from stackoverflow to implement sqlite database -

Android errors when using code from stackoverflow to implement sqlite database - i error: class "databasehelper" must either abstract or implement abstract method. when running code found , stackoverflow, got code: how utilize own database - android it's first part errors, sec part working fine. code: import java.io.file; import java.io.fileoutputstream; import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import android.content.context; import android.database.sqlexception; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; import android.util.log; public class databasehelper extends sqliteopenhelper { private static string tag = "databasehelper"; // tag logcat window //destination path (location) of our database on device private static string db_path = ""; private static string db_name ="menustat.db.sqlite";// database name pr

jquery - getting controls inside a repeater in javascript function for validation -

jquery - getting controls inside a repeater in javascript function for validation - i set several controls within repeater command id = "rpcontacts". repeater placed within table id = "parenttable". need validate command within repeater(say text box- txtlastname) duplicate value value within text box outside repeater. validation function called custom validator outside repeater. the problem not client id of neither repeater nor controls within in javascript function. i values of controls within repeater if give rendered clientid like $find('ctl00_body_content_rpcontacts_ctl00_txtlastname').value; but client id of command wil alter each row of repeater. ie. txtzip in 2nd repeater row id 'ctl00_body_content_rpcontacts_ctl01_txtlastname'. any suggestions how can validation. validate controls way: $find('.rpcontacts').value; //your javascript code var elemarray = document.getelementsbyclassname('rp

c# - Replacing characters at specific locations -

c# - Replacing characters at specific locations - my input string represent machine's execution time , date. problem string formatted badly hence can't utilize datetime.parse convert datetime object. input example: 2014-01-07-15.26.46.000452 i need convert can work (replacing lastly '-' space , first 2 '.' ':') so: 2014-01-07 15:26:46.000452 i figured should utilize regex solve because need replace characters @ specific locations mystring.replace won't good. unfortunately, knowledge of using regex close nil , couldn't find examples match problem. can help me solve 1 out? (also, explanation on how & why regex works) it doesn't pretty, job: string yourstring = "2014-01-07-15.26.46.000452"; string newstring = regex.replace(yourstring, @"(\d+)-(\d+)-(\d+)-(\d+).(\d+).(\d+).(\d+)", "$1-$2-$3 $4:$5:$6.$7"); it cuts numerics apart gibberish around , constructs date want

c++ - Trilinear Interpolation in C# -

c++ - Trilinear Interpolation in C# - i need create trilinear interpolation in c#, i´ve been searching , i´ve found , illustration in c++. the illustration here: http://www.siafoo.net/snippet/33, in c++. i need , illustration in c# or someboy can translate code c#, becauase have tried , don´t known. this close transliteration can understand, clearly not c# code. public static class interpolator { public static double linear(double target, params double[] values) { homecoming target * values[0] + (1.0 - target) * values[1]; } public static double bilinear(double[] target, params double[] values) { var prime = new[] { linear(target[1], values), linear(target[1], values.skip(2).take(2).toarray()) }; homecoming linear(target[0], prime); } public static double trilinear(double[] target, params double[] values) { var prime = new[] { bilinear(

c# - Gridview Paging with Stored Procedure -

c# - Gridview Paging with Stored Procedure - hi having issue getting gridview paging. i've read bunch of articles passing in page numbers , records per page stored procedure problem stored procedure dynamic, uses temp tables bring together on each other i've tried suggested. i'm not sure how else it. shouldn't able utilize default paging sqldatasource. <asp:gridview id="gvfileresults" datasourceid="sqldatasource2" runat="server" autogeneratecolumns="false" emptydatatext="nothing found" allowsorting="true" allowpaging="true" pagesize="50" onpageindexchanging="gvfileresults_pageindexchanging"> <columns> <asp:hyperlinkfield datatextfield="displayname" headertext="file name" datanavigateurlfields="drawer_id, parentfolders_id, folderid, id" target="_blank" sortexpression="displayname" datanavigateurlf

For Loop array is not working in listview in android -

For Loop array is not working in listview in android - i want display array items in listview when used simple array works , when create array using loop not working. here code public class mainactivity extends activity { string nm; int number=0; int ttl; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); textview tv=(textview) findviewbyid(r.id.textview1); listview listview = (listview) findviewbyid(r.id.list); //string[] values =new string[]{"val1","val2"}; contentresolver cr=getcontentresolver(); cursor cur = cr.query(contactscontract.contacts.content_uri, null, null, null, null); ttl=cur.getcount()+1; string[] mystring = new string[ttl]; list<string> values = new arraylist<string>(); if (cur.getcount() > 0) { while (cur.movetonext()) { string id = cur.getstring(

ios - How long before push notifications are active in provisioning profile? -

ios - How long before push notifications are active in provisioning profile? - i've created provisioning profiles apple force notifications before , able them working after registering @ developers.apple.com i created new provisioning profile apple , none of force notifications seem coming through device. (no errors apns service either). wondering if there delay before it's "registered" , working there shouldn't delay before force notifications start working. create sure production flags match in force notification , certificate. create sure certificate supports apns , profile includes certificate. ios apple-push-notifications

c# - Where do pages and user controls end up when you precompile but not merge? -

c# - Where do pages and user controls end up when you precompile but not merge? - when publishing website have several precompile options. example, let's assume it's .ascx user command (though page behavior similar) , "allow precompiled site updatable" not checked. these of options have: don't precompile: user command content stays in .ascx file , compiled on demand temporary asp.net folders. precompile, no merge: main dll (projectname.dll) different, .ascx disappears, , can't find ascx content anywhere?? precompile, merge single assembly: main dll different, .ascx content in new single assembly, , .compiled files appear precompile, merge pages , controls single assembly: identical #3, single assembly smaller (presumably doesn't include top-level assemblies) of code #3 included)same #3 have .compiled files. methodology: used winmerge compare publish output between #1 , #2, #2 , #3 , on. picked unique word 1 ascx , searched publish output usi

asp.net web api - How to receive multiple complex objects using HTTp POST method in WebAp -

asp.net web api - How to receive multiple complex objects using HTTp POST method in WebAp - i want phone call webapi method,this how webapi method looks like: [httppost] [route("postmyservice/updatedby/{updatedbyid}/myobjname")] public void postterminalservice([frombody] list<sometype> lstsomeobj, myclass myobj, int updatedbyid) { //do } this how client looks like: int loggedinuserid=1; list<sometype> lits = new list<sometype>(); myclass myobj=new myclass(); var url = "api/xyz/postmyservice/updatedby/" + loggedinuserid + "/myobjname/" + myobj; httpresponsemessage response = client1.postasjsonasync(url, lits).result; but error/exception getting is: http error 404.0 - not found causes: •the directory or file specified not exist on web server. •the url contains typographical error. •a custom filter or module, such urlscan, restricts access file. any thought how resolve this?i kind of hitting wa

angularjs - Directive with isolated scope unexpectedly accessing parent scopes -

angularjs - Directive with isolated scope unexpectedly accessing parent scopes - i have created directive my-directive isolated scope, looks able access property div1 of $rootscope , property div2 of parent scope $scope of controller1 . what missing? javascript: angular.module('app', []) .controller('controller1', ['$scope', function ($scope) { }]) .directive('mydirective', [ function () { return{ restrict: 'a', replace: true, scope: { mydirective:'=' } }; }]); html: <body> <div id="1" ng-app="app" ng-init="div1='div1'"> <div id="2" ng-controller="controller1" ng-init="div2='div2'"> <div id="4&q

android - How to efficiently click items with a listview -

android - How to efficiently click items with a listview - i have list view , in each list item have image views , 3 text view, 3 of these image view deed image button i.e respond on click events , 2 of text view. have tried using itemonclicklisteneri mean this @override public void onitemclick(adapterview<?> arg0, view convertview, int pos, long arg3) { // todo auto-generated method stub bomb = (imageview) convertview.findviewbyid(r.id.bomb); log.i("item clicked", "item clicked @ pos" + position); bomb.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub // perform action on click //run ever task neccessary } }); } but has problem responds on sec click. know has parent , kid focus haven't been able around that. i tried using the static class view hold

java - Separate content provider for bunch of applications -

java - Separate content provider for bunch of applications - i'm create set of tools android. tools needed track grouping of people, 1 app observing weight loss, other controlling fitness activities of same people etc. think productive way - using same database apps, guess using content provider on db idea. there mutual way such of things? what making dummy application db , content provider , installing dependency when 1 of tools run first time? ps sorry english 1) if install content provider 1 of apps, user seek install sec app (without provider) first. have no command on that. , if user uninstalls app content provider, other apps useless. 2) can't set provider in apps, because cannot have several apps installing content provider same authority. 3) can install content provider separate app: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.example.cntntprvdr" android:versioncode="1

html - How to make this hovering navigation bar -

html - How to make this hovering navigation bar - so i've saw website: http://unfold.no/ , want larn how build navigation bar both transparent , can alter color function of background (if scroll or downwards you'll see it) . have limited experience navigation bars dates old dreamweaver versions, forgive me generality of question... advise of start appreciated. i guess issue can solved reading reply on question: changing classes animation depending on scroll position basically, in illustration showing, menu has position: absolute on page, positions on top right corner of page. then, easy way of changing color of menu swapping classes on menu through javascript. can utilize code shown on link above see how done. by swapping classes regarding element colors animation, give each element css transition this: .object{ -webkit-transition: 0.5s ease-in-out; -moz-transition: 0.5s ease-in-out; -o-transition: 0.5s ease-in-out; transition: 0.5s

qt - Deallocating OpenGL context created by QGLWidget -

qt - Deallocating OpenGL context created by QGLWidget - if create qglwidget, , allocate own textures using glgentextures, gltex2dimage, etc, texture info cleaned when delete widget? (also, have shared widgets deleted too). i looked @ source destructor , looks deleting context, assume clean textures generated context https://qt.gitorious.org/qt/qt/source/ca5b49a2ec0ee9d7030b8d03b561717addd3441f:src/opengl/qgl.cpp#l3409 just want create sure incase missing something no, texture storage released when object uses not bound in any of contexts share it. moreover, not implicitly released because 1 context destroyed. share same object name space between of shared contexts, there no way allowed happen (all contexts in share grouping have destroyed). each context maintains own set of bound textures, if bind texture 1 in context a , b, delete context a texture cannot freed until delete (or unbind from) context b. behavior applies calling gldeletetextures (...) well. tha

java - Running Flyway on Command Line doesn't find SpringJdbcMigrations -

java - Running Flyway on Command Line doesn't find SpringJdbcMigrations - i'm trying set process run flyway command line run our migrations (due restrictions set on my dbas) i have working nicely part, finding , running sql , normal jdbcmigrations, won't recognize springjdbcmigrations, claiming doesn't have spring jdbc available. below, find file structure, properties, , debug output flyway: file construction flyway.properties # # license removed brevity # jdbc url utilize connect database flyway.url=jdbc:mysql://localhost:3306/my_project # user utilize connect database (default: <<null>>) flyway.user=root # password utilize connect database (default: <<null>>) flyway.password=xxxxxxx # comma-separated list of locations scan recursively migrations. (default: filesystem:<<install-dir>>/sql) # location type determined prefix. # unprefixed locations or locations starting classpath: point bundle on classpath , ma

sdl 2 - SDL_Surface alpha blending -

sdl 2 - SDL_Surface alpha blending - while building own graphics engine, need have possibility of alpha blending (on sdl_surface ). here testing code: (...)/test2/test2_1.cpp : #include"../render_sdl/me_render.h" int main(int argc, char* argv[]) { init(); sdl_window* w = sdl_createwindow("test", 50, 50, 800, 600, sdl_window_shown | sdl_window_resizable); me_objects o; me_rect r1(50, 100, 300, 200, me_rgba(0, 0, 255, 255)); me_rect r2(200, 150, 250, 350, me_rgba(255, 0, 0, 127)); o.add(&r1); o.add(&r2); sdl_surface *s1 = sdl_getwindowsurface(w); sdl_setsurfaceblendmode(s1, sdl_blendmode_blend); uint32 rmask, gmask, bmask, amask; #if sdl_byteorder == sdl_big_endian rmask = 0xff000000; gmask = 0x00ff0000; bmask = 0x0000ff00; amask = 0x000000ff; #else rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; amask = 0xff000000; #endif sdl_surface *s = sdl_creatergb

HTTPError 403 (Forbidden) with Django and python-social-auth connecting to Google with OAuth2 -

HTTPError 403 (Forbidden) with Django and python-social-auth connecting to Google with OAuth2 - using python-social-auth , 403: forbiden error message after accepting access google you need add together google+ api list of enabled apis on google developer console (under apis ) note: if want see real error message, utilize traceback @ content of response variable ( response.text ). utilize werkzeug ( django-extensions + python manage.py runserver_plus ). python django oauth-2.0 google-api

c# - Protecting MySQL connection string -

c# - Protecting MySQL connection string - i'm setting mysql connection c# application, i'm wondering if code offers kind of security against connection string hacks?, don't want expose connection credentials much them vulnerable. protected mysqlconnection connection; protected string server; protected string database; protected string uid; protected string password; //initialize values private void initialize() { server = "localhost"; database = "databasename"; uid = "username"; password = "password"; var connectionstring = string.empty; connectionstring = "server=" + server + ";" + "database=" + database + ";" + "uid=" + uid + ";" + "password=" + password + ";"; connection = new mysqlconnection(connectionstring.tostring()); } //open connection database private bool openconnection() { seek { connect

bitmap - Android load resized image from asset -

bitmap - Android load resized image from asset - i getting memory error in android game , think caused image loading function. working fine on mobile on tablet memory exceed error. i using matrix because need resize image float value. in case have load image in total size first , resize matrix , think causes memory error. is right way handle image resize? public class sprite { private bitmap bitmap = null; private float scalex, scaley; public sprite(string path, float targetwidth, float targetheight, context context) { inputstream istr; assetmanager assetmanager = context.getassets(); matrix scalematrix = new matrix(); seek { istr = assetmanager.open(path); bitmap = bitmapfactory.decodestream(istr); scalex = targetwidth / bitmap.getwidth(); scaley = targetheight / bitmap.getheight(); scalematrix.postscale(scalex, scaley); bitmap = bitmap.createbitmap(bitm

c# - Using metadata to get a reference to the class calling a certain method -

c# - Using metadata to get a reference to the class calling a certain method - when using inotifypropertychanged possible name of property method invoking event called. public void raisepropertychanged([callermembername] string prop = "") { if (propertychanged != null) { propertychanged(new object(), new propertychangedeventargs(prop)); } } is there other type of attribute utilize reference class contains property? want able phone call raisepropertychanged() property of viewmodel classes. viewmodel classes derive base of operations i'm thinking can this. public void raisepropertychanged([callermembername] string prop = "", [callerclassref] vmbase base of operations = null) { if (propertychanged != null) { propertychanged(base, new propertychangedeventargs(prop)); } } the keyword access current class reference called this : public void rai

c# - Breaking out of a 'for' loop from a ''case" statement -

c# - Breaking out of a 'for' loop from a ''case" statement - this question has reply here: break out of while loop contains switch statement 14 answers i asked maintenance work on c# code which, i'm told, converted visual basic 6. (i mention because don't know vb6 don't know if have made more sense in language. . .) it's got for loop parses text proprietary scripting language using switch within for loop . . . for ( t = 0; t < upperbound(tokens); t++) { string mystring = tokens[t]; switch (mystring) { case "goto": if (firstgoto == -1) { firstgoto = t; } else { // compute number of tokens in goto pointlength = t - firstgoto - 1; break; // exit }

sql server 2008 - Write a query to get last seven month records from a table -

sql server 2008 - Write a query to get last seven month records from a table - im having 2 tables tablea , tableb. tablea master table. tablea: +-------+---------+ | id | asset | +-------+---------+ | 1 | asset1 | | 2 | asset2 | | 3 | asset3 | | 4 | asset4 | | 5 | asset5 | +-------+---------+ tableb: +-------+---------+-------------+ | id | asset | scandate | +-------+---------+-------------+ | 1 | asset1 | 12/jun/2014 | | 2 | asset2 | 12/jun/2014 | | 3 | asset3 | 12/jun/2014 | | 4 | asset4 | 12/jun/2014 | | 5 | asset5 | 12/jun/2014 | | 6 | asset1 | 13/jun/2014 | | 7 | asset2 | 13/jun/2014 | | 8 | asset3 | 13/jun/2014 | | 9 | asset4 | 13/jun/2014 | | 10 | asset5 | 13/jun/2014 | | 11 | asset1 | 14/jun/2014 | | 12 | asset2 | 14/jun/2014 | | 13 | asset3 | 14/jun/2014 | | 14 | asset4 | 14/jun/2014 | | 15 | asset5 | 14/jun/2014 | | 16 | asset1 | 15/jun/2014 | | 1

If statement inside checked attribute of input element in freemarker? -

If statement inside checked attribute of input element in freemarker? - is possible write in freemarker. <input type="checkbox" value="available ?" checked="<#if ${status}=='available'>true<#else>false</#if>"/> for throws exception i want html checkbox checked if status property equals "available" . how in freemarker? <#if ${status}=='available'> has syntactical error (that error message haven't included points to, i'm certain): can't utilize ${...} within freemarker tags (well, except within string literals, whatever). should <#if status == 'available'> . but, simples solution want is: checked="${(status == 'available')?c}" or if have older freemarker then: checked="${(status == 'available')?string('true', 'false')}" freemarker

html - set background color with a background image -

html - set background color with a background image - i have background image set using id , want body's background black while background image loads user see black instead of default while background color. when set background black in body through css background image cant seen anymore, has gone behind black background, how can create image show on top , black behind image? ( ive tried setting z-index 200 or didnt work set -100 want ) html: <img src="background_optimized_more.jpg" name="fsbg" width="2022" height="1460" id="fsbg"> css: html, body{ width: 100%; height: 100%; margin: 0; overflow-x: hidden; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background: #000; } #fsbg { width: 100%; height: auto; position: fixed; z-index: -100;

amazon web services - How does AWS charge me for my Elastic Beanstalk applications when not doing anything -

amazon web services - How does AWS charge me for my Elastic Beanstalk applications when not doing anything - i created elastic beanstalk environment , created ec2 instance. thought don't need yet i'll stop ec2 instance, seemed start one. so question if have eb instance charged hr underlying ec2 image time or when the service provides beingness access via public elasticip. , if im charged time there way halt elastic beanstalk application or delete or instantiate new environment. the auto scaling feature of elastic beanstalk automatically start instance if current instance continues fail health check. stopping individual instances outside of environment cause failed health checks , trigger new instance spun up. you charged when components within environment running stated amazon here: there no additional charge elastic beanstalk – pay underlying aws resources (e.g. amazon ec2, amazon s3) application consumes. you can stop environment through cli. gave th

r - Unexpected behavior with non-nested looping over multiple lists -

r - Unexpected behavior with non-nested looping over multiple lists - i want produce bunch of character vectors like [1] "w2q5ea" "w2q5eb" "w2q5ec" "w2q5ed" i have next setup: vars <- list( w1 = c("w2q5e*","w2q7e*"), w2 = c("w3q9*5","w3q13*5","w3q15*5"), w3 = c("w4q17*c","w4q16*c","w4q15*c"), w4 = c("w5q16*c","w5q14*c","w5q11*c"), w5 = c("w5q8*c")) alphabet <- function(n) lapply(n,function(n) letters[1:n]) nletts <- list( w1 = list(unlist(alphabet(10)),unlist(alphabet(10))), w2 = list(unlist(alphabet(10)),unlist(alphabet(10)),unlist(alphabet(10))), w3 = list(unlist(alphabet(10)),unlist(alphabet(6)),unlist(alphabet(6))), w4 = list(unlist(alphabet(6)),unlist(alphabet(6)),unlist(alphabet(6))), w5 = list(unlist(alphabet(6)))) so that, e.g., > nletts[["w1"]] [[1]] [1]

ios - find out height of a UILabel which is size to fit -

ios - find out height of a UILabel which is size to fit - i trying find out height of uilabel when height of uilabel changes dynamically when sizetofit enabled. way figure out height of uilabel? of course of study value frame.size.height wrong when enable sizetofit . thanks. try may help you.. -(cgsize)lblsize:(nsstring *)content lblfont:(uifont *)contectlblfont width:(int)width { cgsize maximumlabelsize; maximumlabelsize = cgsizemake(width,9999); nsattributedstring *attributedtext = [[nsattributedstring alloc] initwithstring:content attributes:@ { nsfontattributename:contectlblfont }]; cgrect rect = [attributedtext boundingrectwithsize:(cgsize){maximumlabelsize.width, cgfloat_max} options:nsstringdrawinguseslinefragmentorigin context:nil]; cgsize size = rect.size; homecoming size; } and utilize within table view de

javascript - How to handle json data, which I send via ajax request, in php script? -

javascript - How to handle json data, which I send via ajax request, in php script? - i sending json info ajax: function send() { $.ajax({ url: '/index.php?action=setshopordersgoods&order_id='+orderid, type: 'post', datatype: 'json', success: function (data) { $('#target').html(data.msg); }, data: json.stringify(goods) }); } there no problems it. firebug console screen: soajax request sending okay. need handle it. how can this? echo __file__; echo '<pre>'; var_dump($_post); echo '</pre>'; exit; this code shows nothing. looks there no info send via post. firebug response tab of sent ajax request: how can handle json info in php file then? json info not receive in post. $json = file_get_contents('php://input'); $post = json_decode($json, true); echo __file__; echo '<pre>'; var_dump($post); e

How to enable RCI in SonarQube 4.3? -

How to enable RCI in SonarQube 4.3? - i doing code anaylysis using sonarqube version 4.3 sonar runner 2.4. don't see rci (rules compliance index) there in version 3.7. question: is rci replaced technical debts ? (as in sonar-4820) is possible view rci in sonarqube version 4.3, if how ? fyi @goodspeed, we're going reintroduce rci metric publishing dedicated plugin. expect plugin released end of july. sonarqube

tool to accomplish complex email sending in PHP ( possibly in Yii ) -

tool to accomplish complex email sending in PHP ( possibly in Yii ) - here task: send email grouping of users set limit number of emails sent per hour track progress and things that. what library or else this? i trying in yii framework, advice on extension much appreciated! if not using framework drupal start http://www.php.net//manual/en/function.mail.php for tracking, worth using url shortener track link clicks - or classic hidden image method mail service viewings, though not work on gmail (it auto downloads images when gets images - bad data) or if people have images switched off. educate superiors on possible , limitiations. can create case utilize technology? find if plant seed thought may fruit in 3-8 weeks. php email yii

javascript - Get all string values from a nested object -

javascript - Get all string values from a nested object - i have object, nested objects. how target specific index of object , loop through nested values of image . note length of nested objects vary. target example: productarray[0].image = test1.png, test2.png, test3.png var products = [ //item1 { identifier: "item-0", image: { "img1": "test1.png", "img2": "test2.png", "img3": "test3.png" } }, //item2 { identifier: "item-1", image: { "img1": "test1.png", "img2": "test2.png" } }, //item3 { identifier: "item-2", image: { "img1": "test1.png", "img2": "test2.png", "img3": "test3.png", &qu

android - How can i do viewpager with thumbnail image like flipkart app -

android - How can i do viewpager with thumbnail image like flipkart app - i integrate viewpager https://play.google.com/store/apps/details?id=com.flipkart.android this. here tried, i found useful samples here https://github.com/mikeortiz/touchimageview. should not able click thumbnail image flipkart. what need is, i need viewpager swipe thumbnail image flipkart. thanks in advance android android-viewpager thumbnails

linux - Calling shell script from C++ -

linux - Calling shell script from C++ - a shell script test.sh called c++ code command execl("/system/bin/sh","sh","test.sh") after execution of shell script need command c++, shell script exiting not executing next instructions in c++ code you want utilize fork create kid process before exec : pid_t pid; if((pid = fork()) > 0) execl("/system/bin/sh","sh","test.sh"); int status; waitpid(pid, &status, 0); // wait kid process, test.sh, finish linux bash shell

java - How to query for user story time in Rally -

java - How to query for user story time in Rally - using java, query rally amount of time user stories in specific project took complete become "accepted". have familiarity rally api already, , have used gather defect data. does have suggestions on how this? thanks! references: http://rallytools.github.io/rallyresttoolkitforjava/ https://github.com/rallytools/rallyresttoolkitforjava/wiki/user-guide i have access rally web services api documentation v2.0 @ https://rally1.rallydev.com/slm/doc/webservice/ instead of looking "defects" query "heirarchicalrequirements" queryrequest ustore = new queryrequest("hierarchicalrequirement"); ustore.setlimit(integer.max_value); ustore.setfetch(new fetch("formattedid","name","parent","feature","blocked","planestimate","schedulestate","release","iteration","owner","project")); ustore