Posts

Showing posts from April, 2010

ASP.NET MVC TempData in browser cookie -

ASP.NET MVC TempData in browser cookie - i trying utilize custom itempdataprovider provider store tempdata in browser's cookie instead of session state. however, works fine except unable remove cookie response stream after reading it. any ideas? thanks! public class cookietempdataprovider : itempdataprovider { internal const string tempdatacookiekey = "__controllertempdata"; httpcontextbase _httpcontext; public cookietempdataprovider(httpcontextbase httpcontext) { if (httpcontext == null) { throw new argumentnullexception("httpcontext"); } _httpcontext = httpcontext; } public httpcontextbase httpcontext { { homecoming _httpcontext; } } protected virtual idictionary<string, object> loadtempdata(controllercontext controllercontext) { ...

c# - Add space between Checkboxes and Text of a TreeViewNode -

c# - Add space between Checkboxes and Text of a TreeViewNode - i have treeview checkboxes , want add together spaces between checkboxes , text of treeviewnode. how can that? example from: -a -[]b -[]c -a -[] b -[] c i using http://www.codeproject.com/kb/tree/tristatetreeviewsubmissio.aspx solved problem , give me more flexibility in states. c# winforms treeview

How to show a window before processing in MFC -

How to show a window before processing in MFC - how can window visible before processing? i'm trying this: void cmyclass::onbutton1clicked() { cstring class_str = afxregisterwndclass(cs_vredraw | cs_hredraw, ::loadcursor(null,idc_arrow),(hbrush)::getstockobject(white_brush),::loadicon(null, idi_application)); cwnd* wnd = new cwnd(); wnd->create(class_str,"test",ws_child | ws_visible | ws_border, crect(0,0,100,100), afxgetmainwnd(), 1432); //afxmessagebox("test"); // <- if executed wnd gets visible before sleep() sleep(5000); //this processing wnd->destroywindow(); delete wnd; return; } the window doesn't show @ all. i've tried displaying in ui thread doesn't show either. if message loop until window created, shows after while main message loop asserts. i know shouldn't made rather processing in worker thread, current code i'm working require changes big. disclaimer: don't know mfc, know windows ...

datepicker - Android date/time wheel picker -

datepicker - Android date/time wheel picker - how can accomplish layout time picker (and date picker)? default layout either (very big) clock or (not beautiful) spinner style time picker. saw in several apps couldn't find how accomplish , feel. this illustration has 3 pickers: numberpicker, datepicker , timerpicker. https://github.com/rodrigobusata/android-pickers or use sample without library , override android default pickers. android datepicker datetimepicker timepicker

perl - Why is this script creating a corrupted PNG file on Windows? -

perl - Why is this script creating a corrupted PNG file on Windows? - i trying create png file. the script below executes without returning errors, output file tester.png cannot viewed (and cmd window prints attached attached text). i not sure why cannot view png file produced script. i have used both active perl (5.18.2) , strawberry perl (5.18.4.1) same problem. tried strawberry perl has libgd , libpng part of installation, though i'm not getting errors. advice? #!/usr/bin/perl utilize bio::graphics; utilize bio::seqfeature::generic; utilize strict; utilize warnings; $infile = "data1.txt"; open( align, "$infile" ) or die; $outputfile = "tester.png"; open( outfile, ">$outputfile" ) or die; $panel = bio::graphics::panel->new( -length => 1000, -width => 800 ); $track = $panel->add_track( -glyph => 'generic', -label => 1 ); while (<align>) { # read blast file ch...

java - trying to change a label on an event or board state -

java - trying to change a label on an event or board state - hello fellow nerds have question! working on project due quarta-feira , stuck half way through. game 2 player game each player takes turn selecting list of 16 nodes which, when clicked add together hidden value players score. project given label reads "player 1's turn" default , part of assignment asks create alter text represent who's turn currently. turn changes after current player guesses square. there "hold" button current player can skip turn (there "bust" square hidden sets current player's score zero). think can figure part out after part done. guys please help point me in right direction? please don't solve me. want larn stuff, need direction/advise. here looks when runs: image thanks help, site amazing! here relevant code: public class guicodebehind { private viewmodel theviewmodel; private list<button> buttons; private list<node> boa...

angularjs - ng-click is not working -

