Posts

Showing posts from January, 2014

Cannot connect java to remote Mysql database server -

Image
i created account database on site: byethost and i'm trying connect code works when try connect local database on computer. main.datasource.setservername("sql201.byethost33.com"); main.datasource.setdatabasename("b33_16132071_pizza_service"); main.datasource.setuser("myuser"); main.datasource.setpassword("mypassword"); try( connection connection = main.datasource.getconnection() ){ labstatus.settext("connection " + databasename + " succeed"); labstatus.setstyle("-fx-text-fill: green"); showloginbuttons(); }catch(exception ex){ labstatus.settext("connection " + databasename + " failed"); labstatus.setstyle("-fx-text-fill: red"); exceptiondialog exceptiondialog = new exceptiondialog("couldn't reach connection", ex); exceptiondialog.show(); } i error: com.mysql.jdbc.exceptions.j

haskell - parsing n hex digits using attoparsec -

okay need parse n digits of hex , having problem cant stop standard attoparsec hex parser hexadecimal . my first idea this: nhex n = take n *> hexadecimal doesnt work because takes off 4 digits parses rest of string xd next idea works this: hex :: (num a, eq a) => int -> parser hex n = fst . head . readhex <$> count n (satisfy ishexdigit) but problem code in attoparsec library warns against returning lists of chars speed concerns , hex parser base of whole program next idea try better speed this: parsefragments :: (bits a, integral a) => int -> parser parsefragments n = fourchars <- b.take n let hexdigits = parseonly hexadecimal fourchars case hexdigits of left err -> fail err right x -> return x but feels terrible hack using parseonly. there fast way more idiomatic? data.attoparsec.bytestring.char8.hexadecimal implemented as : hexadecimal :: (integral a, bits a) => parser

angularjs - How to redirect in a ui-router resolve? -

