Posts

Showing posts from April, 2013

node.js - how to check if MongoDb is installed or not -

node.js - how to check if MongoDb is installed or not - i installed mongodb using sudo npm install -g mongoose after installation typed mongo in terminal , came with -bash: mongo: command not found please advice how check if installed properly. using mac to check if installed find version by npm list mongoose to check globally npm list -g mongoose node.js mongoose

javascript - Why does jQuery does not accept my #ID from the array? -

javascript - Why does jQuery does not accept my #ID from the array? - i'm trying add together 3 datepickers 3 of input fields echoeing next code: this 1 works: jquery(function(){ jquery("#newnessdate").datepicker({ dateformat: \'yy-mm-dd\', monthnames: [\'januar\',\'februar\',\'märz\',\'april\',\'mai\',\'juni\',\'juli\',\'august\',\'september\',\'oktober\',\'november\',\'dezember\'], daynames: [\'sonntag\', \'montag\', \'dienstag\', \'mittwoch\', \'donnerstag\', \'freitag\',\'samstag\'], daynamesmin: [\'so\', \'mo\', \'di\', \'mi\', \'do\', \'fr\', \'sa\'] }); }); jquery(function(){ jquery("#availabilitydate").datepicker({ dateformat: \'yy-mm-dd\', monthnames: [\'jan

c++ - Is there a generalization of std::bitset for two-bit values? -

c++ - Is there a generalization of std::bitset for two-bit values? - suppose genome scientist trying store extremely long strings of characters, each of represents 2 bits of info (i.e. each element either g, a, t, or c). because strings incredibly long, need able store string of length n in exactly 2n bits (or rather, n/4 bytes). with motivation in mind, looking generalization of std::bitset (or boost::dynamic_bitset<> ) works on two-bit values instead of single-bit values. want store n such two-bit values, each of can 0, 1, 2, or 3. need info packed closely possible in memory, vector<char> not work (as wastes factor of 4 of memory). what best way accomplish goal? 1 alternative wrap existing bitset templates customized operator[] , iterators, etc., i'd prefer utilize existing library if @ possible. you have 2 choices. given: enum class nucleobase { a, c, g, t }; you have 2 choices. can: use single std::bitset , play indexing use

c# - Newtonsoft JSON - create JArray in JArray -

c# - Newtonsoft JSON - create JArray in JArray - i trying create json array using newtonsoft json api giving me error. want accomplish construction [ { "id":"26", "appsurvey":"1", "fk_curriculumid":"70", "status":"completed", "lastaccessedon":"2014-06-20 09:18:54", "questions":[ { "feedback":"6", "questionid":"1" }, { "feedback":"8", "questionid":"2" }, { "feedback":"1", "questionid":"3" } ], "fk_clientid":"24", "learnerid":"260" } ] i want ot add together quest

sql - How do I find data from this day exactly one year ago? -

sql - How do I find data from this day exactly one year ago? - right have: year(epe_curremploymentdate) = year(dateadd(year, -1, sysdatetime())) but giving me lastly year. want info today's date, 1 year ago. it should be: epe_curremploymentdate = dateadd(year, -1, getdate()) don't check year in clause. edit: simple: use cast(epe_curremploymentdate date) = cast(dateadd(year, -1, getdate()) date) that is, if using sql server 2008 , above. sql sql-server datetime

javascript - Trying to cycle through a group of radio buttons with Jquery using swipe -

javascript - Trying to cycle through a group of radio buttons with Jquery using swipe - i trying utilize matt bryson's jquery touchswipe plugin (https://github.com/mattbryson/touchswipe-jquery-plugin) advance through grouping of radio buttons show/hide content on page. i need go next radio button on left swipe , previous radio button on right swipe, , trying generalize much possible works many button groups on same page. ideally i'd attach name of button grouping , not specific ids or classes associated thing beingness displayed, can't seem working. if has ideas how might achieved i'd appreciate it! my code below. "you swiped..." line that's commented out original event demo , work... $(function() { //enable swiping... $("#log1").swipe( { //left swipe swipeleft:function(event, direction, distance, duration, fingercount, fingerdata) { //$(this).text("you swiped " + direction ); $("in

Java GUI/Swing, stopping the thread, passing integers between classes -

Java GUI/Swing, stopping the thread, passing integers between classes - i'm trying create simulation of roulette game using gui/swing upcoming exam. have 2 classes, 1 called gui , code used components, such jframe, joptionpane, jbuttons etc. other 1 extends thread , supposed show random numbers on little jlabel, , run method goes this: public void run() { int k = 0; (int = 0; < 50; i++) { k = (new random().nextint(37)); label.settext(k + " "); label.setfont(new font("tahoma", font.bold, 56)); label.setforeground(color.yellow); seek { sleep(50); } grab (interruptedexception e) { e.printstacktrace(); } } } and in gui class want take number lastly iteration of above loop, , pass new int, i'm going utilize later in gui class. ideas? use swing timer instead of thread.sleep sometime hangs whole swing application. please have @ how utili

javascript - Showing and hiding menu items efficiently -

