Posts

Showing posts from May, 2014

vb.net - Visual Basic Change maker program -

i'm writing program class , i've been stuck day now. program needs give change user inputted decimal. in 9.41 9 dollars, 1 quarters, 1 dimes, 1 nickel, 1 penny. results aren't correct great thanks! public class tessitorenlab3 private sub btncalculate_click(sender object, e eventargs) handles btncalculate.click dim balance integer dim remainingbalance integer dim txtamount double txtamount = cdbl(txtamount1.text) 'i renamed text box txtamount1... balance = (cint(txtamount / 1)) lstresults.items.add(balance & " dollars") remainingbalance = balance * 100 balance = remainingbalance / 25 lstresults.items.add(balance & " quarters") remainingbalance = balance * 100 balance = remainingbalance / 10 lstresults.items.add(balance & " dimes") remainingbalance = balance * 100 balance = remainingbalance / 5 ...

rewrite - Nginx - Redirect url for certain file type -

i have nginx 1.2.1. want rewrite: http://mywebsite.com/[token].mp4 http://mywebsite.com/get.php?token=[token] return error 404, block: location ~* \.(mp4)$ { rewrite "^/([a-za-z0-9]{23})\$" /get.php?token=$1 break; } i tried this question nothing, returns error 404 according nginx.conf provided here , try below: location ^~ /videos/ { rewrite "^/videos/([a-za-z0-9]{23})\.mp4$" /get.php?token=$1 break; } this should match url: example.com/videos/abc01234567890123456789.mp4 , redirect example.com/get.php?token=abc01234567890123456789 disclaimer: config not tested, may have typos

Javascript trouble when copying element from one array to another. Extra square brackets, extra dimensions? -

starting out with: arraya = [ ["element0"], ["element1"], ["element2"] ]; and arrayb = []; after for-loop: arrayb[i] = arraya.splice(x,1); then arrayb = [ [["element0"]], [["element1"]], [["element2"]] ] any clue why happening? array.splice returns array of removed items. in arraya , each item array, array.splice returns array containing array. example, arraya.splice(0, 1) returns [["element0"]] . if use populate arrayb this, you'll end array in each element array containing single array, have. if use array.splice single element , want element returned, write arraya.splice(0, 1)[0] first element. also, want arraya array of arrays? or want array of strings? if so, arraya = ["element0", "element1", "element2"]; , result of arraya.splice(0, 1) "element0" .

if statement - Better way to check a list for specific elements - python -

i using try/except blocks substitute if/elif has bunch of and s. looking list , replacing elements if has x , x , x, etc. in project, have check upwards of 6 things drew me using try/except .index() throw error if element isn not present. an analogy looks this: colors = ['red', 'blue', 'yellow', 'orange'] try: red_index = colors.index('red') blue_index = colors.index('blue') colors[red_index] = 'pink' colors[blue_index] = 'light blue' except valueerror: pass try: yellow_index = colors.index('yellow') purple_index = colors.index('purple') colors[yellow_index] = 'amarillo' colors[purple_index] = 'lavender' except valueerror: pass so if colors array doesn't contain 'purple' 'yellow' , don't want array change. i bit wary of approach because seems abuse of try/except . shorter alternative because have grab elements...

gps - Android: Get current country offiline -

it easy country when online. possible country phone in right now, without internet connection ? you don't need internet connection use gps. gps information provided satellites in space. how current gps location programmatically in android? to figure out country, use offline reverse geocoder, such https://github.com/areallygoodname/offlinereversegeocode or, shape files of countries , see if gps co-ordinates inside shape. see http://www.gadm.org/ , http://www.naturalearthdata.com/

javascript - Google Charts API: more than one label rows on x axis? -

Image
i have chart bar chart showing multiple data. data divided year (2014, 2015) , quarter (q1,q2,q3,q4). can show either quarters on x-axis or year, not both. made screenshot , put years in there show i'd achieve. <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> </head> <body> <script type="text/javascript"> google.load('visualization', '1.1', {packages: ['bar']}); google.setonloadcallback(drawbasic); function drawbasic() { //create data table object var data = google.visualization.arraytodatatable([ ['','sales', 'expenses'], ['q1',1000, 400], ['q2',1000, 400], ['q3',1170, 460], ['q4',900, 500], ['q1',1400, 420], ['q2',1240, 750], ['q3',1001, 360], ['q4',788, 800] ]); var option...

powershell - Serializing PsObject for Invoke-Command -