i trying redirect inside ui-router resolve , wanted know if there way reroute in router resolver. not work 1 think. resolver(auth, $state){ if(!auth.isloggedin()){ $state.go('nologgedinpath'); } } how 1 redirect in resolver correctly ? my temp hack not comfortable it. resolver(auth, $state, $timeout){ if(!auth.isloggedin()){ $timeout(function () { $state.go('nologgedinpath'); }, 0); } } you can return promise resolver function indicate whether continue navigating state or not. if decide navigate somewhere else - reject promise , specify proper state: resolver($q, $state, $timeout, auth) { var deferred = $q.defer(); // $timeout example; can xhr request or other async function $timeout(function() { if (!auth.isloggedin()) { // user not logged, not proceed // instead, go different page $state.go('nologgedinpath'); deferred.reject(); } el

java - How do I remove the body of a method or constructor with javassist? -

i need remove body of constructors , methods w/ void return type using javassist library. following works. ctclass.getconstructors()[0].setbody("int = 0"); but doesn't ctclass.getconstructors()[0].setbody(""); instead exception compile error: syntax near "" when try ctclass.getconstructors()[0].setbody(null); i get compiler error: no such constructor i same error when trying empty method w/ void return type. looking through google , documentation, can't figure out how empty out body without inserting kind of code , don't want add arbitrary code no reason. javassist replaces method body valid block body of method. non-statement not valid block. can instead set { } method body block. alternatively, make implicit return; statement explicit. for constructor, required invoke super costructor or auxiliary constructor first. empty block not valid.

shutdown - Remote computer batch script with input prompt -

i trying write batch script shuts down remote computer , prompts computer name. i've tried copying bits , pieces of scripts have found far nothing work this have far: @echo off set /p computer =enter computer name: shutdown -m %computer% -r -t 60 this script should work. please note have removed space between computer , =enter computer name @echo off :inputcomputername set /p computer=enter computer name: if "%computer%"=="" goto error echo shutting down %computer% shutdown -s -m \\%computer% -t 600 -c "the computer shutting down. please save work." goto end :error echo did not enter computer name goto :inputcomputername :end

How to manipulate large numbers in C? -

i wrote algorithm check if number prime , numbers divide it. want know 600851475143 divisors (for example) , outputs negative number. that's code: #include <stdio.h> /* discover numbers divide 1 read input, show if it's prime */ int main() { long checker; long step = 1; int divisors = 0; printf("enter number want know divisors: "); scanf("%d", &checker); while(step <= checker){ /* check numbers divide number read*/ if (checker % step == 0) { printf("%d divides %d\n", step, checker); step +=1; divisors +=1; } else{ step+=1; } } /*now check if prime*/ if (divisors == 2) { printf("additional info: %d prime number.\n", checker); } else { printf("additional info: %d not prime number.\n", checker); } printf("done!\n"); retu

sql - Find matching sets in a database table -

i have junction table in (sql server 2014) database columns firstid , secondid. given specific firstid, i'd find other firstids table have equivalent set of secondids (even if set empty). sample data: firstid secondid 1 1 1 2 2 3 3 1 3 2 ... ... in case of sample data, if specified firstid = 1, i'd expect 3 appear in result set. i've tried following far, works pretty except empty sets: select firstsecondequalset.firstid from firstsecond firstsecondoriginal inner join firstsecond firstsecondequalset on firstsecondoriginal.secondid = firstsecondequalset.secondid where firstsecondoriginal.firstid = @firstid  and firstsecondequalset.firstid != @firstid group by firstsecondequalset.firstid having count(1) = (select count(1) firstsecond firstsecond.firstid = @firstid) i think it's somehow related relational division no remainder (rdnr) . see great article dwain camps reference. de

python - Django superuser fixture error - no such table: auth_user -

i want define fixed username , password superuser creation in django's syncdb (after has been executed). method i'm using below working in older version of django (i guess 1.6) it's not working. i have fixture file initial_data.json : [ { "fields": { "username": "me", "first_name": "", "last_name": "", "is_active": true, "is_superuser": true, "is_staff": true, "last_login": null, "groups": [], "user_permissions": [], "password": "pbkdf2_sha256$...", "email": "a@a.co", "date_joined": "2015-04-23t01:13:43.233z" }, "model": "auth.user", "pk": 1 } ] when add in settings.installed_apps : installed_apps = ( 'django.contrib.admin', 'django.contrib.auth', 'django.c

c - Write the integer 0 to file, read the file, increment integer to 10, and arrange it through the child and parent process -

this has been done before, trouble code not incrementing, doing else fine. want have output of file reads integer loop going to. instead, gets stuck @ 0. need help. writing in c. here code: assignment9.c: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/stat.h> #include "tellwait.h" void err_sys(const char* message); int main(void){ file *filepoint; int* 0 = 0; int val; char* buffer[180]; pid_t pid; filepoint = fopen("testfile.txt", "w+"); fprintf(filepoint, "%d", zero); tell_wait(); if((pid = fork()) < 0) { err_sys("fork error"); } else if (pid == 0) //child { int i; for(i = 0; < 10; i++){ wait_parent(); filepoint = fopen("testfile.txt", "w+"); fread(buffer, sizeof(zero), 1, filepoint); // increment val = atoi(buffer[

When My iOS App enters the lock screen state, after about 10 minutes later, the program will be killed. -

when ios app enters lock screen state, after 10 minutes later, program killed. how not killed when app enter lock screen state. in apps info.plist, add key called "required background modes" (an array) , add 1 or more items reason app must stay in background. the info.plist file in xcode group called "supporting files"

git - Downloading C++ Driver for MongoDB -

i feel absolute idiot asking, i'm not able download c++ driver mongodb. i'm running 32-bit fedora 21 box, , it's mongodb instance running. i've been following instructions on page . and tells me perform following cmd clone repository: [user@host ~]$ git clone git@github.com:mongodb/mongo-cxx-driver.git cloning 'mongo-cxx-driver'... permission denied (publickey). fatal: not read remote repository. please make sure have correct access rights , repository exists. as can see, looks remote host expecting form of public key authentication. documentation doesn't reference other steps need taken (except installing necessary software boost, python, git, , scons i've done) in order clone repo local machine. else running same problem? ideas of do? thanks always! use command instead: git clone https://github.com/mongodb/mongo-cxx-driver.git the reason initial command not working because attempting pull using secure connection method. work i

javascript - Convert AJAX callback data to Backbone model -

is there way convert success callback data backbone model? these have: app.models.image = backbone.model.extend({ idattribute : 'image_id' }); app.collections.image = backbone.collection.extend({ model : app.models.image, url : json_url, fetchimage : function(model) { var self = this; var imageid = model.id, name = model.get('name'); this.fetch({ data : { packet : json.stringify({ type : 'loadimage', param : { image_id : imageid, filename : name } }) }, type : 'post', success : function(data) { var `view` = new app.views.image({ model : data }); view.render(); }, error : function() { } }); } }); looking @ success function, declared view callback data model. when program calls render function, model being displayed [object] (based on console.log) assume data passed ob

Sum in PHP with HTML Form using Jquery -

i new jquery , want create very simple page learn bit about. trying make form sends values php. php sum , returns results. jquery show in page, dynamically. this html , javascript: <html> <head> <title>null</title> <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("form1").change(function() { $.get("requisit.php", {a1: $("#a1").html(), a2: $("#a2").html()}, function(data) { $(".results").empty().html(data); }); return false; }); }); </script> </head> <body> <form name="form1"> <input type="text" name="a11" id="a1"><br/> <input type="text" name="a22" id="a2"> </form> <div class="re

