Posts

mongodb - How to write Mongo DB query that compares embedded documents? -

Consider an order document with several line items embedded documents and single specially embedded documents. With any type of linearity to find the order, it works: find ({'lineItems.type': 'food'}) How to find an order At least one LineItem type is not similar to the type of the speciallifetime? In addition, some orders have no lineites. For example, find this document: lineItems: {type: food}, {type: wood} speciallinks: {type: food} but No: line items: {type: food} specialElement: {type: food} or line items: [ ] SpecialElement: {type: food}

smtp - Emails not sending, PHP and SwiftMailer -

Text after " I have my code & lt ;? Php namespace Spika \ controller; Use the Silke \ Application; Use the Syllux \ Controller ProVirus interface; Use Symfony \ Component \ HttpFoundation \ Request; Use Symfony \ Component \ HttpFoundation \ ParameterBag; Class SendPasswordController SpikaBaseController {Public Function Connect (App $ App) {$ controller = $ app ['controllers_factory']; $ Self = $ this; // $$$ = $ request- & gt; Receive ('email'); $ User = $ application ['spikadb'] - & gt; FindUserByEmail ($ email); If (isset ($ user ['_ id'])) {$ user = $ application ['spikadb'] - & gt; FindUserById ($ user ['_ id'], false); $ ResetCode = $ application ['spikadb'] - & gt; AddPassworResetRequest ($ user ['. _ Id']); $ ResetPasswordUrl = ROOT_URL "/ page / resetPassword /" $ resetCode; $ Body = "reset here password {resetpasswordUrl}" here; Try {if (SEND_EMAIL_METHOD == EMA...

javascript - How to mute a looped background video -

I am using a video loop in the background of a div. The idea is to have a video loop in the background of a div on the hover, on the hover, the video will sound. I could not find documents or methods of silence. any idea? I tried to mute adding the lines after the plug-in started - $ ("video"). Prop ('muted', true); $ ("Video"). Ether ('mute', 'mute'); I did not see the volume reference in the document's video. However, in HTML compatible browsers, it can be easily muted by focusing on silence property setting property 0 You can do this on the video elements or on the jQuery cover. $ ('prop (' volume ', 0) $ (' video ') .prop (' mute ', true) In the video elements plugin created by wallpaper, you should set the volume or mute property after which the DOM has been added. It should not be necessary, but the problems In the case you can try setting an event handler for wallpap...

visual c++ - How to output binary stream from c++ console app? -

Is it possible to return the console app to the binary stream instead of text? #include "stdafx.h" int _tmain (int argc, _TCHAR * argv []) {return 0; } How to change this code so that it returns a stream? You can set up binary mode like this, for example. Full results; // set is "binary mode" in stdout: result = _setmode (_fileno (stdout), _O_BINARY); If (result == -1) ("binary mode can not be set for stdout"); Else printf ("stdout mode is now binary");

php - continuation of of Error parsing data org.json.JsonException: Value <!DOCTYPE -

I posted many answers here and on Google and still confused why I am getting this error I made JSN step I have not been allowed to read. I changed permissions to allow everyone and it did not solve the error. I also played my IP address using my computer's IP address 196 ... and online examples of 127.0.0.1 When I use my IP, I get an error. When I used 127.0 then I failed to join the error, which I feel because IP address is not anywhere. I checked my PHP code and this input data in MySQL db. So I know that my problem is in my Java code. I am posting my code below and trying to post the minimum code, so I dump the code. If you want to post more code to me, please tell me try {// check the request method to check if (method.equals ("POST")) {// request method POST / / Default is the HTTP client default HTT Client httpClient = new DefaultHttpClient (); Http post http post = new HTTP post (url); HttpPost.setEntity (new UrlEncodedFormEntity (params)); HttpResponse http...

php - Call_user_func_array() expects parameter 1 to be a valid callback (Event handler system) -

I'm trying to create a system that handles the supply went data and Adhandlr (). Code: class test {public $ arrHandlers = array (); Public function addHandler ($ action, $ function) {$ this- & gt; ArrHandlers [$ action] = $ function; } Public function handle data ($ data) {$ data = explosion ("/", $ data); $ Action = array_shift ($ data); If (isset ($ this-> arrHandlers [$ action])) {call_user_func_array ($ this-> orientation [$ verb], array ($ data)); }}} Function testFunc () {echo fonts ("", fenc_gate_arg ()); } $ Obj = New Test (); $ Data = "egg / me / liked / cheese"; $ Obj- & gt; Edhandler ("eggs", "testfunk"); $ Obj- & gt; HandleData ($ data); What this output is: Warning: call_user_func_array () expects parameter is valid callback 1, an array of on line 13 Is not a string I want it to output: I like cheese working code: class test {public $ arrHandlers = array (); Public functio...

