Posts

Showing posts from April, 2014

Powershell, invoke-webrequest...and Zabbix -

i'm trying use powershell automate creation of reporting tool. need zabbix (v1.8) graph images. not yet possible through api must connect url , graphs. this code : $zabbixloginurl = "http://zabfront-eqx.noc.lan/zabbix/index.php?login=1" $zabbixgraphurl = "http://zabfront-eqx.noc.lan/zabbix/chart2.php?graphid=" $username = "username" $userpwd = "pwd" $loginpostdata = @{name=$username;password=$userpwd;enter="enter"} $login = invoke-webrequest -uri $zabbixloginurl -method post -body $loginpostdata -sessionvariable sessionzabbix #let's see if have cookie set if ($sessionzabbix.cookies.count -eq 0) { write-host "fail connect" break } else {write-host "connected"} #now let's retrieve graph #4433 using priviously established session $graph = invoke-webrequest -uri ($zabbixgraphurl+"4433") -websession $sessionzabbix i can connect , cookie : $sessionzabbix.cookies.getcookies(&quo

facebook - FQL fetch 3 photos from each album -

is there “elegant way” fetch last 3 photos each album of user? i’ve tried using multiquery, doesn’t work: $fqls = array( "q1" => "select aid album owner = $page_id", "q2" => "select src_small,created photo aid in (select aid #q1) order created desc limit 3" ); with graph api, can [user_id]/albums?fields=photos.limit(3)

angularjs - How to get socket.io.js file from server using sails.js -

i trying make angularjs application, independent node.js server running sailsjs. i use socket.io application , apparently need socket.io.js file server. in client load js file in index.html file using: <script src="http://localhost:1337/socket.io/socket.io.js"></script> however sails not deliver file because of handshake error. is there anyway file server? thanks if don't need node.js server, why don't copy socket.io.js file web server, , fetch there?

mysql - insert in database with column number -

i want insert in table using columns order not name insert tablename(1,2,5) values('val1','val2','val3'); i dont want use insert tablename values('val1','val2','val3'); because table not contain 3 columns how can because columns name encrypted can not rely on insert tablex("ccgsvkjvqxnt8a==","adoloqrpfg==","qsdcx112") values('val1','val2','val3'); is there idea how can deal thank you can't use ordinal number of column in insert statement. however, can accomplish you're trying (insert values specific columns in table) using column names instead. presume table has 5 columns; i'm going call them "alpha", "bravo", "charlie", "delta", , "echo", since haven't given schema table, replace these names names of columns in table. i'm guessing third , fourth column (my "charlie" ,

ruby - Webrick does not start when starting a Sinatra app -

any idea why webrick refuses start? require 'sinatra/base' require 'slim' class blog < sinatra::base '/' slim :home end end running ruby blog.rb nothing. no error raised. the built in web server isn’t started when using modular style of sinatra apps. see the docs differences between modular , classic styles . to run classic style app, add line bottom of blog class: run! if app_file == $0

c++ - program ignores everything after function is called -

i can't explaing properly.. have code like printf_s("%s", "1"); gldrawelements(gl_triangles, model.indcount, gl_unsigned_int, (void*)0); printf_s("%s", "2"); eglswapbuffers ( escontext->egldisplay, escontext->eglsurface); and 2 never printed .when remove gldrawelements it's ok gldrawelements(gl_triangles, model.indcount, gl_unsigned_int, (void*)0); ^^^^^^^^^^^^^^^ whaaaaat? opengl es' gldrawelements() not accept gl_unsigned_int type , gl_unsigned_byte or gl_unsigned_short . if check glgeterror() after call should gl_invalid_enum .

PHP MySQL search using WHERE IN -

Image
i have following php code finds servers have , tags assigned them. in example bending, economy. script gets server has both displays twice. best way stop this? please note tags stored in seperate table , obtained searching via server id. php code: $query = "select s.id, s.name, s.ip, s.port, ss.id, ss.votes, ss.added, (1.6 * ss.votes + .053) * greatest(1, datediff(now(), ss.added)) score, greatest(1, datediff(now(), ss.added)) days, st.server_id, st.server_tags $tbl_name s left join server_score ss on s.id = ss.id left join server_tags st on s.id = st.server_id st.server_tags in ($sstag)"; results full script http://pastebin.com/5whapesd join subquery combines rows same server id: select ... ... left join (select server_id, group_concat(server_tags) server_tags server_tags server_tags in ($sstag) group server_id) st on s.id = st.server_id alternatively, can use original query, put group_concat(server_tags) in main s

