Posts

Showing posts from February, 2015

asp.net mvc - JQuery Select Element On Changing Partial View -

i have page changing partial view. in main view, how select model property of partial view when updates? the gist of main page this: <script ...etc > $(document).ready(function () { $("#renew").click(function () { $("#to-renew").load(...etc); }); }); </script> <div> <input type="button" id="renew" value="renew" /> <div id="to-renew"></div> </div> the partial view gets "renewed" every click brings new data database, such like: <div id="to-renew"> @html.hiddenfor(model => model.myproperty) </div> what need is, each refresh, select new updated property main page, such like: <script ...etc > $(document).ready(function () { $("#renew").click(function () { $("#to-renew").load(...etc); alert('@model.myproperty'); });

c# - Client/Screen Coordinate Conversion -

i've fallen down deep rabbit hole. there 2 issues i've dealt with. don't think have solution first issue (mentioned in next paragraph), guess real question how heck use pointtoscreen/pointtoclient reliably. i want use balloons show validation failures user control i've written. way use tooltip isballoon set. in validation error handler, call show() on tooltip user-control parameter. works if click on control, not if use tab leave control. i've tried hacks queuing task on thread sleep bit, try show balloon. nothing works. so, decided try go around , use main window ("this") parameter , specify coordinates, i.e.: _balloon.show(text, this, pos); i can't seem calculate position (pos), though. i'd position bottom right corner of control, here is: var clientbottomright = new point(_ctrlcallbackphone.width, _ctrlcallbackphone.height); then, try actual screen coordinates of spot so: var screenposition = _ctrlcallbackphone.poi

ms word - RegEx : Remove line breaks if lookbehind shows a lowercase -

i'm doing ctrl+h (find & replace) in notepad++ i want find line breaks followed lowercase characters in order replace them space character ; thereby removing unwanted break lines in text. find : \r\n+(?![a-z]|[0-9]) replace : insert space character here *make sure selected " match case " , " regular expression ". it works perfect. now, i'd same in microsoft office word documents. clues? in microsoft word, following: on home tab, in editing group, click replace open find , replace dialog box. check use wildcards check box. if don't see use wildcards check box, click more, , select check box. in find what: box, enter following regular expression: ([a-z])^13 in replace with: box, enter: \1 - thats: (backslash 1 space) (don't forget space!) and that's it! click either replace button or replace all button. note: in ms word, ^13 character matches paragraph mark @ end of each line. here's more inform

php - Embedding a youtube video through mysql - ERROR 404 -

i'm trying store youtube links in mysql database in order view them in page, <embed width="420" height="345" src="'<?php $video[1] ?>'" type="application/x-shockwave-flash"></embed> the video variable imported database through mysql_fetch_row, when use tag error 404 page not found , embed tag white screen. have altered .ht configs deny allow read , don't know if there didn't . you have: <embed width="420" height="345" src="'<?php $video[1] ?>'" type="application/x-shockwave-flash"></embed> you need: <embed width="420" height="345" src="<?php echo $video[1] ?>" type="application/x-shockwave-flash"></embed> p.s.: have lot of other errors in code.

php - ternary operator in a dynamic dropdown menu -

i'm still having trouble adding ternary operator menu. it's purpose add class=active li tag if menuid , page id same. pageid stored in var called thispage... when thispage , menuid equal should class tag. i've included code , php dump determine issue the line of code have issue ternary operator in ///sub menu & ///main menu sections starting ($thispage==$sval['menuid'] ? ' class="active"' : '') i think "$sval['menuid']" problem. <?php $thispage=3; // $sql = "select menuid, menutitle, menuurl, menuparentid, menuorderid menu order menuparentid, menuorderid asc"; $items = mysql_query($sql); while ($obj = mysql_fetch_object($items)) { if ($obj->menuparentid == 0) { $parent_menu[$obj->menuid]['menuid'] = $obj->menuid; $parent_menu[$obj->menuid]['menutitle'] = $obj->menutitle; $parent_menu[$obj->men

ruby - Rails on Heroku: session variables nil -

i've done lot of research , can't find similar questions/answers, appreciate help. my app working great locally, when push heroku, chokes on session variables . specifically, throws nomethoderror nil:nilclass when try access attributes of object held in session. i've narrowed down session after switching params , having success. however, i'd prefer using session keeps code little cleaner. i've poked around , seems happening every session object. quick context create new charge, new organization, , associate charge organization. the protocol https (this checkout page) , these calls happening asynchronously via jquery, though i'm not sure if matters. rails 3.2. cedar/postgres on heroku. sqlite3/thin locally. what's happening session on heroku? production.rb config.session_store :cookie_store, :key => '_my_app_session', :domain => :all application_controller.rb ... helper_method :current_charge def current_charge @_current

android - SimpleDateFormat And Arabic Locale -

i want format date arabic locale doesn't work on galaxy tab2 doesn't work on galaxy note , gives me 2 different results. here code: dateformat format = new simpledateformat("eeee yyyy/mm/dd", new locale( "ar")); string formateddate = format.format(calendar.getinstance().gettime()); note when check supported locales, find android 4.0 on galaxy tab2 does. didn't find arabic locales. locale[] supportedlocales = locale.getavailablelocales(); is there workaround solve issue or library can use that? note: on roomed android version (android 4.1) cyanogenmod, works , support arabic locales. what seems devices bought has android builds not prepared region. remove arabic support reasons (like small rom). may better if device made region or flash new rom support arabic (for mea, middle east area) devices. check same hardware version, can break it.

css sprite transition in responsive design -

i'm trying create social toolbar, using sprite images. when mouse hover "button", transition take place. i'm using code found in cmsms simplex theme; here example: http://jsfiddle.net/ttp7k/ css code: ul.social { padding: 0; margin: 0 } .social li { float:left; margin: 0; padding: 0; list-style: none; margin-right: 6px } .social li { display: block; width: 44px; height: 44px; transition: 0.2s ease-out; -webkit-transition: 0.2s ease-out; -moz-transition: 0.2s ease-out; -o-transition: 0.2s ease-out; text-indent: -999em } .social li.facebook {background: transparent url('http://www.scott-knight.net/facebook-sprite.png') no-repeat 0 0} .social li.facebook a:hover {background: transparent url('http://www.scott-knight.net/facebook-sprite.png') no-repeat 0 -48px} html code: <ul class="social"> <li class="facebook"><a title="facebook" h

eclipse - Saving project on Google Drive when using Android Studio -

is there way save projects on google drive when using android studio? want access project 2 different locations, path account under "users" different, use 2 different usernames on each of machines. since google drive folder under user folder, config wrong if project opened other machine. any advise how can use cloud work on project? thanks! trying use networked folder access 2 different machines problematic -- @ minimum, you'll trying share local.properties files between instances, it's intended not do. .idea , .iml files, if you're using gradle-based projects, aren't intended shared among computers. i've seen reports these can contain absolute paths, make sharing them tricky. that's perhaps bug fixed, treat files local in gradle-based projects , not intended checked source control, example. i think that's answer -- set project in source control , use use multiple places. you'll lose ability able access project in exact

c# - MachineKey.Protect and MachineKey.Unprotect -

i'm using .net 4.5 , machinekey.protect/machinekey.unprotect encrypting , decrypting values. i'm wondering when deploy code production we'll have multiple servers, machinekey.protect/machinekey.unprotect works without synchronizing machine keys? here sample code decrypt: var bytes = convert.frombase64string(token); var decryvalue = machinekey.unprotect(bytes, purpose); string plaintext = encoding.utf8.getstring(decryvalue); let me know thoughts! to unprotect data you'll need same machine key 1 used protect data. if need unprotect data protected server, servers must share same machine key.

Mirroring - server network address cannot be reached or does not exist -

i have read number of articles on how configure mirroring on sql server 2012. went through steps , worked until hitting final step, didn't work. when run on principal: alter database mydbname set partner = 'tcp://1.2.3.4:5022'; i error: the server network address "tcp://1.2.3.4:5022" can not reached or not exist. when run counterpart alter statement shown above, on mirror, works fine. i have tried steps in troubleshooting article . important points: the primary , mirror servers in different datacenters, not on same network @ all. not connected vpn. untrusted each other. i can connect mirror via ssms on primary , run queries. , vice versa. i configured certificates on each server establish trust relationship. worked during setup , config, no errors. i configured endpoints on both servers , verified they're active/enabled. i opened port 5022 on both servers configuring incoming , outgoing windows firewall rules. can telnet mirr

c++ - Python 3.3 C string handling (wchar_t vs char) -

i'm trying embed python 3.3 in our c++ project. python 3.3 seems have introduced utf-8 preferred storage, pep 393 : "the specification chooses utf-8 recommended way of exposing strings c code." i wrote initialization code, seems simple , intuitive: #include <python.h> #include "log.h" void python_init(const char *program_name) { if (not py_isinitialized()) { py_setprogramname(program_name); py_initialize(); const char *py_version = py_getversion(); log::msg("initialized python %s", py_version); } } but compiling fails: /home/jj/devel/openage/src/engine/python.cpp:13:3: error: no matching function call 'py_setprogramname' py_setprogramname(program_name); ^~~~~~~~~~~~~~~~~ /usr/include/python3.3/pythonrun.h:25:18: note: candidate function not viable: no known conversion 'const char *' 'wchar_t *' 1st argument pyapi_func(void) py_setprogramna

ios - Trying to make a TableviewCell call a cell number -

in app have page saves contact's name, amount owe, , cell number. have 2 sections. 1 section list of people owe, , other section list of people owe you. when user taps on someone, want able automatically call user's cell number. have far. -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { if (indexpath.section == 0) { nsmanagedobjectcontext *managedobjectcontext = [self managedobjectcontext]; nsfetchrequest *fetchrequest = [[nsfetchrequest alloc] initwithentityname:@"owedmoney"]; nsmutablearray *storedcellnumbers = [[managedobjectcontext executefetchrequest:fetchrequest error:nil] mutablecopy]; nsstring *cellnumber = [nsstring stringwithformat:@"%@", [storedcellnumbers valueforkey:@"youowecellnum"]]; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:cellnumber]]; } else if (indexpath.section == 1) { nsmanagedobject

playframework - Explain Build.scala in play framework -

can explain syntax build.scala in detail? example, have following build.scala : import sbt._ import keys._ import play.project._ object build extends sbt.build { val appname = "myapp" val appversion = "1.0" val appdependencies = seq( "postgresql" % "postgresql" % "9.1-901-1.jdbc4", javacore, javajdbc, javaebean, "org.json" %"org.json" % "chargebee-1.0", "org.reflections" % "reflections" % "0.9.8", "org.mockito" % "mockito-all" % "1.9.5" % "test" ) val main = play.project(appname, appversion, appdependencies).settings( librarydependencies += "com.jolbox" % "bonecp" % "0.8.0-rc2-snapshot", resolvers += resolver.url("sbt-plugin-snapshots", new url("http://repo.scala

jquery - Draggable not working after append -

im having trouble making buttons draggable after append() through ajax call. does see obvious error? thanks! $(document).ready(function () { $("#exautotxt").keypress(function () { $.ajax({ url: '@url.action("exerciseautocomplete")', datatype: "json", data: { 'term': $("#exautotxt").val() }, datatype: "text", success: function (data) { var exarray = json.parse(data); $(".exresults").html(""); (var x = 0; x < exarray.length ; x++) { $(".exresults").append("<button class='exnamebtn btn'>" + exarray[x] + "</button> <br/> <br/>"); } $('.exnamebtn').draggable(); } }); }) }); buttons fire request

sockets - Can I write an OpenShift Origin app that can ingest UDP traffic on an external port? -

how generic of paas openshift origin? looking @ architecture overview , seems web-centric. can use openshift origin build private cloud can run arbitrary apps, not web-based apps? as title of post indicates, pressing question whether possible create openshift app can open socket , ingest udp traffic -- don't need (and don't want) haproxy app, , don't want udp traffic first go through node host's proxy. essentially, i'd know if can deploy app node, , have app able receive udp packets external -facing port on node. possible? the redhat docs, configuring port proxy , make me think isn't possible: applications listen connections on loopback interface. node runs proxy listens on external-facing ports , forwards incoming requests appropriate application i'm hoping there way around restriction. custom cartridge work? as far know thats not possible @ time. suggest asking developers openshift origin on either mailing lists or check o

Is my embedded Google Group blocked by FireFox because of an incorrect X-Frame-Options "Allow-From" value? -

i'm trying embed google group web page on site, cannot work in browsers , stumped why. using <iframe> , javascript code provided google groups configuration system, things work when view page in safari (version 6.1, 8537.71) , chrome (32.0.1700.107), not firefox (26.0) running on mac os x 10.8.5. running firefox's debug console reveals following error: load denied x-frame-options: https://groups.google.com/ not permit framing http://mysite.org/mypage (where http://mysite.org/mypage actual page url, of course). now, curious thing using debug consoles in chrome , safari, both report error too—but x-frame-options header sent groups: invalid 'x-frame-options' header encountered when loading 'https://groups.google.com/forum/embed/?place=forum/myforum &amp;domain=mydomain.org&amp;showtabs=false&amp;parenturl= http%3a%2f%2fmydomain.org': 'allow-from https://groups.google.com' not recognized directive. header ignored. this

html - CSS floating elements causes other element background colors to disappear -

i testing out css , seeing how works floating elements in horizontal menue: <ul id="navlist"> <li><a href="#">item one</a></li> <li><a href="#">item two</a></li> <li><a href="#">item three</a></li> </ul> ul#navlist { list-style-type: none; margin: 0; padding: 0; background-color: cyan; } ul#navlist li { display: inline; background-color: pink; } /*ul#navlist li { float:left; }*/ i use background colors visually see affected. here output: output notice left gap between list items. when un-comment/insert the following line: ul#navlist li { float:left; } the gap disappears (what intended) background colors both ul , li disappear. output why this? the background despairing because content floating, parent's height gets zero. in practical terms, link it's anchored on <li> ,

PHP Define index for HTML form $_POST -

i have following php code <?php if(isset($_post['address_building_number']) or !isset($_post['address_building_number'])){ $address_building_number = $_post['address_building_number']; echo 'hello'; $good = 'good bye'; } echo $address_building_number; echo $good; ?> when hit submit button words hello , bye displayed telling me php notice: undefined index: $_post['address_building_number' html input form name address_building_number. how can modify if(isset($_post['address_building_number']) or !isset($_post['address_building_number'])){ can 'define index' while still able echo hello , bye. edit all-in-one version <?php if(isset($_post['address_building_number']) || !empty($_post['address_building_number'])){ $address_building_number = $_post['address_building_number']; echo 'hello';

c++11 - C++ 11 Move Semantics and STL Containers -

regarding move semantics , containers: i know stl containers take advantage of move when move operations defined in elements type. how know if element has defined move operations or not? why don't stl containers invoke std::move() on elements anyway, regardless of whether element has defined move operations or not? i'm asking because know can invoke std::move() on objects if type not define move operations. thank you. long story short, that's do, calling std::move without caring if able move or copy. it's worth noting functions offering strong exception guarantee, such std::vector::resize , call lesser known std::move_if_nothrow instead of std::move .

objective c - Why the view doesn't show when I click the button in IOS? -

Image
i new ios , , want implement album collectionview in ios. when click filebrowserbutton button in first view , change second view (name: aitcameracollectionbrowser ). there has 2 button , collectionview in aitcameracollectionbrowser following picture. and code of it's header file following code. #import <uikit/uikit.h> @interface aitcameracollectionbrowser : uiviewcontroller <uicollectionviewdelegate, uicollectionviewdatasource> @property (strong, nonatomic) iboutlet uibutton *backbutton; @property (strong, nonatomic) iboutlet uibutton *localalbumbutton; @property (strong, nonatomic) iboutlet uicollectionview *collectionview; @end i have not load picture phone yet , should show view above picture when click change view button in first view . the code of filebrowserbutton button following. - (ibaction)filebrowserbutton:(id)sender { uiviewcontroller *viewcontroller = nil ; viewcontroller = [[aitcameracollectionbrowser alloc] initwit

shell - Generate Summary report from logs : Peform additions on output of a command ( using AWK / SED or any other way) and formatting output -

i processing several files @ time.each of has summary stats . @ end of process want create summary file add stats . know how dig out stats log files. want able add numbers , echo file here use dig out times . find . -iname "$srch1*" -exec grep "it took" {} \; -print output took 0 hours, 11 minutes , 4 seconds process file. ./filepart000010-20140204-154923.dat.gz.log took 0 hours, 11 minutes , 56 seconds process file. ./filepart000007-20140204-154923.dat.gz.log took 0 hours, 29 minutes , 54 seconds process file. ./filepart000001-20140204-154923.dat.gz.log took 0 hours, 22 minutes , 33 seconds process file. ./filepart000004-20140204-154923.dat.gz.log took 0 hours, 59 minutes , 38 seconds process file. ./filepart000000-20140204-154923.dat.gz.log took 0 hours, 11 minutes , 50 seconds process file. ./filepart000005-20140204-154923.dat.gz.log took 0 hours, 22 minutes , 10 seconds process file. ./filepart000002-20140204-154923.dat.gz.log took 0 hours, 10 min

javascript - login and password fancybox -

never been exposed jquery or fancybox matter though while creating website figured give fancybox try login screen (pop frame). looking on fancybox site download js jquery , css files put them in head asked , continued try , implement password popup have run trouble. verticle nav bar , @ bottom of says login trigger popup no luck. here script: <script> $("#logid").fancybox({ 'scrolling' : 'no', 'titleshow' : false, 'onclosed' : function() { $("#login_error").hide(); } });</script> and here jsfiddle: http://jsfiddle.net/ssmzu/ i dont think jsfiddle work since cant put css files of them, wondering how problem resolved. mean have script @ bottom im not sure issue is. in advance!

regex - filter a Linux log file using Python -

i want filter log file keep lines matching pattern. want python. here's first attempt: #!/usr/bin/env python sys import argv script, filename = argv open(filename) f: line in f: try: e = line.index("some_term_i_want_to_match") except: pass else: print(line) how can improve to: save result new file of similar name (i.e., different extension) use regex make more flexible/powerful. (i'm learning python. question learning python accomplishing particular result.) ok, here's came far... how do equivalent of prepending r in following line re.compile(r"\s*") where string not string literal, in next line? re.compile(a_string_variable) other that, think updated version job: #!/usr/bin/env python sys import argv import re import os import argparse #requires python 2.7 or above parser = argparse.argumentparser(description='filters text file on search phrase'

concatenating two xPaths in XSLT -

in xslt script i'm calling recursive template , want pass xpath parameter each iteration. in each iteration want concatenate child's xpath (*/) current path (please refer code). i'm using concat() function, since returns string, i'm unable use path print content of path. <xsl:copy-of select="$path" /> <!--this requests xpath, not string--> so can 1 tell me how concatenate 2 xpaths or how convert string xpath. thank you. <xsl:template match="/"> <xsl:call-template name="repeatable" > <xsl:with-param name="limit" select="10" /> </xsl:call-template> </xsl:template> <xsl:template name="repeatable"> <xsl:param name="index" select="1" /> <xsl:param name="limit" select="1" /> <xsl:param name="path" select="@*" />

c - The return value of function returning long long unsigned int is incorrect -

when call function wordtoint(c) main, return value different it's printing inside function. main() { long long unsigned item; char c[6] = "abcde"; item = wordtoint(c); printf("main item :%llu\n",item); } long long unsigned wordtoint(char *c) { long long unsigned int k,item=0; int i,len; int j,p=0; len = (int) strlen(c); for(i = len-1;i>=0;i--) { if(c[i] == 'c') j = 42; else if(c[i] == '*') j = 99; else j = (int) c[i]; j = j%100; k = pow(100,p); p++; item = item + (j*k); } printf("function item :%llu\n",item); return item; } the output of program is: function item :6566676869 main item :18446744071686293893 can tell me why there inconsistency in output? first -- pay attention compiler's warnings, matter! answer -- since didn't prototype wordtoint() before

java - I am new to programming and need to store the below input in one array. Any suggestions? -

below code working with. need store input in array , im pretty lost! package code.simpleinput; import edu.cmu.ri.createlab.terk.robot.finch.finch; import java.util.scanner; public class ledsetter { private static scanner sc; public static void main(final string[] args) { // instantiating finch object finch myfinch = new finch(); sc = new scanner(system.in); // providing instructions user system.out.println("enter red, green, , blue intensity led (values 0 255)"); // reading in 3 integers system.out.print("red: <=200 "); int red = sc.nextint(); system.out.print("green: <=250 "); int green = sc.nextint(); system.out.print("blue: <=250 "); int blue = sc.nextint(); /* potential improvement here - check user input make sure in range (0-255) */ // setting led system.out.println("thanks, beak glow 8 seconds according specifications"); myfinch.se

sql - Oracle Date comparison issue -

i have table dates, there weird it. when query table select distinct process_dt table; the output : 11/16/2013 when query table select process_dt table process_dt=to_date('20131116', 'yyyymmdd'); the output 0 records. when query table select process_dt table process_dt=trunc(process_dt); the output give 100 rows, 11/16/2013. i not understanding why second query not working. idea? should change session in way? the problem current check date data type contains time. need use trunc date column make work.

c++ - QAudioProbe is consuming excessive memory under Windows -

i writing mp3 player in qt , need monitor audio levels. this, attach qaudioprobe qmediaplayer. however, when in windows, memory consumption continuously increases. after 3 hours of playing audio, player exhausts memory on machine , ceases function. memory consumption stable under osx. stable when attaching audio probe qaudioinput. i've tried delete , deletelater on probe not result in reduction in memory usage according task manager. there alternatives qaudioprobe? running out of ideas how around memory issue. qmediaplayer *player = new qmediaplayer(this); player->setmedia(qurl_to_my.mp3); qaudioprobe *probe = new qaudioprobe(this); probe->setsource(player); // memory usage stabilizes if comment line out player->play(); update: other things have tried qaudiodecoder - unfortunately, seems have same memory leak. it's not implemented under osx. executing code in separate qthread - still leaks memory.

symfony - how to render checkbox form in syfony 2 -

i have question? there 2 entity manytomany relation join table in syfony 2. first 1 certificate, second 1 mayag , join table certificate_mayag. certificate has many mayag isavailable, startdate, enddate fields. mayag has many certificate want render relation checkbox form. form consists of certificate info , mayag list checkbox , startdate, enddate , isavailable fields. how solution , 1 best way develop? <?php /** * created phpstorm. * user: mendbayar * date: 12/8/13 * time: 1:00 pm */ namespace mnd\srdbundle\entity; use doctrine\orm\mapping orm; /** * @orm\entity(repositoryclass="mnd\srdbundle\repository\certifyrepository") * @orm\table(name="certify") */ class certify { /** * @var integer * * @orm\column(name="id", type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ private $id; /** * @orm\column(type="string", unique=true, length=50) */ protected $certificate_number; /** * @orm\manytoon

android - Show alertdialog from service -

i need show alertdialog service , i'm using code on service: public void oncreate() { intent i=new intent(getapplicationcontext(), groupactivity.class); alertdialog.builder alert=new builder(getapplicationcontext()); alert.settitle("success!"); alert.setmessage("hien tai"); alert.setpositivebutton("success", new onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { } }); alert.show(); }; but code throw execption. how that? public void oncreate() { intent i=new intent(getapplicationcontext(), groupactivity.class); alertdialog alertdialog = new alertdialog.builder(this) .settitle("success!") .setmessage("hien tai") .setpositivebutton("success", new onclicklistener() { @override public vo

c++ - Can I access Windows Kernel system calls directly? -

i have been doing research windows internals, , have learned system calls , wondering if possible use these system calls functions? understand aren't meant accessed externally. for instance: ntuseremptyclipboard system call in win32k.sys, , it's address 0x117f if wanted use call function, how so? emptyclipboard 1 of so-called "win32 api" , ntuseremptyclipboard corresponding "native api". http://en.wikipedia.org/wiki/native_api unlike linux syscall(2) , supposed directly call "native api". heard in ntdll.dll rather win32k.sys . should able invoke them normal functions defined in normal dll. is there way call windows native api functions user mode?

haskell - how to compile category code with ML compiler? -

find there many ml compilers not know compiler suitable these code, , not know how compile it and find haskell has operads package suitable usage of category possible translate haskell? cs.man.ac.uk/~david/categories/programs/cat when compile ocaml, got error # #use "c:/documents , settings/wilson/my documents/downloads/ml/cat.ml";; file "c:/documents , settings/wilson/my documents/downloads/ml/cat.ml", line 20, characters 13-14: error: syntax error: operator expected. # #use "c:/documents , settings/wilson/my documents/downloads/ml/functorcat.ml";; file "c:/documents , settings/wilson/my documents/downloads/ml/functorcat.ml", line 12, characters 13-14: error: syntax error: operator expected. # #use "c:/documents , settings/wilson/my documents/downloads/ml/basic.ml";; file "c:/documents , settings/wilson/my documents/downloads/ml/basic.ml", line 7, characters 15-16: error: syntax error the link posted inco

java - Cookie encryption and decryption using Servlet filters -

is function or api available intercept addcookie() cookies set servlet encrypted using servlet filters. , when getcookies() invoked filter decrypt , give response web server. actually done prevent xss attack. not able find documentation or info. regarding encryption , decryption of cookies using servlet filters.. gratefull.

javascript - Opening a http link in shell itself and not in new window in sapui5 -

there workset items in shell in ui5. have given http link in setcontent method of 1 of worksetitem. link opening in new window , not inside shell. want open link inside shell. how it...??? i had same issue , solved html control content of shell's worksetitem , used iframe: var iframe = new sap.ui.core.html({ content : "<iframe src='youraddress'>" }); if intend create new tab in shell displays content can add new worksetitem in press event listener of link, e.g.: var link = new sap.ui.commons.link({ press : function() { shell.addworksetitem(...); } }); maybe works too.

c# - Why is ShowInTaskbar freezing the application? -

Image
i need hide form @ startup of operating system(windows 7). accomplish that, tried solution:- if (program.args == "/startup") { this.hide(); this.showintaskbar = false; } i had above code in form1_load event, program.args command line argument supplied program. what wrong in above code? how can accomplish hiding of form through command line arguments? as people suggested use this.windowstate = formwindowstate.minimized this.showintaskbar = false tried application freezes, this:- if comment out line this.showintaskbar = false runs shows icon in task bar. normal of application :- try changing visibility. error code on code because of conversion of args string ... works fine. private void form1_load(object sender, eventargs e) { this.visible = false; this.showintaskbar = false; }

objective c - Freeze rows and columns using xlslib library ios -

i want freeze columns , row panels of excel file create using xlslib library in ios contains headers os if have idea please provide code or method used freeze columns or rows using xlslib. i have used locked() method of xlslib doesn't work @ all.

android - key listener is not working for layout -

i want add onkeylistener linear layout not working, here code. in advance. innerlayout.setonkeylistener(new onkeylistener() { @override public boolean onkey(view v, int arg1, keyevent e) { // todo auto-generated method stub if(e.getkeycode()==keyevent.action_down){ toast.maketext(homescreen.this, "down key working", toast.length_long).show(); innerlayout.setfocusable(true); } return true; } }); } as touch events passed child parent. if child consumes (returns true), stops; not passed parent. sure not consumed elsewhere? check this, true 1 action, false rest , super call: @override public boolean onkeydown(int keycode, keyevent event) { super.onkeydown(keycode, event); if (event.getaction() == keyevent.action_down) { //toast here return true;

android - How to show an image from a GridView in an AlertDialog? -

Image
mgridview.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> gridview, view view, int pos, long id) { alertdialog.builder builder = new alertdialog.builder(getactivity()); builder.setview(view); builder.create().show(); } }); when try run code, after click on item, exception: i don't want remove view parent. want show image in alertdialog . can give me hint how that? try this... mgridview.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> gridview, view view, int pos, long id) { alertdialog.builder builder = new alertdialog.builder(getactivity()); imageview imageview = new imageview(gridview.getcontext()); imageview.setscaletype(imageview.scaletype.center); view.setdrawingcacheenabled(true); view.build

angularjs - remove HTML element on click in Angular js -

this directive. display 1 div on body. app.directive("autosuggest", function($rootscope) { return { scope: { doneflag : "=", groupflag : "=", inviteesflag : "=", init: '&' }, templateurl : "title.html", link: function(scope, element, attrs) { } }); and in title.html <div class="showw"> <img id="hidedivonclick" src="ddd.png"/> </div> and include directive this <div autosuggest="" done-flag="1" group-flag="1" invitees-flag="1" selected-array="" ></div> so when click on image <div autosuggest="" done-flag="1" group-flag="1" invitees-flag="1" selected-array="" ></div> parts gets remove body. remove el

php - How to bypass wordpress login screen -

basically want auto login user in wordpress, when clicks on link in email, bears parameter of either user id, username or email. i went researching wordpress stores session information after login. in theme's header.php , when put: <?php print_r($_cookie); print_r($_session); ?> and logged in admin , got 1 array of $_cookie , wordpress not use sessions internally. array ( [wordpress_test_cookie] => wp cookie check [wordpress_logged_in_80d2ab9fd1f16a2a89ddb8a5553b4463] => admin|1391841132|58e4ae330b4ca7aef9d6a8ffa3c3a1fb ) i compared database dumps before , after login, , there no change. this, came conclusion wordpress stores session data in form of cookies. now bypass login screen of wordpress, when user clicks on link in email. i want know data stored inside above array of cookies. can create own data dynamically , push in $_cookie array, auto login user. can throw light on this? not interested in trying plugins. want manually now. edi

syntax - SPSS compute cases in different variables -

i using spss process data. eg. have data like v1 v2 v3 258 235 236 567 123 987 576 234 678 456 for values of v3, wanna compute case of v1 minus former case of v2 236-235, 123-567, 576-987, 678-234 because have more 1 million data , , wanna loop compute so how should write in syntax? thank you! statistics automatically loops on cases. need write compute statement. if meant previous case "former case of v2", see lag function.

php - Passing array to sql query not working -

this question has answer here: mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 resource or mysqli_result, boolean given 33 answers <?php require_once("dbdata.php"); if(mysql_connect($server_name,$db_user,$db_pass)) { if(mysql_select_db($database_name)) { $display_scores = "select distinct user_id, quiz_id, parent_category,category_name, score custom_question_details user_id = 3"; $results = mysql_query($display_scores); $scores = array(); $s_p = array(); while($rows = mysql_fetch_assoc($results)) { $scores[] = $rows; $s_p [] = $rows['parent_category']; } $imp = implode(',',$s_p); $child_sql = "select distinct category_name custom_question_details parent_category in (".$imp.")"; $child_result = mysql_query($

jquery - Repeating Multiple Images As Background in different Styles -

Image
in present project end user select image computer, should display image in below formats. the formats above normal repeat , half- drop , half-brick , center , mirror respectively so started working on css background image tricks. didnt got 100% solution that. what have done taken division of 400px width , 400px height repeated image using background-position: , background-repeat: properties repeated image in repeat-x , repeat-y respective formats. repeated image in such way fit 400px height , 400px width as per code if want repeat image in 4 rows should write 4 background property lines please go through js fiddle better understanding. what want is solution can in css or jquery if there solution in css: background repetition should done automatically if increasing height of division. i not getting idea to repetition of image in mirror format (as last image mentioned above). please give suggestions make perfect. note : please forgive me

Configuration of log4j with Apache Flume -

i running flume agent netcat source, file channel , mongodb sink, want configure log4j work server flume running background process. configuration file in /opt/flume/conf/log4j.properties, please let me know if log4j property file getting included on flume start, , if why flume.log not getting created, here configuration given below flume.root.logger=info,logfile flume.log.dir=/opt/apache-flume-1.4.0-bin/logs flume.log.file=flume.log log4j.logger.org.apache.flume.lifecycle = info log4j.logger.org.jboss = warn log4j.logger.org.mortbay = info log4j.logger.org.apache.avro.ipc.nettytransceiver = warn log4j.logger.org.apache.hadoop = info log4j.rootlogger=${flume.root.logger} log4j.appender.logfile=org.apache.log4j.rollingfileappender log4j.appender.logfile.maxfilesize=100mb log4j.appender.logfile.maxbackupindex=10 log4j.appender.logfile.file=${flume.log.dir}/${flume.log.file} log4j.appender.logfile.layout=org.apache.log4j.patternlayout log4j.appender.logfile.layout.conversionpatte

If url ends with double dash, want to rewrite(Apache) -

if url ends double dash or hyphen(--), need redirect internal page. rewriteengine on rewritecond %{request_uri} --$ rewriterule .* /error www.mysite.com/mypage-- www.mysite.com/error but it's not working. there wrong code? i think because deals special character not string. *edit. this whole vhost.conf . servername mysite.com documentroot "/mywebroot/" errordocument 400 /jsp/errorhandler.jsp errordocument 403 /jsp/errorhandler.jsp errordocument 404 /jsp/errorhandler.jsp errordocument 500 /jsp/errorhandler.jsp errordocument 503 /jsp/errorhandler.jsp redirectmatch --$ /jsp/errorhandler.jsp <ifmodule mod_jk.c> jkmount /*.jsp mysite jkmount /*.do mysite jkmount /*.page mysite jkmount /*.json mysite jkmount /servlet/* mysite </ifmodule> <locationmatch "/servlet/*"> sethandler jakarta-servlet setenv jk_worker_name mysite </locationmatch> <locatio

sql - Subtract minutes from date -

i need subtract number of minutes date. like: select @minute=1440 select @datetime='2014-02-05 23:27:51.413' select @datetime- @minute you can use dateadd function manipulate datetime values. if want subtract values can use parameter negative value this select dateadd(minute, -@minute, @datetime);

html - How to add repeat-x for table td with background url -

i have html table 3 tds there, need add image middle td in tr property repeat-x; property. not working me. code: <td style="background-image:url('repeatbanner.png');background-repeat: repeat-x;"> i have tried width:auto also, no result.please try me. demo <table border='1' width='100%'> <tr> <td style="background-image:url(https://www.google.co.in/images/icons/product/chrome-48.png); background-repeat: repeat-x; ">dgfdg</td> <td>gdgd</td> </tr> </table>

javascript - select drop down is expanding long in IE9 -

i populating values in select drop down using ajax call dynamically. code working fine in ie8 not in ie9. select dropdown not appearing properly. exapading. here snippet code: if(xmlhttpreq.status==200) { var acacomplrulesdtls=xmlhttpreq.responsetext; //resetting individualstoapplycompliancerules dropdown blank document.getelementbyid("individualstoapplycompliancerules").innerhtml=""; var spiltedacacomprules=acacomplrulesdtls.split("###"); if(spiltedacacomprules.length==2){ var indvnames=spiltedacacomprules[0]; var indvnumbers=spiltedacacomprules[1]; var spiltedindvnames=indvnames.split("~~"); var spiltedindvnumbers=indvnumbers.split("^^"); var namelen=spiltedindvnames.length; var numberlen=spiltedindvnumbers.length; //checking names & numbers length same or not if(namelen==numberlen){ var selectfield=document.getelementbyid(&qu

variables - Naming PHP object children in for loop -

i want this: <?php echo $factuurgegevens->aantal.$i; ?> but doesn't work, how can handle this? so have get: <?php echo $factuurgegevens->aantal1; ?> <?php echo $factuurgegevens->aantal2; ?> <?php echo $factuurgegevens->aantal3; ?> <?php echo $factuurgegevens->aantal4; ?> you can use curly braces ( {} ) make dynamic variables : $name = 'aantal'; for($i = 0 ; $i < 5 ; $i++) echo $factuurgegevens->{$name . $i}; however should use array because made things this: $factuurgegevens->aantal = array(); $factuurgegevens->aantal[1] = 'something'; $factuurgegevens->aantal[2] = 'something'; $factuurgegevens->aantal[3] = 'something';

python - Eigenvalues NaN and inf -

suppose have system ax = nbx , b known martrices, x coefficient matrix. i solving using chebyshev polynomials. bc's u(-1)=0=u(1) i imposing bc's first , last rows of matrices , b. e=solve(a,b) e[1]=0 e[-1]=0 x=solve(a,e) what wrong this? the question seem asking: how come generalized eigenvalue problem has eigenvalues inf , nan? your generalized eigenvalue problem singular , has eigenvalues lambda=alpha/beta such (alpha=0, beta=0) , (alpha!=0, beta=0). since eigvals reports eigenvalues, 0/0=nan or x/0=inf, correspondingly. http://www.netlib.org/lapack/lug/node35.html if problem shouldn't have such eigenvalues, it's there error in construction of matrices.

java - How are date and datetime supposed to be serialized SOAP (xml) messages -

we working on building java client third party soap webservice, have not access or control off server side code. provided wsdl description file of service. using axis 1 (version 1.4 ). we have run following issue related date vs datetime serialization , deserialization. said wsdl defines 2 types datetime , daterange <xs:element minoccurs="0" name="datetime" type="xs:datetime"/> <xs:element minoccurs="0" name="daterange"> <xs:complextype> <xs:sequence> <xs:element name="start" type="xs:date"/> <xs:element name="end" type="xs:date"/> </xs:sequence> </xs:complextype> </xs:element> where xs prefix denotes xml schema, following present xmlns:xs="http://www.w3.org/2001/xmlschema" the axis wsdl2java generates java objects whre datetime field type calendar, , start, end fields typed java.util.date