angularjs - ng-click is not working - i'm stuck problem 2 days , couldn't locate core help on matter appreciated. i creating form inline editable xeditable , edit(save/cancel) buttons working expected delete button not calling given method controller. tried placing on other parts in code both button , link , ng-click not working both ways! i'm quite new @ angular debugging tips on how solve kinds of problems welcome! in advance! here code app file: var app = angular.module('app', ["controllers", "xeditable"]) app.run(function (editableoptions) { editableoptions.theme = 'bs3'; }); here code controller (in different .js file app.js) angular.module("controllers", []) .controller("controller", ["$scope", "$http", function ($scope, $http) { $scope.users= {}; //get display info $http.get("/user/all").success(function (data) { $scope.users= data; }); /...

MySQL Syntax error - table name -

MySQL Syntax error - table name - i'm running unusual problem mysql not table name. mysql> drop table if exists 6e0ou1qgku7pj6ycqf0u_results; error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax utilize near '6e0ou1qgku7pj6ycqf0u_results' @ line 1 mysql> drop table if exists 6epgz4xkzfkd6a9e1asp_results; query ok, 0 rows affected (0.00 sec) mysql> any thought why first query has syntax error while sec query allowed? it's 6e0 , sql parser thinks number in scientific notation: 6 * 100. mysql

Android Rss feed from facebook page -

Android Rss feed from facebook page - the info received , shown on log. can't seem display on screen. keeps saying java.lang.string cannot converted jsonobject. tried these lines in project , seems working fine. here code many in advance: mainactivity.java package synctc.me.rssfeed; import android.nfc.tag; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.menuitem; import android.widget.textview; import android.widget.toast; import com.squareup.okhttp.call; import com.squareup.okhttp.callback; import com.squareup.okhttp.okhttpclient; import com.squareup.okhttp.request; import com.squareup.okhttp.response; import org.json.jsonexception; import org.json.jsonobject; import java.io.ioexception; import butterknife.butterknife; import butterknife.injectview; public class mainactivity extends actionbaractivity { public static final string tag = mainactivity.class.getsimple...

asp.net web api - ODataController BearerToken Authorization denied -

asp.net web api - ODataController BearerToken Authorization denied - i'm trying implement authentication provider webapi services. im using guide: http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/ testing purpose i've implemented 2 controllers in separate webapi-project: public class testapicontroller : apicontroller { [authorize] public string get() { homecoming "secure"; } public string get(int id) { homecoming "not secure"; } } public class testodatacontroller : odatacontroller { [authorize] [enablequery] public httpresponsemessage get() { homecoming new httpresponsemessage(httpstatuscode.ok); } } my goal utilize odata controller in end. when phone call localhost:port/api/testapi , set bearer token in header, everythings works fine. when phone call localhost:port/odata/testodata , add together token receive messa...

Java Open Files on Windows/NTFS - not closing -