qt - QML: Communicating with great grandparents through signals -

i'm in process of learning qt cross platform development, , i'm trying using qml. know there lots of ways solve problem using c++, want stay true model , use qml. here is: if using loader display qml files seen in following code, how communicate main.qml secondpage.qml? i assumed through signals, upon further reading seems actions on signal within class sent ( using connected method). here resource on this: http://qt-project.org/doc/qt-4.8/qmlevents.html#connecting-signals-to-methods-and-signals alternatively, may wrong design qml application. i'm trying break away using single source file before things out of hand... main.qml: rectangle { id: background ... item{ id: item1 loader { .... id:pageloader; source : "secondpage.qml" focus:true; } } in secondpage.qml have access background element directly because children have access of parents in hierarchy. ano

jquery - Skrollr animate an element inside, relative to a scrolling div -

i having issue trying element animate inside moving div; imagine have div (blue 800 wide x 100 high) off screen, below screen , when scroll down comes screen , continues , disappears out of top of screen. call div "container". now imagine if have smaller div inside "container" div , called "box" , apply animation "box" moving left right. i expect when scroll down box move left right inside container, container moves screen. (resulting in box looking moving diagonally screen) the result container moves screen, expected, box outside of it's container , moves right left across bottom of screen i cannot figure out how make box move inside it's parent container , scroll it. i think need use relative mode (or view-port mode) can't work @ all. spacer div: <div id="justaspacer" style="height:1000px;"></div> (container div): <div id="container" style="width:800px;

c# - Type or Namespace name 'HTMLWorker' could not be found -

i using itextsharp version 4.1.6 in application. using includes both itextsharp.text , itextsharp.text.pdf. trying follow guidance stackoverflow on creating pdf html page. requires use itextsharp object called htmlworker. intellisence shows no such class. when manually type in "htmlworker worker = new htmlworker(doc);" error "type or namespace name 'htmlworker' not found. missing using directive or reference?" can identify using or reference missing? i believe full namespace is: itextsharp.text.html.simpleparser.htmlworker ( found here ). admittedly documentation seems nonexistent , link wasn't easy find. edit: downloaded dll , decompiled it, correct namespace.

java - jLabel's setText is not working even with SwingWorker -

i'm making jlabel display timer,so being updated every second , i'm updating of thread i'm using swingworker update jlabel not working. here code... long pos=-1; private void jbutton1actionperformed(java.awt.event.actionevent evt) { try { pos=...value of timer.... jlabel1.settext("in function"); jlabel3.settext("in function"); timer=new thread(new adsa()); timer.start(); } catch(exception e) { system.out.println("exception caught"); } } /** * */ public void run() { try { system.out.println(pos); while(pos!=0 && clip.isrunning()) { label1.settext(string.valueof(pos)); system.out.println(pos); pos--; timer.sleep(1000); swingworker worker = new swingworker() { @override public objec

javascript - AngularJS validation of asynchronously loaded form -

i building angularjs application includes modal windows contain forms , loaded dom asynchronously (when appropriate button clicked). forms work fine, cannot check if valid. here's example: html <div ng-app="myapp" ng-controller="myctrl"> <form novalidate name="myform" ng-submit="submitform(myform)"> <input type="text" required ng-model="myname" /> </form> </div> javascript var app = angular.module('myapp', []); app.controller("myctrl", function($scope) { $scope.submitform(form) { if(form.$valid) { // http stuff here } }; }); if form loaded asynchronously, form variable has value nan , form.$valid undefined. however, if load rest of page, works fine. know how force angularjs populate scope variable form? thanks! when include form using ng-include childscope created. parent , childscope cant access eacho

node.js - Javascript objects - feature missing from overall object, yet exists -

strange problem here. i'm running node/express/mongoose/leaflet. pull array of locations db, , once callback initiated, iterate on locations find bunch of string passages deals each location. try append array of passages each location object, , append locations array geojson featurecollection. location.find({}, { _id: 0 }, function (err, locations) { if (err) { console.log('db error loading locations'); res.redirect('/'); } else { var num = 0; console.log("beginning finding passages"); locations.foreach(function (location) { num++; console.log("looking location"); passage.find({"placekey": location.properties.placekey}, function (err, passages) { if (err) { console.log('db error finding passage for: ' + location.properties.placekey); } else { console.log("passage found!"); location.properties.passages = passages[0]; //take

