Posts

Showing posts from June, 2013

How can I calculate rank based on highest points and lowest time in SQL server -

I searched and searched but they are unable to work. I really appreciate it if someone helped me Can do. I have a table that stores information for the game played (small quiz application.) I should be able to determine the top 5 ranks, but having the highest score, the shortest time after. (Many players have a maximum score) I need to rank users at any time. Here is a sample of Game Table: Pre-user_id Credit Time-Playing Surname ------- --- ---- -------- --- -------------- 64 490 180 Daplaya 93 690 187 Superman 64 336 187 Dailaya 75 1962 192 Layer 93 182 197 Superman 57 844 198 John Smith 75 350 198 Layer 64 858 384 Daplaya 73 858 400 littleguy 57 858 412 John Smith 101 858 420 Flash 73 858 423 littleguy 73 858 434 littleguy 65 858 460 Sheena 122 858 540 Chinese Queen 126 858 545 Rachel 176 350 2417 Fire Light 157 350 2442 Big Q161 350 2456 JOI Blue I am using an existing query: up to 5 aliases, user_id, rank () Select (Max's) Credits, as a rank of the game in the o...

parsing - Copy one line of text from a file to a string in c++ -

I need to copy a line of text from a text file in C ++, I have a word that is There is a program to search for that word, so I decided that I could just take each individual line and load it into a string, I can search the line in line, the correct word in the file by string and Its status (in the letters, do not bring) Find s). Help would be greatly appreciated. Edit: I think the code I'm using to locate the line #include You only need one loop to complete it. Your loop should look something like this: while (getline (in_stream, str)) {lines ++; Size_t pos = str.find (search, 0); If (pos! = String :: npos) {size_t position = characters + pos; Cout & lt; & Lt; "Found in line" & lt; & Lt; Line & lt; & Lt; "More Character" & lt; & Lt; Status & lt; & Lt; Endl; } Letter + = str.length (); } I also recommend that you do not mix int and size_t types, for example, the character should be declared as size_t, n...

c++ - How to implement a doubly linked list? -