javascript - Showing and hiding menu items efficiently - right have navigation menu. however, depending on job title can see menu items. the html have looks following <ul> <li ng-repeat="item in navigationitems | orderby:'-id'"> <a href="#/{{item.name}}">{{item.name}}</a> </li> </ul> and controller follows... $scope.navigationitems = [ { name: "item 1", id: 1 }, { name: "item 2", id: 2 }, { name: "item 3", id: 3 }, { name: "item 4", id: 4 }, ] this has been simplified. in reality there 15 menu items. there 5 different job titles, , each job title, can see menu items. how can avo

firebase - Rules for a many to many (join object) association -

firebase - Rules for a many to many (join object) association - i have assignment object "joins" project service . many user s can work on given assignment (or service project). user has many assignment s project has many assignment s assignment has many user s assignment belongs project and service here snapshot of sample info visual. users: { 1: { name: 'john smith', assignments: { 1: true } }, 2: { name: 'jane doe', assignments: { 1: true } } } projects: { 1: { title: 'project #1', assignments: { 1: true } } } services: { 1: { title: 'service #1' } } assignments: { 1: { service: 1, project: 1, users: { 1: true, 2: true } } } i'm trying write security rule a project can read users assigned it. far can figure out how assignments given project. root.child('assignments')[data.child('assignments&#

regex - extract order id from a string using preg match in php -

regex - extract order id from a string using preg match in php - i have parsed email body string in php. in email there lot of information. need extract order id best possible method. line is: order id: 123456789 it numbers. length varies. thank help you can seek using following. preg_match('/order\s*id:\s*([0-9]+)/i', $string, $id); echo $id[1]; working demo php regex preg-match

java - Servlet - isUserInRole() -