asp.net - Gridview Sort Causing RowDataBound to not function correctly -

i have gridview works fine each of row commands, however, once sorted causes rowdatabound event use incorrect values rather actual values in row after has been sorted. appreciated! here code behind. //verify , update record protected void unverifiedsalesgv_rowcommand(object sender, gridviewcommandeventargs e) { buttoncommand = e.commandname; messagelbl.text = ""; if (e.commandname == "verifyrecord") { //get record id string salesid = unverifiedsalesgv.datakeys[convert.toint32(e.commandargument)].value.tostring(); //get productid salesdata getsalesrecord = new salesdata(); getsalesrecord.getrowvaluessalesid(salesid); string productid = getsalesrecord.productid; if (productid != "38") { verifyrenewal = false; try { updatesalesrecordsds.updatecommand = "update sales set verified = @verified id = @id";

c# - do asp page variables not persist? -

i have following test asp page: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:label id="label1" runat="server" text="label"></asp:label> <asp:button id="button1" runat="server" text="button" onclick="button1_click" /> </div> </form> </body> </html> with following code behind: public partial class test : system.web.ui.page { int x = 0; protected void page_load(object sender, eventargs e) { label1.text = x.tostring(); } protected void button1_click(object sender, eventargs e) { x++; label1.text = x.tostring(); } } from non web programming mindset have thought int x have been sort of object field

how to use schema.org metadata on a review for multiple ratings? -