image - Why are my JPEG files larger than expected? -

Image
gm convert +profile "*" -resize 800x800 -quality 90.0 -background white -flatten test.jpg test01.jpg the test01.jpg file size 140262, test.jpg file size 114698, think test01.jpg file less test.jpg, why? gm identify -verbose test.jpg command info: image: test.jpg format: jpeg (joint photographic experts group jfif format) geometry: 960x1280 class: directclass type: true color depth: 8 bits-per-pixel component channel depths: red: 8 bits green: 8 bits blue: 8 bits channel statistics: red: minimum: 0.00 (0.0000) maximum: 255.00 (1.0000) mean: 158.69 (0.6223) standard deviation: 74.34 (0.2915) green: minimum: 0.00 (0.0000) maximum: 255.00 (1.0000) mean: 142.36 (0.5583) standard deviation: 72.48 (0.2842) blue: minimum:

matlab - How to calculate the value of the 'roundness shape feature' of an image contour? -

i doing assignment on image classification different shape features. how compute value roundness of image contour in matlab? there no standard can determine how "round" contour is, or shape in general. however, 1 heuristic have seen post shai bagon : https://stackoverflow.com/a/24802605/3250829 . the heuristic defined as: ratio = 4 * pi * area / ( perimeter^2 ) area area defined shape, or total number of pixels occupy internal shape of contour, , perimeter total number of pixels define perimeter of contour. if contour round, ratio quite high. however, if contour not round, ratio low. therefore, each contour, perhaps use above criteria starting point.

ios - Ridiculous situation : Xcode changes elements frame if I just open storyboard files. I did nothing -

Image
i'm using xcode 6.2 (xcode 6.3 has same problem) @ moment. i've got ridiculous situation when click open storyboard files in project navigator. xcode changes frame of elements in storyboard file. open file, did nothing. see below screenshot. it's diff screen. shot after open storyboard file. those changes tip of iceberg. there tons of unexpected changes. i have no idea reason why? , how can fix it? i'm scare opening storyboard files. i'm gonna die if persist.

asp.net - Which is better to use for adding IEnumerable object? -

i have found 2 ways implement add operation on ienumerable objects in repository pattern. first use . addrange() & pass list in here. or second convert list array & use .addorupdate(arrayobject) . which better use if intension remove foreach loop on ienumerable items? please help. _context.dbset<myentity>().addorupdate(entities.toarray()); or _context.dbset<myentity>().tolist().addrange(entities); addorupdate can called array of new objects, can create array of type city[] , call context.cityset.addorupdate(cc => cc.id, cityarray); once. in generated sql, there should condition. in case of performance, read following https://stackoverflow.com/a/21839455/194345 and following: context.bulkinsert(hugeamountofentities);