java - Servlet - isUserInRole() - spec: servlet: 3.0 java: 7 tomcat: 7.0.54 intro: it possible check programatically if user has specific role using method httpservletrequest.isuserinrole() for example: class="lang-java prettyprint-override"> public void doget(httpservletrequest request, httpservletresponse response) throws ioexception, servletexception{ string username = null; string password = null; //get username , password manually authorization header //... request.login(username, password); if (request.isuserinrole("boss")) { //do } else { //do else } request.logout(); } this works fine, solution requires manually retrieve username , password authorization header , login using these credentials. questions: is possible that? no retrieving info header , manually login()? class="lang-java prettyprint-override"> public void doget(httpservletrequest request,

html - Vertical alignment of the image within a DIV tag -

html - Vertical alignment of the image within a DIV tag - i have been playing around div tag sometime , tried doing rounded corner div tag <div id="y" style="border: 3px solid #000000;background: #b4ef05; border-radius: 25px;width: 300px; height:200px;"> <div id="ds"style="width:100%; height:80%;border-top-left-radius: 2em;border-top-right-radius:2em; background: #b4ef05;"><span> <img style="display: block; margin:auto;border: 0 none; position: absolute;left:40px;top:30px;" src="http://www.urbanfonts.com/images/cache/fontnames/1f99582aeadde4d87491dd323d5f01db_auto_362_97.jpg"> </span></div> <div id="dscs"style="border-bottom-left-radius: 1em;border-bottom-right-radius:1em;width:100%;height:20%;background: #000000;color:#ffffff;"><span style="padding:35px;">sssd</span></div> </div> but not able set image alignment prop

Rails devise redirecting to sign in when attempting reset or unlock -

Rails devise redirecting to sign in when attempting reset or unlock - using ruby 1.9.3p448 rails 3.2.13 devise (2.2.3) when user follows link password reset email or unlock business relationship email (devise :recoverable, :lockable) redirected first sign in. have seen in logs, 302. i have modified ~/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/redirecting.rb so redirect method has next added top: file.open("/home/myname/fooblah.txt", 'a'){|f| f.puts(caller()); f.puts "########"} so see redirect_to beingness called. in caller() chain, no code application calling redirect_to. wondering if there bug or quirk causes redirect. currently user has go link in email , nail sec time update in .rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/devise-2.2.3/app/controllers/devise/unlocks_controller.rb # /resource/unlock?unlock_token=abcdef def show self.resource = resource_

Using CGAL to partition a non-simple polygon -

Using CGAL to partition a non-simple polygon - suppose have non-simple polygon, how cgal can help me partition set of simple polygons? for example, give polygon represented sequence of 2d points: (1, 1) (1, -1) (-1, 1) (-1, -1) i wish acquire 2 polygons; (1, 1) (1, -1) (0, 0) and (0, 0) (-1, 1) (-1, -1) is doable cgal? cgal

linux - How to fix Ubuntu 14.04 Apache PID not match? -

linux - How to fix Ubuntu 14.04 Apache PID not match? - lately, every time restart server, ubuntu gives me warning message of apache 2 pid not match . have manually kill , restart apache 2. i follow guide check if pid file in /var/run/apache2 same 1 in /etc/init.d/apache2/apache2.conf , found there's no file in /var/run/apache2 . i seek follow steps in website which says "check if pid file path set in /etc/init.d/apache2/apache2.conf equals apache_pid_file variable exported in /etc/init.d/apache2/envvars ." there's no such directory of /etc/init.d/apache2/envvars how can prepare this? thanks! linux apache ubuntu pid

android - newMeRequest's onCompleted method user is always null -

android - newMeRequest's onCompleted method user is always null - when create newmerequest using facebook android sdk request.newmerequest(session, new request.graphusercallback() { @override public void oncompleted(graphuser user, response response) { if (user != null) { log.e(tag, "logged in..." + user.getname()); } else { log.e(tag, "logged in... user==null"); } } }).executeasync(); logcat says "logged in.. user==null" what should do? maybe can add together parameter specific fields : request request = request.newmerequest(currentsession, new request.graphusercallback() { .... } bundle parameters = new bundle(); // request_fields : id,name,email parameters.putstring(fields, request_fields); request.setparameters(parameters); request.executebatchasync(request); android facebook

ldap - 'Strong(er) authentication required' -

ldap - 'Strong(er) authentication required' - i have installed review board, want configure users through ldap. did required configuration. not able login through ldap credentials. when checked error log of review board have found below error [tue jun 24 07:26:53 2014] [error] warning:root:ldap error: {'info': '00002028: ldaperr: dsid-0c090203, comment: server requires binds turn on integrity checking if ssl\\tls not active on connection, info 0, v23f0', 'desc': if have thought how resolve it, please help. kuldeep singh your directory server utilizing high security setting. should utilize ldaps or ldap on ssl, port 636, if directory server you're attempting nail supports it. reviewboard utilizng simple bind passes username/pw on cleartext. secure setting not allow this. utilize ssl ldap, , should work. ldap review-board

Windows 8 - Running .bat files from folder - Scheduled tasks -

Windows 8 - Running .bat files from folder - Scheduled tasks - i'm in bit of pickle here. created .bat file works great in windows 7, here is: @echo off cd ./tasks set currentdir=%cd% schtasks /create /xml "%currentdir%/scheduled restart, shutdown.xml" /tn "callcenter tasks\scheduled restart" schtasks /create /xml "%currentdir%/scheduled restart, shutdown (part 2).xml" /tn "callcenter tasks\scheduled restart part 2" exit /b 0 the .bat file on network drive. can see alter dir ./tasks within folder executed. next of set parameter %currentdir% it's current dir. :-) can run path this: "%currentdir%/scheduled restart, shutdown (part 2).xml" instead of z:/tasks/tasks/scheduled restart, shutdown (part 2).xml (a total path) can help lot in circumstances. like said, script works great in windows 7, when running windows 8 gives me error since path incorrect. somehow, windows 8 keeps path c:/windows/system32 inst

testing - Accessing app.settings when running NUnit -

testing - Accessing app.settings when running NUnit - my test fails. made me sad. started debug on , found out nullreferenceexception occurs du line below. system.configuration.configurationmanager.getsection("blopp") it doesn't happen when run programme beingness tested (although said phone call not straight in programme in 1 of libraries). is bad design of code or should consider different approach testing? perhaps there's way fake-in missing config line? i'm totally indecisive... i've had problems before using nunit gui (nunit.exe) when running tests part of nunit project app.config file not read. try opening test library straight in nunit gui clicking file > open project... , selecting test library. testing nunit

Ruby - Loading gems form non-default directory -

Ruby - Loading gems form non-default directory - i'm trying load rubygems non-default directory, default (please right me here, if i'm wrong) specified in gem.path array. i've managed load gem i've got installed in non-default directory (which 'rubyzip' ) in few cases... i'm using jruby 1.7.12 , ruby 1.9.3. here test results: loading gem "e:/rb/gems_" directory: gem.path => ["c:/users/default/.gem/jruby/1.9", "file:/e:/rb/libraries/jruby.jar!/meta-inf/jruby.home/lib/ruby/gems/shared"] gem.path[0] = "e:/rb/gems_" => "e:/rb/gems_" require 'zip' => true in test above, replaced default user-related gem path "e:/rb/gems_" directory, , worked fine. gem.path.clear => [] gem.path.unshift "e:/rb/gems_" => ["e:/rb/gems_"] require 'zip' => true again, though cleared whole array , replaced own entry, worked fine. loading gem &qu

extjs - Regex is showing phone number as valid for 9 & 10 total digits when it should show valid for 10 digits only -

extjs - Regex is showing phone number as valid for 9 & 10 total digits when it should show valid for 10 digits only - i using validate phone number.....it shouldbe of 10 digits , 1 time of 10 digits, remove reddish squiggly line , format in (xxx)xxx-xxxx in pattern. but, according validation, when finished writing 9 digits, shows number valid number , removes reddish squiggly line , when write 10th digit, formats in above pattern. // custom vtype vtype:'phone' // vtype phone number validation ext.apply(ext.form.vtypes, { 'phonetext': i18n.validation.phonetext, 'phonemask': /[\-\+0-9\(\)\s\.ext]/, 'phonere': /^(\({1}[0-9]{3}\){1}\s{1})([0-9]{3}[-]{1}[0-9]{4})$|^(((\+44)? ?(\(0\))? ?)|(0))( ?[0-9]{3,4}){3}$|^ext. [0-9]+$/, 'phone': function (v) { homecoming this.phonere.test(v); } }); // function format phone number ext.apply(ext.util.format, { phonenumber: function(value) { var phonenum

ios - Using imageWithContentsOfFile: to load textures in spritekit -