i'm looking best or proper way pass psobject remote function invoke-command. convertto-xml serializing there no built-in reverse cmdlet. solutions i've found online content specific. i implemented following functions works few objects tested seems rather hacky. going bite me? there better, yet still simple solution? function get-tmpfilename () {...} function serialize-psobject($obj) { $tmpfile = get-tmpfilename export-clixml -inputobject $obj -path $tmpfile $serializedobj = get-content $tmpfile remove-item $tmpfile $serializedobj } function deserialize-psobject($obj) { $tmpfile = get-tmpfilename $obj > $tmpfile $deserializedobj = import-clixml $tmpfile remove-item $tmpfile $deserializedobj } are aware powershell serializes objects sent through invoke-command ? if reason isn't enough or isn't working you, can use use built-in serialization directly: $clixml = [system.management.automation.psserializer]::...

Python 2.7 error: max() got an unexpected keyword argument 'key' -

x = {1:2, 3:6, 5:4} max(x, key=lambda i: x[i]) python 2.7 error: max() got unexpected keyword argument 'key' python throws similar error message when use min(). how can solve problem? thanks!!!

java - What is the rationale for using per-method/field access specification? -

in c++ access specifier field or method based on location under first declared access specification: public: int my_public_variable; private: void secretprivateoperations(); int internal_counter; what design rationale behind java specifying access prepending access specifier each method/field? public int my_public_variable; private void secretprivateoperations(); private int internal_counter; compare: public: t a(); t b(); ... t z(); versus public: t a() { <lots of code> } t b() { <lots of code> } protected: t c() { <more code> } public: t d() { <more code> } if "factor out" access specifiers this, things can pretty nasty pretty quickly. yes, indentation helps. yes, have ctrl-f. there still can lot of noise through (multi-thousand line files, example), , having take mind off of task kind of thing wouldn't productivity. java , c++ java...

Delete Element from Array Using For Loop + If Statement - C# -