Laravel - where to store site config data -

i have got option disable/enable registration of users. should store data? best practise? i think, store little data in db not solution. hope know concept of environment variables in laravel stored in .env.php file <?php return [ 'user_registration' => 'enable/disable' ]; ?> you can retrieve value $_env['user_registration'] and manipulate function accordingly. ex. if enable show form else hide views documentation: http://laravel.com/docs/4.2/configuration#environment-configuration

assembly - Flip contents of EAX register -

i'm attempting create program (using assembly) allows enter word encrypted, followed decrypted. the current code i've got gives me reverse order of i'm after. http://i.imgur.com/kgdiba0.png currently eax register 00000037. i want 00000073. how can achieved? thanks in advance. here code flip eax content, made gui turbo assembler x64 ( http://sourceforge.net/projects/guitasm8086/ ), : assign big number eax = 1234567890. display eax (convert eax string , display message). flip eax = "0987654321" (extracting digits 1 one , storing them in string in reverse order). display string (eax flipped) message. convert string number in eax = 987654321 (this eax reversed). display new eax (convert eax string , display message). and here : .model small .586 .stack 100h .data msj1 db 13,10,'original eax = $' msj2 db 13,10,'flipped eax = $' msj3 db 13,10,'new eax = $' buf db 11 ;max number of

Inserting symbols in mysql using php -

i'm using php , mysql , have problem inserting latitude , longitude values along degree, min , sec symbols. (°,',") symbols. i have referred several sites , tried different ways can't solve it. first tried copying symbols , concatenating 3 user input values. $latitude=$degree.'°'.$min.'''.$sec.'?'.'n'; then after executing insert query,the $latitude variable value inserted in database, symbols replaced random characters shown here. 2Ëš3ʼ4Ë®n (data stored in database) then tried using html character code instead of symbols. $latitude=$degree.'&deg'.$min.'&#8217'.$sec.'#8221'.'n'; but doesn't work.it displays same html characters in databse. i don't know whether problem html entities or something. try function: $result = mysqli_real_escape_string(); refer following link http://php.net/manual/en/mysqli.real-escape-string.php

Video Not streamed in some android devices except Htc -

Image
i trying stream video in android device(moto g) stored in parse.com uploaded ios device. getting error message while streaming video showing "the video cant played" in android device except htc. in htc video streamed correctly. reason shown error "android mediaplayer error (1, -2147483648)". , video format mpeg-4 part 2 mpeg-4 part 2 older, deprecated, video compression format preceded h.264 compression (mpeg-4 part 10). currently, h.264 , aac encoding used formats media devices. with media player need aware of supported formats , know you'll type of error if media incompatible. not sure why ios device creating type of file.

How do I set up a wpf projects for visual studio? (premake5) -

i working on game engine right now. planning use wpf our ui our level editor. trying create solution file multiple projects in it. have managed create 2 projects ("shared library", "windowsapp"). is there sample premake5 lua script out there how add/create wpf projects sln? edited: sorry forgot mention premake. how create wpf project premake. just create blank solution , add new projects it. in "new project" window can filter out wpf template projects typing "wpf" in upper-right search box. more info: https://msdn.microsoft.com/en-us/library/ms752299(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/bb546958(v=vs.110).aspx

c# - Insert Multiple Records in ASP.NET DynamicData Applicatoin -

i using asp.net dynamicdata v4.5 allow admin insert/update records in database. my requirement is, -- allow admin insert more 1 record @ time. default, if admin wants insert 10 records need insert 1 one. -- tried updating default_insert.ascx page display 10 rows. displays 10 rows, saving 1 record. how can acheive requirement thanks in advance you can use stored procedure. in pass arrays of values. , inside stored procedure can insert them dsatabase 1 one. when admin insert 10 records, has pass 10 records in stored procedure. hit stored procedure once , records updated in database.

ios - React Native Integration with Existing App -