ios - Using imageWithContentsOfFile: to load textures in spritekit - so, noticed recommendation in 1 of discussions here. says in order release memory 1 time done textures, possible solution next: create uiimages +imagewithcontentsoffile: create sktextures resulting uiimage objects calling sktexture/+texturewithimage:(uiimage*). i have memory issues comes high res backgrounds , few embedded scroll views, tried above implementation - , works in terms of memory. the problem looks when doing so, imagewithcontentsoffile: in retina devices, scales @2x image 2, need explicit scale 1 time again 0.5. how can ensure right scaling when calling method? here code: nsstring *path = [[nsbundle mainbundle] pathforresource:@"sc_01_bg" oftype:@"png"]; uiimage *img = [uiimage imagewithcontentsoffile:path]; skspritenode *backgroundsprite = [skspritenode spritenodewithtexture:[sktexture texturewithimage: img]]; actually, there upvote on answer, , upvote m

java - Logging SQL on error only -

java - Logging SQL on error only - i logging sql hibernate using p6spy in order total sql parameters in can copied , pasted easier debugging. want log when database has error. there anyway accomplish while still maintaining sql parameters still in using p6spy or different tool. clear when still in mean, example, instead of saying select * employee employee.id = ? select * employee employee.id = 28. java sql hibernate postgresql p6spy

ios - SelectedImageTintColor of UITabBar is getting reset after MFMailComposeViewController -

ios - SelectedImageTintColor of UITabBar is getting reset after MFMailComposeViewController - after mfmailcomposeviewcontroller called. selectedimagetintcolor of uitabbar changed , dark gray. i read kind of bug in ios 7.1 i tried [[self.tabbarcontroller tabbar] setselectedimagetintcolor:[uicolor redcolor]]; in mailcomposecontroller didfinishwithresult but nil changed. workarounds? ios uitabbarcontroller mfmailcomposeviewcontroll

html - Using a textbox to take in an integer value for use in Javascript function. Is there a simpler way? -