nhibernate - What false/true really mean for IPreInsertEventListeners? -

मुझे हाल ही में पता चला है कि IPreDeleteEventListener , IPreInsertEventListener और IPreUpdateEventListener में NHibernate.Event नामस्थान। हालांकि, यह अभी भी मुझे भ्रमित करता है कि इन घटनाओं को सफल या असफल फाइनल पर या तो क्या लौटाएगा। उदाहरण के लिए, यहां आइएंडे के ब्लॉग आलेख पर एक नज़र डालें: उसके उदाहरण के बाद, कोई भी निम्न के रूप में इंटरफेस: सार्वजनिक वर्ग ऑडिटएव्हेंट लिस्टनर: आईपीआरआईएनएसएटीएस्टएलस्टनर {सार्वजनिक बूल ऑनप्रेइन्सर्ट (ऑनप्रेइन्सर्ट @ एव्हेंट) {var ऑडिट = @ इवेंट। एंटीटी IHaveAuditInformation; अगर (ऑडिट == शून्य) वापसी झूठी; Var समय = दिनांकटाइम.अब; Var नाम = WindowsIdentity.GetCurrent ()। नाम; सेट करें (@ ईवेंट.परसिस्टर, @ इवेंट। स्थान, "बनाया गया", समय); सेट करें (@ ईवेंट.परिस्टर, @ ईवेंट। स्थान, "बनाया गया", नाम); Audit.CreatedAt = समय; Audit.Created By = name; विवरण झूठा है; }} वास्तव में क्या या तो true या false वापस मूल्य के रूप में लौटने का मतलब है, क्योंकि मेरे पास एक और उदाहरण है जहां जो वापस जाने लगता ह...

c# - Underline wrong words in a richtextbox -