i want integration existing app. in reactnative docs : remember install subspecs need. <text> element cannot used without pod 'react/rcttext'. now, there wrong in simulator: cant't find variable:listview i want use <listview> , subspecs install? listview can used when pod 'react', think there may wrong javascript code. have included these code in js file ? var { listview, } = react;

linux - Why PROMPT_COMMAND seems to be empty when i acces using system system call in c -

i have defined prompt_command in /etc/profile shown below, prompt_command = date now when print prompt_command c code using system system call shown below not displaying anything, system("echo pwd;echo whoami;echo \"p_cmd = $prompt_command\";eval $prompt_command"); output: \root root p_cmd = please clarify following doubt why prompt_command showing empty? you prompt_command has not been exported, try: export prompt_command=date

javascript - How to get div value when id of div is created in for loop -

please tell me solution of problem. creating 5 dynamic div s , id s using loop. want the loop counter value , each of created div 's html in format "counter: html" 1:123 . right getting loop counter value. <html> <div id="feed"></div> </html> <script> (var = 1; <= 5; i++) { $('#feed').append('<div id="news' + + '" value=' 123 '/>'); var abc = $("#news" + i).attr("value"); console.log(abc); } </script> thanks in advance. try this. $(document).ready(function() { (var = 1; <= 5; i++) { $('#feed').append('<div id="news' + + '" value="123"></div>'); //and want value of dynamic created div using code getting loop counter value. please me answer. var abc = $("#news" + i).attr('value'); console.log(abc + " :

How to conditionally apply attribute in angularJS directive? -

in html: <cms-text required="false" id="product_name" thename="product_name"></cms-text> in cmstext.js angular.module('cmstext',[]).directive('cmstext', function(){ 'use strict'; return { restrict: 'ea', scope: { thename:'=', required:'=', id:'=' }, replace:true, templateurl: 'cms-text/cmstext.html', }; }); in cmstext.html <input id="id" class="form-control" name="thename" type="text" required> i want "required" word in input tag shows when set true , word disappear when set false. help? use ngrequired control required attribute in angular. update template to <input id="id" class="form-control" name="thename" type="text" ng-required="required">

php get ip from proxy -

i think i'm not understanding well... i'm developing php script, inserts new row in table. there's 1 field named 'ip_address', , want use proxy have, change ip address, not insert same ip (the server of website). i'm doing this: $loginpassw = 'login:passw'; $proxy_ip = 'xx.xxx.xxx.xxx'; $proxy_port = 'xx'; $url = "http://www.domain.com"; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_proxyport, $proxy_port); curl_setopt($ch, curlopt_proxytype, 'http'); curl_setopt($ch, curlopt_proxy, $proxy_ip); curl_setopt($ch, curlopt_proxyuserpwd, $loginpassw); $data = curl_exec($ch); curl_close($ch); how obtain changed ip? want obtain it, , insert in database. best regards, daniel edit: what want not being detected i'm doing through same ip... the script receiving query should able obtain c

php - External links to location on leafletjs-map -

i'm trying external links navigate given coordinates on leafletjs-map. i tried approach described here: leaflet zoom on locations using multiple links this works when have links in same file map-div. need create links in external file include in div gets automatically reloaded every 30 seconds. i've pasted files in plunker: http://plnkr.co/edit/qlhhnv3edxxfr0pt1cds in index.php i have following code autorefresh content chkincludes.php in #results -div: <script type="text/javascript">// <![cdata[ $(document).ready(function() { $.ajaxsetup({ cache: false }); // part addresses ie bug. without it, ie load first number , never refresh setinterval(function() { $('#results').load('chkincludes.php'); //#results-div located in main.php }, 30000); // "30000" here refers time refresh div. in milliseconds. }); // ]]> </script> then include main.php in body of index.php . in main.php i have #results -div gets autoloa

c# - How to make ASPX Chart zoomable -

i'm trying make system.windows.forms.datavisualization.charting aspx chart zoomable in c#. in c# used this.diagramm.mousewheel += new mouseeventhandler(diagramm_mousewheel) , diagramm_mousemove(object sender, mouseeventargs e) not working aspx. also tried isuserenabled it's not available. looked around enable-scrolling-on-the-microsoft-chart have not settings. so how can zoom in , out on aspx chart? thanks! or there alternatives?