i need markup review metadata product, review have multiple ratings service, satisfaction, quality, lifetime etc in original schema.org documentation review ( http://schema.org/review ) there property/field: reviewrating using can use 1 field need provide metadata fields, there solution that? thanks. actually 1 property isn't issue here since can used multiple times. there lot of discussions around cardinality of schema.org properties. can dive details here (issue @ open tracker) , here (w3c wiki page). i follow rule stated guha: right now, allowed have multiple values. another part of question how describe different ratings. can use mechanism of "multiple inheritance" in "serious" programming language. 1 entity may have several types. in case 1 type http://schema.org/rating , (quality, service, etc) can external schema.org vocabulary. e.g., productontology candidate (you can use http://www.productontology.org/id/quality_philosop

html - Bootstrap 3: Fixed Right Sidebar -

i using 1 of bootstrap 3 example build sidebar. works fine. how can fix position navigation bar won't loose while scrolling down. tried adding .uploadsidebar class <div class="col-xs-6 col-sm-3 sidebar-offcanvas sidebar-nav-fixed uploadsidebar" this .uploadsidebar { margin-top:117px; postion:fixed } but did not work. i think you're using wrong selector. use 1 instead, i've tested on link gave , works: .well.sidebar-nav { position: fixed; }

ruby on rails - Git/Github not letting me push to new branch -

i created new branch of rails app make changes fix front-end bugs. don't understand why, git/github isn't letting me push branch. after entering github password, hung there until cancelled it. % git status # on branch fefixes nothing commit (working directory clean) % git push origin fefixes username 'https://github.com': {me} password 'https://{me}@github.com': ^c what doing wrong here? it's me since github's status right now. check remote "origin" ensure url looks correct: git remote -v next, try listing out contents of remote: git ls-remote origin if goes steps above, git connecting github hosted repository. try git push origin fefixex again.

javascript - Angularjs ngSwitch with static nodes? -

how can have common nodes in ngswitch? <div ng-controller="myctrl"> <div ng-repeat="widget in widgets" ng-switch="" on="widget.foo"> <h1>test</h1> <p ng-switch-when="bar">lorem ipsum</p> <small ng-switch-when="baz">lorem ipsum</small> <footer>common footer</footer> </div> </div> jsfiddle the switch element renders last child of template. ideas if there better way? try this: <div ng-controller="myctrl"> <div ng-repeat="widget in widgets"> <h1>test</h1> <div ng-switch on="widget.foo"> <p ng-switch-when="bar">lorem ipsum</p> <small ng-switch-when="baz">lorem ipsum</small> </div> <footer>common footer</footer> </div> </div> jsfiddl

Is there a faster way to test if two lists have the exact same elements than Pythons built in == operator? -

if have 2 lists, each 800 elements long , filled integers. there faster way compare have exact same elements (and short circuit if don't) using built in == operator? a = [6,2,3,88,54,-486] b = [6,2,3,88,54,-486] == b >>> true anything better this? i'm curious because have giant list of lists compare. let's not assume, run tests! the set-up: >>> import time >>> def timeit(l1, l2, n): start = time.time() in xrange(n): l1 == l2 end = time.time() print "%d took %.2fs" % (n, end - start) two giant equal lists: >>> hugeequal1 = [10]*30000 >>> hugeequal2 = [10]*30000 >>> timeit(hugeequal1, hugeequal2, 10000) 10000 took 3.07s two giant lists first element not equal: >>> easydiff1 = [10]*30000 >>> easydiff2 = [10]*30000 >>> easydiff2[0] = 0 >>> timeit(easydiff1, easydiff2, 10000) 10000 took 0.0

jquery - Sum multiple inputbox values -

i have bunch of inputboxes class "selectme quantity" , sum amount of together. for example: <input class="selectme quantity" value="4"> <input class="selectme quantity" value="1"> <input class="selectme quantity" value="5"> how can run through these inputs , display total value (it 10)? i'd suggest: function summate (selector) { var sum = 0; $(selector).each(function(){ sum += parsefloat(this.value) || 0; }); return sum; } summate('.selectme.quantity'); js fiddle demo . or, if you're working browser supports array.reduce() : var sum = $('.selectme.quantity').map(function(){ return this.value && parsefloat(this.value); }).get().reduce(function(a,b){ return parsefloat(a) + parsefloat(b); }); console.log(sum); js fiddle demo . references: array.reduce() . get() . map() . parsefloat() .

If filename has single quote C# javascript does not get executed -

i need pass url c# javascript. problem if filename has single quote, not execute javascript. when use httputility.htmlencode(filenamewithoutex) execute javascript if filename "copy of david's birth certificate" url gets converted ?view.aspx?length=60&ext=pdf&file=copy of david&#39; birth certificate. when view.aspx tries querystring file i.e; filename, gets set "copy of david" , not "copy of david's birth certificate". because of & not rest of querystring. if (system.io.file.exists(filelocation)) { string filenamewithoutext = system.io.path.getfilenamewithoutextension(filelocation); string fileextension = system.io.path.getextension(filelocation).replace(".", ""); string title = system.io.path.getfilenamewithoutextension(filename); string url = "view?length=" + 60+ "&ext=" + fileextension + "&file=" + filenamewithoutext

pointers - Doubly Linked List insertion infinite loop... C++ -

i implementing doubly linked list in c++. before insertion, printing node function works after insertion front, printing goes forever. for example, have nodes of 1, 2, 3 data , insert data front 5. try print, , shows 5, 1, infinite loop without going third node 2. here structure. struct dl_node { int data; struct dl_node* prev; struct dl_node* next; dl_node(dl_node* prev, dl_node* next, int data) { // here, prev parameter // this->prev object this->prev = prev; this->next = next; this->data = data; } // constructor, without pointer parameter explicit dl_node(int data) { this->prev = this; this->next = this; this->data = data; } }; here insertion function. // "push-front" operation dl_node* insert_node(dl_node* head, int data)

php - Form values into an array for emails -

i have php script sends email specified email address: $headers = array( 'from: emailhidden', 'content-type: text/html' ); $body = array( '<br><br><br>', '<h3>success!</h3><br>', '<p>your sign panda successful! may sign in using information provided below.</p>', '<p><b>login url:</b> <a href="http://www.green-panda.com/my-panda.html">http://www.green-panda.com/my-panda.html</a></p>', '<p><b>username:</b> echo "$_post[unique_id]";</p>', '<p><b>username:</b>". $post['unique_id']."</p>', '<p><b>password:</b> echo "$_post[passphrase]";</p>', '<p>if ever have problems panda or have questions, please contact at: moevans@green-panda.com' ); mail('emailhidden', 'm

ruby - Rails 4 content entry system -

i interested in building ruby on rails 4 application allows users enter blog articles. don't need full blown blogging architecture - smarter use wordpress or open source alternative. need subset of features such following: add tagging rich editing allow user bold, underline, highlight content create seo friendly urls based on article headline the reason i'm posting i'd rather not reinvent wheel. i'm wondering if there rails gem built has these similar features created can plug in , customize existing application. if there nothing out there because of existence of tools such wordpress, i'll have custom bake them own application. there solution in form of gem or similar out there? here possible options you: acts-as-taggable-on gem works tagging. rich rich editor gem. might want think adding markdown support can done using redcarpet . then try friendly_id seo friendly urls.

environment variables - Executing things on console2 startup -

i using console2 , trying execute few simple things when fire console2 like set path=%path%;c:\mypgm\git\bin how can such things. , on side there somewhere can find example of nice configs of console2 the version working 2.00.148 first, create batch file (*.bat) name ("shell.bat") , add lines executed on start of console.. additionally have add "cmd" (or "bash") command @ end of file open command shell...the file that @echo off set path=%path%;c:\mypgm\git\bin cmd then run console2 ..from main menu > edit > settings > "console" node .. , press ".." button beside "shell" field ,select "*.bat" file type select file created earlier or write down path file..(you can set working directory in "startup dir")...save , restart that's !! enjoy !!

c - A legal array assignment. Is it possible? -

after reading chapter structures in k&r book decided make tests understand them better, wrote piece of code: #include <stdio.h> #include <string.h> struct test func(char *c); struct test { int ; int j ; char x[20]; }; main(void) { char c[20]; struct {int ; int j ; char x[20];} = {5 , 7 , "somestring"} , b; c = func("another string").x; printf("%s\n" , c); } struct test func(char *c) { struct test temp; strcpy(temp.x , c); return temp; } my question is: why c = func("another string").x; working (i know it's illegal, why working)? @ first wrote using strcpy() (because seemed logical thing do) kept having error: structest.c: in function ‘main’: structest.c:16:2: error: invalid use of non-lvalue array char c[20]; ... c = func("another string").x; this not valid c code. not in c89, not in c99, not in c11. apparently compiles latest gcc

python - IPython Notebook with ScipySuperpack: missing markupsafe dependency -

on mac osx 10.8.4. installed ipython via scipysuperpack. seemed install fine. to launch told input ipython notebook --pylab=inline in command line. however following error traceback (most recent call last): file "/usr/local/bin/ipython", line 8, in <module> load_entry_point('ipython==1.0.0-dev', 'console_scripts', 'ipython')() file "/library/python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/ipython/__init__.py", line 118, in start_ipython return launch_new_instance(argv=argv, **kwargs) file "/library/python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/ipython/config/application.py", line 538, in launch_instance app.initialize(argv) file "<string>", line 2, in initialize file "/library/python/2.7/site-packages/ipython-1.0.0_dev-py2.7.egg/ipython/config/application.py", line 89, in catch_config_error return method(app, *args, **kwargs) file "/library/pytho

.net - Sequence Contains No Matching Elements Entity Seed Error -

previously had entity database working. deleted it, out of haste, went run program again (thinking should recreate , repopulate db did before). however, time got weird error: system.invalidoperationexception: sequence contains no matching element on line of code in "sampledata.cs" file (location seed data comes from): 52: new list<card> any idea happening here? app start method: protected void application_start() { system.data.entity.database.setinitializer(new gostopprimer.models.sampledata()); bundleconfig.registerbundles(bundletable.bundles); arearegistration.registerallareas(); registerglobalfilters(globalfilters.filters); registerroutes(routetable.routes); } gostopentities.cs public class gostopentities : dbcontext { public dbset<card> cards { get; set; } public dbset<cardtype> cardtypes { get; set; } public dbset<month> months { get; set; }

java - MenuShortcut KeyEvent not working -

the code below testable class should print out text when control+a has been pushed on keyboard, , display image in system tray. dependent on system tray being supported operating system. my issue text not being printed out when push control+a, printed when press item in system tray. /** * * @author tyluur * @since aug 23, 2013 */ public class testable { public static void main(string... args) { registertrayitems(); } private static void registertrayitems() { if (systemtray.issupported()) { systemtray tray = systemtray.getsystemtray(); trayicon icon = null; menushortcut shortcut = new menushortcut(keyevent.vk_a); menuitem menuitem = new menuitem("toggle", shortcut); menuitem.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e) { system.err.println("the action has been called!"); } }); popupmenu pop

git - github: can no longer commit changes -

i had working on month , of sudden can no longer commit changes. i use netbeans ide , when commit changes, in popup see message:'no files available commit.' when try push remote, select git repository location (same usual) when click on next select local branch, there's nothing showing. has encounter problem ? you may have switched branches, not created new 'local branch' remote branch.. netbeans not know commit to. also, there no local branche, can not push local remote. had problem netbeans before, after few branche switches. try switch correct branche (even if have 1 branche).

javascript - Add checkboxes next to google visualization barchart? -

is possible add checkboxes next google visualization barchart has own events? not want checkboxes hide/show data, attached custom event handler. you can add checkboxes html , hook whatever events want them, there no way add them chart itself.

php - Is it possible to save SESSION variable after a certain time passes? -

i want save session variable's content in database in 5 minutes after content saved in variable. how can ? there way avoid cron ? you save data in table/file/whatever time stamp - say, you'd need cron or equivalent - action can't performed on web page , session data 5 minutes later. unless stay on page , ajax request or that.

java - deploy war file on Tomcat and run without project name -

this question has answer here: deploy war on tomcat without war name in url 4 answers i 've created war file of web project (jsp/servlets). project name: testapp when deply in tomcat 7, run itlike that: localhost:8080/testapp/ or www.maypage.com/testapp/ ok, works, need run without project name, that: localhost:8080 , on hosting www.maypage.com how can that? thank you. and i'm fining jsp/servlet hosting, have configuration option. know hosting that? in order access application without using application name, need deploy root application. there multiple ways achieve , related answer describes pretty well. setting default application in tomcat 7 content copied above link: first method: first shutdown tomcat [from bin directory (sh shutdown.sh)] must delete content of tomcat webapps folder (rm -fr *) rename war file r

Pass variable to function in jquery AJAX success callback -

i trying preload images jquery ajax call, having real problems passing (url) string function within success function of ajax call (if makes sense). here code stands: //preloader images on gallery pages window.onload = function() { settimeout(function() { var urls = ["./img/party/"]; //just 1 started ( var = 0; < urls.length; i++ ) { $.ajax({ url: urls[i], success: function(data,url) { $(data).find("a:contains(.jpg)").each(function(url) { new image().src = url + $(this).attr("href"); }); } }); }; }, 1000); }; one can see (failed) attempt @ passing url through .each() call - url ends takes value of increasing integers. not sure why or these relate to, maybe number of jpg files? ...anyway, should of course take single value in original url

How do I stop a Supervisord process without killing the program it's controlling? -

i using supervisord continually run indexing programs. each time indexer run, grabs set of documents, indexes them, ends. supervisord process spawn of same indexer program, , indexer grab new set of documents index. sometimes need stop supervisord process running these indexer programs. when do, however, kills indexer program in middle of work. what i'd stop supervisord process indexer program running execute completion, supervisord process not spawn indexer. here supervisord.conf settings process: ; triggering indexers ; [program:indexer] command=php /data/app/index_company.php process_name=%(program_name)s_%(process_num)d redirect_stderr=true stdout_capture_maxbytes=10mb stdout_logfile_backups=0 numprocs=5 startsecs=0 autostart=false autorestart=true [group:indexers] programs=indexer supervisord emit sigterm signal when stop requested. child can catch , process signal (the stopsignal configuration can change signal sent). since you're using php,

html - How to make div bigger as it spins (CSS3 Animation) -

i spin div when hover on , spin want make bigger zoom in. so far have this: [html] div class="mymsg"> <p id="welly" style="color: #009">welcome y3!<br><br><br>thanks stopping by!</p> </div> [css] .mymsg { background: white; width: 800px; height : 500px; margin: 100px auto; border: 1px solid black; opactiy: 0.5; -webkit-transform: rotate(360deg); /* safari , chrome */ -webkit-transform: scale(.1,.1) skew(45deg) translatex(-300px); box-shadow: 0px 0px 200px grey; } .mymsg:hover { opacity: 1; -webkit-transform: rotate(360deg); /* safari , chrome */ -webkit-transform: scale(1,.1 skew(0deg); box-shadow: 0px 0px 200px grey; } so want spin before scaling regular size any appreciated first, show can done . now that's out of way, let's down nitty gritty , show how it. first, you'll want use animation animate properties , rotation effect. sadly, transition won't e

How to write QFile in Blackberry 10 device? -

i new in blackberry 10, want create file in device document. does knows how same? thanks in advance. you can access device's documents folder using "/accounts/1000/shared/documents" path. need access_shared permission access shared folders. can find more information bb10 file system here . following sample code shows how write file using qfile. qfile textfile("/accounts/1000/shared/documents/newfile.txt"); textfile.open(qiodevice::writeonly | qiodevice::text); qtextstream out(&textfile); out << "this text file\n"; textfile.close();

xslt - how to read id's and connect it with name's -

my xml: <workingtime> <fromtime>08:00</fromtime> <totime>11:00</totime> <name>izpit matematika</name> <owner>marko lackovic</owner> <category> <school professor="111" room="1" subject="882" /> </category> </workingtime> <professors> <professor email="xxx" id="111" code="string">name 1</professor> <professor email="xxx" id="222" code="string">name 2</professor> <professor email="xxx" id="333" code="string">name 3</professor> </professors> <rooms> <room id="1">ia-301</room> <room id="2">a-302</room> <room id="3">a-303</room> <room id="4">a-304</room> <room id="5">a-305

storyboard - wpf ObjectAnimationUsingKeyFrames setting the left value -

in wpf, i'm trying move image left center, pause second, move image right. i'm trying achieve using objectanimationusingkeyframes. <beginstoryboard> <storyboard storyboard.targetname="roundnumbertext" > <objectanimationusingkeyframes duration="0:0:1" storyboard.targetproperty="left"> <discreteobjectkeyframe value="400" keytime="0:0:0.5"/> <discreteobjectkeyframe value="1400" keytime="0:0:1.5"/> </objectanimationusingkeyframes> </storyboard> </beginstoryboard> somehow got error message on targetproperty object not supported properties. i've tried margin well, still giving error. appreciate if help. to set value alignment, need this: <objectanimationusingkeyframes storyboard.targetname="myimage" storyboard.targetproperty="horizontalalignment"> <di

winforms - Limiting Network Bandwidth Programmatically using C# -

i'm developing application in c# find number of users accessing router (this part done) no.of users need split total n/w bandwidth among each users locally such that userbandwidth = (overallallbandwidth / numberofcurrentusers) now need methodology limit bandwidth per no.of users in c# win form i referred these links http://www.codeproject.com/kb/ip/bandwidth_throttling.aspx but these helps limit on application. my requirement such apply limitation nic itself. for eg: my n/w b/w 1mbps 2 users using in n/w then code should limit 500kbps each users through app locally.

jquery - .submit() open two tabs instead of one -

("#preview").click(function() { $("form").attr({action: "preview.php", target: "_blank"}).submit(); }); when click on <input type="button" id="preview" /> want submit preview other page. thing is, working jquery open 2 times same tab. thank help you try: $("#preview").click(function(e) { e.stoppropagation(); $("form").attr({action: "preview.php", target: "_blank"}).submit(); }); edit: i mean: $("#preview").click(function(e) { $("form").attr({action: "preview.php", target: "_blank"}).submit(); }); $("form").submit(function(e){ e.stoppropagation(); });

javascript - How can I match reference-style markdown links? -

i interested in using javascript find reference-style markdown links in string of text. want following: [all things][things] => "things" [something] => "something" but not: [o hai](http://example.com) [o hai] (http://example.com) in other words, open square bracket followed close square bracket, capturing text inside, not same followed set of parentheses. make sense? thanks! for example: /(?:\[[\w\s]*\])?(\[[\w\s]*\])(?!\s*\()/ ^--------------^ - possibly first [...], ?: - non-capturing group ^-----------^ - followed [...] ^-------^ - not followed " (" - spaces + ( > [all things][things]".match(/(?:\[[\w\s]*\])?(\[[\w\s]*\])(?!\s*\()/)[1] "[things]" > "[something]".match(/(?:\[[\w\s]*\])?(\[[\w\s]*\])(?!\s*\()/)[1] "[something]" > "[o hai](http://example.com)".match(/(?:\[[\w\s]*\])?(\[[\w\s]*\])(?!\s*\()/) null >

php - How to remove save username and password in composer (laravel 4) -

i have updated laravel vendor using composer. have bought package located in github private repo. on downloading composer ask username , password, have entered wrong password gives me error. after run composer update again time keep old wrong password did not ask me enter password again, save in composer cache. how remove old password in composer? in ~/.composer , you'll have file named config.json contains oauth token used log in github. clear oauth token or delete file.

php - If MULTIPLE is enabled for <SELECT>, how is searching based on that field affected? -

in question in unexpected entry in <select> field! how did happen? , had asked unexpected 01,05 entry in field stored values <form><select> . input did not have multiple enabled , should have had default of single select. yet allowed user make multiple selections. have realized in current scenario, there several users need select more 1 option. faced question. what if, need query database values in same field? multiple entries stored in field screw results? let <select> asked user select between 01 , 04. expectation field store either 01, or 02, or 03, or 04 , might query table return rows contained '02'. what if 1 of users has made multiple selections - 02 , 04. in database there entry 02,04 in field. if query 02 (or 04 matter), 02,04 entry in result along ones contained '02' in column? what conditions under face select query did not return rows need? you can use mysql in clause check whether value found inside list of

html - how to create rectangular that had gradient left to right -

i'm noob in css3 , want create 1 div had gradient left right. i want gradient start white black , don't know how create it? please guide me it. go here http://www.colorzilla.com/gradient-editor/ , play available gradients selecting different filters, rgb values. start.

java - My Jar application(myapplication.jar + Mysql connector) doesnt work on other computer -

guy developt simple gui application access mysql database program, created jar file, everthings works great on computer , application access database greatly, problem when run myapplication.jar on others computers, gui (application) showed can't access database. my questions are: did have copy "c:\program files\mysql\mysql server 6.0\data\mydatabase\" files inside applications folder ? i've create manifest file link myapplication.jar mysql-connector-java-5.1.17.jar , plus put mysql-connector-java-5.1.17.jar in same folder, seem application can't access database on others computers . the first thing need know how mysql works. client , server, local in case. when bring application other computer, you'll want install mysql server on machine , set same tables , data(via mysql backup , restore). i become more acquainted intermediate java programming , other databases such db4) before creating business-critical applications.

Resize Images in php -

i having problem in resizing pictures. show uploaded images have saved path in database table , code show images is: $result = mysql_query("select * photos"); while($row = mysql_fetch_array($result)) { $name = 'name'; echo '<div id="imagelist">'; echo '<p ><img src="timthumb.php?src="' .$row['location']. '"&w=100&h=80"/></p>'; echo '</div>'; echo '<div id="imagelist">'; echo '<p>' .$row['id']. '</p>'; echo " "; echo '<p><b>location:</b>' .$row['location']. '</p>'; echo '<p><b>file name:</b>' .$row['name']. '</p>'; echo '<p><b>id:</b>' .$row

css - Javascript setTimeout(); for ProgressBar doesn't work -

on website have progressbar , when click download button, progressbar starts. way want progress bit slowly, thought use settimeout(); . http://jsfiddle.net/phxsy/9/ if @ jsfiddle, when click download button happens. i've tested on firefox , console tells me referenceerror: starttime not defined . how fix this? you have errors in fiddle shared onclick="starttime(i);" should onclick="starttime(0)" the line document.getelementbyid("movingbar").style.width = + "%"; should be document.getelementbyid("prog").style.width = + "%"; as div name prog instead of movingbar working fiddle

cordova - Can you build phonegap project without using build.phonegap.com -

i'm new phonegap , it's not clear me whether able build phonegap project on multiple platforms without using build.phonegap.com site limited on number of private apps. i want target apps android , ios, should both, free , commercial, dont want forced publish them opensource on github can have 1 private app on free plan , other apps has opensource. yes, can go install page , tools build free without having go through build service.

ruby - Remove duplicate text from multiple strings -

i have: a = "this product property b , propery c. buy now!" b = "this product b property x , propery y. buy now!" c = "this product c having no properties. buy now!" i'm looking algorithm can do: > magic(a, b, c) => ['a property b , propery c', 'b property x , propery y', 'c having no properties'] i have find duplicates in 1000+ texts. super performance isn't must, nice. -- update i'm looking sequence of words. if: d = 'this product d text engraving: "buy". buy now!' the first "buy" should not duplicate. i'm guessing have use threshold of n words following eachother in order seen duplicate. def common_prefix_length(*args) first = args.shift (0..first.size).find_index { |i| args.any? { |a| a[i] != first[i] } } end def magic(*args) = common_prefix_length(*args) args = args.map { |a| a[i..-1].reverse } = common_prefix_length(*args) a

WPF Animation of DataGridRow Background color from transparent to "Current" (current is set with Trigger) -

i'm setting datagridrow backgroundcolor green or red trigger based on logerror value. i want animate newly added rows transparency. this works fine: from="transparent" to="red" but want color goes current color set style. not red green well. this not work: from="transparent" to="{templatebinding datagridrow.background}" or from="transparent" to="{binding relativesource={relativesource self}, path=backgound}" code: <datagrid.resources> <style targettype="{x:type datagridrow}"> <setter property = "background" value="limegreen"/> <style.triggers> <datatrigger binding="{binding logmessage}" value="exception has occured"> <setter property = "background" value="red"/> </datatrigger> </style.triggers> </style> </datagrid.resources>