Posts

Showing posts from April, 2012

c# - How to bind static dropdownlist on gridview edit -

Image
i want place static dorpdownlist edititemtemplate of gridview. <edititemtemplate> <%--<asp:textbox id="txtsuppstatus" width="40px" runat="server" text='<%#eval("suppstatus") %>' />--%> <asp:dropdownlist id="ddlsuppstatus" autopostback="true" runat="server" selectedvalue='<%#eval("suppstatus") %>'> <asp:listitem text="yes" value="y"></asp:listitem> <asp:listitem text="no" value="n"></asp:listitem> </asp:dropdownlist> </edititemtemplate> when page load yes or no option show text when user edit row on click on edit show dorpdownlist yes , no option. dropdownlist binding on edit loosing data @ time of edit. i have gone through link facing same problem. rest control getting blank , dropdownlist binding yes , no option. on page load aft

python - Error printing image with Raspberry Pi and OpenCV face detection (imshow function) -

i'm trying build simple surveillance program raspberry pi camera, using opencv face detection. code: # -*- coding: utf-8 -*- picamera.array import pirgbarray picamera import picamera import time import cv2 #setting camera camera = picamera() camera.resolution = (320, 240) camera.framerate = 30 rawcapture = pirgbarray(camera, size=(320, 240)) #basic cascade classifier face_cascade = cv2.cascadeclassifier('haarcascade_frontalface_default.xml') #0.1 sec warmup time.sleep(0.1) # capture frames camera frame in camera.capture_continuous(rawcapture, format="bgr", use_video_port=true): image = frame.array gray = cv2.cvtcolor(image, cv2.color_bgr2gray) faces = face_cascade.detectmultiscale(gray, 1.3, 5) #rectangle loop for(x, y, w, h) in faces: image = cv2.rectangle(image,(x, y), (x+w, y+h), (255, 0, 0), 2) # show frame [here comes problem] cv2.imshow("frame", image) # cv2.imshow("gray", gray

c# - RhinoMocks stubs with simplified implementation, Try-method pattern -

i want mock quite huge repository rhinomocks, purpose of implementing huge , changing interface, instead of using visualstudio's "implement interface" default implementation (which requires mocks updated interface change , causes lot of junk code). i use stubs, haven't found out how override mocked default methods, except defining every possible input value. bad when using bool tryget(key, out value) pattern , when need default behaviour besides, if key not found (here: return false/null, in other cases: throw exception). is there way implement method forwarding in rhinomocks? public interface imyrepository { // implemented database access bool trygetnamebyid(int id, out string name); // more... } // within other class: public void setupmockrepository() { idictionary<int, string> namesbyids = new dictionary<int, string>() //create , fill mock values var mockrep = new mockrepository() var repstub = mockrep.stub<

mysql - I don't know how to query in SQL -

i have table t1, 2 columns c1 , c2, in these columns there numbers , can repeated. sample: c1 | c2 ------- 10 | 8 11 | 8 12 | 10 10 | 2 11 | 10 14 | 2 i need find number of column c1 has value of 8 , 2 in column c2. in case of sample query should return 10. have explained? can me out? the easiest way be select c1 table_name c2 in (2,8) group c1 having count(*) = 2

acumatica - Attachments Overrides existing while adding from VendorMaint graph -

i importing data , documents third party application acumatica. after importing, creating vendor dynamically using below code along attachments. vendormaint graph = pxgraph.createinstance<vendormaint>(); vendorr row1 = null; row1 = new vendorr(); row1.acctname = vendorname; row1.noteid = noteid; // existing - guid created while importing graph.baccount.update(row1); if attachment exists should update instead of duplicating. in case if vendor exists files attached, code overrides these attachments , remove previous files attached existing vendor. i want add attachment instead of override existing attachment. suggestion? try use insert method of view: vendormaint graph = pxgraph.createinstance<vendormaint>(); var row1 = new vendorr(); row1 = graph.baccount.insert(row1); if (row1 == null) // inserted or wasn't able insert { //some logic newly created vendor } else { //some logic existed } row1.acctname = "vendor name"; ro

ios - Is it possible to set a background for the reachability feature? -

Image
with reachability mean ios feature (a feature makes easier use apps 1 hand, executed double-tapping home button without pressing it): is possible set background instead of black screen? you can't it. when tap button system lowers entire uiwindow of application black background outside sandbox , can't touch it.

algorithm - How to rearrange an array by another array of indexes in c++ -

given array: int data[5] = {data[0],data[1],data[2],data[3],data[4]} …and array indexes: int idx[5] = {3,1,0,2,4} what fastest way rearrange data[5] array, resulting (sorted) array becomes: data[5] = {data[3],data[1],data[0],data[2],data[4]} sort array in pairs based on indexes: comparison , reordering operation in reference array, move corresponding indexes in other array such well.

node.js - AngularJS NodeJS HTTPS requests -

i'm beginner in https & developed express example based on certificate & key : server = https.createserver(https_options, app).listen(port, host); where https_options upmentioned security mechanism. question is: how can authenticate angularjs services/factories when i'm calling expressjs api routes. e.g.: routes.js : app.get('/home', function(req, res) { res.send('welcome') }) angular factory : $http.get('/home').success(function(){}).error(function(){}) a simple example work me :) lot ! here article using both node express , angularjs. this article uses token based authentication. authentication not happen in angular app, happens in node, angular app needs know how communicate node api authenticate users. with token based authentication, in case json web tokens, token sent api on every request. api verify token's authenticity , either grant or deny access user making request.