i have array, temparray[] = {1,3,-1,5,7,-1,4,10,9,-1} i want remove every single -1 array , copy remaining arrays new array called original, should output numbers 1,3,5,7,4,10,9 i can use if statement within loop! this have far, keep getting error message, system.indexoutofrangeexception (int = 0; < temparray.length; i++) { if (temparray[i] != -1) { //error occurs @ line //my attempt set new array, original[i] equal temparray[i] values not -1. temparray[i] = original[i]; } } if can use if statement in loop. looks school project. first count how many non negative numbers there in array. create new array length , fill array. int[] temparray = new int[] {1,3,-1,5,7,-1,4,10,9,-1}; int[] original ; int countnonnegative=0; (int = 0; < temparray.length; i++) { if (temparray[i] != -1) { countnonnegative++; } ...

php - Saving a remote image from facebook graph api -

any idea what's wrong? end 1bytes files , wrong. using intervention image & php. tried many ways nothing... if want display works can't save picture... $avatar_url = 'http://graph.facebook.com/' . $id . '/picture?type=square&width=140&height=140&redirect=false'; $avatar_pic_url = json_decode(file_get_contents($avatar_url), true)['data']['url']; dd($avatar_pic_url); $avatar = image::make($avatar_pic_url); $extension = 'jpg'; // save $destinationpath = 'uploads/avatars/'; $filename = uniqid(). '.' . $extension; $path_to_temp_image = $avatar->dirname . '/' . $avatar->filename; $key = $destinationpath . $filename; // upload avatar remo...

php - String to symbols and numbers -

this question has answer here: how mathematically evaluate string “2-1” produce “1”? 7 answers is there way turn addition, subtraction, multiplication, , division symbols in string actual addition, subtraction, multiplication, , division symbols, along numbers inside string actual numbers? so, instead of symbols acting part of string, act outside of string, , same thing numbers. there function this? $string = "1+1-1*1/1"; needed result: $result = 1+1-1*1/1 = 1; assuming you're outputting browser, ÷ &#247; × &#215; and hope you're able figure out add , subtract on own :p $result = "1 + 1 - 1 &#215; 1 &#247; 1 = 1";

mysql - How to do multiple joins and access table from outer query from subquery -

select * items join item_types on it.itemnumber = ( select itemnumber item_types it2 join item_index_info iii on it2.itemnumber=iii.parent , it2.`type` ='electronics' , it2.`value`='televisions' , iii.child=i.itemnumber order iii.`index` limit 1); so tables have following structure: 1.items has columns: itemnumber, availability, quantity, parent 2.item_types has columns: id, itemnumber, type, value 3.item_index_info has columns: parent, child, index (in table parent can child item well) using above query fetch items of type easy find tricky part item_type might not associated each , every child lets child might not have entry in item_index_column parent might (that why have second query have limit 1 beacuse unfortunately child might have parents @ multiple levels i.e. indexes have find first parent (lowest index) has entry in item_types table) please let me know if missing information. p.s. in above query error saying i.itemnumber unknown colu...

html - Bootstrap - Text flows out container -

Image
i'm building site bootstrap. @ 1 special page have strange problem: when opening page in big screen seems correct. if open small display text flows out of container. buttons (link buttons) have same problem. the html code is: <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- die 3 meta-tags oben *müssen* zuerst im head stehen; jeglicher sonstiger head-inhalt muss *nach* diesen tags kommen --> <title>Österweb</title> <!-- ubuntu font aus der google fonts api --> <link href='https://fonts.googleapis.com/css?family=ubuntu' rel='stylesheet' type='text/css'> <!-- bootstrap --> <link href="css/bootstrap_mainindex.css" rel="stylesheet"> ...

jquery - Right menu (Navbar-right) misaligned on first load on IE8 using Bootstrap V 3.0.0 -

i have mvc4 website run on ie 8. creating navigation headers bootstrap nav controls. find right menu items getting misaligned on first time rendering, if hit f5, alignment proper again. tried debug using f12 debugger , fiddler see if scripts , css files getting rendered, render well. what possibly reason getting misaligned @ first shot , how re-aligning on refresh? <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar">...

android - Using OkHttp library for posting to a PHP script that saves to MySQL -

i writing code registers new user server. in order so, implemented post request using okhttp library. public class registrationmanager { private final string tag_register = registrationmanager.class.getsimplename(); private okhttpclient client = new okhttpclient(); private final string registrationurl = url.getinstance().geturlregister(); public void registeruser(final user newuser) { requestbody body = new formencodingbuilder() .add("email", newuser.getemail()) .add("name", newuser.getname()) .add("password", newuser.getpassword()) .add("birthday", newuser.getbirthday()) .build(); request request = new request.builder().url(registrationurl).post(body).build(); call call = client.newcall(request); call.enqueue(new callback() { @override public void onfailure(request request, ioexception...

SignalR is slow to connect from javascript client -

it takes second or more connect signalr server browser - when running locally. thought websockets supposd fast! there configuration option tell signalr js client wait until page load event complete before sending anything. just set waitforpageload: false in startup options prevent happening. of course must make sure in callback can executed safely if page isn't loaded. anything youtube video not loading can delay start - i'm not sure why isn't better/more documented! $.connection.hub.start({ waitforpageload: false}).done(function() { }); excerpt source code (which how discovered this): // check see if start being called prior page load // if waitforpageload true want re-direct function call window load event if (!_pageloaded && config.waitforpageload === true) { connection._.deferredstarthandler = function () { connection.start(options, callback); }; _pagewindow.b...

c# - Need to use IEnumerable.except to compare two dimensional dice roll -

i working on homework assignment c# class , have been going crazy last 2 days trying figure out how put random dice rolls (two dice) 2 dimensional collection or array , compare them using ienumerable.except in order show roll combinations occurred in first set of rolls didn't occur in second set of rolls. here entire code includes commented out attempts have made using nested lists, multidimensional arrays, , dictionary. starting go crazy or advice appreciated. here code: namespace newdicesimulation { public partial class form1 : form { list<dicerolllist> rolllist1 = new list<dicerolllist>(); list<dicerolllist> rolllist2 = new list<dicerolllist>(); list<int> sumlist1 = new list<int>(); list<int> sumlist2 = new list<int>(); public form1() { initializecomponent(); } private void diceroll() { //clear list new roll listview1.items.clear(); //setup random ...

java - Changing the application Context from root to myApp -

i working on java wen application deployed @ root in tomcat's /webapp/root directory. while running tomcat eclipse tomcat provided context path /myapp when click on link or button creates request context path not added link. please share thoughts how can add new context path every request @ once.

asp.net - Gridview rowcommand event not firing in dynamically added usercontrol -

i have usercontrol gridview , rowcommand event. usercontrol added dynamically using loadcontrol on button click of page. gridview's rowcommand doesn't fire. here code loads usercontrol on button click: protected sub btnsearch_click(byval sender object, byval e eventargs) handles btnsearch.click '<uctitle:searchlist id="ucsearchlist" runat="server" visible="false" /> dim ucsearchlist titlesearchlist = loadcontrol("~/controls/titlesearchlist.ascx") ucsearchlist.isbn = txtsearchisbn.text ucsearchlist.loadtitlesearchlist() pnlsearchresults.controls.add(ucsearchlist) end sub and here code in usercontrol public class titlesearchlist inherits system.web.ui.usercontrol public property isbn string protected sub page_load(byval sender object, byval e system.eventargs) handles me.load if not ispostback loadtitlesearchlist() end if end sub public sub loadtitlesearchlist() dim _i...

java - Include Maven Project into NON-MAVEN Dynamic Web Application -

i've included maven based project application, added deployment assembly shows .jar file gets copied web-inf/lib/importedproject.jar . problem occurs when imported lib wants reference lib using which, apparently, not included inside importedproject.jar . example: importedproject pom.xml has: <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>1.7.12</version> </dependency> when add importedproject.jar non-maven project , run it, exception: threw exception [servlet execution threw exception] root cause java.lang.classnotfoundexception: org.slf4j.loggerfactory my question is: how add both maven project and dependencies? maven dependency plugin helps required project library it's dependencies. so, if add pom based project on non-pom based project, execute mvn dependency:copy-dependencies command , have dependencies on target/dependencie...

html5 - CSS layout bug with buttons and empty content -

i've got layout bug snippet below in ie11, chrome, firefox - second button not correctly inline first button. the problem goes away add non-whitespace content inner span on second button. is there css fix bring buttons inline without requiring actual content, ideally without changing rest of css? <!doctype html> <html> <head> <title>css problem</title> <meta charset="utf-8"/> <style> .mainborder { padding: 20px; background-color: #254669 } button { font-family: verdana; font-size: 13px; color: white; position: relative; padding: 0 8px 1px 8px; height: 24px; background-color: #254669; border: 1px solid #53779d; transition: 150ms ease-out; outline: none; } button:disabled { opacity: 0.65; } button:enabled { cursor: pointer; } button:hover:enabled { background-color: #53779d; } button:active:enabled > span.content { di...

How identityserver3 token can be protected -

could please me clarify token related questions? i have implemented https way through, question when token granted can see under chrome developer tool , redirection url, means if hacked computer can use too? have checked fiddler , can't see token there. the web api has cors implemented, works fine in browsers origins not listed requests denied. problem retrieved access token chrome, used fiddler compose request , worked fine, got around cors check , returned results, expected have request denied. thanks in advance! yes cors applies browsers , ajax requests

android send https post request to the server without deprecated metods -

in app used send request https following this source answer . of them apache methods deprecated. can me in order solve in new approach? to avoid using deprecated methods in api connectivity, think using retrofit . it's third party library makes http communication simpler. when using retrofit, can create interface of api endpoint , use method. rest of http request managed library. here link retrofit github homepage: http://square.github.io/retrofit/

c# - NoLock in Entity Framework -

i trying read records table when table locked due particular transaction. i using below code public async task<keyvaluepair<string, list<om_category>>> categorylist(om_category obj) { try { using (var transaction = new transactionscope( transactionscopeoption.required, new transactionoptions { isolationlevel = isolationlevel.readuncommitted }, transactionscopeasyncflowoption.enabled)) { using (var categorycontext = new modelgeneration()) { categorycontext.configuration.proxycreationenabled = false; var data = await categorycontext .tblcategory .tolistasync(); transaction.complete(); return new keyvaluepair<string, list<om_category>>("", data); } } } catch (...

php - PHPChart how to export to pdf,and image? -

i'm using phpchart creating charts, want have option exporting charts pdf , images. bellow code: <link rel="stylesheet" type="text/css" href="/phpchart_enterprise/js/src/jquery.jqplot.css" /> <!--<link rel="stylesheet" type="text/css" href="/phpchart_enterprise/examples/examples.css" />--> <!--[if lt ie 7]> <script type="text/javascript" src="../../flot/excanvas.js"></script> <![endif]--> <!--[if lt ie 7]> <script type="text/javascript" src="../../explorercanvas/excanvas.js"></script> <![endif]--> <!--[if lt ie 9]> <script type="text/javascript" src="/phpchart_enterprise/js/src/excanvas.js"></script> <![endif]--> <!--[if lt ie 7]> <script type="text/javascript" src="../../flashcanvas/src/flashcanvas.js"></script> <![endif]-->...

c# - Code-First Migration Process: What part am I missing? -

my steps: 1) create database in ssms query /* execute in sql server management studio prior building data model(s) */ create database snakedb; go use snakedb; /* create table of scores of games played. every game have score recorded, there corresponding name if user enters 1 */ create table scores ( id int identity(1,1) not null primary key, score int not null, name varchar (50) ); /* create table of text logs of games played. these reviewed sniff out cheating. */ create table gamelogs ( id int identity(1,1) not null primary key, scoreid int not null foreign key references scores(id) on delete cascade on update cascade, logtext varchar (8000) ); /* table of unique ip addresses have visited site. 4 decimal numbers separated dots compose each ip address, e.g. 172, 16, 254 , 1 in 172.16.254.1, correspond 4 columns b...

Spring Security antMachers -

i using spring security 3.2.0.release. want redirect user url if not permitted see page, how can this? .antmatchers("/cabinet/control/members/*").hasrole("owner").redirectto(..) you have define access denied handler/page, see spring security reference : if accessdeniedexception thrown , user has been authenticated, means operation has been attempted don’t have enough permissions. in case, exceptiontranslationfilter invoke second strategy, accessdeniedhandler . default, accessdeniedhandlerimpl used, sends 403 (forbidden) response client. alternatively can configure instance explicitly (as in above example) , set error page url forwards request [ 13 ]. can simple "access denied" page, such jsp, or more complex handler such mvc controller. , of course, can implement interface , use own implementation. example: @override protected void configure(final httpsecurity http) throws exception { http .authorizerequests() ...

python tornado AsyncHTTPClient fetching request working once in thread -

the following code: import sys import os import imp import time import csv import json import uuid import threading import urllib tornado.web import staticfilehandler tornado.httpclient import asynchttpclient nitro.ioloop import ioloop io_loop = ioloop() data_server_host = "192.168.0.148" class alertsrun(object) : def __init__(self, config) : self._data_server_port = config.data_server_port #print self._data_server_port (8080) self._terra_base_url = "http://%s:%s" % (data_server_host, self._data_server_port) #print self._terra_base_url self._http_client = asynchttpclient() def alerts_thread(self): self.call_alert_url() print "stackoverflow" threading.timer(60, self.alerts_thread).start() def handle_response (self,api_response) : print api_response data = api_response.body print data def call_alert_url(self) : try : opt...

ssh - Start a Perl script remotely over LAN or WiFi -

scenario laptop a: have perl script automates ftp/upload download. let me call ftp_script.pl . run script , rest. system b: now, @ different location. want trigger perl script(ftp_script.pl) remotely laptop b(from home) only using perl script . want know what possible ways trigger perl script using perl script ? requirements: i want start perl script (say ftp_script.pl) sitting home remote system (located in office) public ip know. i want start perl script (say ftp_script.pl) 1 laptop other connected on lan via hub . is possible achieve? ps: don't know perl scripting. we need have mechanism @ remote host can pick requested connection on specified port, , handle debugger interaction command line can use netcat reduce dependencies on external programs, , give better idea happening behind scenes, can use following program #!/usr/bin/perl -w use strict; use getopt::long; use io::socket; use term::readline; use constant bignum => 65536; our $previous_...

c# - Unsigned Integer Literal Having Negative Sign -

today came cross strange behaviour, explain why happens? var x = -1u; // when using -1ul complains though. console.writeline(x.gettype().name); console.writeline(x); output: int64 -1 msdn says: if literal suffixed u or u, has first of these types in value can represented: uint, ulong. https://msdn.microsoft.com/en-us/library/aa664674%28v=vs.71%29.aspx your confusion stems interpreting number -1 , followed suffix u . it's negation - of number 1u . number 1u has type uint , indicated quote in question. negating uint produces long .

MySQL Syntax Query for Combining columns in one -

please. me. how combine records of multiple columns in 1 new column ? in table have 3 columns named pio1, pio2 , pio3. want combine records of 3 columns in 1 column. this column [1]: http://i.stack.imgur.com/jonh4.png , output want show [2]: http://i.stack.imgur.com/akumb.png try this alter table <tablename> add combocolumn varchar(3000); update <tablename> set combocolumn = concat (po1,po2,po3); this assumes "combine" means concatenate without adding separator, , 3000 characters enough.

angularjs - Two way databinding does not work in <ion-content> -

two way databinding not woking in <ion-content> . not able updated value of $scope variable ("searchkeyword" in case). if put html outside <ion-conent> works. confused behavior.below code works, <ion-view view-title="search" > <div class="bar bar-header item-input-inset" style="height:52px;"> <label class="item-input-wrapper"> <i class="icon ion-ios-search placeholder-icon"></i> <input type="search" placeholder="search" ng-model="searchkeyword" ng-keyup="$event.keycode == 13 ? search() : null"> </label> <button class="button button-clear" ng-click="search()"> search </button> </div> <ion-content scroll="true" style="margin-top:50px;" > </ion-content> </ion-view> but below not :( <ion-view view-title=...

markerclusterer - Marker Clusterer in DevExtreme Mobile -

i'm developing application in devextreme mobile. in application, use dxmap in application. how can use marker clusterer structure in devextreme mobile app? you can use google maps marker clusterer api create , manage per-zoom-level clusters large number of devextreme dxmap markers. here example:   dxmap marker clusterer this example based on approach described in google too many markers! article here sample code: $("#dxmap").dxmap({ zoom: 3, width: "100%", height: 800, onready: function (s) { var map = s.originalmap; var markers = []; (var = 0; < 100; i++) { var dataphoto = data.photos[i]; var latlng = new google.maps.latlng(dataphoto.latitude, dataphoto.longitude); var marker = new google.maps.marker({ position: latlng }); markers.push(marker); } var markercluster = new markerclusterer(map, markers); }...

css - bootstrap navigation not working -

this code navbar works desktop when go responsive menu links does't work . click on menu , nothing happen please help. <header class="header"> <div class="header-nav"> <nav role="navigation" class="navbar navbar-default navbar-fixed-top navbar-slide show-menu" style="background-color:#7c3a1c;"> <div class="container"> <div class="navbar-header"> <button aria-controls="navbar" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a id="header-logo" href="index.php" class...

javascript - How can i scroll menu to current item in menu? -

i have menu contains 11 elements. 3 of displayed. there buttons slider, helps scrolling menu. on site give special class element, when href == url of page(highlighting of current element). need move current element in first left position of menu on window load, menu list must scrolled, when page loading, , current element stays in first left place regardless position in list. that's code: function slider() { $('#menu > ul > li').first().css('left', '300px').appendto('#menu > ul').animate({ "left": "-=300px" }, 200); } function slidel() { $('#menu > ul > li').last().animate({ "left": "+=300px" }, 200, function() { $(this).prependto('#menu > ul').css('left', '0px'); }); } $('.arrow-right').click(function() { slider(); }); $('.arrow-left').click(function() { slidel(); }); * { padding: 0;...

sql server - SQL Management Studio - Turn on line numbers -

Image
sometimes have tables lots of fields, , handy in case have line numbers, while in table design mode. i have manually added numbers in red (left side) . is possible in sql server 2012?

Sort multidimensional and Associative array by a deply nested array PHP -

i have multidimensional array fetch database , it's structured this: array(session array(items array(databaseid (itemname, itemcategory, children, array(id1, id2, id3...) etc..)))) i not sure how write since i'm beginner hope struture. if want acess itemcategory of item, save item's databaseid in $databaseid , write: $_session['items'][$databaseid]['itemcategory']; if want array items children's databaseid write: $_session['items'][$databaseid]['children']; now, want sort array. have looked around don't understand how sort after want. sort whole $_session['items'] according itemname instead of databaseid. @ possible? mean, itemname stored each databaseid... i want use in order print items sorted name instead of databaseid. thanks in advance. edit : ha...

javascript - Stretch and scale font-awesome icon dynamically -

Image
i've seen countless snippets like one , include font "background image": div { width : 100%; height : 200px; margin : 20px; background-color : grey; color : #fff; position : relative; } div:before { position:absolute; font-family: fontawesome; top:0; left:0px; font-size : 100px; content: "\f003"; } jsfiddle result: is there way make font resize dynamically fill 100% size background image, similar of methods used here ? or there way can use background image in responsive page, wouldn't know width/height of container it's going fill? i'm thinking of using transforms: css, can stretch text? in case it's difficult because don't know how have scale it. i thought i'd ask question because maybe there's way it, prior falling plain old background image. additional links didn't (much): font scaling based on width of container css scale element 100% ...