html - Using a textbox to take in an integer value for use in Javascript function. Is there a simpler way? - this question has reply here: convert string number in javascript 4 answers i'm making simple calculator utilize in intro javascript lesson. know if there's simpler way of taking value html input textbox integer having utilize javascript parse() method? html: <input type = "text" id="num1"> js: var num1 = parseint(document.getelementbyid("num1").value); you can forcefulness string 32-bit integer this: var num1 = ~~document.getelementbyid("num1").value; you can, alternatively, take number possible fractional part with var num1 = +document.getelementbyid("num1").value; in both cases, can check see if original string did number using isnan() : if (isnan(num1)) { /

c# - Get the outlookItem type of an attachment in outlook -

c# - Get the outlookItem type of an attachment in outlook - i getting attachments outlook mail. there traps aroudn c#, of them solved ugly hacks. there 1 not able solve. if add together attachment file, whole filename saved including file extenssion. when save file disc later it's saved correctly can dblclick file , it's opened in right application. but if attachement added using "attach item" -> "add outlook item", mail/calender/contact added without file extenssion. if add together mail service mail function .msg fileextension not part of filename , when trying save disc recognized outlook mail. but if check in outlook can see right icon added attachment, outlook able know if it's mail service / contact / calenderitem info should there somewhere. does knows how find out it's .msg in attachment? when pass outlook item attachments.add, add together create embedded message attachment (attachment.type = olembeddeditem) op

wpf - How to properly set the BasedOn in XAML style -

wpf - How to properly set the BasedOn in XAML style - i have style template: <style x:key="mydogtogglebutton1" targettype="togglebutton" basedon="{x:null}"> <setter property="focusvisualstyle" value="{x:null}"/> <setter property="template"> <setter.value> <controltemplate targettype="togglebutton"> <grid> <image name="normal" source="/images/dogs/dog1.png"/> <image name="pressed" source="/images/dogs/dog3.png" visibility="hidden"/> <image name="disabled" source="images/dogs/dog5.png" visibility="hidden"/> </grid> <controltemplate.triggers> <trigger property="ispressed" value="true">

scala - slick update fields dynamically -

scala - slick update fields dynamically - i form play controller class customertable(tag: tag) extends table[customer]("customer", tag) { def id = column[long]("id") ... def * = ... } case class customer( id: long, remarkname: string ... ) case class customerupdateform( id: long, remarkname: option[string], realname: option[string], birth: option[date], address: option[string], phone: option[string], qq: option[string], email: option[string]) and want update database nonempty fields of form, here's how did def updatefield(form: customerupdateform) = { def updatefield0[t]( field: customertable => column[t], value: t) = { customertable .filer(_.id, form.id) .map(c => field(c) -> c.gmtmodified) .update(value -> new date) } var updated = 0 if (form.remarkname.nonempty) updatefield0(_.remarkname, form.remarkname) updated = updated + 1 if(form.realname.non

php - maximum gap between two 1s in a binary equivalent of a decimal number -

php - maximum gap between two 1s in a binary equivalent of a decimal number - i want write programme find maximum gap between 2 1s in binary equivalent of decimal number. illustration 100101: gap 2 , 10101: gap 1. <?php $numbergiven = 251; $binaryform = decbin($numbergiven); $status = false; $count = 0; for($i = 0; $i < strlen($binaryform); $i++) { var_dump($binaryform[$i]); if($binaryform[$i] == 1) { $status = false; $count = 0; } else { $status = true; $count += 1; } } echo "count = " . $count . "<br>"; echo $binaryform; ?> but not successfull.. i utilize binary right-shift operator >> , iteratively shift 1 bit , check if current rightmost bit 1 until i've checked bits. if 1 found, gap between previous 1 calculated: foreach(array(5,17,25,1223243) $number) { $lastpos = -1; $gap = -1; // means there 0 or excatly 1 '1's // php_int_si

connection - iOS: How to check if a XMPPStream timed out -

connection - iOS: How to check if a XMPPStream timed out - i developing chat application , using https://github.com/robbiehanson/xmppframework/ library develop app. i handle connection time out situations , have used - (bool)connectwithtimeout:(nstimeinterval)timeout error:(nserror **)errptr function connect server . here have provided 60 seconds time out interval. can 1 suggest me how handle time out ? there delegates gets called when time out happens ? thanks, bhat ios connection timeout xmpp chat

css - Why is the alpha value represented as a float? -

css - Why is the alpha value represented as a float? - is there particular reason why rgba colors represented 3 8-bit color values , 1 poorly defined floating point value? i mean, in end, alpha value translate binary. right? don't point in having 3 well-defined values, , 1 can guess how accurate is. for instance, if utilize value 0.1 - end result really be? alpha percentage (0.1 alpha = 10% opacity) , it's mutual specify percentage in floats since more precise. if used integer percent representation specify (int)10 = 10% . works fine numbers, reason want exact, 10,3%. in integer? 103 confused 103%. the point floats can specify percentage precisely, while ints cant. thus, percentage values represented floats. ex: 0% = 0.0f 105% = 1.05f 74,31985% = 0.7431985f etc. even though of doesn't become problem in case of alpha color, it's practice create percentage-representations floats. css rgba

railo - What could break when migrating from Adobe ColdFusion to an alternative CFML engine? -

railo - What could break when migrating from Adobe ColdFusion to an alternative CFML engine? - we using adobe coldfusion 9 rather big application. thinking moving railo or bluish dragon. what problems run into? will require big amount of refactoring or cfml code work on new system? do alternative engines provide back upwards official tags, or more limited? in short, how divergent these alternatives official language? is there can create process less painful (like upgrading cf11 first or removing/avoiding features)? my question similar what notable differences there between railo, open bluedragon, , adobe coldfusion?, while concerned practical differences i'm asking more practicality of transition/implementation. it depends on code , specific adobe coldfusion functionality using. part each cfml iteration supports same tags/functionality. deviate adobe product documented , explained. need dive code base of operations , @ features using , compare cfml

php - Magento - Set product visibility on observer at store level before product save -

php - Magento - Set product visibility on observer at store level before product save - i have 2 websites, each of has 2 stores. when create product store(say, store 1) of website(say, website 1), , if set websites product website 1 , website 2, product's visibility set catalog, search store created it(store 1). other stores, visibility set not visible individually . i have observer catalog_product_save_before , in want set visibility @ store level. tried code: mage::getmodel('catalog/product_action')->updateattributes( array($productid), array('visibility'=>4), 1 ); and works. this, need productid, wont since product not yet saved in observer function. how set product visibility particular store(say store 3 of website 2) catalog, search in catalog_product_save_before observer? finally got it. the observer function: public function before_product_save(

How to find which item in a JSON list has the greatest value for a given attribute in Python? -

How to find which item in a JSON list has the greatest value for a given attribute in Python? - this question has reply here: in list of dicts, find min() value of mutual dict field 4 answers i'm using json info sfg worldcup api. what need find recent goal scored given team in given match. that, need sort value of attribute key in each element of array attribute of away_team_events attribute. let me illustrate. here's sample json french republic ongoing (at time of writing) french republic v switzerland. "away_team_events": [ { "id": 276, "type_of_event": "goal", "player": "giroud", "time": "17" }, { "id": 277, "type_o

Run a maven test-jar file for GroovyTestCase (junit) -

Run a maven test-jar file for GroovyTestCase (junit) - i have maven project contains 30 groovytestcase 'junit' test classes. able generate test-jar file contains test classes, using http://maven.apache.org/guides/mini/guide-attached-tests.html . however, every time seek run jar file using next command: java -cp target/groovy-tests-1.0-snapshot-tests.jar com.mycompany.testclass i next error: exception in thread "main" java.lang.noclassdeffounderror: groovy/lang/groovyobject @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclasscond(classloader.java:631) @ java.lang.classloader.defineclass(classloader.java:615) @ java.security.secureclassloader.defineclass(secureclassloader.java:141) @ java.net.urlclassloader.defineclass(urlclassloader.java:283) @ java.net.urlclassloader.access$000(urlclassloader.java:58) @ java.net.urlclassloader$1.run(urlclassloader.java:197) @ java.security.accesscontroller.doprivileged(native method)

java - Fallback Database with Hibernate -

java - Fallback Database with Hibernate - do of know way have 2 databases running parallel? using hibernate 4 , main database postgres 9.3 - db hosted on machine application - if database downwards still have save stuff. so first intention write csv, i'm not friend of writing stuff unordered file. want utilize fallback database (thinking of h2 database). has experience such construct? we using spring 4 - set datasource + sessionfactory + transactionmanager - , add together name @ @transactional method utilize right manager. other ideas? thank you!! you can extend spring abstractroutingdatasource , configure 2 actual info sources: a primary postgresql info source a secondary h2 info source the application logic see 1 info source, router decide info source going switch on demand. when primary info source downwards need instruct router pick fall-back h2 one. java spring hibernate postgresql h2

scorm2004 - SCORM Content on our web server talking to LMS using LTI -

scorm2004 - SCORM Content on our web server talking to LMS using LTI - hope doing well, wanted know if below scenario can achieved. we have scorm bundle wanted have on our own web server , specify link in lms(blackboard,moodle). when user logs lms, should perform single sign on (with lti) , show scorm content our web server. can scorm in our web server access details of logged in user(userid,score details etc..). i have searched , found details below http://scorm.com/scorm-solved/scorm-cloud-developers/how-to-get-started-with-the-scorm-cloud-api/ but api not free. your own web server utilizing another, dealing user credentials, assignments, , launching of courseware tough one. these systems have runtime api manages pupil effort scorm interacts with. there few parts of scorm back upwards you'd obtain rustici's scorm engine worth paying for. 100% scorm compatibility (1.2, 2004) i believe have .net , java implementation (uncertain php) can p

html - Avoiding text/characters being chopped off vertically -

html - Avoiding text/characters being chopped off vertically - i've constrained height of area of text within thumbnail box in bootstrap, in cases title 2 or more lines, cuts lastly line of text vertically in half. see here: http://www.bootply.com/zbxg6in5r5 since text box has 2 font sizes (larger title , smaller description, dynamic , vary in length), setting line height not help. overflow:hidden not hide total lines of text, part overflows. adding text-overflow: ellipsis or not stop half-line showing up, either. i have reviewed both of these previous posts, don't seem provide reply works case: can hide lines of text half cutting off? sentence showing half @ end of div, overflow: hidden cutting sentence i have mentioned bootstrap in case there solution has found in using thumbnail class, it's more general question. there way stop chopped line-heights happening, preferably in css? thanks! edit: don't want bootply link, css: .container { ma

django - Access session in user model .save() -

django - Access session in user model .save() - is possible access current session in user model .save()? pseudo code of want achieve: # users.models.py def save(self, *args, **kwargs): created = true if self.pk: created = false super(abstractuser, self).save(*args, **kwargs) # post-save if created: look_for_invite_in_session_and_register_if_found(self, session) seems wrong in architecture. shouldn't access request in models layer. work request must done in view. can this: user, created = abstractuser.objects.get_or_create(name=name) if created: look_for_invite_in_session_and_register_if_found(user, request.session) django session

ios - Back button still enabled when using popover in navigation bar -

ios - Back button still enabled when using popover in navigation bar - i have navigation controller master-detail view. detail view's navigation bar shows button on left , utilize uibarbuttonitem uipopovercontroller on right additional features. the right button correctly displays popover , pressing anywhere in view dismiss popover. my problem that, when popover active, navigation bar button still active. when user tries dismiss popover , presses on bar button, navigation controller unwinds master view , popover still visible! i tried placing popover on uibutton within view instead of navigation bar, , there behavior expected: if seek close popover pressing anywhere, on navigation button, closes popover (instead of calling button , unwinding master view) in either case, used story board create popover command dragging button (uibarbutton or uibutton) target view controller. is expected or doing wrong ?? thanks! when uipopovercontroller presented uinavig

mpi - Equivalent to MPI_Reduce_scatter but scattering among a subset of processors -

mpi - Equivalent to MPI_Reduce_scatter but scattering among a subset of processors - is there mpi function equivalent mpi_reduce_scatter performs scattering among subset of processors? in case there no such function, efficient sequence of mpi calls? for clarity, suppose cut down operation sum. proc sendbuf 1 a1 | b1 2 a2 | b2 3 a3 | b3 4 a4 | b4 i want get proc recvbuf 1 2 b 3 4 where a = a1 + a2 + a3 + a4 , b = b1 + b2 + b3 + b4 . workarounds using 2 mpi_reduce . first reduces a s , has 1 root processor. sec reduces b s , has 2 root processor. however, becomes heavy when there many "letters" (and many processors). mpi_reduce_scatter , set recv_count[proc] different 0 if proc belongs subset of processors. however, when scattering message there n_proc square handshakes (most of them useless beacuse no message sent). i agree 2 mpi_reduce calls you're going if want mpi reductio

compiler construction - function definition in BNF C grammar -

compiler construction - function definition in BNF C grammar - i'm reading this c bnf grammar. have next questions: is right it's <declarator> job parse syntax: id(int a, int b) (in <direct-declarator> ) , on arrays in parameters of function prototype/definition, etc; in <function-definition> , why <declarator> followed {<declaration>}* ? understood, create valid type name or storage class followed function header id(int a, int b) int . i'm sure isn't valid in c. missing? yes, <declarator> in grammar name of object beingness declared, plus arguments or array size (and pointer qualifiers of type). <declarator> not include base of operations type (return type function; element type array). note there 2 alternatives in <direct-declarator> , both of seem relevant functions: <direct-declarator> ( <parameter-type-list> ) <direct-declarator> ( {<identifier>}* ) first of these

c - MySQL atomic sequence number generator -

c - MySQL atomic sequence number generator - my programme require generate unique transaction id through mysql due multiple machine environment. i using next mysql function, google review not atomic think is. delimiter $$ create definer=`` function `getnexttxid`(dummy int) returns int(11) deterministic begin declare txid bigint(20); set txid = (select next_txid txid_seq limit 1 update); if txid > 15000000 set txid = 0; end if; update txid_seq set next_txid = txid + 500 limit 1; homecoming txid; end i using last_insert_id , new requirement reset after 15m number imposed. cannot reproduce race status 2 of 100 processes same transaction number (in batch of 500, if application used 500, again). question: does function atomic any other way of doing correctly? table : myisam storage engine : myisam auto commit : true edit: using mysql c api. in advance apply. it's not atomic, because you're reading , writing separately. sh

packer building amazon-chroot - simple example does not work -

packer building amazon-chroot - simple example does not work - i'm trying build amazon ami centos using packer. using amazon-chroot builder. the ami exists, getting build error [root@ip-10-32-11-16 retel-base]# packer build retel-base.json amazon-chroot output in color. ==> amazon-chroot: gathering info ec2 instance... ==> amazon-chroot: inspecting source ami... ==> amazon-chroot: couldn't find root device! build 'amazon-chroot' errored: couldn't find root device! ==> builds didn't finish , had errors: --> amazon-chroot: couldn't find root device! ==> builds finished no artifacts created. cat retel-base.json { "variables": { "access_key_id": "{{env `access_key_id`}}", "secret_access_key": "{{env `secret_access_key`}}" }, "builders": [{ "type": "amazon-chroot", "access_key": "{{user `access_key_id`}}", "secret_key

vbscript - Using VBS to call text file to populate to field in email -

vbscript - Using VBS to call text file to populate to field in email - i creating script placed on servers run without user interaction send email when criteria met. have criteria script running, want create script easy deploy , modify each individual server. i trying create script create phone call text file populate field in email. text file have email addresses placed 1 per line (i putting semicolon on end of addresses since know multiple addresses separated semicolons) i have tried number of different variations on calling script , either error on line, or makes through script , error no recipients defined. here script below: `set objfso = createobject("scripting.filesystemobject") set objdictionary = createobject("scripting.dictionary") set objfileemailaddresses = objfso.opentextfile("emailaddresses.txt", 1) set objwmiservice = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2") set wshshell = wscript.cre

.net - Check if Time Range intersects in C# -

.net - Check if Time Range intersects in C# - this question has reply here: algorithm observe overlapping periods 8 answers i developing simple enrollment scheme in c# , thinking if there straightforward way check if time range (from - to) of input session intersects time range in database. the scenario follows: i have table in database named tblsessionlist stores different sessions per subject , want check each time user adds new session if particular room occupied in particular time range. technically, want check if chosen time range not conflict sessions in tblsessionlist . tblsessionlist | subject code | venue | room | date | | | | | | | | | | | crgov401 | gt tower | room 3d | thursday, june 19, 2014 | 8:00 |10:00 | | crgov401 |

xuggler - Xuggle API - Output video file size increasing. -

xuggler - Xuggle API - Output video file size increasing. - i trying run basic scenario using xuggle api, giving input flv file , writing flv file. i used same input parameters (e.g. bit rate, width , height); however, after conversion, getting much bigger output video file 2-3 times of input video size. please see below ffmpeg command output of both videos. input video: anilj@desk1:~/workspace/androws/xugglemedia$ ffmpeg -i input/internetcrashing.flv ffmpeg version n-36083-g2501f93-xuggle-5.5 copyright (c) 2000-2012 ffmpeg developers built on jun 3 2014 13:43:04 gcc 4.6.4 configuration: --prefix=/home/anilj/workspace/xugglehome --extra-version=xuggle-5.5 --extra-cflags=-i/home/anilj/workspace/xuggle-xuggler/build/native/x86_64-unknown-linux-gnu/captive/stage/home/anilj/workspace/xugglehome/include --extra-ldflags=-l/home/anilj/workspace/xuggle-xuggler/build/native/x86_64-unknown-linux-gnu/captive/stage/home/anilj/workspace/xugglehome/lib --disable-shared --enable-pi

python - Manipulate Pandas DataFrame containing dictionaries from Twitter API -

python - Manipulate Pandas DataFrame containing dictionaries from Twitter API - i working on script uses twitter api pull recent statuses list of users. able retrieve info using api upon converting dataframe, columns storing dictionaries. want spread indexes of dictionaries additional columns. ultimately, trying save info csv. here code: import twython import time import pandas pd import numpy np app_key = '' app_secret = '' oauth_token = '' oauth_token_secret = '' twitter = twython.twython(app_key, app_secret, oauth_token, oauth_token_secret) screen_names = ['@', '@'] #enter screen names of involvement tweets = [] screen_name in screen_names: tweets.extend(twitter.get_user_timeline(screen_name=screen_name, count=200)) time.sleep(5) df = pd.dataframe(tweets) which returns dataframe (400,25). df[[2,3,5]] returns following: created_at entities

c# - MVC 5 Web Api Backslash in Put request -

c# - MVC 5 Web Api Backslash in Put request - here set in controller : [httpput] public httpresponsemessage put(string name, [frombody]string value) { } i testing using advenced rest client : it works fine, ultimate goal able set directory in request's payload (where "test" is). the problem beingness there backslash in string, "value" parameter turns out null when function receive request. how can set backslashes in payload? use url encoding. example: http://meyerweb.com/eric/tools/dencoder/ \ %5c c# asp.net-mvc asp.net-web-api

Visual Studio fails debugging JavaScript after IE downgrade -

Visual Studio fails debugging JavaScript after IE downgrade - i had ie11 on workstation , able debug javascript functions. however, users using ie8 , experiencing issue unable reproduce ie11. downgraded browser ie11 ie8 troubleshooting , unable debug javascript functions now. here's error: the right version of pdm.dll not registered according this post, need right version of vs7debug folder. can folder ie8? p.s. have tried vs 2010, 2012 & 2008 debugging , of them complain same. have 64-bit os (windows server 2008 r2). javascript visual-studio-2010 visual-studio internet-explorer internet-explorer-8

php - Android app custom user registration and login with cookie using facebook sdk -

php - Android app custom user registration and login with cookie using facebook sdk - i developing android application in users need register , log in using facebook. approximately, flow. open app first time, authenticate facebook, data, send info server create them business relationship in application, start session new business relationship in server, cookie perform later interactions. so far good. what need know wich info have send server, can able identify users when log in seccond time. because need start session in server , send cookie android app farther interactions. i'm using php server side language. i thinking getting getaccesstoken() in android facebook sdk, pass server on business relationship creation , storing in android app. but can't manage how login users on sec time utilize app. any suggestions ? in advance ! to uniquely identify user within app, should create request /me , user's id. guaranteed unique , remain con

android export, Command-line Error -1073741819 -

android export, Command-line Error -1073741819 - i don't know why got error! when export project in android failed export application command-line error -1073741819 and no error message , logs.. but, project possible export.. what error -1073741819 on command-line? i got today, after eclipse installed updates. seems "l" related. deleted "bin" , "gen" folders of project , worked again... android command-line export

php - Match alpha letters and accented alpha letters -

php - Match alpha letters and accented alpha letters - i'm looking regex code pattern: must contain @ to the lowest degree 1 of next , match whole string. can contain alpha letters (a-z a-z) ... and accented alpha letters (á ä à etc). i'm using preg_match('/^([\p{l}]*)$/iu', $input) , \p{l} matches unicode letters, including chinese. want allow english language alphabet letters accented variants of them. so johndoe , fübar , lòrem , fírstnäme , Çákë valid inputs, because contain @ to the lowest degree 1 alpha letter and/or accented alpha letters, , whole string matches. i suggest compact regex: (?i)(?:(?![×Þß÷þø])[a-zÀ-ÿ])+ see demo. this regex takes advantage of fact accented letters want seem live in unicode character range À ÿ (see table), add together character class. the À-ÿ has few unwanted characters. unlike engines, pcre (php's regex engine) not back upwards character class subtraction, mimic negative lookahead (?

silverlight - "The user must be authenticated when the Login finishes successfully." -

silverlight - "The user must be authenticated when the Login finishes successfully." - this exception generated little subset of users on silverlight application. it's 3 year old app, had no issues logging in. switched info access tech linq2sql model ef6. authenticationservice.login(username, password, bool..., string...) the above method completes normal each user. database stuff happens fine, same users, little number of them userbase object returned has isauthenticated boolean property set false, causes exception. @ openriaservices.domainservices.client.applicationservices.loginresult..ctor(iprincipal user, boolean loginsuccess) @ openriaservices.domainservices.client.applicationservices.webauthenticationservice.endlogin(iasyncresult asyncresult) @ openriaservices.domainservices.client.applicationservices.loginoperation.endcore(iasyncresult asyncresult) @ openriaservices.domainservices.client.applicationservices.authenticationoperation.end

javascript - Create a child div accordingly if another child already exists at that location (x,y) -

javascript - Create a child div accordingly if another child already exists at that location (x,y) - i inserting textarea side bar (exactly on right to), wherever click made on page. code is: $('#page_to_be_clicked').click(function(e){ var offset = $(this).offset(); var comment_box_y_coord = e.pagey - offset.top; alert(comment_box_y_coord); $("#sidebar").append('<textarea id="cmmnt" rows="4" cols="10" '+ 'style="position:absolute;top:'+comment_box_y_coord + 'px;left:5px"></textarea>'); }) the problem that, if textarea nowadays @ location, overlap existing, i.e. if click made twice @ same point on page, 2 textareas created on top of each other. instead, should created 1 below other. is there way check, if kid exists @ required co-ordinates? any help appreciated. thanks. how should textareas appear on clicks in sequence: this needs tes