windows - How can I read a reg_qword in winreg in python 3.4? -

i inserted registry key, hkey_local_machine\software\test\test_qword of type reg_qword , value 20150509091344 ( 0x1253a7efba10 ). i tried load using winreg following code in python 3.4: import winreg key_dir = r"software\test" reg = winreg.openkey(winreg.hkey_local_machine, key_dir, 0, winreg.key_wow64_64key+winreg.key_all_access) test_dir = list(winreg.queryvalueex(reg, r'test_qword'))[0] print(test_dir) ans = "".join(map(lambda b: format(b, "02x"), test_dir)) print(ans) print(int(ans, 16)) and got following console output: b'\x10\xba\xef\xa7s\x12\x00\x00' 10baefa753120000 1205539352207294464 which not original value. how can retrieve original value winreg ? the code wrote interprets value big-endian-stored integer. however, reg_qword stored little-endian number. there's easier way convert bytes value of 64-bit integer: using struct.unpack() . format '<q' read signed 64-bi

Ruby on rails precompiled images not showing -

i got app deployed on site5, .css s , .js s precompiling , images on other side precompiling (the files) not showing on final views. this production env: cmsdevise::application.configure # settings specified here take precedence on in config/application.rb config.relative_url_root = "/~firmaltt" config.assets.precompile = ['*.js', '*.css', '*.css.erb', '*.*'] # code not reloaded between requests config.cache_classes = true # full error reports disabled , caching turned on config.consider_all_requests_local = false config.action_controller.perform_caching = true # disable rails's static asset server (apache or nginx this) config.serve_static_assets = false # compress javascripts , css config.assets.compress = true # don't fallback assets pipeline if precompiled asset missed config.assets.compile = true # generate digests assets urls config.assets.digest = true the file images route

mysql - Calculate difference between 2 epoch times, large table, optimize having 3 indexes -

Image
i have table represents packets traffic capture called packetsbydirection (showing relevant fields): framenumber frametimeepoch flowid direction 288 1430221042.150789000 29 direction 289 1430221042.150922000 29 direction b now, table has around 2 million rows (packets) , need calculate is, each packet, difference of time between him , previous packet with same direction , same flowid i have done this query, plus adding indexes previous table make query faster. select t1.framenumber, flowid, direction, frametimeepoch - ifnull(( select max(frametimeepoch) packetsbydirection flowid = t1.flowid , direction t1.direction , framenumber < t1.framenumber) ,frametimeepoch) timefromlastpacketfromsamedirection packetsbydirection t1 and result framenumber flowid direction

