Posts

Entity Framework 6 and MySQL base first -

i want use exist db on mysql mvc asp.net . installed mysql plugin vs , mysql connector net . add connection string config. when start vs in server explorer see working connection, when in project try add new ado.net entity data model -> generate database wizard don't know mysql in general, there defaultconnection ms sql , 2 varients new connection: microsoft sql server microsoft sql server database file other maybe forgot install? help.

python - QTextEdit does not print text -

i using pyqt4 design interface of python program. want print in qtextedit called "answere", not print anything. tested text there (see print(n_text) ), , is. short overview of program: question entered, , program should answer it. here code: # -*- coding: utf-8 -*- import sys import database pyqt4 import qtcore, qtgui, uic class raspi(qtgui.qmainwindow): def __init__(self): qtgui.qmainwindow.__init__(self) self.ui = uic.loadui('main_window.ui') self.ui.setwindowtitle('fragen den raspi') self.ui.show() self.connect(self.ui.ask, qtcore.signal("clicked()"), self.reading) def reading(self): txt = str(self.ui.question.text()).lower() database.base().searching(txt) def answere(self, text): n_text = qtcore.qstring(text) print(n_text) self.ui.answere.append(n_text) if __name__=='__main__': app = qtgui.qapplication(sys.argv) raspi=ra...

file upload - Can I change current directory to parent directory using PHP __DIR__ constant? -

i using php magic constant move uploaded file new location, , upload handler file location inside " _inc " file inside main application folder this: "path/tasksapp/_inc/upload_handelr.php" so; when use __dir__ path upload hander exist: "path/tasksapp/_inc/" while new location uploaded file should be: "path/tasksapp/uploads" is there's option or attribute can use __dir__ constant can change current directory parent directory: change: "path/tasksapp/_inc/" to be: "path/tasksapp/" i recommend dirname(__dir__) : it's portable (works on windows a/b/../c not allowed) it's readable

html5 - Need help for disable particular hover jQuery animation in smaller device -

this jquery code $('.sol-card-container').hover(function () { $(".card-content", this).stop().animate({top: '160px'}, {queue: false,duration: 100}); $(".cta-txt-link", this).stop().animate({bottom: '-65px'}, {queue: false,duration: 600}); }, function () { $(".card-content", this).stop().animate({top: '0px'}, {queue: false,duration: 100}); $(".cta-txt-link", this).stop().animate({bottom: '0px'}, {queue: false,duration: 600}); }); html part have using bootstrap 3 version. issues is, these jquery code working fine in desktop layout, need disable animation in <767px breakpoint. can suggest me how disable you can wrap inside resize event : $(document).ready(function(){ var $w = $(window); var breakpoint = 768; $w.on('resize', function(){ if ($w.width() < breakpoint) return false; $('.sol-card-container').hover(...

lucene - Weighted keywords on elasticsearch document -

i want create index in elasticsearch has field of weighted keywords list, when search term in keywords - give better scores documents has key higher weight? for instance: doc1 "id" : "111" "keywords" : "house"(20), "dog"(2) doc2 "id" : "222" "keywords" : "house"(3), "dog"(40) i want when searching "dog" doc2 higher score. how build mapping , query? note it's different searching regular boost, boost per each term different per document. what elasticsearch payloads? see drtech's answer delimited payload token filter separate unrelated question might out. but, describing seems lend use of payloads , using script scoring access these payloads , influence scoring. take note of performance cost mentions.

C# add list of strings to combobox and when item is remove automatic affect to list -

i want add strings list combobox, , when 1 of item removed ui, want automatically effect on list (that list remove selected string). what best tehnic kind of problems. example: list<string> users = new list<string>(){ "frsuser", "secuser", "thruser", "fouuser" }; private void frmmain_load(object sender, eventargs e) { foreach(var user in users) cmbuser.items.add(user); } private void btnremove_click(object sender, eventargs e) { cmbuser.items.removeat(cmbuser.selectedindex); // should removed here? users.removeat(cmbuser.selectedindex); } this done using bindingsource handles interaction between collection of combobox items , list private void frmmain_load(object sender, eventargs e) { bindingsource bs = new bindingsource(); bs.datasource = users; c.datasource = bs; } now @ button click event use code private void btnremove_click(object sender, eventargs e) { if(c.s...

javascript - Getting HTTP Response Header in Firefox Addon -

i trying http response reading response header. not able retrieve anything. missing exactly? here code in index.js var {cc, ci} = require("chrome"); var httprequestobserver = { init: function() { var observerservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); observerservice.addobserver(this, "http-on-examine-response", false); }, observe: function(subject, topic, data) { if (topic == "http-on-examine-response") { subject.queryinterface(ci.nsihttpchannel); this.onexamineresponse(subject); } }, onexamineresponse: function (ohttp) { console.log("header :"+json.stringify(ohttp)); try { var header_value = ohttp.getresponseheader("<the_header_that_i_need>"); // uri nsiuri of response you're looking @ // , spec gives full url string var url = ohttp.uri.spec; } ...