aquafold - How export registered servers settings in Aqua Data Studio? -

does know how export registered servers in aqua data studio? maybe there's tricky method copying .ini file or registry keys? ad studio server registrations in [user_home]/.datastudio/connections directory. can copy existing connections 1 machine another. aquafold's documentation copying registrations 1 computer here: https://www.aquaclusters.com/app/home/project/public/aquadatastudio/wikibook/documentation16/page/128/configuration-connection-files#copy

Batchfile - extract path from file contents into cmd variable -

i'm hoping may able help. dropbox stores path in file called 'info.json'. contents of file follows: {"personal": {"path": "c:\\users\\sam\\dropbox", "host": 241656592}} {"business": {"path": "c:\\common\\allusers\\dropbox", "host": 45143292}} i need extract 'personal' path windows cmd variable %dropboxpath% using windows batch script. have tried using , findstr couldn't make work. the other issue stripping away backslashes in path leave 'c:\users\sam\dropbox'. i believe findstr should locate 'personal' line , should extract after "path": before , "host" , somehow, remove double backslashes. hope makes sense , appreciate give. many thanks, sam @echo off setlocal enableextensions disabledelayedexpansion set "file=info.json" /f usebackq^ tokens^=2^,6^ delims^=^" %%a in ("%file%") (

javascript - Variable on scope doesn't keep the value changed in a function -

i have controller initializes value such: $scope.showthing=true; i toggle value ng-click like ng-click="showthing=!showthing" which works ok if try using same value in function inside controller behaves irrational, least. simple alerting value in interval function gets right value first time iterates after changing value, not that. since it's trivial wouldn't want create factory alone, hope there's can tell me doing wrong here. your question not straightforward, can post code. here hoisting issue. var = 10; console.log("value of 'a' before hoisting: "+a); (function(){ console.log("value of 'a' after hoisting: "+a); var a; })(); result: value of 'a' before hoisting: 10 value of 'a' after hoisting: undefined

ssl - Decrypting SSL3.3 (SSL3 TLS1.2) with Fiddler4 -

i'm working delphi , using indy components ssl connection. had fiddler2 running , able see ssl traffic, had upgrade indy newer version because had errors. compatibility between indy , openssl upgraded openssl1.0.2a. after upgrade seems has switched ssl3.3 newer protocol used before. installed fiddler4.5, .net framework 4.5 , enabled tls1.2 descriped on http://blogs.telerik.com/fiddler/posts/13-02-11/fiddler-and-modern-tls-versions . reimported fiddler's certificate trusted root certificates, can still not decrypt ssl traffic. following written in fiddler: connect tunnel, through encrypted https traffic flows. fiddler's https decryption feature enabled, specific tunnel configured not decrypted. session flag 'x-no-decrypt' set to: 'peekyieldedunknownprotocol'. sslv3-compatible serverhello handshake found. fiddler extracted parameters below. version: 3.3 (tls/1.2) i tried search indy , openssl source string "x-no-decrypt", not

css - Multiple div in class -

so have following html , css. <div class="parent"> <div class="a"> </div> <div class="b"> b </div> <div class="c"> c </div> <div class="d"> d </div> <div class="e"> e </div> <div class="f"> f </div> </div> <style> .parent .a{display:none;} .parent .b{display:none;} .parent .c{display:none;} .parent .d{display:none;} .parent .e{display:none;} </style> in case, how can simplify css don't have repeat same code 5 times? edit: should have been more clear. not of elements hidden. selection of classes hidden in "parent" (class="f" not hidden) thanks you have several options. option 1: like @akshay commented, can do: .parent div { display: none; } and every single div inside of display: none ; option 2: you can do: .parent >div { disp

ibm mobilefirst - Not able to login into Maximo Anywhere (work execution app) after adding new VIEW in app.xml -