javascript - Jquery fadeOut one by one -

i tried give item_div inside container_div fadeout 1 one. , tried code , fadeout together, can improve or suggestion can that? $(".container_div .item_div").each(function(idx){ $(this).delay(100*idx).fadeout(3000); }); .container_div{ background:#ccc; } .item_div{ background:#454545; color:#fff; margin:5px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <div class="container_div"> <div class="item_div">1</div> <div class="item_div">2</div> <div class="item_div">3</div> </div> try this $(".container_div .item_div").each(function(idx,item){ settimeout(function(){ $(item).fadeout(1000); }, (idx+1)*1000); }); this works fine here fiddle

eclipse - Checkout conflict with files git pull -

yesterday made pull in eclipse team repository , worked perfectly. today have tried pull , following message appears: checkout conflict files: .....(here project , window affected) org.eclipse.jgit.api.errors.chechoutconflictexception one of partners has made changes not @ same time me. how can solve it? you have conflict in file. can solve using kind of merging tool. check tutorial. if "git status" command line conflicting files, update question output better answers.

java - Spring error converting nvarchar to bigint -

i'm getting error whenever try save object. the field causing error string mapped varchar(200) in database. name of field localcontact . here's code: site.java: @entity @table(name = "site", uniqueconstraints = { @uniqueconstraint(columnnames = { "site_country_id", "site_name" }) }) @audited(targetauditmode = relationtargetauditmode.not_audited, withmodifiedflag = true) public class site implements isite { /** constant serialversionuid. */ private static final long serialversionuid = -390717603276436784l; /** id. */ @id @generatedvalue(strategy = generationtype.auto) @column(name = "site_id", unique = true, nullable = false) private long id; /** site address. */ @column(name = "site_address", length = businessconstants.site_address) private string address; /** site analog phone number. */ @column(name = "site_analog_phone_number", length = businessconstants.site_analog_phone_number) private string an

filenames - Java - Getting file name without extension from a folder -

i'm using code absolute path of files inside folder public void addfiles(string filefolder){ arraylist<string> files = new arraylist<string>(); fileop.getfiles(filefolder, files); } but want file name of files (without extension). how can this? this code work of removing extension , printing name of file: public static void main(string[] args) { string path = "c:\\users\\abc\\some"; file folder = new file(path); file[] files = folder.listfiles(); string filename; int lastperiodpos; (int = 0; < files.length; i++) { if (files[i].isfile()) { filename = files[i].getname(); lastperiodpos = filename.lastindexof('.'); if (lastperiodpos > 0) filename = filename.substring(0, lastperiodpos); system.out.println("file name " + filename); } }

xml - xsi:type attribute does not bound to any namespace -

i trying generate xml response xml using style sheet. not able generate desired outcome. seems issue xsi:type attribute. can suggest possible change in style sheet. source xml <soapenv:body> <searchresponse> <platformcore:searchresult xmlns:platformcore="urn:core_2015_1.platform.webservices.netsuite.com"> <platformcore:status issuccess="true"/> <platformcore:totalrecords>17403</platformcore:totalrecords> <platformcore:pagesize>1000</platformcore:pagesize> <platformcore:totalpages>18</platformcore:totalpages> <platformcore:pageindex>1</platformcore:pageindex> <platformcore:searchid>webservices_3479023_sb2_050620156958981381039449122_c4911d7b</platformcore:searchid> <platformcore:searchrowlist> <platformcore:searchrow xsi:type="listacct:itemsearchrow" xmlns:listacct="urn:account

actionscript 3 - Pass parameters to Iframe flex -

i new flex. have used iframe embed html page flex application. here following code embed html file : <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:flexiframe="http://code.google.com/p/flexiframe/"> <flexiframe:iframe id="googleiframe" label="google" source="http://heatmap.html" width="80%" height="80%"/><mx:application> the challenge i'm facing want pass parameter html page (heatmap.html) when loaded iframe. how pass parameters? need write separate function? you can write function on html page , call function in html page using ifarameid.calliframefunction("func_name",parameters...)

Kibana 4 : How to remove saved discover request -

a trivial question can't figure how remove or clean saved requests in discover tab. thank's help. go settings, select objects tab, searches sub-tab, hit checkbox next want remove, , hit delete selected button.

android - Using editText in ListView using ParseQueryAdapter -

i using parse api application.i getting list of items parse , after getting list wanted populate in listview contain following things: productname(textview) productquantity(edittext) after getting list user feed quantity of every product , information loaded in new activity adding information , after submitted server back. familiar lists confused how can use edittext in listview feed quantity of each product. please guide me.thank you.

ios - Removing "Define" from UISearchBar -

i wish remove "define" option menu of uisearchbar have placed in view's nib file. as suggested, subclassed uisearchbar , overrode -(bool)canperformaction:(sel)action withsender:(id)sender return yes cut, copy , paste options. set custom class of uisearchbar subclass created, in nib file. the method indeed called, doesn't work intended. when set breakpoint, , monitor actions called, it's called define: on few occasions (yes, randomly - might come on 1 run, , might not on other). when called define: , , no returned, "define" option turns on menu. is there way can fix this? deployment target app ios 7.

Android: How to change the style of a ViewPager? -

activity_main.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v4.view.pagertabstrip android:id="@+id/pager_header" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:padding="@dimen/abc_action_bar_content_inset_material" /> </android.support.v4.view.viewpager> </linearlayout> i'd apply different style viewpager , pagertabstrip . tried of default styles provided an

php - Laravel Request input() or get() -

with laravel 5 seems method injection request object preferred on using request facade. <?php namespace app\http\controllers; use illuminate\http\request; class homecontroller extends controller { public function index(request $request) { $email = $request->input('email'); // or $email = $request->get('email'); } } a few questions have: is using illuminate\http\request better using illuminate\support\facades\request i have no idea how $request->get() resolving there no function name get() in illuminate\http\request . input() , get() same thing. is method injection better using facades? in controller method request injection functionality preferable, because in methods use form requests (they extending default request class) validation, validate request automatically before entering actual controller method. awesome feature helps create slim , clean controller's code. using default reques

c - Predefined string segfaults when copied to by strncpy() -

why ... char *dst = (char*) malloc(sizeof(char) * 11); char *src = "abcdefghijklmnopqrstuvqxyz"; strncpy(dst, src, 10); ... works fine, ... char *dst = "abcdefghij\0"; char *src = "abcdefghijklmnopqrstuvqxyz\0"; strncpy(dst, src, 10); ... or ... char *dst = "abcdefghij\0"; char *src = "klmnopqrst\0"; strncpy(dst, src, 10); gives segfault ? also, how come works: char *dst = (char*) malloc(sizeof(char) * 10); // works 9 char *src = "abcdefghijklmnopqrstuvqxyz\0"; strncpy(dst, src, 10); copying 11 bytes pointer allocated 10 bytes should in principle fail? the difference string literals initialized pointers dst , src in later cases stored in data segment. data segment portion of virtual address space of program, contains global variables , static variables initialized programmer. this segment can further classified initialized read-only area , initialized read-write area. for instance global s

c# - How to solve hard issue about Cannot deserialize the current (eg {“name”:“value”}) by using newtonsoft json -

the classes: public class trackspotify { public class externalurls { public string spotify { get; set; } } public class image { public int height { get; set; } public string url { get; set; } public int width { get; set; } } public class item { public string album_type { get; set; } public list<string> available_markets { get; set; } public externalurls external_urls { get; set; } public string href { get; set; } public string id { get; set; } public list<image> images { get; set; } public string name { get; set; } public string type { get; set; } public string uri { get; set; } } public class albums { public string href { get; set; } public list<item> items { get; set; } public int limit { get; set; } public string next { get; set; } public int offset { get; set; }

c# - Send image to database using Kendo Ui Upload -

in mvc project , have form gives user possibility upload image kendo ui upload. view: @using kendo.mvc.ui @model developmentnotesproject.models.noteform @{ viewbag.title = "index"; } <script> $(function () { $("form").kendovalidator(); }); function limitupload() { if ($("span.k-filename").html() != "" || $("span.k-filename").html() != "undefined") { $("div.k-dropzone div.k-button.k-upload-button input").attr('disabled', 'disabled'); } } function enableuploadafterremove() { $("div.k-dropzone div.k-button.k-upload-button input").removeattr('disabled'); } function onsuccess(e) { limitupload(); } function onremove(e) { alert("innn"); enableuploadafterremove(); } $(document).ready(function () { }); </script> <style>

c# - AttributedText on MvxTableViewCell -

i'm trying set underline on uilabel of mvxtableviewcell. [register("kittencell")] public class kittencell : mvxtableviewcell { private uiimageview mainimage; private uilabel namelabel; private uilabel pricevaluelabel; private uilabel pricelabel; public static readonly nsstring key = new nsstring ("kittencell"); private mvximageviewloader imageloader; public kittencell () { createlayout (); initializebindings (); } public kittencell(intptr handle) : base(handle) { createlayout (); initializebindings (); } void createlayout () { mainimage = new uiimageview (new rectanglef (0, 0, 160, 100)); namelabel = new uilabel (new rectanglef (168, 15, 144, 21)); namelabel.textalignment = uitextalignment.left; var attrs = new uistringatt

c# - Where to register dependency injection when have multiple projects? -

this question has answer here: ioc/di - why have reference layers/assemblies in entry application? 5 answers i should register di. private static void initialize(containerbuilder builder) { builder.registertype<logger>().as<ilogger>().singleinstance(); //... } and clear me. if have 17 projects in solution. projects related, 1 project web project, projects providers, projects libraries, core project etc. example: in project1, have class_a1 , class should inject class_a2 same project in project2, have class_b1 , class should inject class_b2 same project in project3, have class_c1 , class should inject class_c2 same project ... in project17, have class_k1 , class should inject class_k2 same project of course have complicated scenarios, inject class project3 project14 etc. should registration in every proje

ios - local notification are sent at wrong time -

i want sent 2 local notifications daily @ particular time in ios, but notifications sent @ wrong time , sends multiple times in day , not once, here code snippet, - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // running on ios8? if ([application respondstoselector:@selector(registerusernotificationsettings:)]) { uiusernotificationsettings *settings = [uiusernotificationsettings settingsfortypes:(uiusernotificationtypebadge|uiusernotificationtypealert|uiusernotificationtypesound) categories:nil]; [application registerusernotificationsettings:settings]; } else // ios 7 or earlier { uiremotenotificationtype mytypes = uiremotenotificationtypebadge | uiremotenotificationtypealert | uiremotenotificationtypesound; [application registerforremotenotificationtypes:mytypes]; } application.applicationiconbadgenumber = 0; //this if called once.... if

django - urllib2.error.URLError: <urlopen error unknown url type: 'https> -

i using nginx+django+uwsgi depoy app. now weird error https url issue my django version 1.6, uwsgi version 2.0.4 , python version 2.7.3 i can visit https url django shell: >>> import urllib2 >>> response=urllib2.urlopen("https://www.baidu.com") >>> data=response.read() >>> print data it works fine!! if start app uwsgi, error urlopen error unknown url type: https same code i dont know why...

mysql - Can't we call $result as variable in php -

i have query in php code $dbc = mysqli_connect('localhost', 'root','', 'delivery') or die('error connecting mysql server.'); $count = "select max(id_pelanggan) pelanggan"; $result = mysqli_query($dbc, $count) or die('error select query'); if (empty($result)) { $id_pelanggan = 1; } else { $id_pelanggan = $result + 1; } and result object of class mysqli_result not converted int in c:\xampp\htdocs\delivery\addcustomer.php whereas in mysql id_pelanggan datatype int. can me make works? you try assign query $id_pelanggan variable instead of value query. fetch result using *_fetch array() of query i've changed if() condition because $result won't empty no matter happens. number of result maybe. put , replace if else condition: if(mysqli_num_rows($result) == 0){ /* if found 0 result */ $id_pe

php - Setup dynamic search in CakePHP -

i using search plugin cakephp. i try dynamically setup $filterargs array used filtering input user. reason why want because customers can create customer specific input fields. want make them filterable , searchable. customer.php: public function beforefind($querydata) { $this->filterargs['garantie'] = array( 'type' => 'subquery', 'method' => 'findcustomercustomfieldsbytext', 'field' => array('customer.id'), 'encode' => true ); } debugging $filterargs shows entry made: array( 'garantie' => array( 'type' => 'subquery', 'method' => 'findcustomercustomfieldsbytext', 'field' => array( (int) 0 => 'customer.id' ), 'encode' => true ) ) unfortunately method findcustomercustomfieldsbytext() not called. it looks b

Google Chrome - auto scrollbars not working as expected? -

google chrome - horizontal overflow works expected, but, vertical overflow causing showing bottom scrollbar too? code on: http://jsfiddle.net/5yflgo16/ what want? using js center div on page. want browser show vertical or horizontal scrollbar, or both scrollbars when needed. in mentioned example, can see browser showing both of scrollbars when comes vertical overflow. max-width , max-height set 100 px, but, browser shows horizontal scrollbar if width of div not 100px. showing scrollbar on 50px wide div, ability scroll 8 px... 58px, still less maximal 100px. works if force 100px width, or if div not fixed. div have fixed, @ middle of page, , have max 100 x 100 px. user "gmo" convincing me wrong expectations problem. how comes there no problem when overflow horizontal (bottom left example), , show needed, bottom scrollbar, , when comes vertical overflow, browser show both bottom , side scrollbar (top right).

Delphi exe setup in visual studio -

i have multiple exe file in created in delphi 6 . want create setup file visual studio 2010 these exe. how can that. please provide me steps this. this still applies though it's vs 2005 - setup projects haven't changed. https://www.simple-talk.com/dotnet/visual-studio/getting-started-with-setup-projects/ the fact it's delhpi exe doesn't matter. installed use setup project's ide, file system on target machine view , drag/drop exe (usually) applcation folder. it may have dependencies need installed - likely?

parse.com - How to set correct roles for login users -

i trying set roles parse.com aim set role data login users. can please proved step step how should done parse.com, tryed play , read tutrial time getting accecss data if not logined. thnx helping! when create data object should adding acl it, created current user , limiting read , write user. done before save data object. don't need use role. role used had group of users needed access, add users role , create acl role instead of user.

node.js - When I use mongoose & connect MongoDB, I can insert and get data. But unable to find data using MongoClient -

my code follows. open localhost/users/,brower return {"_id":"55519446e063d4c409f93f00","username":"justnode","__v":0} but when open mongo shell , input: use student , db.student.find() ,i can't find anything. mongodb version 3.0.1 , nodejs version 0.12.2 , os centos 6.4 var express = require('express'); var bodyparser = require('body-parser'); var mongoose = require('mongoose'); var app = express(); mongoose.connect('mongodb://localhost/student', function (error) { if (error) { console.log(error); } }); var schema = mongoose.schema; var userschema = new schema({ username: {type: string, unique: true} }); var usermodel = mongoose.model('usermodel', userschema); app.use(bodyparser.json()); app.use(bodyparser.urlencoded({ extended: false })); /* post content follows { "username": "justnode" } */ app.post('/users/create'

java web start app on localhost using WAMP is not able to run php scripts? -

i have signed java web start app has been running on server many years. have need create version can run on local machine. have setup wamp , database , confirmed these work accessing through php scripts via localhost. java program launching there problem when tries access local php file through locahost. nothing returned. call php scripts access database within java app. missing fundamental here? appreciated. thanks thanks responses. problem has been solved. forgot turn off deprecation , other warnings getting php scripts not expected. once turned off warnings functioned expected. sum up, serving java web start app through localhost, executing php scripts within java app manipulate sql database, , return results java app. again, greg

javascript - Bootstrap Datetime picker? -

i using bootstrap date time picker. problem code isnt able fetch am/pm. have tried: $('#datetimepicker6').datetimepicker({ sidebyside: true, format: 'dd/mm/yyyy hh:mm tt' }); but giving me, time as, 09:23 tt. showing tt in place of , pm. please help try 'dd/mm/yyyy hh:mm a' instead, or '...a' capital am/pm. http://momentjs.com/docs/#/displaying/

c++ - Pointer Problems in Vector -

i trying brush on c++ since has been while since used , i'm having problem storing pointers. @ end of method below, vector "graph" has of vertices inserts, edges supposed added corrupt (i can see edges in debugger, data garbage). wondering if guide? thanks! for reference, add_edge function declared follows: std::vector<vertice*> m_edges; ... ... void add_edge(vertice* n); { m_edges.push_back(n); } the primary problem: std::vector<vertice> graph; std::string line; //iterate on line int linecount = 0; while(getline(file, line)) { auto vertices = parse_line(line); for(size_t = 0; < vertices.size(); ++i) { auto result = std::find_if( graph.begin(), graph.end(), [&] (vertice cvert) { return cvert.getname() == vertices.at(i); }); std::vector<vertice>::size_type currpos = std::distance(graph.begin(), result); if(result == graph.end())

reporting services - Adding Difference column on SSRS Matrix -

Image
i on adding difference column (net difference between months) on matrix shown below. i've tried several solutions provided on different websites value doesn't show correct value. column: date value: metric thanks help.

operating system - Hardware Support for Paging -

"the address consists of 16 bits, , page size 8kb. page table consists of 8 entries kept in fast registers." how total entries in page table 8? according calculation should 1. total entries in page table= ((2^16)/(2^3*2^10*2^3))=1. (the first 2^3 8 in 8kb, second 1 bytes bits conversion , 2^10 "kilo" in 8kb.) thanks memory byte-addressable hence, not need divide 2^3 bytes bit conversion. explaining further, 16-bits address means processor generate memory addresses of length 16 bits used address byte or half-word or word present starting (or ending - depends on endianess of machine) @ 16-bit value. now, page size total size of page in bits in case 2^16 bits. memory byte addressable, hence number of processor addresses in 1 page 2^16/2^3 i.e 2^13 addresses. hence number of page table entries 2^16/2^13 = 8.

rest - How to debug a get request in php using curl -

i'm trying make request in php using curl. i'm doing: $curl = curl_init(); curl_setopt($curl, curlopt_httpauth, curlauth_basic); curl_setopt($curl, curlopt_userpwd, "username:password"); curl_setopt($curl, curlopt_url, $url); curl_setopt($curl, curlopt_returntransfer, 1); $result = curl_exec($curl); curl_close($curl); printf($result); but $result doesn't print out anything, no success or failure message. i've reached endpoint via postman , in web browser know works. printing out $curl prints: "resource #1" makes me think curl installed on server. i'm not sure steps take next make things work. add few more option troubleshooting purposes. check error response. if no error, details: curl_setopt($ch, curlopt_connecttimeout, 10); curl_setopt($ch, curlopt_timeout,10); curl_setopt($ch, curlopt_failonerror,true); curl_setopt($ch, curlopt_encoding,""); curl_setopt($ch, curlopt_verbose, true); curl_setopt($c

filtering - Masonry filter + infinite scroll issue -

i built jquery masonry layout infinite scroll , filtering. my problem when filter clicked before scrolling, content loaded infinite scroll not filtered. is there way fix it? here link check: http://www.jcvergara.com/working/ here full masonry code: $(document).ready(function(){ var $container = $('.container'); // initialize $container.masonry({ columnwidth: 250, itemselector: '.item', isfitwidth: true }); $container.masonry( 'on', 'layoutcomplete', function() { $('.right-line').css('height', $('.container').height()); }); $('.right-line').css('height', $('.container').height()); // infinite scroll var $container = $('#content'); $container.infinitescroll({ navselector : "nav.posts-navigation", nextselector : "div.nav-previous a:first", itemselector : "