We learned to implement the linked list alone in the classroom. And like our professor, we have mentioned making a double list, but apparently it is so easy that he did not really understand how to do it completely. I'm really good at working with a list of alone links, but can someone tell me how to make a double link list? If you already have a sound definition of the link went list alone, a double link list it's easy. Before you probably do something like struct link {struct link * next; // An indicator for node that comes in the next int value; } It will need to be changed to straight link {struct link * next}; // An indicator for the node that comes with the next structure link * prev; // a pointer in the node that comes before the int value; } Now you can basically reverse your tasks using the previous instead of the next place while changing the list. Keep in mind that by adding or removing your 'keep a book to keep things right on the right ...

- Where Developers Learn, Share, & Build Careers

I have some code that parses text data in java objects, many parsers based on the JSN value are available. Like when type = 1, use parser1, use type = 2 parser2 etc. My code is like the following: interface pars {data pars (input data); } Class Parser1 implementer Parser {} Class Parser2 Tools Persers {} Switch (Type) {Case 1: Return Pace 1 Paras (data); Case 2: Return Pace 2 Paras (data); Default: return zero; } I do not like the check type manually and manually select parsed. Is spring a way to handle parser with mapping type? Thank you! You can not escape the check for mapping, you must tell the spring in the same way or Second, the parser must be selected in each state. You can apply it very well by using parseffects. The parser method will be found for example: public class parserfactor {@Autowire @Qualifier ("parser1" Parser parser 1; @ Etowair @ qualifier ("parser 2") parser parser 2; Public static parser picar (string value) {if (valu...

web scraping - Using tor and python to scrape Google Scholar -

I am working on a project that has been cited in the journal article how to analyze. I have a big file in the name of the journal article. I try to pass them to Google Scholar and see how many testimonials each has. The strategy I follow here is: Use "scholar.py", it is a previously written Pyro script that Google Scholar Searches and returns information on the first hit in the CSV format (including the number of quotes) Google Scholar blocks you after a certain number of searches (About 3000 article titles for my query ) I have found that most people use tow (and) to solve this problem Tow is a service that lets you find random IP every few minutes to do. I have successfully set up and working both scholar.py and tor I am not very familiar with dragon or library urllib2 and am surprised that for scholar.py What changes need to be made so that questions can be made through Tor. I also approach an easy (and potentially quite different) large scale Google Sc...

sql - Textpad Regular Expression: Replace a group of 3 characters with 5 new lines -

Image
I want to beautify SQL code using this tool. Before this tool will accept it, I will say "& lt; * & gt;" I want to change each example (except double quotes) "\ n \ n \ n \ n \ n" (5 new lines) using the Change in TextPad feature and choose regular expressions. How can I do this? 0) group by patient_num) T & LT; * & Gt; Insert in i2b2demodata.dx (patient_name) * from (i2b2demodata.QUERY_GLOBAL_TEMP, select patient_name, where panel_ count = 1) q & lt; * & Gt; Insert I2b2demodata.MASTER_QUERY_GLOBAL_TEMP (master_id, Patient_Name, Level_NO), select 'MasterDead: 22', Patient_Name, 0 to i2b2demodata.QUERY_GLOBAL_TEMP, where patient_name (choose from i2b2demodata.QUERY_GLOBAL_TEMP from patient_num where panel_count = 1) & lt; * & Gt; Delete I2b2demodata.DX & lt; * & Gt; I2b2demodata.QUERY_GLOBAL_TEMP & lt; * & Gt; Delete I2b2demodata.QUERY_GLOBAL_TEMP (patient_num, panel_count), choose patient_num, from 1...

Placing images programatically on page ASP.net Web application c# -

Image
How can I take an image control programatically? In the asp.net web application on that page, I want to create 3 images with the program and some distance between them; int punctX = 50; Int punctY = 50; For (int y = 0; y & lt; 2; y ++) {System.Web.UI.WebControls.Image image = new system. Web.UI.WebControls.Image (); Image.ID = "coloere" + y.ToString (); - How to insert an image on the page? } This is better if you can use any type of place holder to add your images Are there. In this example I am using an ASP.NET panel control. In the code behind it, you can set the property property with the same property. & lt;% @ page title = "home page" language = "c #" masterpagefile = "~ / Site.master" AutoEventWireup = "true" CodeBehind = "Default.aspx.cs "Inheritance =" stack overflow_2. default "%> & Lt; ASP: Content ID = "Header Content" Run = "Server" Content Placeholder...

bash - unix sort for 2 fields numeric order -

I need to sort some data with Unix sort but I can not understand the exact syntax, the data appears 3. 9.1 Step 10: 3. 9.11 Phase 20: 3.8.10 Step 20: 3.10.2 Step 10: 3.8.4 Phase 9 3.8.4 Phase 100: 3.8.4 Step 10: I want to sort it by using a large number first, then step number, like the above given data. 3.8.4 Phase 10: 3.8.4 Phase 90: 3.8.4 Phase 100: 3.8.10 Phase 20: 3. 9.1 Step 10: 3. 9. 1 step 20: 3.10.2 step 10: I found a way to sort by first number on this site: sort -t P> unix sort ('theory and practice in construction a work order routine' , J. L. Linderman, AT & T Bell Labs Tech Journal, October 1984) Unfortunately, not available on the Internet, AFAICT (I saw a year ago and I did not get it, I was again Ekha now, and you can find the reference, but the article does not). In addition to other things, it has been shown in the article that for Unix sorting , compared to the time compared to the time, it is not much surprisin...

JSON Response is not getting in Android from google app engine servlet -

I am trying to apply an HTTP request response from the Android to GAe Servlet. Requesting from Android is the normal http post request. It's working fine The problem is that I'm sending back Android to Jason's response. I created Jason Ojjest using GSN (GSN v2.2.2) When I tested in the browser, it shows the GSN format correctly. Jason, {"data1": 100, "data2": "hello", "list": ["string 1", "string 2" , "String 3"]} I tried to send this json / * Json is my Jason format / response.getWritet () . Println (json); and system.out.println (json); When I try to read Jason object in Android then I'm getting an exception, value Please suggest some other ways or help me fix it, thanks. Your page is inserting the HTML code ( & lt; html & gt; & lt ; Head & gt; ) Either enter all the HTML and then process JSON (perhaps you can find it easy by putting a JSON in a sp...

android ndk build fails on build-binary.mk:369 -

I have a large project with hundreds of C ++ files, which I want to port on Android. I'm new to the project and Andike I most have been rid of errors and Andike build even goes: Compile ++ thumb: mylib & lt; = MyApp.cpp Shared Library: libmylib.so .: ./ obj / local / armeabi / objs / mylib / MyApp .o: `MyClass :: MyFunction (unsigned long, zero *, unsigned long-term) in function ': development /. / Jni / AClass.h: 249: Undefined context for the MyClass :: function (unsigned long, zero *, unsigned long-term) ' .... lots of these error messages here Are there. .. Collection 2: LD returned 1 exit status / cygdrive / c / android / android-ndk / android-ndk-r8 / build / core / build -binary.mk: 369: The recipe for the target 'obz / local / armeby / libimbilib.' Failed Make: * [obj / local / armeabi / libmylib.so] Error 1 It also "shared library: libmylib. So ", but then I get the heap of these errors as" undefined reference ...

c++ - Custom Socket Inheriting from boost::asio::ip::tcp::socket -

I am quite new in the C ++ legacy, and I am using promotion sockets. I want to make something comparable to Java's data-output stream for a synchronous boost socket. That is, I am trying to do methods like SendInt, ReadLong, etc. I tried to create a class that inherited from socket, but I continue to have errors, now I have something like this: DataSocketStream.h # Include "boost / asio.hpp" #include & lt; Vector & gt; Namespace Server {namespace std; As the namespace = boost :: asio; Nameshot IP = Promotion :: ASIO :: IP; Class Datasetset Stream: Public IP :: TCP :: Socket {Public: Datasocket Stream (eg: io_service); Virtual ~ dataset stream (); Zero WriteInt (int); Zero (long) written; Int ReadInt (boost :: system :: error_code); Read longer (boost :: system :: error_code); Zero flush (boost :: system :: errorGod); String Reedstring (boost :: system :: errorGod); Double ReadDouble (boost :: system :: error_code); Zero WriteDouble (double); Private: ip :...

android - What is logtype=100 OR logtype=500? -

जब मैं ContentResolver.query (कॉल.CONTENT_URI, null, Calls._ID = 'कॉल आईडी यहाँ' का उपयोग करता हूँ) Null, null); टेक्स्ट (logtype = 100 OR logtype = 500) क्वेरी में जोड़ा जाता है। क्या 100 और 500 मतलब है? मुझे लगता है कि आपके पास सैमसंग एंड्रॉइड डिवाइस है यहां देखें: 100 ध्वनि कॉल के लिए है

- Where Developers Learn, Share, & Build Careers

Has anyone solved this problem in Ruby: We say that: a = 8.1999999 We wanted to score it by two decimals which is 8.20 and it has increased to 1,000,000 to 8,200,000 We do it like this; (a (2) * 1000000) .to_i But we have 8199999, why? There are things dentic, if we multiply, we get the right result 1000, 100000 or 10000000, but not 1000000. Do you know any body? We are using 1.9.2 ruby ​​and try with 1.9.3 also. Thank you! is required 'big decimental' A = budicamcam (8.1999999.to_s) (a.round (2) * 1000000) .to_i

objective c - Using a Pascal Library in XCode -

मैं एक आईओएस ऐप विकसित कर रहा हूं (OSX 10.7.4, XCode 4.3.3, और iOS संस्करण 5.1 को लक्षित करना)। मेरे पास इंटरफ़ेस पहले से ही बनाया गया है, लेकिन कोर फ़ंक्शंस का इस्तेमाल करने वाला ऐप पास्कल में लिखा जाएगा। पास्कल फ़ंक्शंस को सी (और दो प्रतियों को बनाए रखने के लिए) को पोर्ट करने के बजाय, मैं एक पास्कल पुस्तकालय बनाने का एक तरीका तलाश रहा था जो एक्सकोड में आयात किया जा सकता है और उद्देश्य-सी कोड द्वारा बुलाया जाता है। पास्कल फ़ंक्शंस गणना से ज्यादा कुछ नहीं है (कोई इंटरफ़ेस कोड नहीं है, आदि)। उदाहरण के लिए कि मैं कैसे काम करना चाहूंगा, कुछ ऐसा होगा: उपयोगकर्ता एक बटन को दबाता है, उद्देश्य-सी कोड दर्ज किए गए डेटा एकत्र करता है, उचित पास्कल गणना समारोह को बुलाया जाता है, और फिर परिणाम वापस आ जाता है और प्रदर्शित किया जाता है - पास्कल केवल परिणाम प्रदान करने के लिए इस्तेमाल किया जा रहा है। मैंने पाया, और यह मान रहा हूँ कि मैं कहाँ शुरू करूँगा, लेकिन मुझे यह पूरा करने के बारे में कोई स्पष्ट जानकारी नहीं मिली है कि मैं क्या करना चाहता हूं। मुझे यह भी मिला, लेकिन अंतिम परिणाम यह है कि ...

asp.net - Javascript Error after using Script Manager- : The message received from the server could not be parsed -

I am opening a ShowModalDialog on a button OnClientClick event and it is javascript for: - & lt; Script language = "javascript" type = "text / javascript" & gt; Function OpenModal WineLunch () {var variable1 = "noon"; Window.showModalDialog ("ClockPopUP.aspx? Code =" + variable1, "dialogue method: 290px; communicationheet: 270px,"); } On the Clock.aspx page, I have an asp button on which I wrote the code: - protected void BtnStop_Click (object sender, event aRGS) {_nonProduction = new nonproduction (); If (Session ["Edit Last"]] == Faucet {} and {int NonProdTimeEntryID = Convert.ToInt32 (Session ["Last Nonproductive"]); // Updating TimeSpaceTemplatesAdvertising = _nonProduction.UpdateTimeSpentInDB (NonProdTimeEntryID); If ( IsTimeSpentUpdated == true) {string timespent = convert.ToString (_nonProduction.GetTimeSpent (NonProdTimeEntryID)); // string msg = "consumption in total time" + ...

elisp - Emacs Lisp: Convert List to String -

"post-text" itemprop = "text"> I'm dubbing in MXS Lisp and I have the following functions Trying to write: (What am I trying to achieve) What am I doing to remove? (Exiting buffer file-name-entity) (last (split-string (buffer-file-name) "/"))) Only (buffer-file-name) The file name and extension from the full path given by . However, this implementation returns a list of an item ("scratch.el") ... I (last) via (string) but it raises an error ... When I searched for Emacs list, Google did not return anything useful to change the list for the string How do I do this? I think what you want "(file-name-nondirectory (buffer-file- Name)) "which gives a simple file name, without the information of any directory in the form of a string

MySql DATETIME to java.util.Calendar -

I managed to store a calendar in a message DATETIME field to get this value managed in Java entredate = calendar.Ast instance (timezone. Gate time zone ("UT")); Entry.date.setTime (rs.getDate (DBBLogEntries.entDate)); Ententade is a Java. The value in the Util.Calendar database is: '2012-07-07 07:18:46' I store all the dates in one unique timezone in DB The problem is that it brings the date but I do not like Brinang for a while. Will anybody participate? Thanks in advance. Probably because of Java ( YYYY-MM-DD HH: MM: SS ) link: You can use it as follows. java.util.Date.dt = new java.util.Date (); Java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat ("yyyy-MM-dd HH: mm: SS"); String datetime = sdf.format (dt);

Working with excel files using apache poi -

What is the procedure for reading or writing both formats of 2003 and 2007 using apache poi? I know that we can use the HSSF workbook for the 2003 format and the XSSF for 2007 (if incorrect then correct me). But using any one workbook to read both formats but there is no way to use it separately. Post-less "itemprop =" text "> Try workbook wb = workbook .factor .create (OPCPackage pkg); . This should work. However, If XSSF is too large, you will get an OutOfMemoryException and therefore you should use the Event User Model to read your file. In that case you should read your route and your File extensions should be examined, such as the following: private Julian isXLS (string inputpath) {string tmp = inputpath.lamp () - 3, inputpath.line ()); if (tmp.equalsIgnoreCase ("XLS")) return true; second false return;} Read more about the event user model. Hope this was useful;

c# - Can the Architect be right "MVVM only splits the code behind to multiple (3) files " -

I am very new to WPF and this morning with my architect, I have a discussion with C, C ++ background, I have a discussion. We are trying to create a video calling application that relies on native code PInvoke WPF application is primarily a UI, and in the code we create a list of calls and available drivers for pinwoke video / audio. So if we are talking about data from the database, there is not much of the " data " included in our application. We are trying to amend and surprisingly they are not even using MVVM. While I'm eager to implement MVVM, the architect states that unnecessarily dividing the files into 3 parts is. He says that if we want to change anything like changing a button or any control, then it can be done directly behind the code, why use MVVM? Although I have theoretical answers but can not help, but agree on its point. Is that really true? He says that we want a button or any control Change anything in the scene like cha...

xcode - How to add Resource in IOS project at runtime -

Is it possible to include images in the iOS application in runtime? No Xcode project is automatically present on runtime, and the application bundle can not be modified. If you need to add data to runtime, you will need to save it outside the application bundle.

joomla2.5 - How to translate zoo blog component in joomla -

I am using 'zombog 2.5.24' in the site of Joomla 2.5.1 where the 'drop' language translator Is used to be used. Can you please tell me that the zoo blog is possible to translate my site with 'zoomingulingual', where I am using the 'drop' language translator without any problem. I have come to know that this is possible with 'jumfish', but I know 'fal' with 't' please reply me so that i can translate the zoo blog from spanish to english. All Joomla 2.5 extensions should follow with multi-language standards It can be multi-language: Everything is unique, except the menu items, content items, content modules, other words, except the home menu item and can not be translated into many languages.

- Where Developers Learn, Share, & Build Careers

मेरे पास एक छवि वैरिएबल है, $ im = imagecreatetruecolor (400, 300); क्या जेपीजी प्रारूप में इस छवि के बाइनरी को एक फ़ाइल में सहेजे बिना पाने के लिए वैसे भी है? धन्यवाद! ob_start (); imagejpeg ($ im); $ ImageString = ob_get_clean ();

Watch XLS with Xml created with QuickLook framework iOS -

I have advised that an XLS has been created: and If I open it from the open office, then it works perfectly My problem is that I open that file openly Like the QuickLook framework The QLPreviewController is looking into Apple's guidelines about class references: It says: A quick look preview controller will display the preview for the following items Microsoft Office Documents (Office 97 and newer) But I tried the same file XLSX which I could open with OpenOffice and it does not work with QLPREV control controller Done If you have no doubt with the file and to support Quick Look, Quick in Finder Try using Look (on OS X) to see if it can display the file, or with numbers and at the end, try sending the file via email to your iOS device and see that the mail app file Can display If it does not happen, then it may be that the Quick Look Enligning Conversion Engine supports its file format (either it is corrupted in a subtle way that the open office can han...

How to change the sqlite table structure dynamically in iPhone? -

Image
I am developing an iPad application, in which I have to store some data in the database. Therefore, I like to use SQLite, here I have a doubt about the table structure. Let me explain, actually there is a scene in which users can add labor volume, labor type and so on, by default I have shown only one set of fields I have created tables in five areas (labor volume, labor type ..... ) And it works fine Now I need to setup a button "Add new" below, I have the following ridge Lusn does apologize for the image I, when the user clicks the button, it will generate a five fields below the last. So how can I get the text field value in the database field, because I've only created for five fields. I tried and thanked any help you could not googled it but found the right way. What you can do in that situation is the following. Put your content in UIScrollView In the UIWebView, click the text box and click on it, create a new installation in it. Enlarging X, Y ...

- Where Developers Learn, Share, & Build Careers

I have a WordPress theme "hatch", and I'm doing it for my photography. I usually do website with HTML / CSS (in Dreamweaver) and this is the first time Wordpress is doing. In my homepage, you can see recent posts as thumbnails. I'm thinking of creating a new menu, called 'blog', basically just like normal topics, blogs Displaying the post. It can be a bit easier, but I did not find the code to display the posts as a normal display. Website lizettephotography.com Thanksgiving! Liz No need of code Create new category "blog" Add the category to your main menu. Then add a new post to the blog category. Clicking the Blog menu link will show all the posts in the blog category. You need to format the post design. Edit: In order to activate the post formats, in WordPress 3.1+, you will have to open your theme, the functions.php file and paste the following code : add_theme_support ('post-format', array ('one side...

javascript - How to get or convert value from imagebox into java script or in php? -

I have an image box and there is some value that says the image box. Getting the value I need is possible to convert the image into a string or character, or what is the other way to get that value? & lt; Img id = "imgid" name = "img" src = "captcha security image.fp? Width = 100 and height = 40 and letters = 5" /> I want to convert this image to string of strings by javascript or PHP. Or is there an alternative way to get the value of an image box? The only possible solution I can think is to add a text field below the photo. & lt; Input type = "text" name = "captcha-text" /> I think you have created a session in captchaci expression impression.fpp, so that you can compare the user after submitting the form.

- Where Developers Learn, Share, & Build Careers

Image
I have an ASP.NET MVC4 project with ESP. In my (create) view I have a week of current year I want to show in front of an editor for the date. I have a helper: @ Model Helios model. Tablename @ helper week (date time dt) {CultureInfo ciCurr = CultureInfo.CurrentCulture; Int weekNum = ciCurr.Calendar.GetWeekOfYear (DT, Calendar WeekRule.FirstFourDayWeek, DayOfWeek.Monday); @weekNum} ... & lt; Div class = "editor-field" & gt; @ Html.TextBoxFor (model = & gt; model.date_birth, new {onchange = "?"}) @Week (date_birth?) & Lt; / Div & gt; I'm not sure that this may be a complete razor, but if I change the date Q : How can I display any number of weeks. Next to Datepicker And if the date has changed? week number. But it all depends on it if you plan to install it on the server If the customer can change the date, then you will need JavaScript instead. function (d) {var day = d.getDay () ; If (days == 0) day = 7; D.setDat...

TextMate: Comment-line shortcut does not work anymore (Cmd-/ or Cmd-Shift-7 on my swiss layout) -

I have experienced quite awkward behavior in TextMate for some time. I had trouble using the keyboard. A line (which is cmd - / ) or shortcut to comment on my Swiss layout is CMD + SHIFT + 7 where SHIFT + 7 result in a / ) Already, when I switched the lion 2 months ago (before that I had never had any problem). I then used to restart TextMate and worked again. But now, the restart does not solve the problem, so I went to the bundle editor and tried to reset the shortcut, and I can set it to me anywhere, but cmd - / not at! + SHIFT + 7 `, the input field is empty! I have some bundles installed from my switch for Lion (Cucumber, RSPEC, Rubyampi, Ruby DeBug, Shia), so perhaps one of them produces trouble? Or is it also the fact that I do not seem to be able to send CMD + SHIFT + 7 in the bundle editor, somewhere else "TextMate "Is Blocked From Outside? How can I debug it? Thanks for the help. goes out that he was running and captured CM...

java - How do you determine the type of data contained in a string? -

I have a method that accepts string logic. An integer in the string, double, boolean, or just plain old letters and numbers. I want an easy way to determine what type of string is. There is a way to catch a bunch of blocks and try to parse it in every type, and if an exception is thrown, then it is probably not that data type. It seems incorrect because it is an intuitive program, not a deterministic program. If you know how to once you enter the parameter You know, it is ok to parse that type of string and catch the exception - it's fair use of exceptions to capture invalid data (unless you're just trying one type ..)

winapi - obtaining proxy from PAC proxy requiring authentication -

itemprop = "text"> I am trying to use WinHttpGetProxyForUrl where specified by the PAC file WINHTTP_AUTOPROXY_OPTIONS HTTP Basic Authentication is required to access lpszAutoConfigUrl . Regularly do the authentication dialog to popup or to supply username and password to use for proxy? Automated credential dialog handling is only supported in. In WinHTTP you have to provide a user way of obtaining the user name and password and pass it to WinHttpSetCredentials or similar tasks. I will check for the return value of WinHttpGetProxyForUrl to ERROR_WINHTTP_LOGIN_FAILURE and then demand the user's credentials. At any point in which you can try WinHTTP to pass those credentials: WinHttpSetOption with WINHTTP_OPTION_USERNAME And Use WINHTTP_OPTION_PASSWORD to set a username and password and remember WinHttpGetProxyForUrl or WinHttpGetProxyForUrl And supply the lpszAutoConfigUrl parameter with a URL containing credentials (i.e. http: // ...

javascript - How to get duration in weeks with Moment.js? -

I use moment.js to format periods in human readable format. For example ( d is a a date is a object): moment (d). Subtract ("day", 3) .from (d) // "3 days ago" I would like to receive "2 weeks ago" now, but the code below returns the periods in days Moment (D) "2 weeks ago" "Return" of 2 weeks before "I / O" 2 weeks ago "" " " Absolute "(" week ", 2) .from (d) //" 14 weeks ago " How can I get moment.js ? You can do this easily with a custom callback function. moment .relativeTime.dd = function (number) {// round var week for the closest number of weeks = mathematics. (Number / 7); If (number & lt; 7) {// if less than a week, use day's return number + "day"; } Other {// week to week week return "week" + (week === 1? "": "S"); }}

mysql - Blank spaces in mysql_insert_id(); return -

Empty space before my ID is empty? When it comes back, I get it? and ID =% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 201005 Expect it Only this and id = 1005 Is this my jquery data code? Success: Work (data) {$ ('success'). Slide Down ('Slow'); SetTimeout (function () {window.location = "user.php? V = single & amp; id =" + data;}, 3000); } Or can this be php code? & lt ;? Php included 'include / db.php'; To protect(); If (issued (clean ($ _ POST ['UID'])) {$ USD = $ _ session ['UID']; $ InsertNewUser = mysql_query ("Add user (UID, status, date time) value ('$ usrid', '0', now ())" or die (mysql_error ()); $ Id = mysql_insert_id (); echo Include $ id; $ InsertUserOptions = mysql_query ("users_options" (UID, lid) values ​​('$ usrid', '$ id') ") or die (mysql_error ()); mkdir ('media / listing /'. Id, 0755); mkdir ('media / listing /...

String.format in JSP -

How can I get the same behavior as string.form (string, object ...) in JSP page? ? ? Are there any tag libraries / function libraries available for this purpose? I need something that provides a set of string strings and arguments & lt; Ns: tag source = "hi {0} {1}" argument = "substitutes 'name' as 'nickname'" /> or $ {ns: func ("hi {0} {1}", "name ',' surname '"}} In that result Hello surname Thanks for any suggestions, Stephano You JSTL & lt; fmt: message & gt; Tags: Pre> & lt; fmt: Message key = "the.message.key"> This internally uses java.text.MessageFormat , though. Most Ua The e-framework also has its own version of such tag. / P>

C++ friend, override nested class's function -

I want to override the virtual function in a nested class from a friend (+ child) class. How is this possible? Here is what I have tried: class guardian {children of friendly class; Square nested {public: virtual zero nestedfunc () {std :: cout & lt; & Lt; "One";} } }; Classroom Children: Parents {Zero Child :: Nested :: NestedFun () {std :: cout & lt; & Lt; "Two";}} But I find: Error: Member can not define work 'Parents :: Nested: : Nestedfunk 'in' hair ' (the same error without "hair ::") As an override, you will need to expand the class and then override it: class guardian {friend class child; Square nested {public: virtual zero nestedfunc () {std :: cout & lt; & Lt; "One";} } }; Classroom Children: Parents {Class ChildNested: Parent :: Nested {public: virtual void nestedfunc () {std :: cout & lt; & Lt; "Two";}}} Inner classes are not that special, they ca...

c# - Efficient Way for Finding Reference Object in LINQ to SQL -

Image
I have a payment system as shown below. Payment can be done through many gift coupons. Gift coupons are issued with a purchase. Customers can use this gift coupon for future purchases. If the payment is made through the gift coupon, the UsedForPaymentID column in the gift coupon table will be updated with that payment ID (for GiftCooping ID). PaidID Gift is a foreign key in the coupon table. I need to write a method: Public DateTime GetPaymentDate (Int Gift Coupon ID) This gift gift coupon The date will be used. To achieve this, I can follow the following steps: GiftCoos ID (from Gift Coupon Repository) using Gift Coupon Objects Get the Payment ID from Gift Coupon Object Store in PDF Variables Paid Pay the object. > Is this an easy / efficient way to do SQL from LINQ? var c = context.GiftCoupons.FirstOrDefault (gc = & gt; gcgiftcounces id == giftcocon idid;); If (c! = Null & amp; amp; amp; amp; amp; payment! = Zero] return c.Payment.Pay...

android - SherlockListFragment cachecolorhint -

I used the FragmentTabsPager example to implement the visual pager on my application I am using a SherlockListFragment and asynctask Get the data and adapter set. The list appears on the piece, but the problem is that I can not set the list Android: cachecolorhint, and it is white (I think it is due to the subject). How can I change it? Thanks, sorted, just getListView () .setCacheColorHint (0 ); In my inactivity mode

MySQL most efficient method to find missing values from multiple tables -

I have three tables, the first is the list of email addresses: Addresses: Id - integer, this is the primary key & lt; Br> Apparently to get into the address desk: - Integer, foreign key reference id: addresses - sent "and" received "tables are the other columns, but they can not Not important for the sent and received tables every time an email is sent or received and if the address is not already in the "Addresses" table, then it is added.T tables can be quite large (100,000 +) . "Sent" and " Entries for the "received" tables are purified on a regular basis and the entries to be removed due to various reasons, leaving the orphaned entries in the "address" table. I clean orphaned entries in the "Addresses" table To find the most effective method in MySQL, I have a query that is yet to be done: Delete from addresses where id is not (choose to get rid of) and no id (Choose the sender sent); This...

c# - MySqlDataReader must be closed -

MySqlCommand स्थिति = नया MySqlCommand ("request_status से name_ru का चयन करें जहां id = '50'", conn); MySqlDataReader dr_status = status.ExecuteReader (); dr_status.Read (); MySqlCommand सीएमडी = नया MySqlCommand (क्वेरी, conn); dt.Load (cmd.ExecuteReader ()); MySqlDataReader dr = cmd.ExecuteReader (); त्रुटि: MySqlDataReader पहले बंद होना चाहिए कृपया, सहायता ... आपको एक ही समय में केवल एक रीडर का उपयोग करना होगा। आप तीन का उपयोग कर रहे हैं सभी पाठकों को एक प्रयोग-ब्लॉक में लपेटें ताकि वे सभी मामलों में निपटा सकें। ExecuteReader जो आपके एसक्यूएल को निष्पादित करता है। आपके नमूना कोड में आप एक ही एसक्यूएल तीन बार निष्पादित करते हैं जो आपके इरादे से नहीं हो सकता है।

Are nested enclosures supported in Wicket, as of 1.5? -

I have participated in some problems while using Nested Enclosure, and I want to know that it is a bug in my coding , Or if I'm trying, it is not basically supported. Like the content: & lt; Wicket: Babysitter = "Primary" & gt; & Lt; Wicket: Message key = "Primary." & Gt; Primary server & lt; / Wicket: message & gt; & Lt; Select ID = "Primary" Wicket: id = "Primary" & gt; & Lt; / Select & gt; & Lt; Wicket: children of the enclosure = "backup" & gt; & Lt; Wicket: Message key = "backup.label" /> & Lt; Span id = "backup" wicket: id = "backup" & gt; & Lt; / Span & gt; & Lt; / Wicket: enclosure & gt; & Lt; / Wicket: enclosure & gt; The question is: Is it ok to use HTML this way, before I want to ensure visibility controllers before I start looking for issues. I have diged some documents and search engines for a ...

php - How we get unmatched values from tables in mysql databases -

Image
I have a problem getting data from mysql database tables. I have two tables like Table-1 and Table-2 In the figures below. How to get Table-2 data in Table 1, if not equal to pyelotid1 I'm not sure if I understand correctly, but it gives all the rows of table-1, in which there is no matching entry in Table 2 You can find related documents for not related . with SELECT * table -1 t1 where it is not present (Select from Table-2 T2 WHERE t1 .Venueid` = t2.`Venueid`)

c - Checking types of macro parameters at compile time -

To test that two variables have the same structure type I use macros #define If some function-like macros #finem (A, B) blockabla Believe that A and B should be of the same composition type, I combine a compile time probe: # defined M (A, B ) (Assert_same_struct_types (a, b), blablabla) which stimulates compiler error if MK collar ( A, B) accidentally passes different types of stranks. However, this approach does not always work due to built-in conversions between them and works for pointer types. So, it is probably not possible to solve this problem for arbitrary type of Structs? I need a solution of C89, however, it would be interesting to hear about the CAM or C11 prospects. define aSSERT_SAME_TYPE (a, b) ((zero) (& amp; ( A) == & amp; (B))) You will get an error with a compiled diagnostic and - Terror ( GCC or for the same options for other compilers). Note that many compilers have non-standard extension operators to get type of...

ios - How to make scaling to persist with CABasicAnimation -

I am creating some animation on my app and the code below will disappear until an object is zoomed out is. I can not understand how the object disappears and stay that way, that is How to finish it after the animation remains. Got anybody on that? Cheers! CABasicAnimation * zoomOut = [with CABasic Animation Animation: @ "Transform Escal"]; ZoomOut.duration = 1; ZoomOut.toValue = [NSNumber Number explosion: 0]; [Dragged Object Ad Animation: ZoomOut Foreke: Nile]; This is because the animation does not actually change the underlying asset, which is the same. The reason is that after the animation is completed it jumps back. Try adding this line before the animation starts - zoomout. RemovedOnCompletion = NO;

- Where Developers Learn, Share, & Build Careers

I claim that Apple has rejected applications that use vanilla HTTP for authentication. I am unable to verify this information and Google does not say anything on the subject. Are there any known cases of any such app on which it has been rejected that it does not use SSL? Apple does not care about how you handle data transfer security I am a writer who is available for more than a year. The app got some updates, all of which went through the approval process and the app never used HTTPS to sign up. Apps such as Twitter or Facebook did not use HTTPS in the first years of iOS also. / P>

plugins - Maven Dependency SLF4J Binding with Code Generation -

I have a Maven Project (P) with reliance on another Maven project (G), I project this project (G). I feel like there is something to do with plugin management? Project GP should not have dependency. This is just a plugin that is used during build. This project is available for PK's & lt; Plugins & gt; should be listed in the section. Its slf4j implementation will not end on PK chamber. It seems that Jee is not playing the rules of the plugin, it should use Maven's logger, not SLF4J and here

- Where Developers Learn, Share, & Build Careers

Is it possible to add a simple HTML link to the title / title of the label? I tried the following code: & lt ;? Php $ form ['legal'] ['# type'] = 'checkbox'; $ Form ['legal'] ['# essential'] = true; $ '[' Legal '] [' # Title '] = T (' You are our TOS and Delgals', Array ('@' (& gt; L (T ('Terms of Service'), 'Node / 6') , '@glals' = & gt; L (T ('leagles'), 'node / 7'));? & Gt; But that simulation label (HTML markup " Translated "does not exist): " You have our & lt; a href = "/ node / 6" & gt; Terms of Service & lt; / a & gt; and & lt; A href = "/ node / 7" & gt; legals & lt; / a & gt; * (I've added spaces after the open bracket that it will not be converted to that link I have to do it) Is not it possible to do this? I'm new to Doppel, maybe someone can help me ... t...

ruby on rails - Allowing either growl or terminal notifier for guard -

OK, I can work with either the Guard Gemfile My Anywhere near me that works with my Gemfile and bundle Code to use Which to select I have many I'm working on a project with developers, and most use Growl I like terminal notifier. I do not want to change the Gemfile because this version is in control. I can not understand a way to move it to guardfile . What's the best thing to do just to work correctly is that it is included in the gammfile and it can be isolated, where each developer can edit his .extra-jewels file or something else ? It seems that messy. When you do not configure your alerts, then the guard tries to detect himself As you know the information facilities you can use the method to configure notifications for your needs, the guard also allows you to keep your own configuration in your home directory. You can now set your personal information settings in ~ / .guard.rb : Notification: Terminal_title This will disable automatic de...

java - Android: Detecting long key press when screen is off -

How to find a long key press in Android when the screen is off? Is there any way to do this? This is not possible, sorry. The only thing that could possibly detect the long press of a volume button is foreground activity. It also assumes that the device has the volume buttons of the hardware, and not all devices.

Loading Flash object in Facebook tab causes inline text to change in Safari -

If you create a new app in HTML, then pointing to an HTML page with the code below, Then you will see a clear change in the flash object after weight load-smoothing in the paragraph. It is only in WebKit Browser and only in Facebook. & lt ;! Doctype html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body style = "background-color: # 333" & gt; & Lt; Object class = "clayed: d27cdb6e-ae6d-11cf-96b8-444553540000" width = "100%" height = "170" id = "movie_name" align = "middle" & gt; & Lt; Param name = "movie" value = "http://edmullen.net/flash/BBC1.swf" /> & Lt; Param name = "wMode" value = "transparent" /> & Lt; Object type = "app / x-shock wave-flash" data = "http://edmullen.net/flash/BBC1.swf" width = "100%" height = "170" & gt; & Lt; Param name = "movie" value = ...

html - Can these two jQuery functions be combined into one that is more efficient? -

I have to hide two functions in jQuery and then show a header, and swap the button so that when The header is hidden, the "Show Title" button appears, and vice versa. They are as follows: $ ('# close_header'). Click (function () {$ ('# header'). Animate ({top: '- = 150px'}, 500); $ (this). Toggle (); $ ('# open_header'). Toggle () ;}); $ ('# Open_header') Click (function () {$ ('# header'). Animate ({top: '+ = 150px'}, 500); $ (this) .toggle (); $ ('# Close_header '). Toggle ();}); The markup to go together is as follows: & lt; Img src = "images / close.png" id = "close_header" class = "header_traced fidin button" & gt; & Lt; Img src = "picture / open page" id = "open_header" class = "header_control fadein button" & gt; & Lt; Div id = "header" & gt; * Header content. * & Lt; / Div & gt; Is there a...

Flex remote object to java class instantion and multithreading -

After reading this very topic about Java Servlets: > I started without looking for documentation about how this works for LCDS or Blaze Remote Objects on Flex without any luck ... So, about any good documentation Knows or is experienced enough to experience it? I am currently using ADP data services for Flash Builder 4.6, Java EE 4.6 and Jbs 7.1. EDIT: I am going to specify some of my doubts on remote objects: If there is scope application, then has the application started like Java circlet? What is the sensitization behavior on different scopes, are requests made and deleted on each call scope objects? What about the stable members?

- Where Developers Learn, Share, & Build Careers

Can anyone temporarily apply the sort of sort in C ++ and if possible, the algorithm link too. I could not find the basic steps for explaining Tim sort on the net. OK, search for more next time :) Here's not the basics: -

ios - How to add large number of static files to MonoTouch bundle? -

I have (quite a few) static files that I need to deploy with my application that made up any legacy The .NET Library contains several XML and config files and only one database to read in 10 megabytes. I have seen that most of the forum is the best way to accomplish this, to refer to the necessary files in a project, These files To add, and set them "Content" is not only a copy of the file, but also them. Embedded in Dll as well. In other words, I have 40 MB worth of files, and 40 MB DLL (The only goal of this project is to import these files, there is no solid code). How can I make this very big DLL? Is there an alternative way to get files in the app bundle? I would love to use a custom build command, and although I can copy the files to the $ {AppDirectory} target directory, but as a result, these files can not be ending in the app bundle. Is this approach possible? is? Any help is appreciated in advance. You must include your files in the main .e...

javascript - JSF button with dialog is not rendered -

मैंने इस सवाल के साथ JSF बटन का उदाहरण बनाया है: & lt;! - छुपा बटन - & gt; & Lt; h: commandButton id = "deleterow" मान = "छिपाई हटाएं" कार्रवाई = "# {AccountProfileTabGeneralController.saveData}" शैली = "प्रदर्शन: कोई नहीं" अद्यतन = "गुर्राना" & gt; & Lt; f: एजेक्स रेंडर = "@ फॉर्म" निष्पादन = "@ फॉर्म" & gt; & lt; / f: ajax & gt; & Lt; / h: CommandButton & gt; & Lt;! - संपादित करें बटन - & gt; & Lt; h: बटन शैली = "स्थिति: पूर्ण; नीचे: 12px; सही: 12%;" Rendered = "# {AccountProfileTabGeneralController.editable}" styleClass = "lbimage" value = "खाता सहेजें" onclick = "editdialog (यह, 'क्या आप परिवर्तनों को सहेजना चाहते हैं?'); वापसी वापस;" / & Gt; मैं संवाद प्रदर्शित करने के लिए इस जेएस का उपयोग करता हूं: फ़ंक्शन editdialog (बटन, ए) {$ ("& lt; div / & gt;", { डायलॉग ({चौड़ाई:...

- Where Developers Learn, Share, & Build Careers

I downloaded and installed the Mondrian 3.4.1 stable community release with an embedded derby database example. I have a lot of examples and run on a local talket example, but I can not get the XMLA examples to work, and I have XML with XMPLA XML 4 JS (http://code.google.com/p/ Xmla4js The example / discover-schema-rowsets example allows you to specify a URL to hit, which is localhost for my local example: 8080 / mondrian / xmla). I have edited the 'datasources.xml' file as found here: xmlaTest.jsp The same error has been found at the bottom of the page, but the .class link is now available Does not work, and I have not been configured locally to create a source yet. So my question is two times: do xmlest to work without any local build Is there a way to get JSP and what else can I do to talk xmla4js to the Mondrian? The JPivot project is very old and is not up-to-date with the current Mondrian codline. Actually, we have a form of Moderion 4.0 In our distribution...

c# - "Base class could not be loaded" - for no clear reason -

I am using Visual C # 2008 Express The error was done in many years, for the last time I had time to start programming. I do not know what it really means or why it came suddenly, it seems to be obscure rather than what the error message says. I know that in my app, I get many main windows from themed widev class, on which I came to give them a custom appearance, there is no error in that code and everything is 100% right before 20 minutes was doing. Error in full: WARNING 12 The designer could not be shown for this file because no class can be drawn from it. The designer inspected the following sections in the file: Inheriting window --- Base class 'Thindwindo' could not be loaded. Ensure that the assembly has been referred and all the projects have been created. 0 / I get the form that is received from ThreadWindows, and many other errors because the project will not be enough to work completely. Before this happened, I updated the font on all forms and sub-...

- Where Developers Learn, Share, & Build Careers

I have already searched something over the stack overflow and as far as I can see the use of databases in C ++ There are many ways to do unfortunately my tools at work are quite limited. I only use Visual Studio C ++ 6 and I do not even get the boost (though I have learned to face it) - I believe that I can get the standard delivery of VS C ++ 6 I can use Now my code generates a lot of data and I want to store it in some simple database (such as MS Access DB). What equipment can I be able to use? My alternative intent structure and vectors / arrays have to be created as objects like a database. I also have a 2010 office - maybe I can use access anyway? Computation-Speed ​​also plays a role - Better faster Another important thing: My PC at work is open The client does not have such a way that I can not install any new software to download files and amplify functions. Basically I should be able to install the tool by simply transferring files to the desired folder. ...

- Where Developers Learn, Share, & Build Careers

The idea that I am trying to add comments to table rows is that you select a table and the macro each Will add a comment to the line. Say that you have an integer in the comment content after the string. Example comment content will be: comment1 comment2 comment3 Note that the contents of the comments are important because they play an important role Play. Even if I have already detected this, please help me if someone has already detected this sub-callADE comment () Integer I = active document as DIM I Tables (1) rows. (I & gt; 1) Call AddNewcomment (strText: = "This is a test comment.") Loop & All All AddNewComment (by-string string as form) comments. Add Row = i, Text: = strteext end Sub sub-tester ) In the form of dim tbl table, I for each TBL.Rows.Count ActiveDocument.Comments.Add _tbl.Rows (i) for activeDocument.Tables i = 1 in TBL.Cell (1) .Range, " Comment "& amp; I Next I next tbl & all

Grep with color and multiple excludes -

I would like to grep to dig through my code hierarchy and search the word "x", but the result is color and annoying Skip the words I do now: grep -Rn --color x * | The problem is that the matching color loses color because of the pipe. Is it any way to make a statement, so do not lose color? specify : grep --color = always x * | Grep -v -e html -e svn -e test -e doc -ey and afterwards if you need the result in a file pipe and removing the characters that fall in it This format color is required, here is a nifty CAD script, so that you can pipe your result to remove the pipe savers: sed -r "s / \ x1b \ [([0- 9] {1, 2} (; [0- 9] {1,2})?) [M | K] // g " (Meditation Please give you the option of -E instead of -r for OS X)

php - How to prevent directly accessing assets on a site that requires authentication? -

The company's site is written in PHP, but runs on IIS7. Status: An unverified user follows a bookmark or manually enters the URL of a page. The user should be redirected to sign in, if they are not already. Current status This works, but only for PHP pages. Each page contains a code that checks for the active session and if no one is found, the user is taken to the sign in page. The problem that needs to be addressed is: If the user enters a bookmark or a URL of a property manually that is not a page (an icon in the page, an excel Document, an image, a PDF, etc.), we want the user to be redirected to sign in. / P> How do we check an active session when the user accesses non-PHP assets directly? In other words, how do we check an active session for the URL like this: ? Not sure about IIS, can help with Apache, but uh .. I The social network address that links to its fixed assets via PHP. Therefore, an image link will not be direct, but: /getImage.php?id...

c# - Print line numbers on MonoMac application stack traces -

I have a monomaker application and to see which line has generated an exception. All my stack traces are like this: [error] Fatal exception: system reflection. Target invocation exception: An exception has been thrown to the goal of a greeting. --- & gt; System Extension: I'm going to crash now. On & amp ;; File Name Unknown>: 0 (Sync on Sync Manager: 0) (Configuring on File> Unknown Name> 0: 0 (Wrapper Managed & amp;; SY; Mac Configuration..clier (System.String Destination, IDbasePath Generator Path Generator) [0x00000] MacConfiguration..ctor () [0x00000] -to-native) System. Reflection.MonoCMethod: On InternalInvoke (System.Reflection.MonoCMethod, Object, Object [], System.express & amp;) system. Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection Binary Binder, System.Object [] Criteria, System. Globalization.Cultural Information Culture) In [0x00000] & lt; Filename Unknown & gt ;: 0 --- End of Inter...

javascript - jquery mobile page with more button -

I'm showing more than 50 elements to AJ query mobile page, how to open only to show the first 10 Also the suggestion page, and another button on the bottom that can show all if click on it is my script: & lt; Body & gt; & Lt; Div data-role = "page" data-add-back-btn = "correct" data-back-btn-text = "back" & gt; & Lt; Div data-role = "header" & gt; & Lt; H1 style = "white spot: normal" & gt; Body & lt; / H1> & Lt; / Div & gt; & Lt; Ul data-roll = "listview" data-inset = "true" data-filter = "wrong" & gt; & Lt; Li & gt; & Lt; A href = "http://www.mydomain.co.nz/users/262/" & gt; Feature listing & lt; / A & gt; & Lt; / Li & gt; & Lt; Ul data-roll = "list view" data-filter = "wrong" & gt; & Lt; Table & gt; & Lt; Li & gt; & Lt; A href = "/ user / 264 / p...