i trying customize work execution app adding new view of maximo object (sr). had completed oslc integration steps mentioned ibm http://www-01.ibm.com/support/knowledgecenter/sspjlc_7.5.1/com.ibm.si.mpl.doc_7.5.1/integration/t_ctr_int_mam.html?lang=en after changed app.xml , added view definition as <view id="sr.srview" label="service request"> <requiredresources> <requiredresource name="servicerequest"> <requiredattribute name="description" /> </requiredresource> </requiredresources> <list resource="servicerequest" attribute="description"> <sortoptions> <sortoption label="item"> <sortattribute name="description" direction="asc" /> </sortoption> </sortoptions> <listite

jquery - Parse RSS title into HTML using Javascript -

i trying populate menu on webpage 5 latests topics our site's rss newsfeed using javascript (e.g. jquery - import v. 1.9.1 already), , have been trawling content in here find work, answer suiting problem seems using deprecated scripts. the rss feed stored on our own server, reading rights should ensured. prefer using javascript of sort , need have titles of e.g. latest x news , links tossed <li><a href="link article">first news header</a></li> <li><a href="link article">second news header</a></li> one of answers in here led me jsfiddle: code doesn't seem work? answer in here code gives jquery code have no clue how utilize in html afterwards, might simple guiding me use of this? i have limited experience using js, appreciate pretty low-tech advice on how things working both in terms of include in .js file , how make appear in html afterwards. the news feed here: link thanks! based on a

java - GWT Developer Plugin is not running -

this question has answer here: development mode requires gwt developer plugin 11 answers i run web application sample project using eclipse opened url provided ide ( http://127.0.0.1:8888/stockwatcher.html?gwt.codesvr=127.0.0.1:9997 ) , chrome browser (version: 42) showed me message: "development mode requires gwt developer plug-in". i downloaded plug-in , installed on browser (i checked @ chrome://extensions/) restarted browser , entered same link again still shows me same message. what's wrong? the gwt plugin no longer supported chrome due npapi being deprecated ( https://www.chromium.org/developers/npapi-deprecation ). to debug application, you'll need 1 of following: temporarily enable npapi in chrome chrome://flags/#enable-npapi downgrade chrome version supports plugin update application use superdevmode - http://www.gwtpr

javascript - If hasClass condition jquery not working properly -

i trying execute alerts onclick events , conditions jquery statement. seems event handlers don't work properly, due fact missing in event handling logic. have 1 button, id # bottone1 , , have menu buttons id #b1 , # b2 . the first event works fine, adds correctly class " cliccatoinvoca1_onready ". when click on #bottone1 starts the first alert " cliccatoinvoca1_onready ". onclick event $("#b1") works properly, removes class " cliccatoinvoca1_onready " , replaces class " cliccatoinvoca1 ". this point encounter first problem when click on #bottone1 comes first alert " cliccatoinvoca1_onready ", , "cliccatoinvoca1". when click on #b2 , afer click on #bottone1 executes 3 alerts, " cliccatoinvoca1_onready ", " cliccatoinvoca1 " , " cliccatoinvoca3 ". so, main problem doesn't work if condition execute 1 alert @ time. when click on # bottone1 executes alerts in seque

Querying for last 7 or 30 days date range with mongodb mongoid rails -

i using mongodb 2.4.8, mongoid 4.0.2 , rails 4.2.1 i have been trying date range query ran through mongoid return right set of results on test data mongodb. created 6 documents spanning on 5 - 7 days period. instance, query below, ought return 3 records days between 22nd - 27th, instead returns 1 record : person.where(:person_email_clicks.elem_match => {:date.gte => 'wed, 22 apr 2015 22:12:00 +0000'}, :person_email_clicks.elem_match => {:date.lte => 'mon, 27 apr 2015 22:12:00 +0000'}) this entire documents test purposes: {"_id"=>bson::objectid('55364a416461760bf1000000'), "status"=>"premium" "person_email_clicks"=>[ {"_id"=>bson::objectid('55381d256461760b6c000000'), "name"=>"buyer", "date"=>2015-04-22 22:12:00 utc}, {"_id"=>bson::objectid('55381d536461760b6c010000'), "name"=>&quo