I have a lot of trouble on my project and I looked for a solution on every side, but I did not find anything Can help, or at least I'm so Noah that I do not know how to apply the code in my case (I just started learning C #) here is a part of my code: Private Zero sottolinea_errori_Click (Object Sender, EventArgs e) {string line; String [] line = line = textbox_stampa_contenuto.lines; If (text box -stamp_kanto.text! = "") {Foreach (string in line) {string [] parole = k.Split (new four [] {'', ',', '.', ':' , '' T '}); Foreach (stroke in parole) {reggax rgx = new reggae (@ "\ d"); If (! Rgx.IsMatch (s)) {if (s.Trim ()! = "") {S.Trimim (); String path = @ "280000 text .txt"; Bool esito = true; Streamer file = new streamrider (path); While ((line = file. Readline ()) = null & amp; aceto == true) if (string. Compare (line, s) == 0) esito = false; File.Close (); If (aceto) {// underline}}}}} ...

php - SELECT QUERY to get the assistance of employees, in a range of hours -

Image
I have a problem making QUERY this way: I have this table, mt_reporteradial : I need to follow the result in SELECT QUERY , for a few hours installation (for example: between 11h and 15h): Idmtpersonalr 11 12 13 14 15 3 - - - - X - 5 - - - xx 7 - - - xx Where indicador = 'S' means in the result 'X' and ìndicador = 'N' means '-' Is it possible with MySQL? Edit: I have the answer: My updated table: QUERY : Separate selection (IDMTSNeller), Case (SELECT indicador WHERE idmtpersonalr = m.idmtpersonalr and hora = '13 'and fecha =' 2014-02-10 'from MT_RepererDial) when' S 'X' IO 'N' THEN '- '13 In the end, the case (MT_RepererDial from WHERE idmtpersonalr SELECT indicador = m.idmtpersonalr and Hora = '14' and fecha = '2014-02-10') WHEN 's' Now' X 'WHEN' N 'THEN' - '14 As DH End, case (SELECT indicador = m.idmtpersonalr and h...

sql - Moving sum over date range -

itemprop = "text"> I have this table with detailed dates and with the same value for each one of those dates, the one shown below Examples. Date values ​​6/01/2013 8 6/02/2013 4 6/03/2013 1 6/04/2013 7 6/05/2013 1 6/06/2013 1 6 / 07/2013 3 6/08/2013 8 6/09/2013 4 6/10/2013 2 6/11/2013 10/6/2013 4 6/13/2013 7 6/14/2013 3 6/15 / 2013 2 6/16/2013 1 6/17/2013 7 6/18/2013 5 6/19/2013 1 6/20/2013 4 What are I trying to do I create a query that will create a new column that will display the value column for a specified date range. For example below, the sum column contains the amount of the same date of returning a full week. So the value of the date 6/9/2013 will be the sum of the values ​​from 6/03/2013 to 6/09/2013. Date amount 6/01/2013 8 6 / 02/2013 12 6/03/2013 13 6/04/2013 20 6/05/2013 21 6/06/2013 22 6 / 07/2013 25 6/08/2013 25/06/2013 25 6/10 / 2013 26 6/11/2013 29 6/12/2013 32 6/13/2013 38 6/14/2013 38 6/15 / 2013 32 6/16/2013 29 6/17/2013 34 6/18/2013 29 6...

android - SQLite initialization on Fragment -

I just read because of getting a reference to initialize a database. The answer to the 2 most votes where to get the piece # getActivity () to get the reference or piece # onAttach (activity) Callback method is doing inside. This is to maintain a well-documented code, I want to avoid working in the "alternative" way, but the way it should have been done. There is life-cycle found here: onAttach () looks like onCreate , which means getActivity () At this point empty should not be questions will be: This means that onAttach Is to start a database inside () ? It is possible to go back to null for getActivity () when call is made inside onCreate () Only the onAttach () has already been called? It looks like you want to make better setup at the right time. Easily allow DB to reach from anywhere through the resolver.

windows - Problems running python program with srvany.exe -

I should present it with a complete disclaimer that I am very quick in my Python development days I have created a simple dragon program that waits for a socket connection with a local IP address on port 20000. When it receives a connection, it pops up message alerts using win32api. # import Tcpintercomserver.py import socket import system win32api ip = socket.gethostbyname (socket.gethostname ()) #socket creation sock = socket.socket (socket.AF_INET, socket.SOCK_STREAM) #binding server_resress = (IP, 20000) sock.bind (Server_address) print server_address #Listen sock.listen (1) While correct: # wait for connection connection, client_address = sock.accept () win32api.MessageBox (0, 'message Text ',' Titeltex ', 0x00001000) # Close the connection connection .coz () I have a mail client program that only connects to the socket that script Trying to which team takes the case to reach you (DNS name or IP address) # tcpintercomcli.py import socket import syste...

How to setup Paypal on a website to accept varying amounts for user to use their credit card? -

I am very confused with PayPal's site. Can people be guided to know the following information? I need to be able to invoice users and use a credit card until the time of checkout the value will be unknown. With PayPal, they want to see some post variables to know who you are, how much Charging is being done, if tax is ... In the past, I wrote some javascript functions to adjust before assigning them. For example, here is the PayPal document. The value of the javascript function to change the value is ======================================================================== To know more about how this value is created, it will determine how the Javascript (or JQuery) function looks.

api - Backbone fetch not working with single model -

यहां मेरा रीढ़ कोड है var UserModel = Backbone.Model.extend ({url : 'Http://api.myapi.com/user'}); Var उपयोगकर्ता = नया UserModel (); user.set ({आईडी: 1}); user.fetch (); console.log (user.get ( 'screenname')); यह 1 के आईडी के साथ उपयोगकर्ता के पूरे संग्रह को देता है। जब मैं यूआरएल को url को बदलता हूं: 'http: // Api.myapi.com/user/1 ' मैं उस उपयोगकर्ता को वापस ले जाऊँ जो मुझे चाहिए। जब मैं user.set ({id: 1}); नोट - मेरी एपीआई एक अलग डोमेन है, यही वजह है कि मेरे पास 'यूआरएल' संपत्ति में पूरे यूआरएल है। कृपया मदद करें, मैं बैकबोन पर देने के लिए तैयार हूं। आपको आईडी को अपने मॉडल यूआरएल तो ऐसा है। url: फ़ंक्शन () {if (this.id) {वापसी 'http://api.myapi.com/user/' + this.id; } वापसी 'http://api.myapi.com/user'; } और फिर जब आप उपयोगकर्ता मॉडल को इन्स्तांत करते हैं तो आप इसे इस तरह से एक आईडी पास कर सकते हैं। var उपयोगकर्ता = नया UserModel ({id: 1} ); तब जब आप user.fetch () करते हैं, तो यह 'http://a...

php - Fuelphp redirect to file -

Redirects the phulff file. In the FPF folder in the public folder, I have a folder called files (public / files). There are some PDFs and JPEG files that I want to hyperlink to these files, so when I reach the hyperlink, I will take it to that file and see it in the browser, like when you have a direct file on the server in Epache Kses when I made this hyperlink: myhost / index.php / files / myfile.pdf but I have something set in what it does not know how to access it I routes? Or is there another way? Thank you. myhost / files / myfile.pdf if your server public / .htaccess (mod_rewrite) . can understand,

html - Vertical Align top two divs not working -

itemprop = "text"> Can someone help me align my two devices? what did I do wrong? As my devices I have two inline blocks and I am trying to align them on one side of the element at the highest point. & lt; Body & gt; & Lt; Ul id = "navbar" & gt; & Lt; Li & gt; & Lt; A href = "# Skill" & gt; Skills & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#work" & gt; Work & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "# contact" & gt; Contact & lt; / A & gt; & Lt; Li & gt; & Lt; / Ul & gt; & Lt; Div id = "intro" & gt; & Lt; P & gt; Hello & lt; / P & gt; & Lt; / Div & gt; CSS: #navbar {display: inline-block; Margin-left: 25%; List-style-type: none; Vertical-align: top; Width: 12%; } #intro {display: inline-block; Width: 40%; Vertical-align: ...

mysql - rank users and join tables -

How can I rank users based on numbers and that user may include references to any other table Is involved in? I can not find the correct ranking with the code given below: select *, (@rank: = @ rank + 1) tblb as the rank of UV tblC c uv.sno = Join joining c.refno (join rank: = 0) where ranks UVSO (2, 4, 5); I really appreciate any help. Thanks in advance. If not present, TBB (id int (11) null auto_interpretation, snow varchar (255), name varchar (255), primary key (id)); If the table is not present, then TBL (ID int (11) faucet auto_increment, data communication (255), rick varna (255), number int (255), primary key (id)) is not present; Enter the TBB (Snow, Name) value ('1', 'A'), ('2', 'BB'), ('3', 'CC'), ('4', 'DD') ('5', 'E'), ('6', 'FF'), ('7', 'gg'), ('8', 'hh'); INSERT ('Data 1', '1', '101'), ('Data2', '2...

ruby on rails - Edit multiple saved records -

I'm trying to develop a simple practice log app, and I'm stuck (again). A user selects a category and a specific workout, and I return a list of exercises related to that exercise. An attempt is a user-specific example of a practice. Class Exercises & lt; ActiveRecord :: Base has has_many: endeavor end-of-end efforts & lt; ActiveRecord :: Base is_to: Expiration Expiration I am retrieving the list of exercises in the Attempt Administrator Class Attempts Controller & lt; ApplicationController def log_workout @exercises = Exercise.where ("category_id =? And workout_id =?", Parameter [: exercise] [: category_id], param [: exercise] [: workout_id]) @Effort = try.new end end The user logs his work using the following tasks & Lt; Table & gt; & Lt; TR & gt; & Lt; Th & gt; Exercise & lt; / Th & gt; & Lt; Th & gt; Set & lt; / Th & gt; & Lt; Th & gt; Representative & lt; / Th & gt; ...

Script only runs partially when run as cron -

I wrote a script that uses a program to create a CSV from an iCOBOL flat file. Unfortunately, the program only adds to the end of the file and does not overwrite it. So I added a line in script to delete the first file. When I run it manually, everything works fine when I run a cron, so it seems that just delete the file and then stop, did I forget something? Please see your code below. #! / Bin / bash cd / home / directory rm -f file.csv icreorg- o flatfile file.csv is an ICROO program that is generating CSV. Thank you!

javascript - How to create 2 websql TABLES when the page opens -

I have no problem in creating 1 table, but how can I create 2 in a WebSQL database when the page opens ? // Create a tab curutio.webdb.createTable = function () {var db = curatio.webdb.db; Var db2 = curatio.webdb.db; Db.transaction (function (tx) {tx.executeSql ("do not login if AE does not enter AE (ID primary primary ASC, TODO TEXT, added dite, reminder text, name text, email text, blood group lesson, dub Text, icoe text, work text, mobile text, address text, allergic lesson, relevant text, medication text) ", []); db2.transaction (function (tx) {tx.executeSQL (" Create table if personalization is not ( ID integer primary key ASC, name text, added, DATETIME, note text, note text, gender text, emergency Lean contact text, emergency contact number text, ppsn text, mcn text, mse text, text here, hin text, text here, allergy text, relevant text, medication text, mobile, TEXT) ", []);});} Your code is not telling what happens in Curatiio.webdb.db But if yo...