Java Open Files on Windows/NTFS - not closing - problem: java app embedded database. on linux/mac closing database closes open files. on windows, find database stop cleanly files using held open jvm. ( proc explorer lists them, can't delete or rename them) i guessing difference between behavior on windows , *ix downwards how jvm interacts ntfs. any suggestions on how 1 of following: close file opened thread has terminated? change ntfs settings or jvm property ensure closure? also open other debug ideas: jstack -l, visualvm, process explorer , running in ide break points introduce pauses etc. have not helped other farther java education on windows. thanks, fitcs java windows file-io java-7 windows-server-2012-r2

text processing - How to easily generate debugging statements for PHP code? -

text processing - How to easily generate debugging statements for PHP code? - i need able generate debugging statements code. example, here code have: $this->r->radius_ft = $this->tc->diameter / 24; $this->r->tbeta2_rad = $this->d->beta2 / $rad; //outer angle $this->r->tbeta1_rad = $this->r->inner_beta1 / $rad; //inner angle i need able display results of computations can read human. so far have been doing (example showing first line above only): $this->r->radius_ft = $this->tc->diameter / 24; if (self::debug) print("radius_ft({$this->r->radius_ft}) = diameter({$this->tc->diameter}) / 24"); the above print radius_ft(1.4583) = diameter(35) / 24 , few of lines looks equations , nicely traceable when want verify things on paper, or if want expose intermediate work of computations else. the problem is pain build debugging statements. craft them hand, , not problem, in current example, there...

ggplot2 - My R code creates plots in interactive mode, but not as a script (on Windows) -

ggplot2 - My R code creates plots in interactive mode, but not as a script (on Windows) - this question has reply here: ggplot's qplot not execute on sourcing 1 reply this code runs fine in interactive mode , creates plots specified. however, plots produced when run script blank. there way code work both script , interactively? i'm using rstudio version 0.98.1091, running on 32-bit windows 7. works fine script on linux. library(ggplot2) genes <- data.frame(genes=c("a","b","c","d","e"), expression=c(1,7.6,100,2,67) ) png("genes_with_legend.png") qplot(genes,expression,data=genes,stat="identity",geom="bar",fill=factor(genes)) dev.off() png("genes_without_legend.png") ggplot(genes,aes(genes,expression)) + geom_bar(stat="id...

sharepoint - Get the Selection Options from a mutiple selection listbox populated in another Textbox -

sharepoint - Get the Selection Options from a mutiple selection listbox populated in another Textbox - i have mulitiselect list box info source beingness sharepoint list having 2 columns. no , fullname list box has value no , displayname total name. when user selects fullname list box, want corresponding number appear in textbox 2,3,4,5 . these steps followed. created rule on listbox - if there changes on field - > set textbox's values as(got formula when doing search solution) substring-after(eval(eval(value, 'concat(., ";")'), ".."), ";") however, when select options values not displayed in textbox, if unselect of options values displayed in textbox. please help! sharepoint infopath2010

git - gitignore does not work for db-files -

git - gitignore does not work for db-files - i working grails , generated .gitignore file integrate-with --git the gitignore contains line /*db.* that should omit top level databasefile proddb.h2.db from commiting not. tried line /*db.* but doesn't work either. peter i guess file tracked, delete it: $ git rm proddb.h2.db $ git commit -m "remove database file" then set @ .gitignore : *db.* git grails

Iterating through a list and searching for each element in another list in c++ -

Iterating through a list and searching for each element in another list in c++ - i have created list of 4 elements called "worklist." have list called "choicelist" has around 40 elements in it. want check if of elements in "worklist" nowadays in "choicelist". i understand i'd utilize "std::find" search, how go checking each element in order "worklist" in "choicelist"? baring in mind 1 time element "worklist" has been found in "choicelist" want search process end (and preferably kind of notification element in "worklist" first 1 match). you have iterate on elements of first list , check there in sec list using find function. if finds searching element , print , break loop. std::list<int> worklist; std::list<int> choicelist; //this loop works in c++11 , above, //in case of c++98, need utilize iterators iterate on list for( auto &x : workl...

php - Is it possible to create an array from existing array by pairing every two values into key and value? -

php - Is it possible to create an array from existing array by pairing every two values into key and value? - this want do. i have array. $arr = array('value1','value2','value3','value4','value5','value6'); is possible pair every 2 values like: $new_arr = array('value1' => 'value2','value3' => 'value4', 'value5' => 'value6'); in first array, there no keys. values. want pair them..in same order every key => value (the next it..just illustration above) is possible? badly need it.. assuming array has number of members can do: for($i=0 ; $i<count($arr)-1 ; $i+=2) { $new_array[$arr[$i]] = $arr[$i+1]; } where $arr existing array , $new_array new resultant associative array. working ideone link php arrays

java ee - ActiveMQ forwarding from local broker to a remote broker [with unstable connection] -

java ee - ActiveMQ forwarding from local broker to a remote broker [with unstable connection] - i have next problem: have several sites local activemq broker forwards remote broker (in datacenter). connection unstable, , goes downwards several times month few minutes or hours @ time. messages hence need wait on local broker if remote broker not accessible @ moment. i have next activemq configuration: <networkconnectors> <networkconnector uri="static://(tcp://my-remote-broker:61616)" name="myremotebroker" dynamiconly="false" conduitsubscriptions="true" decreasenetworkconsumerpriority="false"> <!-- exclude destinations default --> <excludeddestinations> <queue physicalname=">" /> <topic physicalname=">"...

HTML5 Canvas eraser -

HTML5 Canvas eraser - there's way of implementing eraser (other using white pencil?). i'm using layering, have image below canvas, so, if eraser paints white, user going notice since below image isn't solid white. basically, set globalcompositeoperation copy , paint using color opacity zero, e.g. "rgba(0,0,0,0)" trying. the question answered in bit more detail here: http://stackoverflow.com/questions/3328906/erasing-in-html5-canvas html5 canvas

how to run hello-exe in the Android emulator -

how to run hello-exe in the Android emulator - i compiled hello-exe sample, contained in android ndk. problem don't know how run on emulator (i'm using windows emulator). any ideas? also, there way telnet emulator, , run programs, in regular linux terminal? thanks, joan you can shell on emulator using: adb shell do mean hello-jni sample ndk? i'm not familiar hello-exe. reply need build java code next (using eclipse or ant) , run there. see ndk instructions again; it's there. android-ndk

python - Generate permutation among several lists -

python - Generate permutation among several lists - suppose have a=[a,b,c], b=[d,e], c=[f,g] , want possible permutations among a,b , c. ex: [[a,d,f],[a,d,g],[b,d,f],[b,d,g],[c,d,f],[c,d,g],[a,e,f],[a,e,g],[b,e,f],[b,e,g],[c,e,f],[c,e,g]] how do in python? one way itertools.product: >>> itertools import product >>> list(product(a,b,c)) [('a', 'd', 'f'), ('a', 'd', 'g'), ('a', 'e', 'f'), ('a', 'e', 'g'), ('b', 'd', 'f'), ('b', 'd', 'g'), ('b', 'e', 'f'), ('b', 'e', 'g'), ('c', 'd', 'f'), ('c', 'd', 'g'), ('c', 'e', 'f'), ('c', 'e', 'g')] python list permutation

ini - Is it possible to using more than 1 windows language codes -

ini - Is it possible to using more than 1 windows language codes - i want add together more language online games want game display "english" language still keeps "thai" language readable. i've tried several time in launch.ini none works. so, want know possible utilize 2 languages codes in once? please reply oh! , here's code helping figure out! [config] svr1=login.avatarstar.in.th svr2=login.avatarstar.in.th port=9531 language=1054 remoteurl=http://patch.avatarstar.in.th/as/ saveaccountname=1 accountname=lookeaw np=5 internetbar= [url] regedit=http://www.avatarstar.in.th/link/regedit.html forgetpsw=http://www.avatarstar.in.th/link/forgetpsw.html promise=http://www.avatarstar.in.th/link/promise.html advurl=http://www.avatarstar.in.th/link/advurl.html download=http://www.avatarstar.in.th/link/download.html [ver] launch=1.4.0.9 game=1.4.0.51663 [ingame] rechurl=http://www.avatarstar.in.th/link/topup.html suggest= sugkey=t2zvyndhrvfowuvgrkq5rlh3qx...

mongodb - Adding an hardcoded property to a json output -

mongodb - Adding an hardcoded property to a json output - here code in mongodb : . db.mydb.aggregate([ { "$group": { "_id": { "a": "$a", "b": "$b", "c": "$c" }, }}, { "$group": { "cpt": { '$sum': 1 } , "_id": "$_id.a", "allowdrag": {'$literal':false}, "expanded": {'$literal':false}, "children": { "$push": { "text": "$_id.b", "details": "$_id.c", "leaf": {'$literal': true}, } }, }} ]) i add together in json output hardcoded properties , values, works "leaf": {'$literal': true} but don't know why can't create ...

c# - Spaces in file path -

c# - Spaces in file path - i'm creating console application in c#, , want check if specific file ( foo.exe ). when path contains spaces ( c:\a folder spaces\ ) checks if foo.exe exists @ directory: c:\a . question: how can check within of folder contains spaces? it looks passing name of file command-line parameter. in case split @ space done windows cmd command processor when pass c:\a folder spaces\ parameter. prepare this, enclose file name in doublequotes: c:\test>myprog.exe "c:\a folder spaces\foo.exe" c# file path space

github - What is the storage mechanism behind Git Large File Storage? -

github - What is the storage mechanism behind Git Large File Storage? - github introduced extension git storing big files in different way. mean extension replaces big files text pointers within git ? you can see in git-lfs sources how "text pointer" defined: type pointer struct { version string oid string size int64 oidtype string } the smudge , clean sources means git-lfs can utilize content filter driver in order to: download actual files on checkout store them in external source on commit. see the pointer specs: the core git lfs thought instead of writing big blobs git repository, pointer file written. version https://git-lfs.github.com/spec/v1 oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393 size 12345 (ending \n) git lfs needs url endpoint talk remote server. git repository can have different git lfs endpoints different remotes. the actual file upload or downloaded serve...

android - How can i make this simple thing work? -

android - How can i make this simple thing work? - ok have code in android studio: driver.setbaudrate(9600); byte buffer[] = new byte[16]; driver.write(buffer,1000); and have in arduino: void setup() { pinmode(ledpin4,output); serial.begin(9600); } void loop () { int ok = serial.read(); if( //...... //){ <------------- don't know set here digitalwrite(ledpin4,high);} } edit: want like: android: driver.setbaudrate(9600); int ok = 1; driver.write(1); arduino: void setup() { pinmode(ledpin4,output); serial.begin(9600); } void loop () { byte ok = serial.read(); if( ok == 1){ digitalwrite(ledpin4,high);} } i alowed utilize bytes[], how do ? try replacing byte ok = serial.read(); with int ok = serial.parseint(); note: if code seems laggy seek adding serial.settimeout(20); in void setup after serial.begin(9600); android arduino byte output communication

shell - AWK Script along with loop and if condition -

shell - AWK Script along with loop and if condition - the input file below 827 819 830 826 828 752 756 694 828 728 821 701 724 708 826 842 719 713 764 783 752 828 694 756 #$1 first row , $2 sec row. trying omit rows such 11th row same 3rd row swapped values. basically, every $1 $2 has $2 $1, want omit latter. snippet of data. there many such values in actual dataset.` i have tried below: awk -f “ “ ‘{ in cat 686.edges.txt | if [ expr $1 $2 == expr $2 $1 ] #evaluating status file and awk -f “ “ ‘{ print $2 $1 }’ >> t.txt else ‘{ print “ not found “ } fi #printing $y $x file and awk -f “ “ ‘{ in cat t.txt} | grep -v "$1 $2" 686.edges.txt >> new.txt i reading inputs t.txt result of previous operation , removing of them main file , writing in new.txt i unable execute have been getting errors. can evaluate above , right me. this prints rows unless reverse of row has been seen: $ awk '!seen[$2" "$1] {print} {...

sql - Row Aggregation after Cross Join in BigQuery -

sql - Row Aggregation after Cross Join in BigQuery - say have next table in bigquery: a = user1 | 0 0 | user2 | 0 3 | user3 | 4 0 | after cross join, have dist = |user1 user2 0 0 , 0 3 | #comma showing user val seperation |user1 user3 0 0 , 4 0 | |user2 user3 0 3 , 4 0 | how can perform row aggregation in bigquery compute pairwise aggregation across rows. typical utilize case, compute euclidean distance between 2 users. want compute next metric between 2 users: sum(min(user1_row[i], user2_row[i]) / abs(user1_row[i] - user2_row[i])) summed on each pair of users. for illustration in python simply: for in np.arange(row_length/2)]): dist.append([user1, user2, np.sum(min(r1[i], r2[i]) / abs(r1[i] - r2[i]))]) to start ugly way: flatten out math query. is, turn for in ... sum(min(...)/abs(...)) sql operating on each of fields. note min , sum aggregate functions won't want use. instead utilize + sum , if(a < b, a...

javascript - Strategy for assigning a unique price for all customers based on a condition in MongoDB -

javascript - Strategy for assigning a unique price for all customers based on a condition in MongoDB - i working on web store application each client assigned unique markup value products each client has his/her own custom pricing. 2 attributes in products collection invoiceprice , memberprice. memberprice = invoiceprice x markup value. is there efficient way me give each client custom memberprice without having create custom products collection each client contains custom memberprice? note 1 - using datatables bundle nowadays product list client , doesn't allow me modify info (such memberprice calculation) 1 time info sent datatable. note 2 - create memberprice calculation , modification on client side using javascript, expose invoiceprice , custom markup client, not secure. note 3 - building app using meteor. well easiest way dynamically compute cost when it's presented datatables bundle won't allow that. one alternative create clien...

matrix - Scaling of mesh world-relative -

matrix - Scaling of mesh world-relative - in object3d contains mesh object3d has arbitrary scaling mesh has arbitrary rotation. mesh scaled relative world coordinates. but when detach mesh in scene (for example, aid of three.sceneutils.detach (mesh, obj3d, scene) wrong result, mesh scaled locally. i tried alter geometry of mesh, still wrong result: http://jsfiddle.net/ni55an/vswb9/3426/ var euler = new three.euler(-mesh.rotation.x,-mesh.rotation.y,-mesh.rotation.z); mesh.geometry.applymatrix(new three.matrix4().makerotationfromeuler(mesh.rotation)); mesh.geometry.applymatrix(new three.matrix4().makescale( obj.scale.x, obj.scale.y, obj.scale.z )); mesh.geometry.applymatrix(new three.matrix4().makerotationfromeuler(euler)); mesh.geometry.verticesneedupdate=true; i realized mistake. necessary apply getinverse of first matrix instead .makerot...

mysql - bad HTTP response from Google CloudSQL -

mysql - bad HTTP response from Google CloudSQL - i'm trying hand @ google cloud sql using go-sql-driver. i'm stuck here don't know whats wrong here. error totally unknown me. package hello import ( "fmt" "net/http" "database/sql" _ "github.com/go-sql-driver/mysql" ) func init() { http.handlefunc("/", handler) } func handler(w http.responsewriter, r *http.request) { const dbusername = "username" const dbpassword = "password" const dbip = "123.123.231.123" db, err := sql.open("mysql", dbusername+":"+dbpassword+"@"+dbip+":3306/user") if err != nil { panic(err.error()) } // query name rows, err := db.query("select * user") if err != nil { panic(err.error()) } fmt.println(rows) defer db.close() } error: runtime process gave bad http response: '' 2015/04/12 09:23:36 http:...

businessworks - TIBCO BW: Read Resource file using "Read File" or "Parse Data" activities -

businessworks - TIBCO BW: Read Resource file using "Read File" or "Parse Data" activities - i have txt file within resource folder of bw project. i have need read file using "read file" or "parse data" activities. these activities require me specify location of file. what location of resource file, utilize file spec of "read file" or "parse data" activities? let's txt file /resources/policy.txt, in bw project. if project utf-8 enconding, encoding of file utf-8? you can read content of file "retrieve resource" activity. if set in relative project path "/resources/policy.txt", gives content of file (base64 encoded). can decode content , work point onwards. regarding 1) utilize "retrieve resources" instead of "read file" , should fine. regarding 2) project encoding should have no influence of encoding of text file. have manage encoding on own , implement t...

php - How to get data matching against multiple column values in same table -

php - How to get data matching against multiple column values in same table - this question has reply here: mysql search products attributes 1 reply how can id of books belong country 79 , author 80 , publisher 91 select id books ( (filter = 'country' , cat = 79) , (filter = 'author' , cat = 80) , (filter = 'publisher' , cat = 91) ) here table structure +----+----------+-----+ | id | fiter | cat | +----+----------+-----+ | 1 | country | 79 | | 1 | author | 80 | | 1 | publisher| 91 | | 2 | country | 476 | | 2 | author | 85 | | 2 | publisher| 121 | +----+----------+-----+ thank you this problem kind of table structure, have many filters can't columns on own?. anyway, this: select distinct id books b filter = 'country' , cat = 79 , exists( select 1 b...

ios - Swift : why Safari doesn't open? -

ios - Swift : why Safari doesn't open? - i set button function loading oauthswift, when click on breakpoint on function goes well, safari doesn't start dribbble authentification link. what have ? my button @ibaction func loginbutton(sender: anyobject) { func dooauthdribbble(){ allow oauthswift = oauth2swift( consumerkey: dribbble["consumerkey"]!, consumersecret: dribbble["consumersecret"]!, authorizeurl: "https://dribbble.com/oauth/authorize", accesstokenurl: "https://dribbble.com/oauth/token", responsetype: "code" ) oauthswift.authorizewithcallbackurl( nsurl(string: "dribs://oauth-callback/dribbble")!, scope: "public+write+comment+upload", state: "", success: { credential, response in // user var parameters...

meteor - facebook and meetup login always fail the first time -

meteor - facebook and meetup login always fail the first time - login facebook fails first time , fires error : serviceconfiguration.configerror {message: "service not configured", name: "serviceconfiguration.configerror"} i login normaly code below on button click : meteor.loginwithfacebook({}, function(err){ if (err) { console.log(err); session.set("fberror",true); throw new meteor.error("facebook login failed"); } else{ session.set("fbconnected",true); } }); update : meteor.startup(function(){ env = process.env; if (env.fb_id && env.fb_secret) { console.log('got settings facebook auth'); accounts.loginserviceconfiguration.remove({ service: "facebook" }); accounts.loginserviceconfiguration.insert({ service: "facebook", appid: env.fb_id, secre...

loopbackjs - Loopback Remote Method Callback not working -

loopbackjs - Loopback Remote Method Callback not working - okay citizens of internet, need help... super-simple remote method isn't firing callback. instead error message: /maestro/common/models/datalog.js:11 cb(null, err || 'success'); ^ typeerror: undefined not function @ /maestro/common/models/datalog.js:11:11 the model: module.exports = function(datalog) { datalog.logdata = function(description, errordetails, errormsg, severity, cb) { datalog.create( { description: description, errordetails: errordetails, errormsg: errormsg, severity: severity }, function(err, res) { cb(null, err || 'success'); } ); } datalog.remotemethod( 'logdata', { accepts: [ {arg: 'description', type: 'string'}, ...

haskell - Return JSON based on Persistent Query from yesod handler -

haskell - Return JSON based on Persistent Query from yesod handler - this additional question @konstantinerybnikov return json yesod handler. what if want have persistent query selectlist , result info must homecoming json format? code it? here code (adopt code of @konstantinerybnikov): -- json import data.aeson (object, (.=)) import qualified data.aeson j import yesod.core.json (returnjson) getimagesr :: handler value getimagesr = images <- rundb $ selectlist [imagesfilename !=. ""] [desc imagesdate] homecoming $ object (if null images [] else [] -- want result of perstent in json format) `` hope help me give thanks you. i guess main problem selectlist returns list of entity record (where record type querying) instead of record , we'll have list of records using map entityval ( entityval defined in entity ). handler : getimagesr = images <- rundb $ sel...

matching - how to match two fingerprints basedon the minutiae extraction in matlab? -

matching - how to match two fingerprints basedon the minutiae extraction in matlab? - i want match 2 fingerprints , have extracted termination , bifurcation points. how should go alignment , matching phase?i have applied thinning before extracting minutiae points. matching fingerprint biometrics

c# - Crystal Report Goes Blank on moving from one PC to Another -

c# - Crystal Report Goes Blank on moving from one PC to Another - i designed study in crystal study v13. steps followed are, create scheme dsn mysql database details in administration tools. go crystal report, click on database->database expert->create new connection -> odbc -> new connection , selected dsn created. when connection added clicked on add together command , added study command. then designed report. loaded , printed study using c# once designed study tested printing , moved study file(.rpt file) pc.printing through c# in scheme failed(blank report).then opened study in crystal study in scheme , previewed.the study blank. so followed first 2 steps did in pc(above mention step 1 , 2). 1 time again preview it. study blank no details database other skeletal construction present(i mean except values database). what did wrong here? i had step 3 , step 4 1 time again in pc. designing study in every scheme transfer study file path...

Extracting images from pptx with apache poi in google app engine using java -

Extracting images from pptx with apache poi in google app engine using java - i experimenting google image api , apache poi api. getting exception: org.apache.poi.poixmlexception: org.apache.poi.openxml4j.exceptions.invalidformatexception: bundle should contain content type part [m1.13] my souce code given below: import com.google.appengine.api.blobstore.blobstoreinputstream; import com.google.appengine.api.images.image; import com.google.appengine.api.images.imagesservice; import com.google.appengine.api.images.imagesservicefactory; xmlslideshow ppt= new xmlslideshow(blobstoreinputstream); //getting dimensions , size of slide //dimension pgsize = ppt.getpagesize(); xslfslide[] slide = ppt.getslides(); (int = 0; < slide.length; i++) { packagepart part= slide[i].getpackagepart(); outputstream outputstream = part.getoutputstream(); imagesservice imagesservice = imagesservicefactory.getimagesservice(); ppt.write(outputstream); bytearray...

repository - How to replace git repo? -

repository - How to replace git repo? - i created git repo , updated stuff. later created new directory project , initialized new git it. want force changes , replace old ones in repo. when git force origin master ! [rejected] master -> master (non-fast-forward) error: failed force refs 'git@github.com:username/repo2.git' prevent losing history, non-fast-forward updates rejected merge remote changes before pushing again. see 'note fast-forwards' section of 'git force --help' details. what can do? you need utilize little force: git force --force origin master --force can abbreviated -f . git repository

python - Cant get a custom ItemDelegate to work -

python - Cant get a custom ItemDelegate to work - first off, im new python , pyqt please bear me. im using qtableview qsqltablemodel works intended. lastly column of view contains 0 , 1 value want display checkbox , column should editable. ive read should subclass qitemdelegate did. unluckily table wont show lastly column checkbox. i tried set delegate lastly column (the way prefer) using setitemdelegateforcolumn(), didnt work. modified , set entire qtableview using setitemdelegate() reacting requests lastly column. still wont work. wont work means there no error messages wont ;) seems none of methods reimplemented gets ever called except init(). guess im missing fundamental. ive extracted relevant lines of code, kscheckboxdelegate subclass. version delegate set entire qtableview. -- code applications main class -- self.taglist = qtableview() self.tagmodel = qsqltablemodel() self.tagmodel.settable("data") self.tagmodel.select() self.taglist.setmodel(self....

node.js - How to properly escape raw SQL query (plainto_tsquery) in Postgres / node -

node.js - How to properly escape raw SQL query (plainto_tsquery) in Postgres / node - i'm writing raw sql query implement postgres total text search in node backend. i've looked through official docs, state: plainto_tsquery transforms unformatted text querytext tsquery. text parsed , normalized much to_tsvector, & (and) boolean operator inserted between surviving words. but i'm not familiar plenty different sql injection techniques know whether next escaped: 'select * "products" "catalog_ts_vector" @@ plainto_tsquery(\'english\', ' + search_term + ')' the user able come in whatever search_term want via uri. do need farther escaping/manipulation, or functionality baked plainto_tsquery() , other postgres safeguards? edit as side note, plan strip out non-alphanumeric characters (including parentheses) .replace(/[^\w-_ .\&]|\(\)/g, ' ') ; should go long way, i'm still curious if nec...

regex - JavaScript regular expression match amount -

regex - JavaScript regular expression match amount - i'm trying write regular look match amounts. in case, need either amount should positive integer or if decimal used, must followed 1 or 2 integers. basically, next valid amounts: 34000 345.5 876.45 what wrote this: /[0-9]+(\.[0-9]{1,2}){0,1}/ my thinking using parenthesis so: (\.[0-9]{1,2}) , able bundle whole "decimal plus 1 or 2 integers" part. isn't happening. among other problems, regex allowing stuff 245. , 345.567 slip through. :( help, please! your regular look good, need match origin , end of string. otherwise, regex can match portion of string , still (correctly) homecoming match. match origin of string, utilize ^ , end, utilize $ . update: avinash has noted, can replace {0,1} ? . js supports \d digits, regex can farther simplified finally, since if testing against regex, can utilize non-capturing grouping ( (?:...) instead of (...) ), offers better performance. or...

javascript - Meteor: Async Callback issues -

javascript - Meteor: Async Callback issues - currently have user click submit , click event occurs token created , method called. trying after charge callback says if or not. if successful run router.go confirmation page. if not successful allow user know card has been declined. above can code out except despite non stop tinkering, can't seem figure out how pass message event. here server side method: meteor.methods({ 'chargecard': function(token,amount,email) { var stripe = stripeapi('where key info guys'); // sync version of our api async func var stripecustomerscreatesync=meteor.wrapasync(stripe.customers.create,stripe.customers); // phone call sync version of our api func parameters method phone call var result=stripecustomerscreatesync({ description: 'woot! new customer!', card: token, email: email }, function(error,result) { if(error) { homecoming error; ...

mysql - Copy all the Database - Tables,Stored Procedures into a file and save on a flash disk -

mysql - Copy all the Database - Tables,Stored Procedures into a file and save on a flash disk - is there way re-create database - tables,stored procedures file , save on flash disk? i want able open anywhere. also there anyway can pass permission while so? if have mysql database name "mydatabase" backup have execute next code command line: mysqldump -u root -p mydatabase > mydatabase.sql and after set password to restore on server, re-create mydatabase.sql , execute command line: mysql -u root -p mydatabase < mydatabase.sql mysql sql database ssms

What do the "S", "T" and "Pr" icons that appear in the "auto completion box" in Swift playground mean? -

What do the "S", "T" and "Pr" icons that appear in the "auto completion box" in Swift playground mean? - this question has reply here: xcode intellisense meaning of letters in colored boxes f,t,c,m,p,c,k,# etc 1 reply question what "s", "t" , "pr" icons appear in "auto completion box" in swift playground mean? there other kinds? thanks! answer (for search engine indexing) c : classes pr : protocols f : functions s : structs u : unions e : enums t : types v : globals these same abbreviations appear in symbol navigator, defined (as attached screen shot shows): thus, table tells you, c means class, pr means protocol, , on. swift swift-playground

javascript - jquery ajax https call gives ERR_INSECURE_RESPONSE -

javascript - jquery ajax https call gives ERR_INSECURE_RESPONSE - i'm trying create https cors ajax phone call jquery node.js process. when ever phone call made chrome complains in console options https://localhost/ net::err_insecure_response . looking @ similar stack overflow question, cross domain request http https aborts immediately should able create cross origin https ajax calls if import self signed cert made. imported cert chrome. can see certificate in chrome's manage certificates tab under authorities. still fails when seek ajax call. this how made private key: openssl genrsa -out domain.key 4096 now cert: openssl req -x509 -sha512 -nodes -newkey rsa:4096 -keyout domain.key -out domain.crt for mutual name set ip address of computer chrome not complain url mismatch. here html page. <!doctype html> <html> <title>blackbox</title> <head> <meta charset="utf-8"> <script src="jquery-1....