اذهب إلى المحتوى

E.Nourddine

الأعضاء
  • المساهمات

    1458
  • تاريخ الانضمام

  • تاريخ آخر زيارة

  • عدد الأيام التي تصدر بها

    18

كل منشورات العضو E.Nourddine

  1. من خلال الشكل الأصلي: سنقوم بتحديد جزء معين، حيث يقبل التكرار بشكل يجعله متممًا لبعضه البعض: من خلال قائمة(Pattern Options (Window>Pattern Options نحدد الجزء: ثم الخاصية Make Pattern: ثم نحدد Done لتأكيد الشكل : الصورة المتحركة التالية تجمع الخطوات السابقة:
  2. اتبع الخطوات التالية: حدد تدرج اللون من خلال أداة Gradient tool . غيّر Gradient type من Solid إلى Noise. حدد نمط اللون HSB. اضغط Randomize. ثمOK.
  3. سنصمم نفس الشكل على برنامج Photoshop باتباع الخطوات التالية: نرسم شكل مربع في طبقة جديدة، ونملأها بأي لون. نرسم الخطوط المُقسمة للأشكال التي سيتضمنها التصميم، هذه الخطوط خطوط بأداة Pen Tool : من خلال القائمة Object -> Expand سنقسم الشكل الأصلي إلى قطع مجزئة عن طريق الخطوط المرسومة سلفاً: من قائمة Window -> Pathfinder ثم حدد Divide، ستظهر الأجواء منفصلة. من القائمة Effect -> Stylize -> Round Corners تنعدل على الزوايا الخارجية للأشكال لتصبح:
  4. هذا السكريبت يقدم طريقة لعرض ووضع 5 علامات على خرائط google، حيث تم استخدامhtml وَ Javascript لذلكM <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>Google Maps Multiple Markers</title> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </head> <body> <div id="map" style="width: 500px; height: 400px;"></div> <script type="text/javascript"> var locations = [ ['Bondi Beach', -33.890542, 151.274856, 4], ['Coogee Beach', -33.923036, 151.259052, 5], ['Cronulla Beach', -34.028249, 151.157507, 3], ['Manly Beach', -33.80010128657071, 151.28747820854187, 2], ['Maroubra Beach', -33.950198, 151.259302, 1] ]; var map = new google.maps.Map(document.getElementById('map'), { zoom: 10, center: new google.maps.LatLng(-33.92, 151.25), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); } })(marker, i)); } </script> </body> </html> هذه النتيجة المُحصل عليها: هذا مثال آخر يحدد الأماكن عن طريق title وَ infoWindow: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Multiple Markers Google Maps</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script src="https://maps.googleapis.com/maps/api/js?v=3.11&sensor=false" type="text/javascript"></script> <script type="text/javascript"> // check DOM Ready $(document).ready(function() { // execute (function() { // map options var options = { zoom: 5, center: new google.maps.LatLng(39.909736, -98.522109), // centered US mapTypeId: google.maps.MapTypeId.TERRAIN, mapTypeControl: false }; // init map var map = new google.maps.Map(document.getElementById('map_canvas'), options); // NY and CA sample Lat / Lng var southWest = new google.maps.LatLng(40.744656, -74.005966); var northEast = new google.maps.LatLng(34.052234, -118.243685); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); // set multiple marker for (var i = 0; i < 250; i++) { // init markers var marker = new google.maps.Marker({ position: new google.maps.LatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()), map: map, title: 'Click Me ' + i }); // process multiple info windows (function(marker, i) { // add click event google.maps.event.addListener(marker, 'click', function() { infowindow = new google.maps.InfoWindow({ content: 'Hello, World!!' }); infowindow.open(map, marker); }); })(marker, i); } })(); }); </script> </head> <body> <div id="map_canvas" style="width: 800px; height:500px;"></div> </body> </html> ستلاحظ أنه تمّ تحديد 250 Markers:
  5. نعم يمكنك فعل ذلك على برنامج تحرير الوثائق LaTeX، وذلك باستخدام الخاصيتين \multirow{} وَ \multicolumn{} حيث تأخذ كقيمة عدد الخانات المُراد مزجها، سواء أكانت لصفوف أم أعمدة، وهذا الكود يعطيك فكرة أوضح حول إمكانية فعل ذلك: \documentclass[a4paper]{report} \usepackage{multirow} \usepackage{array} \begin{document} \begin{table}[h] \centering \renewcommand{\arraystretch}{2} \begin{tabular}{|m{2cm}|m{2cm}|m{3cm}|m{2cm}|m{2cm}|} \hline \multirow{2}*{text} & \multirow{2}*{text} & \multirow{2}*{text} & \multicolumn{2}{c|}{text}\\ \cline{4-5} & & & 4 & 5\\ \hline 1 & 2 & 3 & 4 & 5\\ \hline \end{tabular} \end{table} \end{document} لنحصل في الأخير على جدول بخانات ممزوجة :
  6. الفكرة المستعملة لإنشاء هذا النوع من الأشكال، هي إنشاء شكل مستطيلي مع تغيير في مكان بعض النقط الموجودة على الإطار الخارجي له. تُعرّف هذه الأشكال بـ macro \myshapepath، حيث تستعمل مكتبة خاصة بتقاطع النقط the intersection library، وهذا الكود مخصص لإنشاء شكل بهذه الطريقة: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{intersections} \makeatletter \def\myslant{0.2} % defines the skew of the right and left side \def\myxsep{0.5} % extra distance in x direction; relative to node height \def\myvhandlelen{.85} % length of the vertical bezier handles; relative to node height \def\myhhandlelen{.65} % length of the horizontal bezier handles; relative to node width \def\mypoint#1#2#3{ % #1 = x coordinate, in multiples of the width % #2 = y coordinate, in multiples of the height, slanted % #3 = x coordinate, relative to height and slant factor \pgfpointdiff{\southwest}{\northeast} \pgf@xc=\pgf@x % xc = width of the node \pgf@yc=\pgf@y % yc = height of the node \pgf@xb=\myslant\pgf@yc % xb = width of the node scaled by \myslant \southwest \advance\pgf@x by .5\pgf@xc \advance\pgf@y by .5\pgf@yc \advance\pgf@x by #1\pgf@xc \advance\pgf@y by #2\pgf@yc \advance\pgf@x by #2\pgf@xb \advance\pgf@x by #3\pgf@xb } % this defines the shape of the node; the macro is used for drawing the shape as well as for calculating intersection points \def\myshapepath{ \pgfpathmoveto{\mypoint{-.5}{0}{-\myxsep}} \pgfpathcurveto{\mypoint{-.5}{\myvhandlelen}{-\myxsep}}{\mypoint{-\myhhandlelen}{.5}{0}}{\mypoint{0}{.5}{0}} \pgfpathcurveto{\mypoint{\myhhandlelen}{.5}{0}}{\mypoint{.5}{\myvhandlelen}{\myxsep}}{\mypoint{.5}{0}{\myxsep}} \pgfpathcurveto{\mypoint{.5}{-\myvhandlelen}{\myxsep}}{\mypoint{\myhhandlelen}{-.5}{0}}{\mypoint{0}{-.5}{0}} \pgfpathcurveto{\mypoint{-\myhhandlelen}{-.5}{0}}{\mypoint{-.5}{-\myvhandlelen}{-\myxsep}}{\mypoint{-.5}{0}{-\myxsep}} \pgfpathclose } % compute an intersection point between a line and \myshapepath \def\myshapeanchorborder#1#2{ % #1 = point inside the shape % #2 = direction \pgftransformreset % without this, the intersection commands yield strange results \pgf@relevantforpicturesizefalse % don't include drawings in bounding box \pgfintersectionofpaths{ \myshapepath %\pgfgetpath\temppath\pgfusepath{stroke}\pgfsetpath\temppath % draw path for debugging }{ \pgfpathmoveto{ \pgfpointadd{ \pgfpointdiff{\southwest}{\northeast}\pgf@xc=\pgf@x \advance\pgf@xc by \pgf@y % calculate a distance that is guaranteed to be outside the shape \pgfpointscale{ \pgf@xc }{ \pgfpointnormalised{ #2 } } } { #1 } } \pgfpathlineto{#1} %\pgfgetpath\temppath\pgfusepath{stroke}\pgfsetpath\temppath % draw path for debugging } \pgfpointintersectionsolution{1} } \def\myshapeanchorcenter{ \pgfpointscale{.5}{\pgfpointadd{\southwest}{\northeast}} } % we could probably re-use some existing \dimen, but better be careful \newdimen\myshapedimenx \newdimen\myshapedimeny \pgfdeclareshape{myshape}{ % some stuff, we can inherit from the rectangle shape \inheritsavedanchors[from=rectangle] \inheritanchor[from=rectangle]{center} \inheritanchor[from=rectangle]{mid} \inheritanchor[from=rectangle]{base} % calculate these anchors so they lie on a coorinate line with .center \anchor{west}{\myshapeanchorborder{\myshapeanchorcenter}{\pgfpoint{-1cm}{0cm}}} \anchor{east}{\myshapeanchorborder{\myshapeanchorcenter}{\pgfpoint{1cm}{0cm}}} \anchor{north}{\myshapeanchorborder{\myshapeanchorcenter}{\pgfpoint{0cm}{1cm}}} \anchor{south}{\myshapeanchorborder{\myshapeanchorcenter}{\pgfpoint{0cm}{-1cm}}} % calculate these anchors so they lie on a line through .center and the corresponding anchor of the underlying rectangle \anchor{south west}{\myshapeanchorborder{\myshapeanchorcenter}{\pgfpointdiff{\myshapeanchorcenter}{\southwest}}} \anchor{north east}{\myshapeanchorborder{\myshapeanchorcenter}{\pgfpointdiff{\myshapeanchorcenter}{\northeast}}} \anchor{south east}{\myshapeanchorborder{\myshapeanchorcenter}{\pgfpointdiff{\myshapeanchorcenter}{\northeast\pgf@xa=\pgf@x\southwest\pgf@x=\pgf@xa}}} \anchor{north west}{\myshapeanchorborder{\myshapeanchorcenter}{\pgfpointdiff{\myshapeanchorcenter}{\southwest\pgf@xa=\pgf@x\northeast\pgf@x=\pgf@xa}}} % somewhat more special anchors. The coordinate calculations were taken from the rectangle node \anchor{mid west}{\myshapeanchorborder{\myshapeanchorcenter\pgfmathsetlength\pgf@y{.5ex}}{\pgfpoint{-1cm}{0cm}}} \anchor{mid east}{\myshapeanchorborder{\myshapeanchorcenter\pgfmathsetlength\pgf@y{.5ex}}{\pgfpoint{1cm}{0cm}}} \anchor{base west}{\myshapeanchorborder{\myshapeanchorcenter\pgf@y=0pt}{\pgfpoint{-1cm}{0cm}}} \anchor{base east}{\myshapeanchorborder{\myshapeanchorcenter\pgf@y=0pt}{\pgfpoint{1cm}{0cm}}} \backgroundpath{ % uncomment to draw underlying rectangle node %\southwest\pgf@xa=\pgf@x \pgf@ya=\pgf@y %\northeast\pgf@xb=\pgf@x \pgf@yb=\pgf@y %\pgfpointdiff{\southwest}{\northeast}\pgf@xc=\pgf@x \pgf@yc=\pgf@y %\pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}} %\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}} %\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}} %\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}} %\pgfpathclose \myshapepath } \anchorborder{ \myshapedimenx=\pgf@x \myshapedimeny=\pgf@y \myshapeanchorborder{\myshapeanchorcenter}{\pgfpoint{\myshapedimenx}{\myshapedimeny}} } } \makeatother \tikzset{shape example/.style={color=black!30,draw,fill=yellow!30,line width=.5cm,inner xsep=2.5cm,inner ysep=0.5cm}} \begin{document} {\Huge\begin{tikzpicture} \node[name=s,shape=myshape,shape example] {myshape\vrule width 1pt height 2cm}; \foreach \anchor/\placement in { north west/above left, north/above, north east/above right, west/left, center/above, east/right, mid west/right, mid/above, mid east/left, base west/left, base/below, base east/right, south west/below left, south/below, south east/below right, text/left, 10/right, 130/above% } { \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; } \end{tikzpicture}} \begin{tikzpicture} \draw (-2.0, 0.0) node[draw,myshape] (a) {normal}; \draw (-0.5, 2.0) node[draw,myshape] (b) {very long node indeed}; \draw ( 2.0, 0.0) node[draw,myshape,align=left] (c) {h\\i\\g\\h\\\\n\\o\\d\\e}; \draw ( 0.0,-1.5) node[draw,myshape,align=left] (d) {almost\\square\\node}; \draw[->] (a) -> (b); \draw[->] (b) -> (c); \draw[->] (c) -> (d); \draw[->] (d) -> (a); \end{tikzpicture} \end{document} وهذا شكل توضيحي لكيفية الرسم: الميزة المُميزة هنا هي إمكانية التحكم في الشكل ككل رغم أن الأمر قد يبدو صعبا نوعاً ما.
  7. جرب هذا الكود: \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{arrows.meta,automata,quotes,positioning,shapes} \begin{document} \begin{frame} \centering \begin{tikzpicture}[ node distance=3cm, >={Latex[blue!50]}, every state/.style={ellipse,draw=blue}, every edge/.style={draw=blue!50,very thick,->}, every loop/.style={min distance=12mm}, auto ] \node (q1) [state] {A}; \node (q2) [state,right=of q1] {B}; \path (q1) edge ["1"] (q2) (q1) edge [loop above,"0"] (); \end{tikzpicture} \end{frame} \end{document} استعملت مكتبة TikZ لرسم السهمين. يرجع سبب اختلاف رسم السهمين في النتيجة المٌُحصل عليها عند كل منحى، فعند الذهاب من a إلى a سيكون الناتج هو القيمة 0، بينما عند الذهاب من a إلى b هو 1، لذا كان عدم تكرار العقدة a مرتين الحل الأفضل و توجيه السهم نحوها.
  8. لقد قمت بتخزينها فعلاً، كل ما ستحتاجه هو تغيير في طريقة عرض البيانات، حيث أن المصفوفة تحتوي على اسم مفتاح لكل حقل مثل name,age... لذا سيكون الكود كالآتي: $itemArray = array(); foreach ($a->getDetails() as $b) { if ($b->getValue1() !== $b->getValue2()) { if (!array_key_exists($b->getId(), $itemArray)) { $itemArray[$b->getId()] = array('name' => $b->getName(), 'age' => $b->getAge()); } } } if (count($itemArray) > 0) { foreach($itemArray as $item) { $personName = $item['name']; $personAge = $item['age'] ; $content = ('Name is: ' . $personName . ', age is: ' . $personAge); } }
  9. لحل المشكل اذهب إلى ملف config.php الموجود في المسار application/config. عدل على القيمة config$ لتصبح: $config['cookie_domain']=""; أيضا حاول تغيير session library داخل ملف autoload config من خلال application/config/autoload.php وذلك بتغيير قيمة autoload$ إلى : $autoload['libraries'] = array('session'); جرب الآن.
  10. سنستعمل كود php المسؤول عن التحكم في ظهور وإخفاء بعض الخصائص على القالب في ووردبريس، وهو : show_admin_bar(false); والتي نستعملها عند التأكد من أن المستخدم هو أحد مديري الموقع، أي عند دخول مستخدم عادي يطبق الكود التالي : if (!current_user_can('administrator')) { show_admin_bar(false); } تدخل هذه الوظيفة تحت صنف Function_Reference. Function Reference/show admin bar Function_Reference
  11. عليك باستعمال هذا الجزءwpp_get_mostpopular داخل الدالة : <?php if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular(); ?> وعند استعمالparameters: if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular("range=weekly&order_by=comments"); كما يمكنك الاستعانة بالجمل الشرطية في جمل الاستعلام مثل: posts_join, posts_where التي ستجدها في هذا الرابط.
  12. بالنسبة لخاصية calc لا يمكن التحكم في قيمتها إلا عن طريقmedia query والتي تتيح ذلك عن طريق max-height على الأكثر 650. .my-margin-top { margin-top: calc(50vh - 325px); } @media all and (max-height: 650px) { .my-margin-top { margin-top: 0; } } في هذه الحالة يمكنك استعمال دور min-height وإعطاءها القيمة الدنيا الي لا يجب النزول عنها، مثلا: @media all and (min-height: 650px) { .my-margin-top { margin-top: calc(50vh - 325px); } } Range Checking
  13. من خلال الموقع الرسمي لـ W3C Media Queries أنه إذا لم يتم تحديد media type في media query سيتم تحديد الكل. A shorthand syntax is offered for media queries that apply to all media types; the keyword all can be left out (along with the trailing and). I.e. if the media type is not explicitly given it is all. مثال: @media all and (min-width: 500px) { ... } @media (min-width: 500px) { ... } وأيضا: @media (orientation: portrait) { ... } @media all and (orientation: portrait) { ... } مما يعني أن في حال حذفنا media type داخل media query، سيتم تطبيق التنسيق المخصص لها على الكل. @media all { ... } /* تكافئ */ @media { ... }
  14. على Inkscape: من قائمة ...File - Import اختر embed حدد the embedded bitmap. ثم اختر Path -Trace Bitmap لتفتح لك النافذة التالية: ثم اتبع الخطوات المبينة في الصورة: لنحصل في الأخير على أيقونة انطلاقا من صورة بنمط Pixel:
  15. أنصحك باستعمال \SetNlSty{}{}{} والتي ستتيح لك امكانية اضافة * في أي سطر داخل كود الخوارزمية، ليصبح كودLaTeX على الشكل: \documentclass[conference]{IEEEtran} \usepackage[ruled,linesnumbered]{algorithm2e} \begin{document} \begin{algorithm} $x=1$\; {% star group begin \SetNlSty{textbf}{*}{} \For{$i=1$ \emph{\KwTo} $10$}{ $x=x+1$\; } }% star group end $x=2$ \end{algorithm} \end{document} كود الخوارزمية:
  16. الخطأ كان في تحديد مكان المفتاح، حيث أنه يظهر افتراضيا بجانب المبيان، لذا كان من الواجب إضافة سطر فارغ ليتمكن من الظهور في الأسفل. الكود بعد التصحيح: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ybar stacked, legend style={ % this is modified legend cell align=left, % legend columns=2, % at={(xticklabel cs:0.5)}, % anchor=north % up to here }, area legend, x tick label style={ /pgf/number format/1000 sep=}, ylabel=Revenue (\$\,billions), enlargelimits=0.05,width=10cm,height=12cm, bar width=12pt, ] \addplot coordinates {(2012,1388) (2013,1388) (2014,1388) (2015,1388) (2016,1388) (2017,1388) (2018,1500)}; \addlegendentry{\textsc{InkJet Head}} \addplot coordinates {( 2012 , 2995 ) ( 2013 , 3144.75 ) ( 2014 , 3294.5 ) ( 2015 , 2126.45 ) ( 2016 , 3594 ) ( 2017 , 3893.5 ) ( 2018 , 4342.75 ) }; \addlegendentry{\textsc{Pressure sensors}} \addplot coordinates {( 2012 , 3594 ) ( 2013 , 3923.45 ) ( 2014 , 4193 ) ( 2015 , 4432.6 ) ( 2016 , 4792 ) ( 2017 , 5091.5 ) ( 2018 , 5450.9 ) }; \addlegendentry{\textsc{Microphones}} \addplot [color=yellow, fill=yellow] coordinates {( 2012 , 5361.05 ) ( 2013 , 5450.9 ) ( 2014 , 5690.5 ) ( 2015 , 5960.05 ) ( 2016 , 6289.5 ) ( 2017 , 6529.1 ) ( 2018 , 6738.75 )}; \addlegendentry{\textsc{Accelerometers}} \addplot [color=black, fill=white] coordinates {( 2012 , 6648.9 ) ( 2013 , 6888.5 ) ( 2014 , 7128.1 ) ( 2015 , 7188 ) ( 2016 , 7457.55 ) ( 2017 , 7637.25 ) ( 2018 , 7787 )}; \addlegendentry{\textsc{Gyroscopes}} \addplot [color=violet, fill=violet] coordinates {( 2012 , 6948.4 ) ( 2013 , 7337.75 ) ( 2014 , 7547.4 ) ( 2015 , 7727.1 ) ( 2016 , 7787 ) ( 2017 , 8086.5 ) ( 2018 , 8236.25 )}; \addlegendentry{\textsc{Digital compass}} \addplot [color=gray, fill=gray] coordinates {( 2012 , 7337.75 ) ( 2013 , 7906.8 ) ( 2014 , 8445.9 ) ( 2015 , 9164.7 ) ( 2016 , 9584) ( 2017 , 10033.25 ) ( 2018 , 10482.5 ) }; \addlegendentry{\textsc{Inertial combos}} \addplot [color=purple, fill=purple] coordinates {(2012,7487.5) (2013,8176.35) (2014,8835.25) (2015,9494.15) (2016,10033.25) (2017,10632.25) (2018,11021.6)}; \addlegendentry{\textsc{Microbolometers}} \addplot [color=pink, fill=pink] coordinates {( 2012 , 7547.4 ) ( 2013 , 8236.25 ) ( 2014 , 8850.225 ) ( 2015 , 9509.125 ) ( 2016 , 10048.225 ) ( 2017 , 10647.225 ) ( 2018 , 11081.5 ) }; \addlegendentry{\textsc{PIR \& thermopiles}} \addplot [color=olive, fill=olive] coordinates {( 2012 , 7562.375 ) ( 2013 , 8251.225 ) ( 2014 , 8865.2 ) ( 2015 , 9524.1 ) ( 2016 , 10063.2 ) ( 2017 , 10662.2 ) ( 2018 , 11096.475 ) }; \addlegendentry{\textsc{Micro displays}} \addplot [color=magenta, fill=magenta] coordinates {( 2012 , 8386 ) ( 2013 , 9134.75 ) ( 2014 , 10033.25 ) ( 2015 , 10886.825 ) ( 2016 , 11740.4 ) ( 2017 , 12608.95 ) ( 2018 , 13477.5 ) }; \addlegendentry{\textsc{Projection systems}} \addplot [color=lime, fill=lime] coordinates {( 2012 , 8685.5 ) ( 2013 , 9434.25 ) ( 2014 , 10332.75 ) ( 2015 , 11081.5 ) ( 2016 , 12129.75 ) ( 2017 , 12938.4 ) ( 2018 , 13926.75 ) }; \addlegendentry{\textsc{Other optical MEMS}} \addplot [color=green, fill=green] coordinates {( 2012 , 8985 ) ( 2013 , 10003.3 ) ( 2014 , 10931.75 ) ( 2015 , 12219.6 ) ( 2016 , 13417.6 ) ( 2017 , 14825.25 ) ( 2018 , 16472.5 ) }; \addlegendentry{\textsc{Microfluidics for research}} \addplot [color=cyan, fill=cyan] coordinates {( 2012 , 9823.6 ) ( 2013 , 10931.75 ) ( 2014 , 12129.75 ) ( 2015 , 13537.4 ) ( 2016 , 15124.75 ) ( 2017 , 16831.9 ) ( 2018 , 19018.25 ) }; \addlegendentry{\textsc{Microfluidics for IVD}} \addplot [color=brown, fill=brown] coordinates {( 2012 , 10123.1 ) ( 2013 , 11231.25 ) ( 2014 , 12579 ) ( 2015 , 14076.5 ) ( 2016 , 15723.75 ) ( 2017 , 17520.75 ) ( 2018 , 18419.25 ) }; \addlegendentry{\textsc{Microdispensers}} \addplot [color=red, fill=red] coordinates {( 2012 , 10482.5 ) ( 2013 , 11830.25 ) ( 2014 , 13327.75 ) ( 2015 , 14825.25 ) ( 2016 , 16622.25 ) ( 2017 , 18628.9 ) ( 2018 , 21114.75 ) }; \addlegendentry{\textsc{RF MEMS}} \addplot [color=orange, fill=orange] coordinates {( 2012 , 10542.4 ) ( 2013 , 11860.2 ) ( 2014 , 13447.55 ) ( 2015 , 14975 ) ( 2016 , 16921.75 ) ( 2017 , 19018.25 ) ( 2018 , 21564 ) }; \addlegendentry{\textsc{Oscillators}} \addplot [color=black, fill=black] coordinates {( 2012 , 10871.85 ) ( 2013 , 12279.5 ) ( 2014 , 13777 ) ( 2015 , 17071.5 ) ( 2016 , 17371 ) ( 2017 , 19617.25 ) ( 2018 , 22312.75 ) }; \addlegendentry{\textsc{Others}} %\legend{InkJet Head, Pressure sensors, Microphones, Accelerometers, Gyroscopes, Digital compass, Inertial combos, Microbolometers, PIR \& thermopiles, Micro displays, Projection systems, Other optical MEMS, Microfluidics for research, Microfluidics for IVD, Microdispensers, RF MEMS, Oscillators, Others} \end{axis} \end{tikzpicture} \end{document} النتيجة النهائية:
  17. السيناريو المتوقع في مثل هذه الوظائف، هو تصفح الملف النصي عن طريق دالة التكرار forEach ثم إضافة العناصر إلى القائمة المنسدلة انطلاقا من الملف النصي. هذا المثال التطبيقي، يتيح لك عمل ذلك، حيث يتم التأكد من وجود الملف النصي قبل الشروع في تصفحه: الكود المختص بـ Combobox: <ComboBox x:Name="comboBox" HorizontalAlignment="Left" Margin="149,43,0,0" VerticalAlignment="Top" Width="120" IsEditable="True" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" Text="{Binding NewItem, UpdateSourceTrigger=LostFocus}"/> <ComboBox x:Name="comboBox1" HorizontalAlignment="Left" Margin="349,122,0,0" VerticalAlignment="Top" Width="120"/> الدالة المسؤولة عن إضافة القيم من الملف النصي: public partial class MainWindow : Window { private string _selectedItem; private ObservableCollection<string> ServerNames; private string fileLocation = @"C:\Temp\ServerNames.txt"; public MainWindow() { ServerNames = new ObservableCollection<string>(); if (File.Exists(fileLocation)) { var list = File.ReadAllLines(fileLocation).ToList(); list.ForEach(ServerNames.Add); } DataContext = this; InitializeComponent(); } public IEnumerable Items => ServerNames; public string SelectedItem { get { return _selectedItem; } set { _selectedItem = value; OnPropertyChanged("SelectedItem"); } } public string NewItem { set { if (SelectedItem != null) { return; } if (!string.IsNullOrEmpty(value)) { ServerNames.Add(value); SelectedItem = value; } } } protected void OnPropertyChanged(string propertyName) { var handler = this.PropertyChanged; handler?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } public event PropertyChangedEventHandler PropertyChanged; private void Window_Closing(object sender, CancelEventArgs e) { if (!File.Exists(fileLocation)) { File.Create(fileLocation); } File.WriteAllLines(fileLocation, ServerNames); } }
  18. تعتبر DataAdabter من بين الأدوات المتواجدة على بيئة Net. المهمة، والتي تلعب دوراً هاما، حيث تُمكن من ربط التطبيق مع مجموعة من مصادر البيانات. هنا في مثالك لم يتم ربط DataSet بـ DataAdapterـ لذا من البديهي ألا يعمل التطبيق. الحل: إضافة DataAdapter وملأ DataSet بها: dbCmd = DBConnection.GetDbCommand(sql); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = dbCmd; da.Fill(movieSet); مثال آخر من موقع msdn.microsoft.com: // Assumes that connection is a valid SqlConnection object. string queryString = "SELECT CustomerID, CompanyName FROM dbo.Customers"; SqlDataAdapter adapter = new SqlDataAdapter(queryString, connection); DataSet customers = new DataSet(); adapter.Fill(customers, "Customers");
  19. صادفت نفس المشكل، وكان الخلل فقط في إعطاء الصلاحيات للملفات الموجود داخل نطامLaravel، وذلك لأني أستعمل Ubuntu كنظام تشغيل، وكان الحل هو بتغيير صلاحيات الملفات، كالآتي: Laravel 4: # Group Writable (Group, User Writable) $ sudo chmod -R gu+w app/storage # World-writable (Group, User, Other Writable) $ sudo chmod -R guo+w app/storage Laravel5: # Group Writable (Group, User Writable) $ sudo chmod -R gu+w storage # World-writable (Group, User, Other Writable) $ sudo chmod -R guo+w storage
  20. Laravel سيعتمد على المسار الخاص بالدالة UpdateCountry، وبالمقابل فإنك لم تخصص أي مصار لهذه الدالة. في الكود الخاص بك، يتم الاتصال بـ SaveChanges والتي تعيد Redirect، لكنها لا تعيد أي قيمة من خلال UpdateCountry. لذا وجب الرجوع بقيم عند استعمال Rdirect عند UpdateCountry. سيكون الحل بتغيير كود UpdateCountry إلى الآتي: public function UpdateCountry(\App\Http\Requests\CountryRequest $request) { return $this->SaveChanges($request); }
  21. الدالة WhereIn تقبل mixed/array أي بإمكانك استعمالها عوض Where في الكود الخاص بك، على الشكل التالي: $event = \App\Events::whereIn('event_id',$request->input('event_name'))->get(); ليصبح الكود كالتالي: public function generate(Requests\Generate $request) { $event_id = implode(",", $request->input('event_name')); $event = \App\Events::whereIn('event_id',$request->input('event_name'))->get(); } والملفين الآخرين، دون تغيير: @foreach ($events as $events) <tr> <td>{{$events->Name}}</td> <td>{{$events->Summary}}</td> <td class="select_event">{!! Form::checkbox('event_name[]', $events->Event_ID) !!}</td> </tr> @endforeach ثم: public function index() { $events = Events::all(); $user = Auth::user()->name; $id = 1; return view('Delta.Index')->with([ 'user' => $user, 'events' => $events, 'id' => $id, ]); }
  22. لحل المشكل، عليك بإضافة الرمز "`"، لأن للاسم فقط إمكانية احتواء الأرقام، لذا وجب إضافة علامة الترميز "`" بجانبي الاسم لتفادي أي مشكل، لتصبح جملة الاستعلام كالتالي: $sql="update mark_list set `".$_SESSION['question_id']."` ='2' where user_id= ".$_SESSION['user_id']; مثال: ننشئ جدول على Mysql: CREATE TABLE `a``b` (`c"d` INT); جملة استعلام لتحديد بيانات: mysql> SELECT 1 AS `one`, 2 AS 'two'; +-----+-----+ | one | two | +-----+-----+ | 1 | 2 | +-----+-----+ يمكنك الرجوع إلى الرابط من الموقع الرسمي لـ Mysql.
  23. لكي يتموضع العنصر وسط الوسم div والذي يعتبر العنصر الأب في هذه الحالة، عليك بإضافة الخاصية text-align:center إلى العنصر div و margin:auto إلى العنصر الإبن. هذا مثال تطبيقي يشرح كيفية فعل ذلك: صفحة html تضم div مع id بقيمةparent، مع 3 عناصر : <div id="parent"> <div id="child1" class="block center">a block to align center and with text aligned left</div> <div id="child2" class="block left">a block to align left and with text aligned left</div> <div id="child3" class="block right">a block to align right and with text aligned left</div> </div> كود css المتحكم في العناصر السابقة و الأب parent أيضا: #parent { text-align:center; background-color:blue; height:400px; width:600px; } .block { height:100px; width:200px; text-align:left; } .center { margin:auto; background-color:green; } .left { margin:auto auto auto 0; background-color:red; } .right { margin:auto 0 auto auto; background-color:yellow; } صورة للنتيجة: مثال تطبيقي
  24. أولاً سنقوم بإنشاء حلقة تكرار foreach تتصفح أعمدة DataRow ثم نضيف العمود في آخرها: foreach (DataRow dr in ret.Rows) { DataRow row = dt.Rows.Add(); for (int i = 0; i < dr.ItemArray.Length; i++) row.SetField(i, dr.ItemArray[i]); row.SetField(dt.Columns.Count - 1, "1"); } كما يمكن استعمال خاصية DefaultValue للعمود الأخير: dt.Columns[dt.Columns.Count - 1].DefaultValue = "1"; ثم ندمجها عن طريق DataTable.Merge: dt.Merge(ret);
  25. من خلال الموقع الرسمي لـ W3C : *|ns : جميع العناصر ذات namespace ns. *|* : جميع العناصر. *| : جميع العناصر التي لا تندرج ضمن أي namespace. * : إذا لم يتم تحديد أي namespace فإنها تكافئ *|*. إذن فإن * وَ *|* غير متشابهتين ولكل منهما استعمالاتها وإن تشابهتا في جزئية بسيطة. مثال تطبيقي: ملف css جُمعت فيه الخاصيتين: @namespace "http://www.w3.org/2000/svg"; * { background: beige; } *|* { border: 1px solid; } ملف html: <a href="#">This is some link</a> <svg xmlns="http://www.w3.org/2000/svg"> <a xlink:href="#"> <text x="20" y="20">This is some link</text> </a> </svg> النتيجة المحصل عليها:
×
×
  • أضف...